Skip to content

Commit

Permalink
fixed runmode for two invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed May 28, 2024
1 parent 5699335 commit de513a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/state_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
}

func ApplyTransactionWithResultFilter(config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, header *types.Header, tx *types.Transaction, usedGas *uint64, cfg vm.Config, resultFilter func(*ExecutionResult) error) (*types.Receipt, *ExecutionResult, error) {
msg, err := TransactionToMessage(tx, types.MakeSigner(config, header.Number, header.Time), header.BaseFee, MessageCommitMode)
msg, err := TransactionToMessage(tx, types.MakeSigner(config, header.Number, header.Time), header.BaseFee, MessageReplayMode)
if err != nil {
return nil, nil, err
}
Expand Down
3 changes: 1 addition & 2 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ func runScheduledTxes(ctx context.Context, b core.NodeInterfaceBackendAPI, state
scheduled := result.ScheduledTxes
for runMode == core.MessageGasEstimationMode && len(scheduled) > 0 {
// This will panic if the scheduled tx is signed, but we only schedule unsigned ones
msg, err := core.TransactionToMessage(scheduled[0], types.NewArbitrumSigner(nil), header.BaseFee, core.MessageReplayMode)
msg, err := core.TransactionToMessage(scheduled[0], types.NewArbitrumSigner(nil), header.BaseFee, runMode)
if err != nil {
return nil, err
}
Expand All @@ -1167,7 +1167,6 @@ func runScheduledTxes(ctx context.Context, b core.NodeInterfaceBackendAPI, state
log.Warn("Scheduling tx used less gas than scheduled tx has available", "usedGas", result.UsedGas, "scheduledGas", msg.GasLimit)
result.UsedGas = 0
}
msg.TxRunMode = runMode
// make a new EVM for the scheduled Tx (an EVM must never be reused)
evm := b.GetEVM(ctx, msg, state, header, &vm.Config{NoBaseFee: true}, &blockCtx)
go func() {
Expand Down

0 comments on commit de513a2

Please sign in to comment.