Skip to content

Commit 3789ea3

Browse files
author
HaoyangLiu
committed
improve upgrade config
1 parent 3f36e99 commit 3789ea3

File tree

5 files changed

+87
-18
lines changed

5 files changed

+87
-18
lines changed

cmd/geth/retesteth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ func (api *RetestethAPI) mineBlock() error {
508508
if api.chainConfig.DAOForkSupport && api.chainConfig.DAOForkBlock != nil && api.chainConfig.DAOForkBlock.Cmp(header.Number) == 0 {
509509
misc.ApplyDAOHardFork(statedb)
510510
}
511-
systemcontractupgrade.UpgradeBuildInSystemContract(header.Number, statedb)
511+
systemcontractupgrade.UpgradeBuildInSystemContract(api.chainConfig, header.Number, statedb)
512512
gasPool := new(core.GasPool).AddGas(header.GasLimit)
513513
txCount := 0
514514
var txs []*types.Transaction

core/chain_makers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
208208
if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(b.header.Number) == 0 {
209209
misc.ApplyDAOHardFork(statedb)
210210
}
211-
systemcontractupgrade.UpgradeBuildInSystemContract(b.header.Number, statedb)
211+
systemcontractupgrade.UpgradeBuildInSystemContract(config, b.header.Number, statedb)
212212
// Execute any user modifications to the block
213213
if gen != nil {
214214
gen(i, b)

core/state_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
6767
misc.ApplyDAOHardFork(statedb)
6868
}
6969
// Handle upgrade build-in system contract code
70-
systemcontractupgrade.UpgradeBuildInSystemContract(block.Number(), statedb)
70+
systemcontractupgrade.UpgradeBuildInSystemContract(p.config, block.Number(), statedb)
7171
// Iterate over and process the individual transactions
7272
posa, isPoSA := p.engine.(consensus.PoSA)
7373
commonTxs := make([]*types.Transaction, 0, len(block.Transactions()))

core/systemcontractupgrade/system-contract-upgrade.go

Lines changed: 83 additions & 14 deletions
Large diffs are not rendered by default.

miner/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
901901
if w.chainConfig.DAOForkSupport && w.chainConfig.DAOForkBlock != nil && w.chainConfig.DAOForkBlock.Cmp(header.Number) == 0 {
902902
misc.ApplyDAOHardFork(env.state)
903903
}
904-
systemcontractupgrade.UpgradeBuildInSystemContract(header.Number, env.state)
904+
systemcontractupgrade.UpgradeBuildInSystemContract(w.chainConfig, header.Number, env.state)
905905
// Accumulate the uncles for the current block
906906
uncles := make([]*types.Header, 0, 2)
907907
commitUncles := func(blocks map[common.Hash]*types.Block) {

0 commit comments

Comments
 (0)