Skip to content

Conversation

@ScottyPoi
Copy link
Contributor

This is the most basic version of what it could look like to sync a cient using era1 files.

We add an optional CLI flag --loadBlocksFromEra1=<path_to_era1_dir>

Set this flag, and point it to a directory with era1 files. We assume that the era1 files are named in such a way that alphabetical order equals chronological order.

New fuction eraSync() will be called during client startup. This function will iterate through the directory of era1 files, store the extracted block data, then run block execution. The end result is a client synced to the height of the final era1 file.

While this process does take time, it is faster than full sync via devp2p. More importantly, this method of syncing can be used in a post 4444 world, where this historical data may not be available over devp2p.

--

This concept is far from optimized. A more sophisticated version of era1Sync would avoid storing and recalling these blocks from the client database at all.

--

To test:

Download 1 or more era1 files from era1.ethportal.net
Start a client via CLI with the --loadBlocksFromEra1 flag set, pointing towards the era1 directory.
Observe the logs while each file is processed, and the client execution runs in batches of 8192 blocks.

@codecov
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

❌ Patch coverage is 9.75610% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.90%. Comparing base (38444f8) to head (00e4af9).
⚠️ Report is 183 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block ∅ <ø> (∅)
blockchain ∅ <ø> (∅)
client ∅ <9.75%> (∅)
common ∅ <ø> (∅)
devp2p ∅ <ø> (∅)
ethash ∅ <ø> (∅)
evm ∅ <ø> (∅)
genesis ∅ <ø> (∅)
mpt ∅ <ø> (∅)
rlp ∅ <ø> (∅)
statemanager ∅ <ø> (?)
tx ∅ <ø> (∅)
util ∅ <ø> (∅)
vm ∅ <ø> (∅)
wallet ∅ <ø> (∅)

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

🚀 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.

@jochem-brouwer
Copy link
Member

Could this PR also add an issue template in .github/ISSUE_TEMPLATE? 😄

@ScottyPoi ScottyPoi marked this pull request as ready for review February 18, 2025 01:28
@ScottyPoi ScottyPoi force-pushed the load-blocks-era branch 2 times, most recently from c5dcb16 to c5b5262 Compare February 25, 2025 19:15
@gabrocheleau
Copy link
Contributor

Since this is portal-specific, I imagine this should be closed? Feel free to re-open @ScottyPoi if this should be pursued further

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants