Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statemanager: small refactor to get storage objects for snapsync #3033

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

g11tech
Copy link
Contributor

@g11tech g11tech commented Sep 18, 2023

a small refactor to obtain account trie/storagetries and codedb for building state in snapsync PR

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #3033 (235a5fe) into master (1f711d0) will decrease coverage by 0.02%.
The diff coverage is 48.57%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 88.73% <ø> (ø)
blockchain 92.58% <ø> (ø)
client 87.53% <ø> (-0.07%) ⬇️
common 98.19% <ø> (ø)
ethash ∅ <ø> (∅)
evm 71.75% <ø> (ø)
rlp ∅ <ø> (∅)
statemanager 90.15% <48.57%> (+0.14%) ⬆️
trie 90.34% <ø> (+0.03%) ⬆️
tx 96.35% <ø> (ø)
util 86.78% <ø> (ø)
vm 78.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@scorbajio scorbajio mentioned this pull request Aug 17, 2023
9 tasks
@@ -375,7 +375,7 @@ export class DefaultStateManager implements EVMStateManagerInterface {
* cache or does a lookup.
* @private
*/
protected async _getStorageTrie(address: Address, account: Account): Promise<Trie> {
protected _getStorageTrie(address: Address, account: Account): Trie {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function does no actual async call

@g11tech g11tech force-pushed the statemanager-refac branch 2 times, most recently from cf8813c to 0ec8187 Compare September 19, 2023 13:35
@@ -802,23 +820,21 @@ export class DefaultStateManager implements EVMStateManagerInterface {
if (!account) {
throw new Error(`dumpStorage f() can only be called for an existing account`)
}
const trie = this._getStorageTrie(address, account)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of the diff here is because of pulling this out of the promise below

@@ -841,48 +857,44 @@ export class DefaultStateManager implements EVMStateManagerInterface {
if (!account) {
throw new Error(`Account does not exist.`)
}
const trie = this._getStorageTrie(address, account)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of the diff here is because of pulling this out of the promise below

@holgerd77
Copy link
Member

Rebased this via UI

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevertheless curious: what does this actually do? 😆

to be used in this PR: #3031 to get the account trie, storagetrie and code db from the statemanager for the fetchers to write into, currently snapfetchers just make independent tries

@holgerd77 holgerd77 merged commit fb4a05a into master Sep 20, 2023
41 of 42 checks passed
@holgerd77 holgerd77 deleted the statemanager-refac branch September 20, 2023 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants