feat: implement proposal_id caching for L2 blocks#885
Merged
mikhailUshakoff merged 10 commits intomasterfrom Mar 4, 2026
Merged
feat: implement proposal_id caching for L2 blocks#885mikhailUshakoff merged 10 commits intomasterfrom
mikhailUshakoff merged 10 commits intomasterfrom
Conversation
mskrzypkows
reviewed
Mar 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Implements a cached mechanism for deriving the last safe L2 block height from L1 nextProposalId, and wires it through node verification/reanchor flows to reduce repeated RPC work.
Changes:
- Introduce
LastSafeL2BlockFinderwith proposal_id→last_block_id caching and a binary-search fallback when direct lookup fails. - Update
Node/Verifiercall sites to use the finder instead ofget_l2_height_from_l1. - Add L2 execution-layer helpers for fetching latest block/proposal_id and optimize proposal_id fetch to use headers.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| shasta/src/node/verifier.rs | Uses LastSafeL2BlockFinder to compute inbox height during verification/reanchor decisions. |
| shasta/src/node/mod.rs | Instantiates and passes LastSafeL2BlockFinder through node flows; removes l2_height_from_l1 module export. |
| shasta/src/node/last_safe_l2_block_finder/mod.rs | New cached “last safe L2 block” resolver with fast-path lookup and slow-path search. |
| shasta/src/node/last_safe_l2_block_finder/binary_search_last_block.rs | New binary-search utility + unit tests for proposal_id monotonic sequences. |
| shasta/src/l2/execution_layer.rs | Adds get_latest_block_id_and_proposal_id; switches proposal_id fetch to use block headers. |
| Cargo.toml | Workspace version bump to 1.33.11. |
| Cargo.lock | Lockfile updates reflecting the version bump. |
Comments suppressed due to low confidence (1)
shasta/src/node/verifier.rs:121
- Error message grammar: "Verifier return an error" should be "Verifier returned an error" (or similar) to read correctly for operators reviewing ReanchorNeeded reasons.
Ok(VerificationResult::ReanchorNeeded(
taiko_inbox_height,
format!("Verifier return an error: {err}"),
))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
shasta/src/node/last_safe_l2_block_finder/binary_search_last_block.rs
Outdated
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
shasta/src/node/verifier.rs:121
- The error message has a grammatical issue:
"Verifier return an error"should be"Verifier returned an error"(or similar) to read correctly in logs/UI.
let taiko_inbox_height = self.last_safe_l2_block_finder.get().await?;
Ok(VerificationResult::ReanchorNeeded(
taiko_inbox_height,
format!("Verifier return an error: {err}"),
))
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mskrzypkows
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.