-
Notifications
You must be signed in to change notification settings - Fork 839
refactor: block export #4639
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
base: master
Are you sure you want to change the base?
refactor: block export #4639
Conversation
decfba5 to
e096dc1
Compare
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.
Pull request overview
This PR refactors the block export functionality by converting TestExportRange() from a test function into a standalone executable. This change makes the code more idiomatic and sets the stage for future refactoring work by separating concerns between testing and utility executables.
Key Changes:
- Created new
blockexportpackage with standalone executable for block export functionality - Modified
CreateBlockChanFromLevelDBto accept generic cleanup handler instead oftesting.TB - Updated Taskfile to use
go runinstead ofgo testfor block export operations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/reexecute/db.go | Updated function signature to accept generic require.TestingT and cleanup handler for broader reusability |
| tests/reexecute/c/vm_reexecute_test.go | Removed test-specific export function and related flags, updated caller to pass cleanup handler |
| tests/reexecute/blockexport/main.go | Added new standalone executable with main function for block export functionality |
| Taskfile.yml | Changed command from go test to go run to execute new blockexport executable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
aaronbuchwald
left a comment
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.
LGTM - one minor nit
Why this should be merged
Currently,
TestExportRange()is a multi-step process (which doesn't test anything) that's housed inside a unit test - it would be more idiomatic ifTestExportRange()was it's own executable. This PR accomplishes this by makingTestExportRange()into its own executable separate fromBenchmarkReexecuteRange(), eliminating the need to host it in a unit test.Converting
TestExportRange()into an executable also allows us to remove thego benchlogic fromBenchmarkReexecuteRange()in a future PR (#4640) as there can only be onemain()function per package.This PR follows #4638 and precedes #4640.
How this works
Moves the export block range functionality to its own package
blockexport+ updatesTaskfile.ymlto use this new package.How this was tested
CI + ran
task export-cchain-block-rangelocallyNeed to be documented in RELEASES.md?
No