Skip to content

Comments

interop: sync test: op-node ahead of op-supervisor#15714

Closed
pcw109550 wants to merge 51 commits intopcw109550/interop-sync-test-supervisor-ahead-l2cl-unsafe-knownfrom
pcw109550/interop-sync-test-l2cl-ahead-supervisor
Closed

interop: sync test: op-node ahead of op-supervisor#15714
pcw109550 wants to merge 51 commits intopcw109550/interop-sync-test-supervisor-ahead-l2cl-unsafe-knownfrom
pcw109550/interop-sync-test-l2cl-ahead-supervisor

Conversation

@pcw109550
Copy link
Member

@pcw109550 pcw109550 commented May 6, 2025

Description

Builds on top of #15618.

Adds test which tests below supervisor<>L2CL out out sync scenario:

// TestL2CLAheadOfSupervisor tests the below scenario:
// L2CL ahead of supervisor, aka supervisor needs to reset the L2CL, to reproduce old data. Currently supervisor has only managed mode implemented, so the supervisor will ask the L2CL to reset back.
// To create this out-of-sync scenario, we follow the steps below:
// 0. System setup
// - Two supervisor initialized, each managing two L2CLs per chains.
// - Primary supervisor manages sequencer L2CLs for chain A, B.
// - Backup supervisor manages verifier L2CLs for chain A, B.
// - Each L2CLs per chain is connected via P2P.
// 1. Make sequencers (L2CL), verifiers (L2CL), and supervisors sync for a few blocks.
// - Sequencer and verifier are connected via P2P, which makes their unsafe heads in sync.
// - Both L2CLs are in managed mode, digesting L1 blocks from the supervisor and reporting unsafe and safe blocks back to the supervisor.
// - Wait enough for both L2CLs advance unsafe heads.
// 2. Stop backup supervisor.
// - Verifiers stops advancing safe heads because there is no supervisor to provide them L1 data.
// - Verifiers advances unsafe head because they still have P2P connection with each sequencers.
// - Wait enough to make sequencers and primary supervisor advance safe head enough.
// 3. Connect verifiers (L2CL) to primary supervisor.
// - Primary supervisor has safe heads synced with sequencers.
// - After connection, verifiers will sync with primary supervisor, matching supervisor safe head view.
// - Stopped backup supervisor and verifiers becomes out-of-sync with safe heads.
// - Every L2CLs advance safe head.
// 4. Stop primary supervisor.
// - Every L2CL safe heads will stop advancing.
// - For disconnecting every L2CLs from the supervisor.
// 5. Restart primary supervisor and reconnect sequencers (L2CL) to primary supervisor.
// - Sequencers will resume advancing safe heads, but not verifiers.
// 6. Restart backup supervisor and reconnect verifiers (L2CL) to backup supervisor.
// - Backup supervisor will compare its safe head knowledge with L2CLs, and find out L2CLs are ahead of the backup supervisor.
// - Backup supervisor asks the verifiers (L2CL) to rewind(reset) back to match backup supervisor safe head view.
// - After rewinding(reset), verifier will advance safe heads again because backup supervisor gives L1 data to the verifiers.

Note that the current sync tests lives in sysgo, but will be removed to parent directory or op-acceptance-tests/ dir for targeting both sysgo and sysext backends. Sysgo is a start.

Metadata

@codecov
Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.71%. Comparing base (669f3b7) to head (a3e3561).
Report is 46 commits behind head on pcw109550/interop-sync-test-supervisor-ahead-l2cl-unsafe-known.

Additional details and impacted files
@@                                        Coverage Diff                                         @@
##           pcw109550/interop-sync-test-supervisor-ahead-l2cl-unsafe-known   #15714      +/-   ##
==================================================================================================
- Coverage                                                           45.97%   42.71%   -3.26%     
==================================================================================================
  Files                                                                1242     1081     -161     
  Lines                                                              104053    95297    -8756     
==================================================================================================
- Hits                                                                47834    40710    -7124     
+ Misses                                                              52668    51170    -1498     
+ Partials                                                             3551     3417     -134     
Flag Coverage Δ
cannon-go-tests-64 ?
contracts-bedrock-tests ?

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

see 170 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pcw109550 pcw109550 force-pushed the pcw109550/interop-sync-test-l2cl-ahead-supervisor branch from f227c22 to df94208 Compare May 6, 2025 14:06
@pcw109550 pcw109550 linked an issue May 6, 2025 that may be closed by this pull request
@pcw109550 pcw109550 marked this pull request as ready for review May 6, 2025 14:45
@pcw109550 pcw109550 requested a review from a team as a code owner May 6, 2025 14:45
@pcw109550 pcw109550 requested review from a user, ajsutton, axelKingsley and protolambda and removed request for a team and ajsutton May 6, 2025 14:45
@pcw109550 pcw109550 marked this pull request as draft May 8, 2025 17:11
@pcw109550 pcw109550 force-pushed the pcw109550/interop-sync-test-supervisor-ahead-l2cl-unsafe-known branch from b93e18b to ff92bb5 Compare May 9, 2025 08:26
@pcw109550 pcw109550 force-pushed the pcw109550/interop-sync-test-l2cl-ahead-supervisor branch 2 times, most recently from 3db7f6e to a701599 Compare May 9, 2025 08:50
@pcw109550 pcw109550 force-pushed the pcw109550/interop-sync-test-l2cl-ahead-supervisor branch from a701599 to a3e3561 Compare May 9, 2025 12:01
@pcw109550 pcw109550 force-pushed the pcw109550/interop-sync-test-supervisor-ahead-l2cl-unsafe-known branch from 3a0e285 to e2922bf Compare May 13, 2025 08:09
@pcw109550 pcw109550 closed this May 15, 2025
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.

Test that supervisor resets node when it is ahead

1 participant