Conversation
src/main.rs
Outdated
| .help("Do not bake validator stake accounts into genesis. \ | ||
| Validators will be funded and staked after the cluster boots. \ | ||
| This will result in several epochs for all of the stake to warm up"), |
There was a problem hiding this comment.
Huh. I was going to suggest that in the future (not in this PR), we could have rustfmt format these long help strings by adding format_strings = true to the rustfmt.toml and running cargo +nightly fmt. But it is not touching these strings when I run it locally, for some reason...
Either way, fyi that rustfmt is not styling this long command/arg list as a result of those strings.
4bde184 to
b4d4fc8
Compare
CriesofCarrots
left a comment
There was a problem hiding this comment.
I'm going to hold off reviewing this until anza-xyz/agave#2704 is finished and merged. It's helpful to see what the interface looks like from this side, though.
336d715 to
28e51d7
Compare
1d79dd1 to
ec7a6ed
Compare
ec7a6ed to
ae8d479
Compare
CriesofCarrots
left a comment
There was a problem hiding this comment.
Here are a few comments from a quick pass. I need to make a more careful read after I remind myself of the setup flow 😅
| #[derive(Serialize, Deserialize)] | ||
| struct ValidatorAccountsFile { | ||
| validator_accounts: Vec<StakedValidatorAccountInfo>, | ||
| } | ||
|
|
||
| /// Info needed to create a staked validator account, | ||
| /// including relevant balances and vote- and stake-account addresses | ||
| #[derive(Serialize, Deserialize, Debug, Clone)] | ||
| pub struct StakedValidatorAccountInfo { | ||
| pub balance_lamports: u64, | ||
| pub stake_lamports: u64, | ||
| pub identity_account: String, | ||
| pub vote_account: String, | ||
| pub stake_account: String, | ||
| } |
There was a problem hiding this comment.
Can we import these types from solana-genesis now?
There was a problem hiding this comment.
what is the best way to do that? There is no release yet that includes ValidatorAccountsFile and StakedValidatorAccountInfo? For now I could just patch it in to use solana-genesis from master if that sound good:
solana-genesis = { git = "https://github.com/anza-xyz/agave.git", package = "solana-genesis" }
^ I can then update this to the specific release when release comes out
There was a problem hiding this comment.
actually let's just wait on this PR maybe until a v2.2.0 gets tagged and released. using the github link causes a ton of dependency issues because the master agave branch just changed to use a different Pubkey (solana_program::pubkey::Pubkey instead of solana_sdk::pubkey::Pubkey). Dependencies like spl-token-2022 will pull dependencies from crates.io which only has solana-* up to v2.1.9, so I'd have to individually patch all solana-* crates to agave github master. so probably just makes sense to wait
There also may be another way to do this but I am not sure
There was a problem hiding this comment.
Oh duh, sorry, I forgot we haven't released those types yet. Yeah, holding off on this until v2.2.0 is probably a-okay.
| } | ||
| } | ||
|
|
||
| self.write_validator_genesis_accouts_to_file()?; |
There was a problem hiding this comment.
| self.write_validator_genesis_accouts_to_file()?; | |
| self.write_validator_genesis_accounts_to_file()?; |
| v0: | ||
| balances_lamports: <balance0> | ||
| stake_lamports: <stake0> | ||
| v1: | ||
| balances_lamports: <balance1> | ||
| stake_lamports: <stake1> | ||
| ... | ||
| vN: | ||
| balances_lamports: <balanceN> | ||
| stake_lamports: <stakeN> |
There was a problem hiding this comment.
| v0: | |
| balances_lamports: <balance0> | |
| stake_lamports: <stake0> | |
| v1: | |
| balances_lamports: <balance1> | |
| stake_lamports: <stake1> | |
| ... | |
| vN: | |
| balances_lamports: <balanceN> | |
| stake_lamports: <stakeN> | |
| v0: | |
| balance_lamports: <balance0> | |
| stake_lamports: <stake0> | |
| v1: | |
| balance_lamports: <balance1> | |
| stake_lamports: <stake1> | |
| ... | |
| vN: | |
| balance_lamports: <balanceN> | |
| stake_lamports: <stakeN> |
| --cpu-requests <cores> | ||
| --memory-requests <memory> | ||
| # deploy with clients | ||
| bench-tps |
There was a problem hiding this comment.
This looks out of place. Is it correct?
There was a problem hiding this comment.
bench-tps is a subcommand so should be passed in like this
| // Creates yaml file solana-genesis can read in for `--validator-stakes-file <FILE>` | ||
| // Yaml file created with the following format dictated in agave/genesis/README.md | ||
| // See: https://github.com/anza-xyz/agave/blob/master/genesis/README.md#3-through-the-validator-accounts-file-flag | ||
| fn write_validator_genesis_accouts_to_file(&mut self) -> std::io::Result<()> { |
There was a problem hiding this comment.
| fn write_validator_genesis_accouts_to_file(&mut self) -> std::io::Result<()> { | |
| fn write_validator_genesis_accounts_to_file(&mut self) -> std::io::Result<()> { |
|
About to archive this repo so closing this PR out |
Current deployment forces user to wait for stakes to warmup for multiple epochs. This lets the user bake the validator stakes into genesis so the cluster has stakes fully warmed up upon deployment.
Baking stakes into genesis is set as the default. If you want the original method that requires stake warmup, pass in
--skip-primordial-stakesRequires Agave PR anza-xyz/agave#2704 to be merged before this one