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

implement shadow feature for juno sequencer #2173

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

rianhughes
Copy link
Contributor

@rianhughes rianhughes commented Sep 23, 2024

closes #2015

Just creating a fresh branch with all commits from PR 2015 squashed into one, to make reviewing easier.

This PR builds on top of the rianhughes/merge-sequnecer PR. It implements a new "shadow" mode for the Juno sequencer feature. This "shadow" mode pulls blocks from the FGW, re-executes them, builds the corresponding state-update (etc), and applies it to the local blockchain if the verification checks pass.

Running make sequencer-shadow-sepolia with a snapshot from a 0.13.2 block, will allow it to "sync" the Sepolia network by re-executing every block, and only storing it if the verification checks pass. Currently, this is running fine from block ~120,000 to block ~190,000 (still syncing at the time of writing), without any issues.

The main logic is contained in the runSequencer() function in the builder package. There are some helper functions that really aid in debugging (eg CompareReceipts(), the Print() methods on some of the methods), which I've left in.

@rianhughes rianhughes marked this pull request as ready for review September 23, 2024 14:50
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

Attention: Patch coverage is 46.00117% with 925 lines in your changes missing coverage. Please review.

Project coverage is 72.10%. Comparing base (0d02f9e) to head (392d5aa).

Files with missing lines Patch % Lines
builder/builder.go 54.36% 203 Missing and 48 partials ⚠️
blockchain/blockchain.go 38.39% 97 Missing and 41 partials ⚠️
core/receipt.go 1.57% 125 Missing ⚠️
core/printers.go 0.00% 88 Missing ⚠️
core/state_update.go 40.28% 74 Missing and 9 partials ⚠️
genesis/genesis.go 55.81% 39 Missing and 18 partials ⚠️
mempool/mempool.go 63.76% 35 Missing and 15 partials ⚠️
adapters/vm2core/vm2core.go 59.30% 34 Missing and 1 partial ⚠️
node/node.go 51.38% 29 Missing and 6 partials ⚠️
node/genesis.go 0.00% 23 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2173      +/-   ##
==========================================
- Coverage   76.25%   72.10%   -4.15%     
==========================================
  Files         104      111       +7     
  Lines       11200    12818    +1618     
==========================================
+ Hits         8540     9242     +702     
- Misses       2012     2783     +771     
- Partials      648      793     +145     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rianhughes rianhughes changed the base branch from main to rianhughes/merge-sequencer September 25, 2024 08:39
@rianhughes rianhughes changed the base branch from rianhughes/merge-sequencer to main September 25, 2024 08:40
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.

1 participant