Skip to content

Conversation

gianbelinche
Copy link
Contributor

@gianbelinche gianbelinche commented Sep 26, 2025

Motivation
We want to test different reorg situations.

Description
We want to test a reorg where we have 3 nodes. One with the base chain, one with a side chain and a third one where we want to full sync the base chain. As per this issue #4617
Adds a test for that scenario, this test is currently flaky, since 50% of the times it will choose the peer with the base chain, working fine, but the other 50% it will choose the peer with the side chain, where it currently fails.
Since there is always a 50% chance of failing, we run the test 30 times to make sure the probability of failure is small enough.
Other tests are also added:
test_reorg_back_to_base: Tests a node that syncs to a side chain and wants to sync back to the base chain
test_reorg_back_to_base_with_common_ancestor: Same test as before but the base chain has blocks
test_storage_slots_reorg: test using a simple contract that sets a storage slot as received by calldata
no_reorgs_full_sync_smoke_test: Tests a normal fullsync without reorgs

Closes

@github-actions github-actions bot added the L1 Ethereum client label Sep 26, 2025
Copy link

github-actions bot commented Sep 26, 2025

Lines of code report

Total lines added: 228
Total lines removed: 0
Total lines changed: 228

Detailed view
+----------------------------------------+-------+------+
| File                                   | Lines | Diff |
+----------------------------------------+-------+------+
| ethrex/tooling/reorgs/src/main.rs      | 270   | +122 |
+----------------------------------------+-------+------+
| ethrex/tooling/reorgs/src/simulator.rs | 465   | +106 |
+----------------------------------------+-------+------+

@gianbelinche gianbelinche changed the base branch from test/full-sync-without-reorg-smoke-test to main September 29, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants