mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
core: add EIP-2935 support in GenerateChain
This commit is contained in:
parent
3c208cdea8
commit
9cdbb3f2e2
1 changed files with 10 additions and 0 deletions
|
|
@ -330,6 +330,7 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
|
||||||
b.header.Difficulty = big.NewInt(0)
|
b.header.Difficulty = big.NewInt(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mutate the state and block according to any hard-fork specs
|
// Mutate the state and block according to any hard-fork specs
|
||||||
if daoBlock := config.DAOForkBlock; daoBlock != nil {
|
if daoBlock := config.DAOForkBlock; daoBlock != nil {
|
||||||
limit := new(big.Int).Add(daoBlock, params.DAOForkExtraRange)
|
limit := new(big.Int).Add(daoBlock, params.DAOForkExtraRange)
|
||||||
|
|
@ -342,6 +343,15 @@ func GenerateChain(config *params.ChainConfig, parent *types.Block, engine conse
|
||||||
if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(b.header.Number) == 0 {
|
if config.DAOForkSupport && config.DAOForkBlock != nil && config.DAOForkBlock.Cmp(b.header.Number) == 0 {
|
||||||
misc.ApplyDAOHardFork(statedb)
|
misc.ApplyDAOHardFork(statedb)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.IsPrague(b.header.Number, b.header.Time) {
|
||||||
|
// EIP-2935
|
||||||
|
blockContext := NewEVMBlockContext(b.header, cm, &b.header.Coinbase)
|
||||||
|
blockContext.Random = &common.Hash{} // enable post-merge instruction set
|
||||||
|
evm := vm.NewEVM(blockContext, statedb, cm.config, vm.Config{})
|
||||||
|
ProcessParentBlockHash(b.header.ParentHash, evm)
|
||||||
|
}
|
||||||
|
|
||||||
// Execute any user modifications to the block
|
// Execute any user modifications to the block
|
||||||
if gen != nil {
|
if gen != nil {
|
||||||
gen(i, b)
|
gen(i, b)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue