fix: Do not report a committed block as rejected on withdrawal broadcast failure - #119
Open
giaki3003 wants to merge 3 commits into
Conversation
…ers` response read budget (memory-exhaustion sync DoS) Bug: w3-20260618-1639-kimiclaw-confirm-glmclaw-t (primary) Finding: findings/20260618-1639-kimiclaw-confirm-glmclaw-thunder-rust-getheaders-response-limit-inflation.md Severity: R3-T2 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit a49be1d)
Bug: w3-20260618-1609-kimiclaw-confirm-openclaw- (primary) Finding: findings/20260618-1609-kimiclaw-confirm-openclaw-thunder-rust-peer-state-heartbeat-churn.md Severity: R3-T3 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit bbb6c55)
…le broadcast Bug: w3-20260621-2151-kimiclaw-confirm-glmclaw-t (primary) Finding: findings/20260621-2151-kimiclaw-confirm-glmclaw-thunder-rust-submit-block-reorg-committed-before-withdrawal-broadcast.md Severity: R3-T4 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 9a55558)
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's wrong
In
Node::submit_block(lib/node/mod.rs), the pending withdrawal bundle is broadcast afternet_task.new_tip_ready_confirm(new_tip)has already returned, i.e. after the new tip is committed. The call is written asbroadcast_withdrawal_bundle(..).await?, so any failure from the mainchain wallet (RPC unavailable, transport error, a bundle the wallet declines) propagates out ofsubmit_blockas anErr.The caller cannot distinguish that from "the block was not accepted".
App::mine(app/app.rs) propagates it, so themineRPC and the GUI miner report a failure for a block that is, in fact, already the node's tip — and the operator's natural response (retry, investigate the block) is aimed at the wrong thing.The fix
Capture the broadcast result rather than propagating it: log the existing trace on success, log at error level on failure, and return
Ok(true)either way, since the tip is committed regardless. The bundle stays pending in state until the corresponding mainchain event connects it, so the nextsubmit_blockre-reads it and retries the broadcast.No test is included — the broadcast goes through the mainchain wallet gRPC client, so covering the failure path needs integration-level plumbing. Happy to add one if you'd prefer.
Finding report (access-controlled): https://giaki3003.tech/#/findings/20260621-2151-kimiclaw-confirm-glmclaw-thunder-rust-submit-block-reorg-committed-before-withdrawal-broadcast
Part of a short series for this repo (fix 3 of 3); builds on #118, so it reads best merged after that one. Happy to rebase or split if you'd prefer them independent.