mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 22:26:42 +00:00
EIP-2935: bug fix
This commit is contained in:
parent
185ea54ff4
commit
3f802eb8e0
3 changed files with 6 additions and 8 deletions
|
|
@ -512,12 +512,10 @@ func GenerateVerkleChain(config *params.ChainConfig, parent *types.Block, engine
|
|||
// Save pre state for proof generation
|
||||
// preState := statedb.Copy()
|
||||
|
||||
if config.Bor == nil { // EIP-2935 / 7709
|
||||
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)
|
||||
}
|
||||
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.
|
||||
if gen != nil {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
|||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||
ProcessBeaconBlockRoot(*beaconRoot, evm)
|
||||
}
|
||||
if (p.config.IsPrague(block.Number()) || p.config.IsVerkle(block.Number())) && p.config.Bor == nil {
|
||||
if p.config.IsPrague(block.Number()) || p.config.IsVerkle(block.Number()) {
|
||||
// EIP-2935
|
||||
ProcessParentBlockHash(block.ParentHash(), evm)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ func (eth *Ethereum) stateAtTransaction(ctx context.Context, block *types.Block,
|
|||
core.ProcessBeaconBlockRoot(*beaconRoot, evm)
|
||||
}
|
||||
// If prague hardfork, insert parent block hash in the state as per EIP-2935.
|
||||
if eth.blockchain.Config().IsPrague(block.Number()) && eth.blockchain.Config().Bor != nil {
|
||||
if eth.blockchain.Config().IsPrague(block.Number()) {
|
||||
core.ProcessParentBlockHash(block.ParentHash(), evm)
|
||||
}
|
||||
if txIndex == 0 && len(block.Transactions()) == 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue