core: enable EIP-2935 in chain maker (#30575)

This commit is contained in:
Felix Lange 2024-10-13 18:51:51 +02:00 committed by GitHub
parent 2246d66135
commit 16f64098b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -462,16 +462,15 @@ func GenerateVerkleChain(config *params.ChainConfig, parent *types.Block, engine
// Save pre state for proof generation // Save pre state for proof generation
// preState := statedb.Copy() // preState := statedb.Copy()
// TODO uncomment when the 2935 PR is merged // Pre-execution system calls.
// if config.IsPrague(b.header.Number, b.header.Time) { if config.IsPrague(b.header.Number, b.header.Time) {
// if !config.IsPrague(b.parent.Number(), b.parent.Time()) { // EIP-2935
// Transition case: insert all 256 ancestors blockContext := NewEVMBlockContext(b.header, cm, &b.header.Coinbase)
// InsertBlockHashHistoryAtEip2935Fork(statedb, b.header.Number.Uint64()-1, b.header.ParentHash, chainreader) vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, cm.config, vm.Config{})
// } else { ProcessParentBlockHash(b.header.ParentHash, vmenv, statedb)
// ProcessParentBlockHash(statedb, b.header.Number.Uint64()-1, b.header.ParentHash) }
// }
// } // 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)
} }
@ -485,7 +484,7 @@ func GenerateVerkleChain(config *params.ChainConfig, parent *types.Block, engine
panic(err) panic(err)
} }
// Write state changes to db // Write state changes to DB.
root, err := statedb.Commit(b.header.Number.Uint64(), config.IsEIP158(b.header.Number)) root, err := statedb.Commit(b.header.Number.Uint64(), config.IsEIP158(b.header.Number))
if err != nil { if err != nil {
panic(fmt.Sprintf("state write error: %v", err)) panic(fmt.Sprintf("state write error: %v", err))