Skip to content

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

Merged
unclezoro merged 1 commit intobnb-chain:developfrom
j75689:fix/miner
Jul 20, 2022
Merged

[R4R] fix: missing contract upgrades and incorrect behavior when miners enable pipecommit#1007
unclezoro merged 1 commit intobnb-chain:developfrom
j75689:fix/miner

Conversation

@j75689
Copy link
Copy Markdown
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

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
Copy Markdown
Contributor

@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
Copy Markdown
Contributor

@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