Skip to content

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Oct 8, 2025

Motivation
In order to properly handle reorgs, we should download headers from the latest announced fcu head until me meet our local chain instead of requesting headers from our current head till we reach the fcu head, as our current head may not be part of the canonical chain after a reorg.
The main behaviour changes imposed by this are that
A) We must request all headers before we can begin to execute the blocks
B) We are no longer able to keep all headers in memory (in case of long syncs)

Description

Closes #issue_number

@github-actions github-actions bot added the L1 Ethereum client label Oct 8, 2025
@fmoletta fmoletta changed the title feat(l1): download all headers from new to old as first step of full sync [Early Draft] feat(l1): download all headers from new to old as first step of full sync Oct 8, 2025
@github-actions github-actions bot removed the L1 Ethereum client label Oct 8, 2025
Copy link

github-actions bot commented Oct 8, 2025

Lines of code report

Total lines added: 113
Total lines removed: 0
Total lines changed: 113

Detailed view
+---------------------------------------------+-------+------+
| File                                        | Lines | Diff |
+---------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/sync.rs        | 1285  | +61  |
+---------------------------------------------+-------+------+
| ethrex/crates/storage/api.rs                | 231   | +6   |
+---------------------------------------------+-------+------+
| ethrex/crates/storage/store.rs              | 1440  | +10  |
+---------------------------------------------+-------+------+
| ethrex/crates/storage/store_db/in_memory.rs | 540   | +10  |
+---------------------------------------------+-------+------+
| ethrex/crates/storage/store_db/rocksdb.rs   | 1136  | +26  |
+---------------------------------------------+-------+------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant