Add TransactionManager to handle stalled tx#767
Open
evgeny-stakewise wants to merge 8 commits into
Open
Conversation
tsudmi
previously approved these changes
Jun 24, 2026
cyc60
reviewed
Jun 25, 2026
|
|
||
| # forget gas records for nonces that have already been mined (nonce | ||
| # `latest_nonce` itself may still be pending, so keep it) | ||
| self._nonce_to_tx_params = { |
Contributor
There was a problem hiding this comment.
Optional: complicated one-liner, can be exracted into _update_nonce... func
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Routes all wallet transactions through a single
TransactionManager.transact(...)path and removestransaction_gas_wrapper. The manager owns submit + receipt-wait under a lock (one in-flight tx at a time), reuses the lowest unconfirmed nonce, and replaces a stuck pending tx with bumped fees instead of an in-call retry loop.What changed
transact(tx_function, tx_params=None, high_priority=False) -> TxReceipt | None: serializes submit and the receipt wait so exactly one wallet tx is in flight at a time; returns the receipt (orNoneon revert).high_priority=True(e.g. validator registration) skips the default-gas attempts and submits high-priority fees straight away.high_priority=Falsekeeps the existing default-gas attempts loop, escalating to high-priority fees onFeeTooLow.execution_transaction_timeoutthe task retries on its next run, where a pending tx is detected and its fees bumped (max(high_priority, bump(prev)), capped atmax_fee_per_gas).transaction_gas_wrapper; migrated every caller (validators register/fund/consolidate, withdrawals, exits, harvest, reward splitter, meta vault) plus thetx_aggregate/deposit_to_sub_vaultswrappers, which now returnTxReceipt | None.Behavior note
transactreturnsNoneand leaves the tx pending, so the next run detects and replaces it (previouslyTimeExhaustedpropagated out of the caller).max_fee_per_gasceiling, the bump can't clear the node's +10% replacement threshold, so the manager skips the replacement, logs a warning, and returnsNoneinstead of broadcasting a doomed underpriced tx — it mines once the base fee drops or is retried on a later run.