Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
palango committed Nov 26, 2024
1 parent b92d29c commit 0fe03a5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion cannon/mipsevm/testutil/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion op-chain-ops/cmd/op-simulate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 4 additions & 2 deletions op-e2e/actions/helpers/l1_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions op-program/client/l2/engineapi/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 0fe03a5

Please sign in to comment.