Skip to content

eth/sequencer: judge the served preconf commitment on a matching store seal - #2433

Closed
kamuikatsurgi wants to merge 4 commits into
v2.10.2-candidatefrom
fix/preconf-audit-judge-served-on-verdict
Closed

kamuikatsurgi wants to merge 4 commits into
v2.10.2-candidatefrom
fix/preconf-audit-judge-served-on-verdict

Conversation

@kamuikatsurgi

Copy link
Copy Markdown
Member

Problem

The audit only reconciled the served preconf commitment (#2427) when the store could not confirm a height — NOT_FOUND, unsealed, or an unusable seal. On a plain matching seal it cleared the commitment without judging it.

A matching seal only says what the store holds now. If the generation this node followed was displaced — a backup producer republished the height and its block became canonical — and the node crashed before the live path judged it (the pending entry is memory-only; the commitment is the only durable evidence), the store's current seal matches canonical while what this node served does not. That contradicted preconf was dropped, unrecorded.

Fix

Judge the served commitment on every verdict except a mismatch, which already recorded the height. Same code path the auditUnknown branch already used; no new inputs.

Evidence

TestAuditJudgesServedCommitmentDespiteMatchingSeal reproduces the mechanism (store seal == canonical, served digest ≠ canonical): before the fix mismatch = 0, no ledger record, commitment cleared; after it, one served_mismatch at the height and the commitment cleared. Full eth/sequencer suite green under -race.

Cost: one ReadPreconfServed per audited height and, when a commitment exists, a body read + hash fold — per-block cadence, bounded.

Not included: a live devnet reproduction of the compound scenario (primary stall → backup wins → consumer crash before import); the unit test is the precise mechanism.

🤖 Generated with Claude Code

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

Copilot AI lite review requested due to automatic review settings September 22, 2026 11:07

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

An unjudgeable canonical body can leave a commitment behind while the audit watermark advances past it, preventing later reconciliation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Updates sequencer auditing so matching store seals also reconcile durable served preconfirmation commitments.

Changes:

  • Judges commitments for matching seals.
  • Adds regression coverage for served-content divergence.
File Description
eth/​sequencer/​audit.go Extends commitment reconciliation to matching seals.
eth/​sequencer/​audit_served_test.go Tests divergence despite a matching store seal.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread eth/sequencer/audit.go
@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.57%. Comparing base (68a4609) to head (5cc71b3).
⚠️ Report is 32 commits behind head on v2.10.2-candidate.

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##           v2.10.2-candidate    #2433      +/-   ##
=====================================================
- Coverage              57.93%   57.57%   -0.36%     
=====================================================
  Files                    957      959       +2     
  Lines                 177763   175928    -1835     
=====================================================
- Hits                  102984   101298    -1686     
+ Misses                 69118    68967     -151     
- Partials                5661     5663       +2     
Files with missing lines Coverage Δ
eth/sequencer/audit.go 94.79% <100.00%> (-0.14%) ⬇️

... and 55 files with indirect coverage changes

Files with missing lines Coverage Δ
eth/sequencer/audit.go 94.79% <100.00%> (-0.14%) ⬇️

... and 55 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kamuikatsurgi
kamuikatsurgi force-pushed the fix/preconf-audit-judge-served-on-verdict branch from 8fead4b to 61fd0b2 Compare September 22, 2026 12:37
Copilot AI review requested due to automatic review settings September 22, 2026 12:37

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

The implementation directly addresses the described loss window and includes focused regression coverage.

Review effort: Lite
Findings: None

Resolved since last review (1)

The audit only reconciled the served preconf commitment when the store could
not confirm a height (NOT_FOUND, unsealed, unusable seal); on a plain match it
cleared the commitment unjudged. A matching seal only says what the store
holds now. If the generation this node followed was displaced — a backup
producer republished the height and its block became canonical — and the
node crashed before the live path judged it, the store's current seal matches
canonical while what this node served does not. That broken promise was
dropped, unrecorded.

Judge the commitment on every verdict except a mismatch, which already
recorded the height.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 22, 2026 12:53
@kamuikatsurgi
kamuikatsurgi force-pushed the fix/preconf-audit-judge-served-on-verdict branch from 61fd0b2 to d0cc446 Compare September 22, 2026 12:53

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The new test fixture does not keep the canonical block, seal, and canonical hash consistent, so it does not accurately exercise the intended scenario.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Comment thread eth/sequencer/audit_served_test.go Outdated
kamuikatsurgi and others added 2 commits September 22, 2026 20:29
The fixture sealed one header at 7 and made canonical another, so the
seal did not actually match. Derive the seal and canonical hash from the
reordered block.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 22, 2026 15:19

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Unreadable durable commitments can still be cleared without judgment, losing evidence.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)

Comment thread eth/sequencer/audit.go
Copilot AI review requested due to automatic review settings September 22, 2026 16:12

Copilot AI 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.

Copilot review overview

🟢 Approval recommended

No unresolved issues were identified, and all assessments support approval.

Review effort: Lite
Findings: None

Resolved since last review (1)

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