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

trie: implement NodeBlob API for trie iterator #24391

Merged
merged 1 commit into from Feb 15, 2022

Conversation

rjl493456442
Copy link
Member

@rjl493456442 rjl493456442 commented Feb 15, 2022

This functionality is needed in new path-based storage scheme, but
can be implemented in a seperate PR though.

When an account is deleted, then all the storage slots should be
nuked out from the disk as well. In hash-based storage scheme they
are still left in the disk but in new scheme, they will be iterated
and marked as deleted.

But why the NodeBlob API is needed in this scenario? Because when
the node is marked deleted, the previous value is also required to
be recorded to construct the reverse diff.

This functionality is needed in new path-based storage scheme, but
can be implemented in a seperate PR though.

When an account is deleted, then all the storage slots should be
nuked out from the disk as well. In hash-based storage scheme they
are still left in the disk but in new scheme, they will be iterated
and marked as deleted.

But why the NodeBlob API is needed in this scenario? Because when
the node is marked deleted, the previous value is also required to
be recorded to construct the reverse diff.
Copy link
Contributor

@holiman holiman left a comment

LGTM

@@ -514,6 +514,15 @@ func (t *Trie) resolveHash(n hashNode, prefix []byte) (node, error) {
return nil, &MissingNodeError{NodeHash: hash, Path: prefix}
}

func (t *Trie) resolveBlob(n hashNode, prefix []byte) ([]byte, error) {
Copy link
Member

@karalabe karalabe Feb 15, 2022

Choose a reason for hiding this comment

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

Please add a method doc

Copy link
Member

@karalabe karalabe Feb 15, 2022

Choose a reason for hiding this comment

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

Ah, I see the private methods aren't really documented here. Oh well

Copy link
Member

@karalabe karalabe left a comment

LGTM

@karalabe karalabe modified the milestones: 1.10.16, 1.10.17 Feb 15, 2022
@karalabe karalabe merged commit fc8ad1b into ethereum:master Feb 15, 2022
1 check passed
sidhujag pushed a commit to syscoin/go-ethereum that referenced this pull request Feb 15, 2022
trie: implement NodeBlob API for trie iterator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants