@@ -462,16 +462,15 @@ func GenerateVerkleChain(config *params.ChainConfig, parent *types.Block, engine
462
462
// Save pre state for proof generation
463
463
// preState := statedb.Copy()
464
464
465
- // TODO uncomment when the 2935 PR is merged
466
- // if config.IsPrague(b.header.Number, b.header.Time) {
467
- // if !config.IsPrague(b.parent.Number(), b.parent.Time()) {
468
- // Transition case: insert all 256 ancestors
469
- // InsertBlockHashHistoryAtEip2935Fork(statedb, b.header.Number.Uint64()-1, b.header.ParentHash, chainreader)
470
- // } else {
471
- // ProcessParentBlockHash(statedb, b.header.Number.Uint64()-1, b.header.ParentHash)
472
- // }
473
- // }
474
- // Execute any user modifications to the block
465
+ // Pre-execution system calls.
466
+ if config .IsPrague (b .header .Number , b .header .Time ) {
467
+ // EIP-2935
468
+ blockContext := NewEVMBlockContext (b .header , cm , & b .header .Coinbase )
469
+ vmenv := vm .NewEVM (blockContext , vm.TxContext {}, statedb , cm .config , vm.Config {})
470
+ ProcessParentBlockHash (b .header .ParentHash , vmenv , statedb )
471
+ }
472
+
473
+ // Execute any user modifications to the block.
475
474
if gen != nil {
476
475
gen (i , b )
477
476
}
@@ -485,7 +484,7 @@ func GenerateVerkleChain(config *params.ChainConfig, parent *types.Block, engine
485
484
panic (err )
486
485
}
487
486
488
- // Write state changes to db
487
+ // Write state changes to DB.
489
488
root , err := statedb .Commit (b .header .Number .Uint64 (), config .IsEIP158 (b .header .Number ))
490
489
if err != nil {
491
490
panic (fmt .Sprintf ("state write error: %v" , err ))
0 commit comments