-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added functional beacon snapshots reader and generator to Caplin #8570
Conversation
"io/fs" | ||
"testing" | ||
|
||
"github.com/ledgerwatch/erigon/spectest" |
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.
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 { |
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.
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
@@ -1118,6 +1118,28 @@ func noOverlaps(in []snaptype.FileInfo) (res []snaptype.FileInfo) { | |||
return res | |||
} | |||
|
|||
func SegmentsCaplin(dir string) (res []snaptype.FileInfo, missingSnapshots []Range, err error) { |
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.
i dont like this repeated code with Segments... is there a way we make this generic, configurable, etc?
This PR adds beacon blocks snapshots and beacon blocks snapshot generator to Caplin, plus a snapshot verifier CLI