1
0
Fork 0
forked from forks/go-ethereum
go-ethereum-modded-tocallarg/core/txpool/locals
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
..
errors.go eth: add tx to locals only if it has a chance of acceptance (#31618) 2025-04-17 21:27:48 +02:00
journal.go core/txpool: remove locals-tracking from txpools (#30559) 2025-02-04 17:23:01 +01:00
tx_tracker.go eth: add tx to locals only if it has a chance of acceptance (#31618) 2025-04-17 21:27:48 +02:00
tx_tracker_test.go eth: add tx to locals only if it has a chance of acceptance (#31618) 2025-04-17 21:27:48 +02:00