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: wrap deletion in case trie.root is nil #26365

Merged
merged 4 commits into from
Dec 19, 2022

Conversation

rjl493456442
Copy link
Member

This PR fixes an error in trie commit.

If the trie.root is nil, it can be two possible scenarios:

  • The trie was empty, and no change happens
  • The trie was non-empty and all nodes are dropped

For the latter one, we should collect the deletions and
apply them into database(e.g. in PBSS).

trie/committer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

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

LGTM. But maybe handleDeletions should be markDeletions, since it's the tracer which takes all the deletions and marks them in the given set

@rjl493456442 rjl493456442 added this to the 1.11.0 milestone Dec 16, 2022
@holiman holiman merged commit d3411b9 into ethereum:master Dec 19, 2022
shekhirin pushed a commit to shekhirin/go-ethereum that referenced this pull request Jun 6, 2023
This PR fixes an error in trie commit. If the trie.root is nil, it can be two possible scenarios:

-  The trie was empty, and no change happens
-  The trie was non-empty and all nodes are dropped

For the latter one, we should collect the deletions and apply them into database(e.g. in PBSS).
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.

2 participants