Repository navigation
fix(incentive): report a nonce too low send as possibly broadcast (#2562) - #2563
Merged
Merged
Conversation
…med (#2562) A gateway that retries the same signed bytes on a second backend gets `nonce too low` once the first copy is sequenced. is_nonce_collision read that as a foreign collision that broadcast nothing, so topUp re-sent on a fresh nonce and openPool released its entry: either could escrow twice. is_nonce_collision now matches only `replacement transaction underpriced`; the new is_nonce_spent matches `nonce too low`, which open_pool and send_top_up treat as possibly broadcast at the pinned nonce. Closes #2562 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
6 tasks done
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 5 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…w-maybe-broadcast # Conflicts: # CHANGELOG.md # crates/client/src/buyer_pool.rs
…w-maybe-broadcast # Conflicts: # CHANGELOG.md
…2562) Fold `nonce too low` into send_broadcast_unknown, as #2560 did for `already known`: every chain write (send_for_receipt, pool close/reclaim, approve, publish) now reports it as MaybeBroadcast, and open_pool / send_top_up need no separate check. is_nonce_spent goes away. Narrow is_nonce_collision's safety claim to the answering backend and point at #2565 for the remaining gateway-retry risk of the underpriced re-send. Add a test for `nonce too low` after a collision re-send, and fix review comments on the docs and CHANGELOG. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nonce too low unconfirmed (#2562)nonce too low send as possibly broadcast (#2562)
…w-maybe-broadcast # Conflicts: # crates/cli/src/commands/pool.rs # crates/client/src/buyer_pool.rs # crates/incentive/src/tx.rs # crates/incentive/src/tx/tests.rs
thiras
approved these changes
Oct 20, 2026
This was referenced Oct 20, 2026
Merged
This was referenced Oct 28, 2026
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.
Closes #2562
Problem
open_pool/top_upsend at an explicit pending nonce N. A load-balancing RPC gateway that loses backend A's response and retries the same signed bytes on backend B getsnonce too lowonce A's copy is sequenced. Two things went wrong with that answer:is_nonce_collisionread it as a foreign same-account collision, sosend_top_upreleased itsTopUpUnconfirmedentry and re-sent on a fresh nonce.send_broadcast_unknownread it as a clean rejection, soopen_poolreleased itsOpenUnconfirmedentry.Either could escrow twice. Every other chain write (
send_for_receipt,pool close/reclaim) also reported "nothing broadcast". This is the sibling of #2432 / #2560 (already known).Fix
send_broadcast_unknown: treatsnonce too lowas uncertain, the way fix(incentive): treat an "already known" send rejection as possibly broadcast #2560 treatsalready known.open_pool/send_top_upkeep the entry and returnOpenUnconfirmed/TopUpUnconfirmedwith the nonce and no hash.send_for_receiptreportsMaybeBroadcast.pool close/reclaim,publish, key rotation andapprovewarn that the tx may still mine.is_nonce_collision: matches onlyreplacement transaction underpriced. The immediate re-send stays, and the doc now says the answer speaks for one backend only. The remaining gateway-retry risk of that re-send is topUp re-send onreplacement transaction underpricedcan double-escrow under a gateway retry #2565.Node resolution with no hash.
settle_unconfirmed_top_up/settle_unconfirmed_openread the confirmed nonce. Once N is spent, they compare the pool deposit (orgetPools) at that block with the row's baseline:On Arbitrum, most same-key collisions now go through this settle and not the 250 ms re-send.
Why not sign locally and look up the hash. The generic
P: Providerbound hides the wallet filler at every call site (impl Providerreturns,DynProviderin sponsord). Local signing would need a provider-type change across node, CLI and sponsord. #2565 lists it as an option.Tests
crates/client/src/buyer_pool/tests.rs:an_open_pool_submit_answered_nonce_too_low_stays_unconfirmedanda_top_up_submit_answered_nonce_too_low_is_unconfirmed_not_re_sentboth fail on main.a_nonce_too_low_after_a_collision_re_send_is_unconfirmed_at_the_new_nonceis new.replacement transaction underpriced.crates/incentive/src/tx/tests.rs:nonce too lowis broadcast-unknown and not a collision.send_for_receiptreportsMaybeBroadcastfor it.Gate (local)
cargo nextest run -p decdn-client -p decdn-incentive -p decdn-cli: 2311 passed.cargo nextest run -p decdn-node buyer_pool: 117 passed.cargo fmt -- --check,cargo clippy --workspace --all-targets -- -D warningsandCARGO_BUILD_WARNINGS=deny cargo doc --workspace --no-deps --document-private-itemsare clean.Commits use
--no-verify: the cargo-deny pre-commit hook fails on the broken local advisory DB, so I ran the gate above by hand.🤖 Generated with Claude Code