Skip to content

Conversation

jonastheis
Copy link
Contributor

@jonastheis jonastheis commented Sep 11, 2025

  • Adds improvements to the Docker testing framework
  • some more misc improvements and fixes
  • Adds an extensive test case as described below
/// Tests cross-client block propagation and synchronization between heterogeneous nodes.
///
/// This integration test validates that blocks can be successfully propagated between
/// different Ethereum client implementations (l2geth and rollup-node) in various
/// network topologies. The test exercises:
///
/// 1. **Isolated Network Segments**: Initially runs l2geth nodes in isolation, verifying they can
///    produce and sync blocks independently
///    - Topology: `l2geth_follower -> l2geth_sequencer`
///    - l2geth_sequencer produces blocks, l2geth_follower syncs
///    - Rollup nodes remain disconnected at block 0
///
/// 2. **Cross-Client Synchronization**: Connects rollup nodes to the l2geth network, ensuring they
///    can catch up to the current chain state
///    - Topology: `[rn_follower, rn_sequencer, l2geth_follower] -> l2geth_sequencer`
///    - All nodes connect to l2geth_sequencer as the single source of truth
///    - Rollup nodes sync from block 0 to current height
///
/// 3. **Sequencer Handoff**: Transitions block production from l2geth to rollup-node, testing that
///    all nodes stay synchronized during the transition
///    - Topology remains: `[rn_follower, rn_sequencer, l2geth_follower] -> l2geth_sequencer`
///    - Block production switches from l2geth_sequencer to rn_sequencer
///    - All nodes receive new blocks from rn_sequencer via l2geth_sequencer relay
///
/// 4. **Network Partition Recovery**: Disconnects l2geth nodes, continues production on rollup
///    nodes, then reconnects to verify successful resynchronization
///    - Initial partition: `rn_follower -> rn_sequencer` (isolated rollup network)
///    - l2geth nodes disconnected, fall behind in block height
///    - Reconnection topology: `[l2geth_follower, l2geth_sequencer] -> rn_sequencer`
///    - l2geth nodes catch up by syncing from rn_sequencer
///
/// 5. **Bidirectional Compatibility**: Returns block production to l2geth after rollup nodes have
///    extended the chain, ensuring backward compatibility
///    - Final topology: `[rn_follower, l2geth_follower, l2geth_sequencer] -> rn_sequencer`
///    - Block production returns to l2geth_sequencer
///    - Validates that l2geth can continue the chain after rollup node blocks
///
/// The test validates that both client implementations maintain consensus despite
/// network topology changes, sequencer transitions, and temporary network partitions.
/// Each topology change tests different aspects of peer discovery, block gossip,
/// and chain synchronization across heterogeneous client implementations.

Closes #274

jonastheis and others added 28 commits September 11, 2025 07:45
@jonastheis jonastheis marked this pull request as ready for review September 18, 2025 09:02
@frisitano frisitano requested a review from Copilot September 18, 2025 16:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements significant improvements to the Docker e2e test framework and introduces a comprehensive heterogeneous client synchronization test. The changes enhance the testing infrastructure's reliability and add validation for complex network scenarios involving multiple client implementations.

Key changes:

  • Replaced a simple block propagation test with an extensive sequencer handoff test that validates cross-client synchronization
  • Enhanced Docker testing framework with better timeout handling, container management, and peer networking utilities
  • Consolidated workspace dependency management by centralizing reth dependencies in the root Cargo.toml

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/tests/heterogeneous_client_sync_and_sequencer_handoff.rs New comprehensive test validating cross-client block propagation and sequencer transitions
tests/tests/block_propagation_multi_clients.rs Removed simple test replaced by the more comprehensive heterogeneous test
tests/src/utils.rs Added peer management functions and improved timeout handling for better test reliability
tests/src/lib.rs Simplified exports to use glob imports for better ergonomics
tests/src/docker_compose.rs Enhanced container management with IP resolution, enode URL construction, and log dumping
tests/launch_*.bash Updated node configuration scripts to enable admin APIs and improve networking
tests/l2geth-genesis-e2e.json Added blocks_per_second configuration for system contract
Cargo.toml files Consolidated reth dependencies to use workspace-level definitions
Dockerfile.test Added sccache for faster builds and improved cache mounting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@frisitano frisitano left a comment

Choose a reason for hiding this comment

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

Looks good. Left a few commens inline.

frisitano
frisitano previously approved these changes Sep 19, 2025
@jonastheis jonastheis merged commit 3a67f58 into main Sep 22, 2025
13 checks passed
@jonastheis jonastheis deleted the feat/improve-docker-e2e-test branch September 22, 2025 05:30
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.

[E2E Test] Migrate sequencer from L2geth to reth
3 participants