Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/checkpoint verification in CL STF #730

Merged
merged 10 commits into from
Mar 13, 2025

Conversation

prajwolrg
Copy link
Contributor

@prajwolrg prajwolrg commented Mar 11, 2025

Description

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

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.

Related Issues

Copy link

codecov bot commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 35.80247% with 52 lines in your changes missing coverage. Please review.

Project coverage is 54.79%. Comparing base (0c9741c) to head (ca0fc41).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
crates/chaintsn/src/transition.rs 41.66% 35 Missing ⚠️
crates/crypto/src/groth16_verifier.rs 0.00% 11 Missing ⚠️
...tes/consensus-logic/src/checkpoint_verification.rs 0.00% 2 Missing ⚠️
crates/proof-impl/checkpoint/src/lib.rs 50.00% 2 Missing ⚠️
crates/primitives/src/batch.rs 0.00% 1 Missing ⚠️
crates/sequencer/src/checkpoint/worker.rs 0.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main     #730      +/-   ##
==========================================
- Coverage   54.90%   54.79%   -0.11%     
==========================================
  Files         321      322       +1     
  Lines       35826    35961     +135     
==========================================
+ Hits        19669    19704      +35     
- Misses      16157    16257     +100     
Files with missing lines Coverage Δ
crates/proof-impl/cl-stf/src/lib.rs 64.51% <100.00%> (+0.58%) ⬆️
crates/proof-impl/cl-stf/src/program.rs 88.88% <ø> (ø)
crates/primitives/src/batch.rs 27.60% <0.00%> (ø)
crates/sequencer/src/checkpoint/worker.rs 0.00% <0.00%> (ø)
...tes/consensus-logic/src/checkpoint_verification.rs 0.00% <0.00%> (ø)
crates/proof-impl/checkpoint/src/lib.rs 71.42% <50.00%> (-2.77%) ⬇️
crates/crypto/src/groth16_verifier.rs 0.00% <0.00%> (ø)
crates/chaintsn/src/transition.rs 48.99% <41.66%> (-3.09%) ⬇️

... and 21 files with indirect coverage changes

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

@prajwolrg prajwolrg changed the title Fix/checkpoint verification in cl stf Fix/checkpoint verification in CL STF Mar 12, 2025
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.

A couple of comments.

Copy link
Contributor

github-actions bot commented Mar 12, 2025

Commit: d6a005e

SP1 Execution Results

program cycles success
Bitcoin Blockspace 70,991
EVM EE STF 302,087
CL STF 175,314
Checkpoint 4,252

@prajwolrg prajwolrg marked this pull request as ready for review March 12, 2025 16:29
@prajwolrg prajwolrg requested review from a team as code owners March 12, 2025 16:29
@prajwolrg prajwolrg requested a review from bewakes March 12, 2025 16:35
Copy link
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

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

ACK ca0fc41

@storopoli storopoli added this pull request to the merge queue Mar 13, 2025
Merged via the queue into main with commit 0e1171e Mar 13, 2025
18 of 19 checks passed
@storopoli storopoli deleted the fix/checkpoint-verification-in-cl-stf branch March 13, 2025 12:22
Comment on lines +202 to +213
if receipt.proof().is_empty() {
warn!(%ckpt_epoch, "Empty proof posted");
// If the proof is empty but empty proofs are not allowed, this will fail.
if !params.proof_publish_mode.allow_empty() {
error!(%ckpt_epoch, "Invalid checkpoint: Empty proof");
return Err(TsnError::InvalidProof);
}
} else {
// Otherwise, verify the non-empty proof.
verify_rollup_groth16_proof_receipt(&receipt, &params.rollup_vk)
.map_err(|e| TsnError::InvalidProof)?;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I just realized that this returning an error means if a sequencer publishes an invalid checkpoint then we can never produce a new block after we receive it (without rolling back L1), since this will always fail the state transition. We should just disregard it (and print an error/warning).

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.

6 participants