feat: catchup l1 head on start#3594
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (56.52%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3594 +/- ##
==========================================
- Coverage 75.80% 75.73% -0.07%
==========================================
Files 381 382 +1
Lines 34377 34487 +110
==========================================
+ Hits 26059 26119 +60
- Misses 6492 6540 +48
- Partials 1826 1828 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
38a6b64 to
422c7da
Compare
thiagodeev
approved these changes
May 6, 2026
Contributor
thiagodeev
left a comment
There was a problem hiding this comment.
Nice work! LGTM.
Just a few nitpicks
f552a90 to
55bae28
Compare
Contributor
|
Bypassing coverage rule because missing tests will be add in a follow up |
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.
Previously, the L1 client only subscribed to live
LogStateUpdateevents on startup. After downtime, this left Juno running with a stale L1 head until the next on-chain update was emitted, which can take hours on Starknet.This PR catches up the L1 head on start by issuing a backward
eth_getLogsscan over the core contract before subscribing. The catch-up is best-effort: free-tier RPC providers might cap range size or rate-limit, so on failure we log a warning and fall through to the live subscription rather than terminating.Changes
catchUpL1HeadUpdatesrunning once beforewatchL1StateUpdatesinClient.Runeth_getLogsquery for the core contract'sLogStateUpdate