Skip to content

Commit

Permalink
switch to --validator-balances-file instead of flags for each individ…
Browse files Browse the repository at this point in the history
…ual validator
  • Loading branch information
greg committed Oct 4, 2024
1 parent b4d4fc8 commit 336d715
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 84 deletions.
10 changes: 6 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ openssl = "0.10.66"
rand = "0.8.5"
reqwest = { version = "0.11.23", features = ["blocking", "brotli", "deflate", "gzip", "rustls-tls", "json"] }
rustls = { version = "0.21.11", default-features = false, features = ["quic"] }
serde = "1.0.208"
serde_yaml = "0.9.34"
solana-accounts-db = "1.18.20"
solana-clap-v3-utils = "1.18.20"
solana-core = "1.18.20"
Expand Down
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ cargo run --bin cluster --
--base-image <base-image> # e.g. ubuntu:20.04
--image-name <docker-image-name> # e.g. cluster-image
# validator config
--skip-primordial-accounts
--full-rpc
--internal-node-sol <Sol>
--internal-node-stake-sol <Sol>
--internal-node-sol <sol>
--internal-node-stake-sol <sol>
# kubernetes config
--cpu-requests <cores>
--memory-requests <memory>
Expand All @@ -119,8 +120,39 @@ For client Version >= 2.0.0
```

## Baking Validator Stakes into Genesis
- By default, validator stakes are baked into genesis on genesis creation. That way when the cluster boots up, all validators will consistently be in the leader schedule.
- If you do not want this and instead want the stake to warm up after deplyoyment, pass in the flag `--skip-primordial-stakes`.
- You can bake validator stakes into gensis on genesis creation by passing in `--validator-balances-file <file-path-to-validator-balances-yml>`. This way when the cluster boots up, all validators will consistently be in the leader schedule. In the validator balances file, you can set specific validator balances and stake amounts.
The validator balances file has the following yaml format:
```
---
v0:
balances_lamports: <balance0>
stake_lamports: <stake0>
v1:
balances_lamports: <balance1>
stake_lamports: <stake1>
...
vN:
balances_lamports: <balanceN>
stake_lamports: <stakeN>
```
^ Note, the file must have the `v0`, `v1`, ..., `vN` format. The number of validators in this file must match `--num-validators <number-of-validators>`

For example, we could create: `validator-balances.yml` and have it look like:
```
---
v0:
balance_lamports: 400000000000
stake_lamports: 40000000000
v1:
balance_lamports: 200000000000
stake_lamports: 20000000000
v2:
balance_lamports: 300000000000
stake_lamports: 30000000000
```

- If you do not want to bake stakes into genesis and instead want the stake to warm up after deplyoyment, pass in the flag `--skip-primordial-stakes` and leave out `--validator-balances`
- `--internal-node-sol`, `--internal-node-stake-sol`, are `--comission` are only valid with `--skip-primordial-stakes`

## Metrics
1) Setup metrics database:
Expand Down
Loading

0 comments on commit 336d715

Please sign in to comment.