Skip to content

core/systemcontracts: use vm.StateDB in UpgradeBuildInSystemContract#2578

Merged
zzzckck merged 3 commits intobnb-chain:developfrom
easyfold:upgrade-sys-contract
Aug 13, 2024
Merged

core/systemcontracts: use vm.StateDB in UpgradeBuildInSystemContract#2578
zzzckck merged 3 commits intobnb-chain:developfrom
easyfold:upgrade-sys-contract

Conversation

@easyfold
Copy link
Copy Markdown
Contributor

Description

Change UpgradeBuildInSystemContract() parameter type from *state.StateDB to vm.StateDB

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

"strings"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

0x5B8cDe74766c1d05a2a9047BC9D47AAFbCd4F9fE

buddh0
buddh0 previously approved these changes Jul 15, 2024
@buddh0
Copy link
Copy Markdown
Contributor

buddh0 commented Jul 15, 2024

for easily integrated with opBNB, which implement another StateDB struct


func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.Int, lastBlockTime uint64, blockTime uint64, statedb *state.StateDB) {
func UpgradeBuildInSystemContract(config *params.ChainConfig, blockNumber *big.Int, lastBlockTime uint64, blockTime uint64, statedb vm.StateDB) {
if config == nil || blockNumber == nil || statedb == nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would break this code "statedb == nil",

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.

@easyfold pls add a unit test for the senario to pass nil interface

Copy link
Copy Markdown

@Ahmedalmmm Ahmedalmmm left a comment

Choose a reason for hiding this comment

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

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.

5 participants