Skip to content

cmd: fix dump cli cannot work in path mode#2160

Merged
zzzckck merged 3 commits intobnb-chain:developfrom
sysvm:fix-dumppathdb
Jan 25, 2024
Merged

cmd: fix dump cli cannot work in path mode#2160
zzzckck merged 3 commits intobnb-chain:developfrom
sysvm:fix-dumppathdb

Conversation

@sysvm
Copy link
Copy Markdown
Contributor

@sysvm sysvm commented Jan 17, 2024

Description

This pr provides a fix for #2157. According to issue, users cannot dump state data in path mode. After debugging, there are some errors in state dump process.
BSC doesn't use preimages, so DumpToCollector uses getTrie cannot find trie in path mode. Hash mode only uses hash to retrieve node info. Therefore, use trie.NewStateTrie create a MPT trie in path mode.
In addtiton, add geth dump-roothash to help dump state in path mode.

Rationale

Users can dump state data in path mode which locates in diffLayer, diskLayer or diskLayer nodebuffer(128+1).
Add geth dump-roothash command to dump all available state root hash in path mode. Next, users can use geth dump to get what you like.

Example

./geth dump-roothash --datadir ./data/ --state.scheme path

image

./geth dump --datadir ./data --incompletes --db.engine=pebble --state.scheme path 481968

Changes

Notable changes:

  • N/A

@sysvm sysvm added the wip work in process label Jan 17, 2024
@sysvm sysvm linked an issue Jan 17, 2024 that may be closed by this pull request
@sysvm sysvm force-pushed the fix-dumppathdb branch 15 times, most recently from 52b7b42 to 268e195 Compare January 23, 2024 09:14
@sysvm sysvm changed the title [WIP]cmd: check parseDumpConfig for path mode cmd: check parseDumpConfig for path mode Jan 23, 2024
@sysvm sysvm added r4r ready for review and removed wip work in process labels Jan 23, 2024
@sysvm sysvm changed the title cmd: check parseDumpConfig for path mode cmd: parseDumpConfig handles path mode Jan 23, 2024
@sysvm sysvm force-pushed the fix-dumppathdb branch 2 times, most recently from 22aac42 to c75e2e0 Compare January 23, 2024 12:53
joey0612
joey0612 previously approved these changes Jan 24, 2024
@sysvm sysvm force-pushed the fix-dumppathdb branch 17 times, most recently from d5b8024 to c0a47cd Compare January 24, 2024 15:05
Copy link
Copy Markdown

@RenRick RenRick left a comment

Choose a reason for hiding this comment

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

LGTM

@fynnss
Copy link
Copy Markdown
Contributor

fynnss commented Jan 25, 2024

The title of the PR is misleading. Please check.

@sysvm sysvm changed the title cmd: parseDumpConfig handles path mode cmd: add dump-roothash command to help dump state in path mode Jan 25, 2024
@sysvm
Copy link
Copy Markdown
Contributor Author

sysvm commented Jan 25, 2024

The title of the PR is misleading. Please check.

fixed

@sysvm sysvm changed the title cmd: add dump-roothash command to help dump state in path mode cmd: fix dump cli cannot work in path mode Jan 25, 2024
Copy link
Copy Markdown
Contributor

@fynnss fynnss left a comment

Choose a reason for hiding this comment

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

LGTM

@zzzckck zzzckck merged commit fecd2bf into bnb-chain:develop Jan 25, 2024
@sysvm sysvm deleted the fix-dumppathdb branch March 6, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r4r ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"geth dump" on fast node snapshot gives "missing trie node"

6 participants