Skip to content

fix(ol): select valid canonical epoch commitments#1806

Open
voidash wants to merge 4 commits into
mainfrom
fix/ol-valid-canonical-epoch-selection
Open

fix(ol): select valid canonical epoch commitments#1806
voidash wants to merge 4 commits into
mainfrom
fix/ol-valid-canonical-epoch-selection

Conversation

@voidash
Copy link
Copy Markdown
Contributor

@voidash voidash commented May 11, 2026

Summary

This PR fixes OL canonical block and epoch commitment selection so callers prefer terminal blocks with BlockStatus::Valid instead of blindly taking the first stored commitment.

It also includes the previously validated checkpoint DA/inbox-index fixes needed for the real bridge e2e path.

Bug Context

During the real bridge e2e run with staging-v2-like SP1 proving, the bridge deposit path succeeded, but the EE update path previously failed because the OL tracker/checkpoint prover could resolve an epoch terminal block from an invalid fork. That produced failures like No OL state found for terminal block ... even though the valid canonical block at the same slot existed.

The root cause is that epoch summaries/commitments can contain multiple candidates for the same epoch/slot, and the old lookup path selected the first stored entry. The first entry is not guaranteed to be valid.

Fix

  • Prefer BlockStatus::Valid in OL canonical block lookup.
  • Prefer valid terminal blocks when RPC/prover code resolves canonical epoch commitments.
  • Re-check the valid canonical epoch commitment after checkpoint proof completion before advancing the checkpoint proof cursor.
  • Keep fallback behavior to the first stored entry when no valid block is available.

Verification

  • cargo fmt --check
  • cargo check -F sequencer -F strata/sp1 -F debug-utils -F test-mode -F debug-asm --bin strata --bin alpen-client --bin strata-dbtool
  • Local real bridge e2e in SP1 reserved-network mode: test_real_bridge_deposit_withdraw passed in datadir functional-tests/_dd/12-1-tbtyw. Deposits credited OL/EE, SAU landed, and withdrawal settled on regtest.

@github-actions
Copy link
Copy Markdown
Contributor

Commit: 1024c50

SP1 Execution Results

program cycles success
EVM EE Chunk 553,055
EVM EE Account 1,271,238
Checkpoint 2,203,301

@voidash voidash marked this pull request as ready for review May 11, 2026 20:31
@voidash voidash requested review from a team as code owners May 11, 2026 20:31
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 89.23077% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.88%. Comparing base (b819de3) to head (6d525a8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/storage/src/managers/ol.rs 58.33% 5 Missing ⚠️
crates/ol/checkpoint/src/context.rs 95.23% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main    #1806      +/-   ##
==========================================
- Coverage   78.95%   78.88%   -0.07%     
==========================================
  Files         655      655              
  Lines       71268    71328      +60     
==========================================
- Hits        56268    56266       -2     
- Misses      15000    15062      +62     
Flag Coverage Δ
functional 58.13% <87.69%> (-0.28%) ⬇️
unit 64.94% <21.53%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
bin/strata/src/rpc/provider.rs 73.91% <ø> (ø)
...s/alpen-ee/sequencer/src/ol_chain_tracker/state.rs 98.74% <100.00%> (-0.01%) ⬇️
crates/ol/checkpoint/src/context.rs 72.50% <95.23%> (+3.67%) ⬆️
crates/storage/src/managers/ol.rs 93.83% <58.33%> (-3.68%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d525a8d43

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread bin/strata/src/prover/mod.rs Outdated
Comment thread bin/strata/src/rpc/provider.rs Outdated
Comment thread bin/strata/src/prover/spec.rs Outdated
Comment thread crates/ol/checkpoint/src/context.rs Outdated
Comment thread crates/storage/src/managers/ol.rs
Comment thread bin/strata/src/rpc/provider.rs Outdated
Comment thread bin/strata/src/prover/spec.rs Outdated
Comment thread bin/strata/src/rpc/provider.rs Outdated
Copy link
Copy Markdown
Contributor

@delbonis delbonis left a comment

Choose a reason for hiding this comment

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

nit, but significant

Comment thread bin/strata/src/prover/spec.rs Outdated
@voidash
Copy link
Copy Markdown
Contributor Author

voidash commented May 14, 2026

The checkpoint DA/preseal state-root mismatch fix belongs to STR-3412, which Bibek is already tracking separately. I’m going to remove that part from this PR so #1806 stays focused on valid canonical epoch commitment selection.

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.

4 participants