Repository navigation
fix(node): report a redeemMany or reclaim send with no answer as possibly broadcast (#2568) - #2574
Merged
Merged
Conversation
…ibly broadcast (#2568) The node's wallet providers carry SendLegLayer, but the redeemer and the reclaim sweep read every failed send as "nothing issued". Split TxOutcome::SendErr on decdn_incentive::tx::send_broadcast_unknown into SendErr and MaybeBroadcast. A MaybeBroadcast redeemMany warns that the transaction may be in a mempool, counts into the new decdn_onchain_tx_maybe_broadcast_total instead of send_failed and redemption_failures, and still parks a hinted lane. The reclaim sweep warns the same way and keeps metering buyer_reclaim_failures. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The focused reporting changes preserve retry behavior, include targeted regression coverage, and have no unresolved findings.
No open issues 🎉
What changed in this PR
Corrects node transaction reporting for #2568 by distinguishing possibly broadcast sends from definite failures, using the existing send-leg marker.
Changes:
- Adds
MaybeBroadcastclassification and a dedicated settlement counter. - Updates settlement and reclaim warnings without changing retry behavior.
- Adds regression tests and updates observability documentation.
| File | Description |
|---|---|
| crates/node/src/runtime/tests.rs | Updates wallet-provider test documentation. |
| crates/node/src/runtime/mod.rs | Updates the send-leg marker comment. |
| crates/node/src/payment_settlement/tests.rs | Tests classification, counters, and chain-fault handling. |
| crates/node/src/payment_settlement.rs | Handles possibly broadcast settlements separately. |
| crates/node/src/onchain_tx/tests.rs | Tests marked send-failure classification. |
| crates/node/src/onchain_tx.rs | Adds and counts MaybeBroadcast outcomes. |
| crates/node/src/metrics/tests.rs | Checks the new counter exports at zero. |
| crates/node/src/metrics.rs | Defines the counter and documents accounting. |
| crates/node/src/buyer_pool/tests.rs | Tests reclaim warnings and retained state. |
| crates/node/src/buyer_pool.rs | Distinguishes uncertain reclaim sends in warnings. |
| CHANGELOG.md | Documents the reporting correction. |
| adr/appendix-observability.md | Updates transaction metric definitions. |
Review effort: Balanced
Code coverage overviewLanguages: Rust Rust / code-coverage/cargo-llvm-cov
View coverage of the 6 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
…he answer path (#2568) Review follow-up. `send_broadcast_unknown` also reads three JSON-RPC answers (`already known`, `nonce too low`, `replacement transaction underpriced`) as uncertain, so the redeemMany and reclaim warnings say "failed with no tx hash" rather than "got no answer". Tests now drive those answers through the classifier and the reclaim sweep, plus an `insufficient funds` answer that stays refused. Docs: MaybeBroadcast, the maybe_broadcast counter and its ADR row say the transaction may have mined, that a seller/buyer nonce collision gives the same answers with nothing broadcast, and what a steady rate means; the CHANGELOG no longer claims the watermark read settles a mined redeemMany; SendErr covers a send that never connected; the reclaim sweep is named as an uncounted buyer-side transaction; incentive's tx docs list the node as a reader of the marker; over-width doc lines rewrapped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
What
The node's wallet providers carry
SendLegLayer(#2567), but nothing incrates/noderead the marker. The seller'sredeemManyand the buyer's reclaim sweep reported every failed.send()as "nothing issued". A send request that timed out, reset or got a 5xx was logged as refused and counted intodecdn_redemption_failures_total, even though the transaction may be in a mempool.onchain_tx::TxOutcomesplitsSendErrondecdn_incentive::tx::send_broadcast_unknownintoSendErr(refused, or a chain read before the send failed) andMaybeBroadcast.submit_chunk:MaybeBroadcastwarns that the send failed with no tx hash, but the transaction may be in a mempool. This covers a send request with no answer, and analready known,nonce too loworreplacement transaction underpricedanswer. It counts into the newdecdn_onchain_tx_maybe_broadcast_total, not intosend_failedorredemption_failures. It is still a chain fault, so a hinted lane parks until a sweep finishes clean. The claims stay: if theredeemManymined, the next sweep skips the lanes it paid, and a re-send of a still-pending one is an on-chain no-op.reclaim_once: the same split in the log wording. Both cases still count intodecdn_buyer_reclaim_failures_total, which already covered the uncertain receipt-wait case.adr/appendix-observability.mdgets a row for the new counter, and thesend_failed/redemption_failuresrows are updated. CHANGELOG entry added.Closes #2568
Reviewer notes
onchain_tx.rs(the split), thenpayment_settlement.rs(submit_chunk,is_chain_fault,is_redemption_failure).SendErronly. An oversize answer is a JSON-RPC error response or an HTTP 4xx, and both read as definite.mocked_*fixtures useProviderBuilder::new(), so their sends fail in the fill leg and staySendErr.decdn_redemption_failures_total, whichDecdnRedemptionFailingwatches. Until that issue lands, nothing alerts on a send leg that keeps failing. The issue asks for a separate rule shaped likeDecdnRedemptionFailing, not an addition toDecdnOnchainTxUnconfirmed: that rule fires on the first event (for: 0m), so harmless seller/buyer nonce collisions would page, and its runbook needs a tx hash these sends don't have.Verification
cargo fmt -- --checkcargo clippy -p decdn-node --all-targets --all-features -- -D warnings(onlycrates/nodechanged)cargo nextest run -p decdn-node -p decdn-incentive: 2082 passedCARGO_BUILD_WARNINGS=deny cargo doc -p decdn-node --no-deps --document-private-items,make -C adr check-refs, pre-commitMaybeBroadcast; a table of RPC answers (nonce too low,already knownandreplacement transaction underpricedare possibly broadcast,insufficient fundsis refused), plusnonce too lowandinsufficient fundsreclaim cases; markedredeemManyandreclaimwith no answer versus a failing gas estimate (refused) viaredeem_planned_lanes/reclaim_once; the classifier tables include the new arm. I mutated the four new branches one at a time, and each mutation fails at least one test. Narrowing either check to transport failures only also fails a test.contracts/changed: n/aCHANGELOG.mdentry addedadr/appendix-observability.mdrows updated🤖 Generated with Claude Code