Skip to content

trie: wrap deletion in case trie.root is nil#26365

Merged
holiman merged 4 commits into
ethereum:masterfrom
rjl493456442:fix-commit
Dec 19, 2022
Merged

trie: wrap deletion in case trie.root is nil#26365
holiman merged 4 commits into
ethereum:masterfrom
rjl493456442:fix-commit

Conversation

@rjl493456442
Copy link
Copy Markdown
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).

Comment thread trie/committer.go Outdated
Copy link
Copy Markdown
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).
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Jun 19, 2025
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).
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Nov 13, 2025
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).
AnilChinchawale pushed a commit to XinFinOrg/XDPoSChain that referenced this pull request Nov 17, 2025
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).

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
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