Skip to content

perf(headers): derive retained height from checkpoint finality - #1019

Merged
czarcas7ic merged 4 commits into
mainfrom
adam/perf-checkpoint-retained-height
Sep 23, 2026
Merged

czarcas7ic merged 4 commits into
mainfrom
adam/perf-checkpoint-retained-height

Conversation

@czarcas7ic

@czarcas7ic czarcas7ic commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Checkpoint finality scans the retained header graph to recover its minimum
height after pruning, although the new finalized anchor already determines
that minimum.

Solution

Use the finalized anchor height when checkpoint finality actually appends a
finalized prefix. Keep the existing calculation for all other transition
shapes.

Testing

The independent branch on main f8a62d4be passed 290 header-chain library tests on Rust 1.97.1, workspace all-target Clippy with warnings denied, formatting, and changelog validation. Two existing header-chain tests were ignored.

Earlier paired Zakura-only runs over heights 705,000–735,000 measured 214.1 to 236.3 committed BPS with the queue-refill patch in both arms. Those measurements have not been repeated for this independent branch.

Codex separated this PR from its former stack and ran the current validation.

@czarcas7ic
czarcas7ic force-pushed the adam/perf-checkpoint-retained-height branch from 7427c9c to b56db67 Compare September 21, 2026 12:38
@czarcas7ic
czarcas7ic force-pushed the adam/fix-floor-peer-ranking branch from c262126 to 734f37c Compare September 21, 2026 12:38
@czarcas7ic
czarcas7ic changed the base branch from adam/fix-floor-peer-ranking to main September 21, 2026 12:38
@czarcas7ic
czarcas7ic marked this pull request as ready for review September 21, 2026 13:26
@czarcas7ic
czarcas7ic requested a review from a team September 21, 2026 13:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T21:16:17.810078Z 829dcf2 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@v12-auditor

v12-auditor Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Note

Complete: Audit complete. V12 did not find any issues that need review.

Open the full results here.

Analyzed one file, diff 9688193...756c2c6.

@evan-forbes evan-forbes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread crates/zakura-header-chain/src/transition/planner/write_set.rs Outdated
The checkpoint finality fast path derives oldest_retained_height from
the new anchor instead of scanning the graph. Nothing else checks that
value against the graph (recovery would silently repair a mismatch),
so assert in debug builds that the anchor is the lowest retained header.

Addresses review feedback on the retained height derivation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@czarcas7ic
czarcas7ic merged commit 37a3484 into main Sep 23, 2026
57 checks passed
@czarcas7ic
czarcas7ic deleted the adam/perf-checkpoint-retained-height branch September 23, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants