You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace-by-fee detection and mempool prune/restore keyed sponsored transactions by (sponsor_address, nonce). But nonce is the origin's nonce, and sponsor_nonce was never read. A sponsored tx actually uses two account nonces: (origin, nonce) and (sponsor, sponsor_nonce). The node's mempool enforces a unique constraint on each.
This PR computes conflicts per nonce slot. Each tx occupies (sender, nonce), plus (sponsor, sponsor_nonce) when it's sponsored.
Recalculate RBF ordering for restored mempool transactions
src/datastore/pg-write-store.ts:4283
When every orphaned transaction already has a mempool row (for example, a transaction that was pending before confirmation), this CTE restores all same-slot rows to Pending but never recalculates RBF ordering. The later block-ingestion call is keyed only by transactions in the replacement block, so an empty replacement block leaves all conflicting rows visible and overcounts mempool_tx_count. The current re-org tests avoid this by confirming a transaction that never touched the mempool, which forces the insertion path to run the recalculation. Re-run RBF for the restored IDs here as well.
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
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.
Replace-by-fee detection and mempool prune/restore keyed sponsored transactions by
(sponsor_address, nonce). Butnonceis the origin's nonce, andsponsor_noncewas never read. A sponsored tx actually uses two account nonces:(origin, nonce)and(sponsor, sponsor_nonce). The node's mempool enforces a unique constraint on each.This PR computes conflicts per nonce slot. Each tx occupies
(sender, nonce), plus(sponsor, sponsor_nonce)when it's sponsored.