Added functional beacon snapshots reader and generator to Caplin#8570
Merged
Giulio2002 merged 63 commits intodevelfrom Oct 24, 2023
Merged
Added functional beacon snapshots reader and generator to Caplin#8570Giulio2002 merged 63 commits intodevelfrom
Giulio2002 merged 63 commits intodevelfrom
Conversation
| "io/fs" | ||
| "testing" | ||
|
|
||
| "github.com/ledgerwatch/erigon/spectest" |
Collaborator
There was a problem hiding this comment.
Use _test.go for test files - then they will not compiled in binary
| p.Processed.Add(1) | ||
| num := make([]byte, 8) | ||
| n := binary.PutUvarint(num, i) | ||
| if err := idx.AddKey(num[:n], offset); err != nil { |
Collaborator
There was a problem hiding this comment.
Likely more compact encoding of keys will not make index more compact (it doesn’t store keys). Feel free to use BigEndiqn encoding - ifyou like. Ot important
AskAlexSharov
approved these changes
Oct 24, 2023
elee1766
reviewed
Oct 25, 2023
| return res | ||
| } | ||
|
|
||
| func SegmentsCaplin(dir string) (res []snaptype.FileInfo, missingSnapshots []Range, err error) { |
Contributor
There was a problem hiding this comment.
i dont like this repeated code with Segments... is there a way we make this generic, configurable, etc?
This file contains hidden or 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
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.
This PR adds beacon blocks snapshots and beacon blocks snapshot generator to Caplin, plus a snapshot verifier CLI