-
Notifications
You must be signed in to change notification settings - Fork 20.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
Add export-history subcommand. #25325
Conversation
2c63079
to
616ca05
Compare
I rebased to |
cmd/utils/cmd.go
Outdated
} | ||
|
||
func ExportHistoryRange(bc *core.BlockChain, fn string, first uint64, last uint64, targetSize int) error { | ||
var blocks []*spec.Block |
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.
We should define the block here to target the spec and not define externally.
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.
Hmm is there a reason to define another block type if we annotate types.Block
here?
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.
We should define the block here to target the spec and not define externally.
Happy to move it here (maybe in its own package under cmd/utils) If you're ok with adding that here (along with all the go.mod dependency additions)
Hmm is there a reason to define another block type if we annotate types.Block here?
Back when I was defining that it seemed hard to do it all via just annotations on the existing geth structs, but I've paged out all the details 😬. Will take another look (maybe it is possible?) and report back.
return ExportHistoryRange(bc, fn, uint64(0), bc.CurrentBlock().NumberU64(), targetSize) | ||
} | ||
|
||
func ExportHistoryRange(bc *core.BlockChain, fn string, first uint64, last uint64, targetSize int) 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 think there should be verification that first+last < maxBlocks
?
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.
🤔 what would maxBlocks be here?
geth export-history exports blocks and receipts in SSZ format.
616ca05
to
f6ed864
Compare
@lightclient I moved the ssz definitions into the repo. Unfortunately right now annotating
|
Superseded by #26621 |
geth export-history
exports blocks and receipts in SSZ format.running todo:
bart
)