Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client: sync from era1 #3869

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Client: sync from era1 #3869

wants to merge 7 commits into from

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.

Copy link

codecov bot commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 9.75610% with 37 lines in your changes missing coverage. Please review.

Project coverage is 75.83%. Comparing base (a3c4c98) to head (c5b5262).

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 76.87% <ø> (ø)
blockchain 85.69% <ø> (ø)
client 66.12% <9.75%> (-0.15%) ⬇️
common 90.73% <ø> (ø)
devp2p 76.27% <ø> (+0.06%) ⬆️
ethash 81.04% <ø> (ø)
evm 71.04% <ø> (ø)
genesis 99.84% <ø> (ø)
mpt 59.93% <ø> (+0.20%) ⬆️
rlp 69.70% <ø> (ø)
statemanager 70.47% <ø> (ø)
tx 80.96% <ø> (ø)
util 85.54% <ø> (ø)
vm 57.81% <ø> (ø)
wallet 83.78% <ø> (ø)

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

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

3 participants