Skip to content

fix(forge-core): retry a result wait whose DAPI node lost its Tenderdash instead of reporting E604 - #627

Merged
PastaPastaPasta merged 1 commit into
masterfrom
fix/write-wait-tenderdash-unavailable
Nov 20, 2026
Merged

PastaPastaPasta merged 1 commit into
masterfrom
fix/write-wait-tenderdash-unavailable

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

Last night's Testnet Nightly (run 44555209237) failed one scenario, 22-issue-parity: dg label delete exited with E604 "label not changed: Platform rejected the write", cause state 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 waitForStateTransitionResult with an error body, not a gRPC status. Its DapiError::Unavailable("Tenderdash is not available") therefore reaches the SDK as a StateTransitionBroadcastError with code 14 (gRPC Unavailable) and no consensus cause. The source is v5.0.0-rc.8 rs-dapi/src/services/platform_service/wait_for_state_transition_result.rs, lines 63–68 and 421–443. classify_write_error didn't recognise that shape and returned Fatal, and user_error then matched "state transition broadcast error" as E604.

Change

  • is_transient_node_error now 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_text gains "tenderdash is not available", so if the text still reaches the user it reads as E701 (unreachable) rather than E604.

Testing

  • New assertions in node_level_failures_classify_as_transient and a new a_node_without_its_tenderdash_is_unreachable_not_a_refusal.
  • cargo test -p forge-core --lib: 1157 pass. clippy -p forge-core --all-targets -D warnings and fmt --check are clean.
  • Not reproduced live: the failure depends on a testnet node losing Tenderdash. The rest of that run passed 30 of 31.

🤖 Generated with Claude Code

…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]>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e25b9ef-4d4c-4528-8675-d8263bbbb3a7
Commits

Reviewing files that changed from the base of the PR and between 75ab20f and fea819d.

Files selected for processing: 2

  • crates/forge-core/src/platform/mod.rs
  • crates/forge-core/src/user_error.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: approve

Reviewed head fea819d9afeb6de3e5b416f36be146d8f93398c6.

  • Narrow classification. is_node_unavailable_answer matches only StateTransitionBroadcastError with cause: None and code == 14 (gRPC Unavailable). Consensus refusals carry a cause and use consensus codes (10000+), so they still reach classify_write_error's consensus branches first. Any other code with no cause still ends as Fatal, and the new negative test (Internal) pins that.
  • No double-submit. A Retryable from the wait goes through drive_write's existing path. nonce_spent() is asked first, and a spent nonce goes to NonceConsumed, 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 is Error::Timeout { retryable: true }, not a silent success, so a node that stays unavailable is reported, not hidden.
  • Read path. is_transient_node_error is also used by read_retryable, but reads never produce this variant, so nothing changes there.
  • user_error. is_network_text is 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.

@PastaPastaPasta
PastaPastaPasta merged commit 3546dbf into master Nov 20, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant