mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 22:56:43 +00:00
Merge pull request #49 from DeBankDeFi/multicall
differentiate context cancell and fast fail error
This commit is contained in:
commit
2545a28162
1 changed files with 11 additions and 1 deletions
|
|
@ -60,6 +60,11 @@ const (
|
|||
errMessageExecuting = -40012
|
||||
errEVMCancelled = -40013
|
||||
errEVMReverted = -40014
|
||||
errEVMFastFailed = -40015
|
||||
|
||||
// internal error
|
||||
errUnderlyingDB = -40020
|
||||
errLoadingState = -40021
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -253,7 +258,12 @@ func doOneCall(ctx context.Context, b Backend, state *state.StateDB, header *typ
|
|||
// If the timer caused an abort, return an appropriate error message
|
||||
if evm.Cancelled() {
|
||||
result.Code = errEVMCancelled
|
||||
result.Err = fmt.Sprintf("execution cancelled, either fast failed or exceeding timeout(%v)", singleCallTimeout)
|
||||
result.Err = fmt.Sprintf("execution cancelled, timeout(%v)", singleCallTimeout)
|
||||
// if execution time is close to timeout, not proper
|
||||
if time.Since(start) < singleCallTimeout {
|
||||
result.Code = errEVMFastFailed
|
||||
result.Err = "fast failed"
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue