Skip to content

STR 2586 update checkpoint status in OL checkpoint db#1514

Open
krsnapaudel wants to merge 4 commits intomainfrom
STR-2586
Open

STR 2586 update checkpoint status in OL checkpoint db#1514
krsnapaudel wants to merge 4 commits intomainfrom
STR-2586

Conversation

@krsnapaudel
Copy link
Contributor

@krsnapaudel krsnapaudel commented Mar 18, 2026

Description

  • Normalize OL checkpoint storage into three write-once tables (payload, signing, observation) keyed by EpochCommitment, replacing the combined mutable OLCheckpointEntry model.
  • Derive checkpoint status (Unsigned/Signed/Confirmed/Finalized) at read time from table presence and L1 depth, using l1_reorg_safe_depth for finalization instead of checkpoint-progression-based declared_final_epoch.
  • Wire CSM v1 tip processing to write L1 observation entries; remove direct finalization writes from v1 path.
  • Switch FCM finalized/confirmed epoch resolution from client-state to OL checkpoint DB depth-based derivation.
  • Update dbtool checkpoint commands to derive and display status from normalized facts.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

Is this PR addressing any specification, design doc or external reference document?

  • Yes
  • No

If yes, please add relevant links:

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added (where necessary) tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.
  • I have disclosed my use of AI in the body of this PR.

Related Issues

STR-2586

@krsnapaudel krsnapaudel requested review from a team as code owners March 18, 2026 19:18
@krsnapaudel krsnapaudel marked this pull request as draft March 18, 2026 19:26
@krsnapaudel krsnapaudel self-assigned this Mar 18, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 18, 2026

Commit: 9c948fa

SP1 Execution Results

program cycles success
EVM EE STF 1,322,311
Checkpoint 5,226
Checkpoint New 883,623

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 39.93506% with 555 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.00%. Comparing base (743c513) to head (a810a85).

Files with missing lines Patch % Lines
bin/strata-dbtool/src/cmd/checkpoint.rs 0.00% 194 Missing ⚠️
crates/storage/src/managers/ol_checkpoint.rs 36.73% 124 Missing ⚠️
crates/consensus-logic/src/fcm/service.rs 0.00% 108 Missing ⚠️
crates/db/store-sled/src/ol_checkpoint/db.rs 87.19% 31 Missing ⚠️
bin/strata-dbtool/src/cmd/syncinfo.rs 0.00% 16 Missing ⚠️
crates/ol/sequencer/src/extraction.rs 0.00% 15 Missing ⚠️
bin/strata-dbtool/src/cmd/ol_state.rs 0.00% 14 Missing ⚠️
bin/strata-dbtool/src/cmd/ol.rs 0.00% 11 Missing ⚠️
bin/strata-dbtool/src/cmd/writer.rs 0.00% 11 Missing ⚠️
bin/strata-dbtool/src/output/checkpoint.rs 0.00% 11 Missing ⚠️
... and 5 more

❗ There is a different number of reports uploaded between BASE (743c513) and HEAD (a810a85). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (743c513) HEAD (a810a85)
unit 2 1
functional 1 0
@@             Coverage Diff             @@
##             main    #1514       +/-   ##
===========================================
- Coverage   76.29%   65.00%   -11.30%     
===========================================
  Files         802      800        -2     
  Lines       76189    76595      +406     
===========================================
- Hits        58130    49791     -8339     
- Misses      18059    26804     +8745     
Flag Coverage Δ
functional ?
unit 65.00% <39.93%> (-0.39%) ⬇️

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

Files with missing lines Coverage Δ
bin/strata-dbtool/src/cmd/client_state.rs 0.00% <ø> (ø)
bin/strata/src/rpc/provider.rs 0.00% <ø> (ø)
bin/strata/src/sequencer/rpc.rs 0.00% <ø> (ø)
crates/db/types/src/types.rs 62.01% <100.00%> (-9.36%) ⬇️
crates/ol/checkpoint/src/context.rs 100.00% <100.00%> (ø)
crates/ol/checkpoint/src/state.rs 81.89% <100.00%> (+0.54%) ⬆️
crates/chain-worker-new/src/context.rs 0.00% <0.00%> (ø)
bin/strata/src/sequencer/node_context.rs 0.00% <0.00%> (ø)
bin/strata-dbtool/src/output/syncinfo.rs 97.88% <55.55%> (-2.12%) ⬇️
crates/csm-worker/src/processor.rs 95.69% <90.00%> (-1.60%) ⬇️
... and 11 more

... and 241 files with indirect coverage changes

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

@krsnapaudel krsnapaudel marked this pull request as ready for review March 18, 2026 22:04
Copy link
Contributor

@bewakes bewakes left a comment

Choose a reason for hiding this comment

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

Looks good mostly. Some concerns over the splitted statuses which are sequential in nature.

Copy link
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.

Needs rework, the database concepts were misconceived.

@krsnapaudel krsnapaudel requested a review from a team as a code owner March 19, 2026 23:31
@krsnapaudel
Copy link
Contributor Author

krsnapaudel commented Mar 19, 2026

Needs rework, the database concepts were misconceived.

@delbonis Your suggestions have many side effects. As mentioned in the slack message.

  1. OL checkpoint db api needs to be rewritten and all callers need to be updated.
  2. What is now the source of truth for checkpoint/epoch finalization? OL checkpoint db or client state db? Should csm-worker update ol checkpoint db and FCM read from ol checkpoint db for determining status? I have made CSM worker update OL checkpoint db and FCM read from that db.
  3. strata-dbtool will need a finality_depth argument to for deriving checkpoint status. Then what about syncinfo and revert? They also get all confirmation, finalization info from OL checkpoint db.

@krsnapaudel krsnapaudel requested review from bewakes and delbonis March 19, 2026 23:34
@krsnapaudel krsnapaudel requested a review from a team as a code owner March 20, 2026 02:54
Copy link
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.

Design-wise this is a lot better, although there's still some organization issues.

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.

3 participants