-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: TipRouter CLI separate stages (#87)
### Change notes * New top-level environment variable/CLI arg * SAVE_PATH: renaming of `META_MERKLE_TREE_DIR`. Path where all generated operator files are stored * Separates each stage of the process into more coherent functions. * `run` CLI command loops through each stage, saving the outputs to _save-path_ CLI argument. The output from each stage is held in memory to reduce the processing. * New Environment Variables/CLI Args for `run` * STARTING_STAGE: Ability to start the operator from a specific stage before it continues * one of: `load-bank-from-snapshot, create-stake-meta, create-merkle-tree-collection, create-meta-merkle-tree, cast-vote, wait-for-next-epoch` * SAVE_STAGES: true/false - whether to save the state of intermediate stages in files. Needed for CLAIM_TIPS and SET_MERKLE_ROOT * SAVE_SNAPSHOTS: true/false - whether to save the bank loaded in the target as a full snapshot (~100GB). * Create CLI commands for each stage * _snapshot-slot_ - Create and store a full snapshot for a given slot * _create-stake-meta_ - For a given epoch and slot, load the bank and create the `StakeMetaCollection` file which contains validator vote accounts and their staking delegations. * _create-merkle-tree-collection_ - For a given epoch, load the `StakeMetaCollection` from disk at _save-path_, generate and save the `GeneratedMerkleTreeCollection`. * _create-meta-merkle-tree_ - For a given epoch, load the `GeneratedMerkleTreeCollection` from disk at _save-path_, generate and save the`MetaMerkleTree`. * _submit-epoch_ - For a given epoch, load the MetaMerkle file and cast a vote to the NCN's ballot box. Optionally set the merkle root on the Tip Distribution account if the NCN has consensus for the epoch. * _claim-tips_ - For a given epoch, generate and execute Tip Distribution Claim instructions for any unclaimed tips. * TipRouter saved files * generated files are now saved under _save-path_ * Files _<= current_epoch - num_monitored_epochs_ are purged for anything * NOTE: file names have change to a _{epoch}_file_name.json_ format. All previous files will not be removed. Operators should manually delete old files. --------- Co-authored-by: Evan Batsell <[email protected]>
- Loading branch information
1 parent
7bf9c11
commit d27f552
Showing
17 changed files
with
1,153 additions
and
695 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.