Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gregcusack
Copy link
Collaborator

@gregcusack gregcusack commented Aug 16, 2024

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

@gregcusack gregcusack marked this pull request as ready for review August 16, 2024 22:04
src/main.rs Outdated
Comment on lines 253 to 255
.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"),
Copy link
Contributor

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.

src/genesis.rs Outdated
@@ -378,6 +358,21 @@ impl Genesis {
args.push(path);
}

if !self.flags.skip_primordial_stakes {
for i in 0..num_validators {
args.push("--bootstrap-validator".to_string());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work quite right. By marking these as bootstrap validators, they use the GenesisFlags::bootstrap_validator_sol and GenesisFlags::bootstrap_validator_stake_sol values, instead of GenesisFlags::internal_node_sol and GenesisFlags::internal_node_stake_sol.

Unless we want to update the solana-genesis crate/bin (which isn't totally out of the question, but is a bit of a hassle), I think we'll have to populate an accounts file and use the --primordial-accounts-file flag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh shoot ok ya let's do --primordial-accounts-file flag

Copy link
Collaborator Author

@gregcusack gregcusack Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey been struggling with this a little. I am having a hard time getting the --primordial-accounts-file flag setup properly to work with vote and stake accounts. do you know how to setup these stake/vote accounts in the primordial-accounts-file and then get them recognized at the start of the cluster?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i could see how we could modify solana-genesis as you mentioned to get this to work. but definitely a little more of a hassle. Although just can't quite figure out how to properly add stake and vote accounts to a primordial accounts file. it doesn't appear net/ scripts support that either. but could be missing it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take a look later today!

@gregcusack gregcusack force-pushed the bake-stake-into-genesis branch from 4bde184 to b4d4fc8 Compare August 22, 2024 20:33
Copy link
Contributor

@CriesofCarrots CriesofCarrots left a 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.

@gregcusack gregcusack force-pushed the bake-stake-into-genesis branch from 336d715 to 28e51d7 Compare October 4, 2024 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants