-
Notifications
You must be signed in to change notification settings - Fork 490
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
goal: Add export and import options for genesis files during network creation #5672
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5672 +/- ##
==========================================
+ Coverage 54.31% 55.48% +1.17%
==========================================
Files 474 474
Lines 66416 66471 +55
==========================================
+ Hits 36075 36884 +809
+ Misses 27839 27077 -762
- Partials 2502 2510 +8
... and 80 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
This change is great and it will have a great impact for projects that use private networks.
I left one nit regarding the usage of -r
in the context of goal network genesis
which seems a bit confusing to me. Maybe this was motivated by -r
being required for goal network
. Some options (other than keeping things as is) are to not mark it as required, but then add checks to all the other goal network
commands enforcing its presence, or to carve out a new goal genesis
command.
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
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.
Tested, updated the PR description to match cli switches
Summary
Generating part keys (particularly falcon keys) is on the critical path when creating new private networks. This PR provides an option to export and import files like genesis.json, root and participation keys to speed that up.
Adds a new command to goal to export genesis files:
goal network pregen [-p] [-t]
: Generates genesis.json, root and part keys based on the template file[-t]
.[-p]
is where the genesis files are saved (since this is an inherited required flag), and it must be empty or command will error.Adds a new flag to import genesis files:
goal network create [-r] [-t] [-p]
: Imports files from pregendir to networkDir. Importing keys was already possible, but this explicitly copies over the keys from another directory, because network directories are wiped if there is an error during creation.Some small benchmarks experiment to estimate start-up time savings: https://gist.github.com/algochoi/53af36bc5d0356124098ffe2c0967b3e
#4826
Test Plan
Manually tested that importing large number of rounds saves time, checked partkeys using:
goal account partkeyinfo -d ${NETROOTPATH}/{WALLET}
Added a e2e test.