Skip to content

fix(consensus): apply late commits for completed blocks - #1441

Merged
lklimek merged 2 commits into
v1.7-devfrom
fix/apply-late-commit-with-complete-block
Sep 8, 2026
Merged

lklimek merged 2 commits into
v1.7-devfrom
fix/apply-late-commit-with-complete-block

Conversation

@lklimek

@lklimek lklimek commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

A node now applies a confirmed block it has already downloaded when confirmation arrives after it discarded conflicting proposal metadata.

User story

As a node operator, I want my node to continue processing confirmed blocks regardless of whether confirmation arrives before or after the block.

Scenario

A node downloads a block, discards a proposal whose metadata disagrees with it, then receives valid confirmation. It currently stores that confirmation and waits for another block-completion event, even though the block is complete. It should validate and apply the available block immediately.

Detailed discussion

Issue being fixed or feature implemented

The release review of 1.7.1-dev.1 identified this recovery gap in the retained-block/dropped-proposal state exercised by #1439 (merged into v1.7-dev through #1437). Reproduction covers commits from the current and an earlier round, including arrival during the propose step. This is a local recovery defect; an unconditional network-wide halt has not been demonstrated.

What was done?

  • Let a complete block without proposal metadata proceed through existing commit/block verification after signature verification succeeds.
  • Dispatch a fully verified commit immediately, including during the propose step.
  • Keep signature, complete BlockID, application processing and block validation checks before application.
  • Add dispatcher-level regression and rejection cases, and update the changelog.

How Has This Been Tested?

  • Regression cases failed against the base implementation and passed with the fix.
  • Ten scenarios cover both message orders, current/earlier rounds, the propose step, conflicting proposal StateID/CoreChainLockedHeight, invalid signatures and mismatches in all three BlockID fields.
  • Go 1.27.1 with native BLS: go test -mod=readonly -count=1 -timeout=5m -race -p 1 ./internal/consensus/....
  • Scoped golangci-lint v2.13.2: run --timeout 10m --new-from-rev=origin/v1.7-dev ./internal/consensus/... (0 issues).
  • Matching Go formatter and git diff --check.

Breaking Changes

None. No wire-format or public API changes.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Co-authored by Claudius the Magnificent AI Agent

Validate and apply retained blocks when commit confirmation arrives after
conflicting proposal metadata has been dropped, including during propose.
Cover arrival order, round differences and invalid commit rejection.

Co-Authored-By: Codex GPT-6 <[email protected]>

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b798e1b0-eb59-4daf-8fc9-8ab14589b893

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

@lklimek
lklimek marked this pull request as ready for review September 8, 2026 07:29
@thepastaclaw

thepastaclaw commented Sep 8, 2026 •

Copy link
Copy Markdown

🕓 Queued for automated review — 68th in line, estimated start in ~94 h (commit 1f8adce)
Estimated review time once started: ~2.8 h (two-phase automated review; median of recent runs).

  • Request priority review — tick this box and the review moves to the front of the queue.

Keep immediate validation for matching retained parts and preserve download selection for an authenticated different block. Cover current and earlier rounds, propose-step arrival, and invalid signatures.

Co-Authored-By: Codex <[email protected]>
@lklimek
lklimek merged commit 98df1e8 into v1.7-dev Sep 8, 2026
25 of 26 checks passed
@lklimek
lklimek deleted the fix/apply-late-commit-with-complete-block branch September 8, 2026 08:16
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.

2 participants