Repository navigation
fix(forge-core): retry a result wait whose DAPI node lost its Tenderdash instead of reporting E604 - #627
Merged
Conversation
…ied, not a refusal
rs-dapi answers waitForStateTransitionResult with an error body, so a node that has
lost its own Tenderdash connection reaches the SDK as a StateTransitionBroadcastError
with gRPC Unavailable's code and no consensus cause ("Tenderdash is not available").
dg classified it as fatal and reported E604 "Platform rejected the write", although
nothing judged the transition. Treat it as a transient node error: the write loop
checks the nonce and re-sends the same signed bytes. If the text still reaches the
user, it maps to E701 (unreachable) instead of E604.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 41 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
commented
Nov 20, 2026
PastaPastaPasta
left a comment
Owner
Author
There was a problem hiding this comment.
Verdict: approve
Reviewed head fea819d9afeb6de3e5b416f36be146d8f93398c6.
- Narrow classification.
is_node_unavailable_answermatches onlyStateTransitionBroadcastErrorwithcause: Noneandcode == 14(gRPC Unavailable). Consensus refusals carry a cause and use consensus codes (10000+), so they still reachclassify_write_error's consensus branches first. Any other code with no cause still ends asFatal, and the new negative test (Internal) pins that. - No double-submit. A
Retryablefrom the wait goes throughdrive_write's existing path.nonce_spent()is asked first, and a spent nonce goes toNonceConsumed, where the caller's proved read decides. With the nonce free, the same signed bytes are re-sent, so nothing is re-signed and a duplicate is rejected on its nonce. - Bounded. The retries count against
MAX_BROADCAST_ATTEMPTS(4) with 2/4/8 s backoff. Once that runs out the result isError::Timeout { retryable: true }, not a silent success, so a node that stays unavailable is reported, not hidden. - Read path.
is_transient_node_erroris also used byread_retryable, but reads never produce this variant, so nothing changes there. - user_error.
is_network_textis checked at L1104, before the E604 match at L1107, so "tenderdash is not available" now maps to E701. The new test covers it.
CI is green on this head. A live repro isn't possible (it needs a node that has lost Tenderdash), which is acceptable; tonight's nightly 22-issue-parity will exercise the path.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
5 of 9 tasks
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.
Last night's Testnet Nightly (run 44555209237) failed one scenario,
22-issue-parity:dg label deleteexited with E604 "label not changed: Platform rejected the write", causestate transition broadcast error: Tenderdash is not available. Platform rejected nothing. The DAPI node that served the result wait had lost its own Tenderdash connection.Why dg read it as a refusal
rs-dapi answers
waitForStateTransitionResultwith an error body, not a gRPC status. ItsDapiError::Unavailable("Tenderdash is not available")therefore reaches the SDK as aStateTransitionBroadcastErrorwith code 14 (gRPCUnavailable) and no consensus cause. The source is v5.0.0-rc.8rs-dapi/src/services/platform_service/wait_for_state_transition_result.rs, lines 63–68 and 421–443.classify_write_errordidn't recognise that shape and returnedFatal, anduser_errorthen matched "state transition broadcast error" as E604.Change
is_transient_node_errornow counts a broadcast error with Unavailable's code and no consensus cause as a node problem. The write loop already handles a retryable wait failure: if the nonce is spent, the proved read decides; otherwise it re-sends the same signed bytes, so nothing is signed twice. A broadcast error with any other code, or with a cause, is still an answer.is_network_textgains "tenderdash is not available", so if the text still reaches the user it reads as E701 (unreachable) rather than E604.Testing
node_level_failures_classify_as_transientand a newa_node_without_its_tenderdash_is_unreachable_not_a_refusal.cargo test -p forge-core --lib: 1157 pass.clippy -p forge-core --all-targets -D warningsandfmt --checkare clean.🤖 Generated with Claude Code