Repository navigation
Conversation
Keep application work on the node context and wait for the result consumer to exit before handing its final state to consensus. Fixes #1485. Co-Authored-By: Codex GPT-6 <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: dashpay/tenderdash/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
|
PR HygieneState: ready-to-merge · commit
Self-review is an author attestation that you have read the diff: This check passes when the policy is satisfied; the repository decides whether merging requires it. |
Keep the parent context only for applying received blocks. Cancel result receives and peer-error delivery with the synchronizer so a blocked P2P send cannot prevent consumer shutdown. Cover a full peer-error channel and a consumer paused before Apply. Strengthen stop ordering checks; removing the consumer join fails both handover tests in five repeated mutation-test runs. Co-Authored-By: Codex <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
Check finalization without blocking after the consumer has been joined. A missing application must fail the regression test and run cleanup, not hang until the global test timeout. Verified with a skipped-application mutation before and after the fix. Co-Authored-By: Codex <[email protected]> <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
|
/self-reviewed |
thepastaclaw
left a comment
There was a problem hiding this comment.
⚠️ DEGRADED — Final validation — Phase 1 + Phase 2
⚠️ DEGRADED review. The primary review models were unavailable (gpt-6-astraunavailable: All credentials for model gpt-6-astra are cooling down (last error: usage_limit_reached: The usage limit has been reache), so this review ran on stand-in models:gpt-5.6-luna→muse-spark-1.3-contributor,gpt-5.6-sol→muse-spark-1.3-contributor,gpt-5.6-terra→muse-spark-1.3-contributor,gpt-6-astra→muse-spark-1.3-contributor. Both review phases and the independent verifiers still ran, but on weaker models, with Phase 1 capped athigheffort. Treat the verdict as provisional; a full-strength re-review will run on the next push once the primary models are back.
Handover fix is correct: consumer I/O uses the cancelable child context while FinalizeBlock keeps the parent node context, and OnStop joins the consumer before consensus reads state. The unbounded-wait concern describes the intended safety-over-liveness tradeoff, not a defect, and shutdown cancellation is preserved.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: tenderdash-consensus-security); reviewer 3: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: phase2-reviewer, role: general); reviewer 4: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: phase2-reviewer, role: tenderdash-consensus-security); final verifier: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: astra-verifier, role: final-verifier)
- Degraded mode:
gpt-6-astraunavailable: All credentials for model gpt-6-astra are cooling down (last error: usage_limit_reached: The usage limit has been reache (detected by probe, since 2026-09-20T20:45:34Z); stand-insgpt-5.6-luna→muse-spark-1.3-contributor,gpt-5.6-sol→muse-spark-1.3-contributor,gpt-5.6-terra→muse-spark-1.3-contributor,gpt-6-astra→muse-spark-1.3-contributor; Phase 1 effort capped athigh - Triage:
lowbymuse-spark-1.3-contributor(standing in forgpt-6-astra) (effort low) — Small contained context-scoping and shutdown-ordering fix in synchronizer.go with extensive tests and no change to consensus rules, crypto, or serialization logic. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— tenderdash-consensus-security (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 100% left, weekly 100% left; passed overgemini-3.8-flash-high(lane failed) - Fresh verifier:
muse-spark-1.3-contributor(standing in forgpt-6-astra) — final-verifier; agentastra-verifier - Phase 2 reviewers:
muse-spark-1.3-contributor(standing in forgpt-6-astra) — general (completed, effort medium); agentphase2-reviewer,muse-spark-1.3-contributor(standing in forgpt-6-astra) — tenderdash-consensus-security (completed, effort medium); agentphase2-reviewer
|
/self-reviewed |
TL;DR: Prevent a syncing node from crashing as it catches up and switches to consensus.
User story
As a node operator, I want my node to finish syncing without a restart so it can join consensus reliably.
Scenario
A node reaches the network tip while its application is still finishing the last block. The switch to consensus must wait for that work without interrupting it or getting stuck reporting a peer error.
Detailed discussion
Issue being fixed or feature implemented
Fixes #1485. Synchronizer shutdown canceled the context shared with an in-flight
FinalizeBlock, triggering the committed-block panic.What was done?
consumerDone: the applier's mutex waits for oneApply, but cannot prevent a received block from starting application after a state snapshot. Worker-pool shutdown andBaseService.Waitdo not independently join this consumer.How Has This Been Tested?
Apply, checking shutdown ordering, final state, and parent cancellation.internal/blocksyncpackage passed with-race -tags deadlock -count=1(9.233s), using BLS 1.3.6 headers matching the locally built native library.internal/blocksync: 0 issues.gofmtandgit diff --checkpassed.Breaking Changes
None.
Checklist
For repository code-owners and collaborators only
🤖 Co-authored by Claudius the Magnificent AI Agent