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

[R4R] fix: missing contract upgrades and incorrect behavior when miners enable pipecommit #1007

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

j75689
Copy link
Contributor

@j75689 j75689 commented Jul 20, 2022

Description

  1. The code for the mining block upgrade system contract is missing.
    systemcontracts.UpgradeBuildInSystemContract(w.chainConfig, header.Number, env.state)
  2. Incorrect update of stateb when miner enables pipecommit.

Rationale

  1. Missed when merging ethereum versions.
  2. When a miner does a commit, a new *environment is copied to work, but when pipecommit is enabled, CorrectAccountsRoot should be called to correct the root hash of the accounts in the snapshot, which results in only the copied ones be updated, and the continuously running statedb is not properly updated.

Example

N/A

Changes

Notable changes:

  • miner/worker.go

miner/worker.go Outdated Show resolved Hide resolved
forcodedancing
forcodedancing previously approved these changes Jul 20, 2022
unclezoro
unclezoro previously approved these changes Jul 20, 2022
brilliant-lx
brilliant-lx previously approved these changes Jul 20, 2022
Copy link
Collaborator

@brilliant-lx brilliant-lx left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@brilliant-lx brilliant-lx left a comment

Choose a reason for hiding this comment

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

LGTM

@unclezoro unclezoro merged commit 21c4ece into bnb-chain:develop Jul 20, 2022
This was referenced Jul 28, 2022
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.

4 participants