diff --git a/state/transaction.go b/state/transaction.go index ae7fca748a..ba5ed64f88 100644 --- a/state/transaction.go +++ b/state/transaction.go @@ -1010,11 +1010,16 @@ func (s *State) internalTestGasEstimationTransactionV2(ctx context.Context, batc txExecutionOnExecutorTime := time.Now() processBatchResponseV2, err := s.executorClient.ProcessBatchV2(ctx, processBatchRequestV2) log.Debugf("executor time: %vms", time.Since(txExecutionOnExecutorTime).Milliseconds()) - if err != nil { + if err != nil && !errors.Is(err, runtime.ErrExecutorErrorOOG2) { log.Errorf("error estimating gas: %v", err) return false, false, gasUsed, nil, err } - if processBatchResponseV2.Error != executor.ExecutorError_EXECUTOR_ERROR_NO_ERROR && processBatchResponseV2.Error != executor.ExecutorError_EXECUTOR_ERROR_CLOSE_BATCH { + if processBatchResponseV2.Error != executor.ExecutorError_EXECUTOR_ERROR_NO_ERROR && + processBatchResponseV2.Error != executor.ExecutorError_EXECUTOR_ERROR_CLOSE_BATCH { + if processBatchResponseV2.Error == executor.ExecutorError_EXECUTOR_ERROR_OOG_2 { + return true, false, gasUsed, nil, nil + } + err = executor.ExecutorErr(processBatchResponseV2.Error) s.eventLog.LogExecutorErrorV2(ctx, processBatchResponseV2.Error, processBatchRequestV2) return false, false, gasUsed, nil, err @@ -1060,7 +1065,7 @@ func isGasApplyError(err error) bool { // Checks if EVM level valid gas errors occurred func isGasEVMError(err error) bool { - return errors.Is(err, runtime.ErrOutOfGas) || errors.Is(err, runtime.ErrExecutorErrorOOG2) + return errors.Is(err, runtime.ErrOutOfGas) } // Checks if the EVM reverted during execution