go-ethereum/ethclient
rjl493456442 9089f9461c
eth: add tx to locals only if it has a chance of acceptance (#31618)
This pull request improves error handling for local transaction submissions.

Specifically, if a transaction fails with a temporary error but might be
accepted later, the error will not be returned to the user; instead, the
transaction will be tracked locally for resubmission. 

However, if the transaction fails with a permanent error (e.g., invalid
transaction or insufficient balance), the error will be propagated to the user.

These errors returned in the legacyPool are regarded as temporary failure:

- `ErrOutOfOrderTxFromDelegated`
- `txpool.ErrInflightTxLimitReached`
- `ErrAuthorityReserved`
- `txpool.ErrUnderpriced`
- `ErrTxPoolOverflow`
- `ErrFutureReplacePending`

Notably, InsufficientBalance is also treated as a permanent error, as
it’s highly unlikely that users will transfer funds into the sender account
after submitting the transaction. Otherwise, users may be confused—seeing
their transaction submitted but unaware that the sender lacks sufficient funds—and
continue waiting for it to be included.

---------

Co-authored-by: lightclient <lightclient@protonmail.com>
2025-04-17 21:27:48 +02:00
..
gethclient ethclient/gethclient: testcase for createAccessList, make tabledriven (#30194) 2024-11-08 13:28:16 +01:00
simulated eth: add tx to locals only if it has a chance of acceptance (#31618) 2025-04-17 21:27:48 +02:00
ethclient.go ethclient: Add EstimateGasAtBlock[Hash] to estimate against a specific block (#27508) 2025-03-18 15:41:34 +01:00
ethclient_test.go ethclient: Add EstimateGasAtBlock[Hash] to estimate against a specific block (#27508) 2025-03-18 15:41:34 +01:00
example_test.go ethclient: add RevertErrorData function and example (#30669) 2024-11-07 20:26:02 +01:00
signer.go ethclient: fix tx sender cache miss detection (#23877) 2021-11-17 14:44:41 +01:00
types_test.go ethclient: add RevertErrorData function and example (#30669) 2024-11-07 20:26:02 +01:00