Skip to content

fix: reopen statedb for dump after commit (ethereum#29437) - #123

Merged
hmlee-wm merged 1 commit into
devfrom
fix/evm-reopen-statedb-for-dump
Sep 15, 2026
Merged

hmlee-wm merged 1 commit into
devfrom
fix/evm-reopen-statedb-for-dump

Conversation

@hmlee-wm

@hmlee-wm hmlee-wm commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports ethereum#29437. After statedb.Commit() the trie is marked as committed and can no longer be traversed, causing statedb.Dump() to fail with "trie is already committed" and return an empty result. Open a fresh statedb from the committed root before dumping.

Upstream References

PR Description
#29437 cmd/evm: reopen the statedb for dumping
#29410 Why this command can cause a "trie is already committed"

Problem

evm --dump run called statedb.Dump() on the same instance after statedb.Commit(). The committed trie cannot be traversed again, so dumping silently fails and returns accounts: {}.

Changes

  • cmd/evm/runner.go: capture root from statedb.Commit(), open a new state.New(root, sdb, nil), and call Dump() on the new instance

(cherry picked from commit fe0bf325a68504292f910240f8da6243defffa71)
@hmlee-wm hmlee-wm self-assigned this Sep 4, 2026
@hmlee-wm hmlee-wm added the bug Something isn't working label Sep 4, 2026

@0xmhha 0xmhha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@colinkim colinkim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@eomti-wm eomti-wm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@hmlee-wm
hmlee-wm merged commit 282b109 into dev Sep 15, 2026
3 checks passed
@hmlee-wm
hmlee-wm deleted the fix/evm-reopen-statedb-for-dump branch September 15, 2026 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants