EIP-2935: bug fix

This commit is contained in:
Pratik Patil 2025-05-26 10:52:44 +05:30
parent 185ea54ff4
commit 3f802eb8e0
No known key found for this signature in database
GPG key ID: AFDCA496554874B3
3 changed files with 6 additions and 8 deletions

View file

@ -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)
}
// Execute any user modifications to the block.
if gen != nil {

View file

@ -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)
}

View file

@ -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 {