소스 검색

improve upgrade config

HaoyangLiu 5 년 전
부모
커밋
3789ea31dd
5개의 변경된 파일51개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 1
      cmd/geth/retesteth.go
  2. 1 1
      core/chain_makers.go
  3. 1 1
      core/state_processor.go
  4. 47 4
      core/systemcontractupgrade/system-contract-upgrade.go
  5. 1 1
      miner/worker.go

+ 1 - 1
cmd/geth/retesteth.go

@@ -508,7 +508,7 @@ func (api *RetestethAPI) mineBlock() error {
 	if api.chainConfig.DAOForkSupport && api.chainConfig.DAOForkBlock != nil && api.chainConfig.DAOForkBlock.Cmp(header.Number) == 0 {
 		misc.ApplyDAOHardFork(statedb)
 	}
-	systemcontractupgrade.UpgradeBuildInSystemContract(header.Number, statedb)
+	systemcontractupgrade.UpgradeBuildInSystemContract(api.chainConfig, header.Number, statedb)
 	gasPool := new(core.GasPool).AddGas(header.GasLimit)
 	txCount := 0
 	var txs []*types.Transaction

+ 1 - 1
core/chain_makers.go

@@ -208,7 +208,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
 		if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(b.header.Number) == 0 {
 			misc.ApplyDAOHardFork(statedb)
 		}
-		systemcontractupgrade.UpgradeBuildInSystemContract(b.header.Number, statedb)
+		systemcontractupgrade.UpgradeBuildInSystemContract(config, b.header.Number, statedb)
 		// Execute any user modifications to the block
 		if gen != nil {
 			gen(i, b)

+ 1 - 1
core/state_processor.go

@@ -67,7 +67,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
 		misc.ApplyDAOHardFork(statedb)
 	}
 	// Handle upgrade build-in system contract code
-	systemcontractupgrade.UpgradeBuildInSystemContract(block.Number(), statedb)
+	systemcontractupgrade.UpgradeBuildInSystemContract(p.config, block.Number(), statedb)
 	// Iterate over and process the individual transactions
 	posa, isPoSA := p.engine.(consensus.PoSA)
 	commonTxs := make([]*types.Transaction, 0, len(block.Transactions()))

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 47 - 4
core/systemcontractupgrade/system-contract-upgrade.go


+ 1 - 1
miner/worker.go

@@ -901,7 +901,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
 	if w.chainConfig.DAOForkSupport && w.chainConfig.DAOForkBlock != nil && w.chainConfig.DAOForkBlock.Cmp(header.Number) == 0 {
 		misc.ApplyDAOHardFork(env.state)
 	}
-	systemcontractupgrade.UpgradeBuildInSystemContract(header.Number, env.state)
+	systemcontractupgrade.UpgradeBuildInSystemContract(w.chainConfig, header.Number, env.state)
 	// Accumulate the uncles for the current block
 	uncles := make([]*types.Header, 0, 2)
 	commitUncles := func(blocks map[common.Hash]*types.Block) {

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.