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

fix: fix statedb copy #2567

Merged
merged 1 commit into from
Jul 10, 2024
Merged

fix: fix statedb copy #2567

merged 1 commit into from
Jul 10, 2024

Conversation

will-2012
Copy link
Contributor

@will-2012 will-2012 commented Jul 8, 2024

Description

In the force-kill test scenario, it was found that rewind failed. The specific reason was that the data format of the state's undolog was incorrect. Failed to rollback state, error like this:
invalid account index, len: 0

Rationale

bsc/miner/worker.go

Lines 1434 to 1437 in a5810fe

// Create a local environment copy, avoid the data race with snapshot state.
// https://github.com/ethereum/go-ethereum/issues/24299
env := env.copy()

Miner inner workflow uses statedb copy function, but the copy function loses the state's origin fields, so the written undo log is wrong and fails to rollback.

Example

N/A.

Changes

Notable changes:

  • Statedb: copy function

@will-2012 will-2012 marked this pull request as draft July 8, 2024 01:54
@will-2012 will-2012 added the wip work in process label Jul 8, 2024
@NathanBSC
Copy link
Contributor

go-ethereum has fix this, not upstreamed
ethereum/go-ethereum#29563

@NathanBSC
Copy link
Contributor

NathanBSC commented Jul 8, 2024

LGTM

@will-2012 will-2012 added r4r ready for review and removed wip work in process labels Jul 9, 2024
@will-2012 will-2012 marked this pull request as ready for review July 9, 2024 09:30
@zzzckck zzzckck merged commit a00ffa7 into bnb-chain:develop Jul 10, 2024
7 checks passed
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.

5 participants