-
Notifications
You must be signed in to change notification settings - Fork 5
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
Bake stake into genesis #68
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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'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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we import these types from solana-genesis now?
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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> |
# kubernetes config | ||
--cpu-requests <cores> | ||
--memory-requests <memory> | ||
# deploy with clients | ||
bench-tps |
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 looks out of place. Is it correct?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fn write_validator_genesis_accouts_to_file(&mut self) -> std::io::Result<()> { | |
fn write_validator_genesis_accounts_to_file(&mut self) -> std::io::Result<()> { |
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-stakes
Requires Agave PR anza-xyz/agave#2704 to be merged before this one