diff --git a/cannon/mipsevm/testutil/evm.go b/cannon/mipsevm/testutil/evm.go index dbe9970fdc24..d34b778aa645 100644 --- a/cannon/mipsevm/testutil/evm.go +++ b/cannon/mipsevm/testutil/evm.go @@ -100,7 +100,9 @@ func NewEVMEnv(contracts *ContractMetadata) (*vm.EVM, *state.StateDB) { if err != nil { panic(fmt.Errorf("failed to create memory state db: %w", err)) } - blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, state) + + feeCurrencyContext := core.GetFeeCurrencyContext(header, chainCfg, state) + blockContext := core.NewEVMBlockContext(header, bc, nil, chainCfg, state, feeCurrencyContext) vmCfg := vm.Config{} env := vm.NewEVM(blockContext, vm.TxContext{}, state, chainCfg, vmCfg) diff --git a/op-chain-ops/cmd/op-simulate/main.go b/op-chain-ops/cmd/op-simulate/main.go index 8b0986e4554f..19f4cb41a6ae 100644 --- a/op-chain-ops/cmd/op-simulate/main.go +++ b/op-chain-ops/cmd/op-simulate/main.go @@ -294,7 +294,8 @@ func simulate(ctx context.Context, logger log.Logger, conf *params.ChainConfig, // run the transaction start := time.Now() - receipt, err := core.ApplyTransaction(conf, cCtx, &sender, &gp, state, header, tx, &usedGas, vmConfig) + feeCurrencyContext := core.GetFeeCurrencyContext(header, conf, state) + receipt, err := core.ApplyTransaction(conf, cCtx, &sender, &gp, state, header, tx, &usedGas, vmConfig, feeCurrencyContext) if err != nil { return fmt.Errorf("failed to apply tx: %w", err) } diff --git a/op-e2e/actions/helpers/l1_miner.go b/op-e2e/actions/helpers/l1_miner.go index 5fe5c762d5c9..e4675a246305 100644 --- a/op-e2e/actions/helpers/l1_miner.go +++ b/op-e2e/actions/helpers/l1_miner.go @@ -110,7 +110,8 @@ func (s *L1Miner) ActL1StartBlock(timeDelta uint64) Action { // TODO(client-pod#826) // Unfortunately this is not part of any Geth environment setup, // we just have to apply it, like how the Geth block-builder worker does. - context := core.NewEVMBlockContext(header, s.l1Chain, nil, s.l1Chain.Config(), statedb) + feeCurrencyContext := core.GetFeeCurrencyContext(header, s.l1Chain.Config(), statedb) + context := core.NewEVMBlockContext(header, s.l1Chain, nil, s.l1Chain.Config(), statedb, feeCurrencyContext) // NOTE: Unlikely to be needed for the beacon block root, but we setup any precompile overrides anyways for forwards-compatibility var precompileOverrides vm.PrecompileOverrides if vmConfig := s.l1Chain.GetVMConfig(); vmConfig != nil && vmConfig.PrecompileOverrides != nil { @@ -176,8 +177,9 @@ func (s *L1Miner) IncludeTx(t Testing, tx *types.Transaction) { return } s.l1BuildingState.SetTxContext(tx.Hash(), len(s.L1Transactions)) + feeCurrencyContext := core.GetFeeCurrencyContext(s.l1BuildingHeader, s.l1Cfg.Config, s.l1BuildingState) receipt, err := core.ApplyTransaction(s.l1Cfg.Config, s.l1Chain, &s.l1BuildingHeader.Coinbase, - s.L1GasPool, s.l1BuildingState, s.l1BuildingHeader, tx.WithoutBlobTxSidecar(), &s.l1BuildingHeader.GasUsed, *s.l1Chain.GetVMConfig()) + s.L1GasPool, s.l1BuildingState, s.l1BuildingHeader, tx.WithoutBlobTxSidecar(), &s.l1BuildingHeader.GasUsed, *s.l1Chain.GetVMConfig(), feeCurrencyContext) if err != nil { s.l1TxFailed = append(s.l1TxFailed, tx) t.Fatalf("failed to apply transaction to L1 block (tx %d): %v", len(s.L1Transactions), err) diff --git a/op-program/client/l2/engineapi/block_processor.go b/op-program/client/l2/engineapi/block_processor.go index 2e6cc5beade4..5798b317e5db 100644 --- a/op-program/client/l2/engineapi/block_processor.go +++ b/op-program/client/l2/engineapi/block_processor.go @@ -83,7 +83,8 @@ func NewBlockProcessorFromHeader(provider BlockDataProvider, h *types.Header) (* if h.ParentBeaconRoot != nil { // Unfortunately this is not part of any Geth environment setup, // we just have to apply it, like how the Geth block-builder worker does. - context := core.NewEVMBlockContext(header, provider, nil, provider.Config(), statedb) + feeCurrencyContext := core.GetFeeCurrencyContext(header, provider.Config(), statedb) + context := core.NewEVMBlockContext(header, provider, nil, provider.Config(), statedb, feeCurrencyContext) // NOTE: Unlikely to be needed for the beacon block root, but we setup any precompile overrides anyways for forwards-compatibility var precompileOverrides vm.PrecompileOverrides if vmConfig := provider.GetVMConfig(); vmConfig != nil && vmConfig.PrecompileOverrides != nil { @@ -113,8 +114,9 @@ func (b *BlockProcessor) CheckTxWithinGasLimit(tx *types.Transaction) error { func (b *BlockProcessor) AddTx(tx *types.Transaction) error { txIndex := len(b.transactions) b.state.SetTxContext(tx.Hash(), txIndex) + feeCurrencyContext := core.GetFeeCurrencyContext(b.header, b.dataProvider.Config(), b.state) receipt, err := core.ApplyTransaction(b.dataProvider.Config(), b.dataProvider, &b.header.Coinbase, - b.gasPool, b.state, b.header, tx, &b.header.GasUsed, *b.dataProvider.GetVMConfig()) + b.gasPool, b.state, b.header, tx, &b.header.GasUsed, *b.dataProvider.GetVMConfig(), feeCurrencyContext) if err != nil { return fmt.Errorf("failed to apply transaction to L2 block (tx %d): %w", txIndex, err) }