Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix oog2 in internal gas estimation #3280

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions state/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading