-
Notifications
You must be signed in to change notification settings - Fork 459
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
Feature/Era1 import/export #6547
Open
ak88
wants to merge
324
commits into
master
Choose a base branch
from
feature/era-import
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 tasks
rubo
requested changes
Jan 16, 2024
rubo
reviewed
Jan 16, 2024
changed coverage package Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com>
Changed testinghelpers package Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com>
removed unnecessary TargetFramework Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com>
flcl42
approved these changes
Dec 23, 2024
|
||
public void Dispose() | ||
{ | ||
_file.Dispose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we dispose it even if it's passed externally? And we don't need to care about double disposal?
using Nethermind.Logging; | ||
using Nethermind.Serialization.Rlp; | ||
|
||
namespace Nethermind.Era1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more \n after
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Includes #7665 #7680 #7927
Introduces a new archive format called Era1, which is based on the Era spec made by nimbus, and this proposal from arnetheduck.
The purpose of Era1 is to provide the same functionality for EL, that Era provides for the CL. An easily verifiable and shareable format for pre-merge historic EL data, which is considered a prerequisite for eip-4444 . Era1 only concerns pre-merge data, since post-merge EL payload is contained in the beacon chain.
In the long term the idea is to distribute historic data through the portal network.
Underneath Era1 is based on e2store which is a simple type-length-value scheme.
Specification
An Era1 archive can be expressed like so
Headers, bodies and receipts are compressed using the snappy framing format.
Additionally each file contains a block index for fast lookup, and an Epoch accumulator for verification.
The epoch accumulator can be used to verify the entire archive with accumulators from a trusted source. Additionally it allows a node to download a header with a merkle-proof, that proves it belongs to a certain epoch.
The Epoch accumulator is defined in the portal network spec here.
Behaviour
Two operation is added, import and export can be invoked via rpc or cli.
--Era.ImportDirectory "something" --Era.From 0 --Era.To 0 --Era.TrustedAccumulatorFile "somefile"
From
,To
andTrustedAccumulatorFile
is optional. Will import everything when range is set to 0. Will trust the era directory ifTrustedAccumulatorFile
is not specified.admin_importHistory
.--Era.ExportDirectory "something" --Era.From 0 --Era.To 0
From
,To
is optional. Will export everything when set to 0.accumulators.txt
andchecksums.txt
is always created.admin_exportHistory
.For simpliciy, CLI will block the application from starting until it is completed. RPC does not block but only one import/export can run at the same time.
During import, block range before head will be inserted in parallel like old bodies, and after head will be "suggested" like forward sync. So it will process new imported block.
IBlockValidator
.During export, it export the range in parallel, each era file having its own task.
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Documentation
Requires documentation update
Requires explanation in Release Notes