Skip to content

Commit

Permalink
add in additional args.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg committed Oct 10, 2023
1 parent b6e970e commit d3ba7fc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 9 deletions.
25 changes: 24 additions & 1 deletion k8s-cluster/src/kubernetes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub struct ValidatorConfig<'a> {
pub bank_hash: Option<Hash>,
pub max_ledger_size: Option<u64>,
pub skip_poh_verify: bool,
pub no_snapshot_fetch: bool,
pub skip_require_tower: bool,
pub enable_full_rpc: bool,
}

impl<'a> std::fmt::Display for ValidatorConfig<'a> {
Expand All @@ -51,7 +54,10 @@ impl<'a> std::fmt::Display for ValidatorConfig<'a> {
shred_version: {:?}\n\
bank_hash: {:?}\n\
max_ledger_size: {:?}\n\
skip_poh_verify: {}",
skip_poh_verify: {}\n\
no_snapshot_fetch: {}\n\
skip_require_tower: {}\n\
enable_full_rpc: {}",
self.tpu_enable_udp,
self.tpu_disable_quic,
self.gpu_mode,
Expand All @@ -63,6 +69,9 @@ impl<'a> std::fmt::Display for ValidatorConfig<'a> {
self.bank_hash,
self.max_ledger_size,
self.skip_poh_verify,
self.no_snapshot_fetch,
self.skip_require_tower,
self.enable_full_rpc,
)
}
}
Expand Down Expand Up @@ -105,6 +114,20 @@ impl<'a> Kubernetes<'a> {
if self.validator_config.skip_poh_verify {
flags.push("--skip-poh-verify".to_string());
}
if self.validator_config.no_snapshot_fetch {
flags.push("--no-snapshot-fetch".to_string());
}
if self.validator_config.skip_require_tower {
flags.push("--skip-require-tower".to_string());
}
if self.validator_config.enable_full_rpc {
flags.push("--enable-rpc-transaction-history".to_string());
flags.push("--enable-extended-tx-metadata-storage".to_string());
}
if self.validator_config.enable_full_rpc {
flags.push("--enable-rpc-transaction-history".to_string());
flags.push("--enable-extended-tx-metadata-storage".to_string());
}

if let Some(slot) = self.validator_config.wait_for_supermajority {
flags.push("--wait-for-supermajority".to_string());
Expand Down
21 changes: 19 additions & 2 deletions k8s-cluster/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,21 @@ fn parse_matches() -> ArgMatches<'static> {
the ledger they already have saved to disk at
boot (results in a much faster boot)"),
)
.arg(
Arg::with_name("no_snapshot_fetch")
.long("no-snapshot-fetch")
.help("Validator config. If set, disables booting validators from a snapshot"),
)
.arg(
Arg::with_name("skip_require_tower")
.long("skip-require-tower")
.help("Validator config. Disable require tower"),
)
.arg(
Arg::with_name("full_rpc")
.long("full-rpc")
.help("Validator config. Support full RPC services on all nodes"),
)
.get_matches()
}

Expand Down Expand Up @@ -383,8 +398,10 @@ async fn main() {
} else {
None
},
skip_poh_verify: matches.is_present("skip_poh_verify")

skip_poh_verify: matches.is_present("skip_poh_verify"),
no_snapshot_fetch: matches.is_present("no_snapshot_fetch"),
skip_require_tower: matches.is_present("skip_require_tower"),
enable_full_rpc: matches.is_present("enable_full_rpc"),
};

let wait_for_supermajority: Option<u64> = validator_config.wait_for_supermajority;
Expand Down
12 changes: 6 additions & 6 deletions k8s-cluster/src/scripts/bootstrap-startup-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ while [[ -n $1 ]]; do
elif [[ $1 = --no-rocksdb-compaction ]]; then # not enabled in net.sh
args+=("$1")
shift
elif [[ $1 = --enable-rpc-transaction-history ]]; then # not enabled in net.sh
elif [[ $1 = --enable-rpc-transaction-history ]]; then # enabled through full-rpc
args+=("$1")
shift
elif [[ $1 = --rpc-pubsub-enable-block-subscription ]]; then # not enabled in net.sh
Expand All @@ -59,7 +59,7 @@ while [[ -n $1 ]]; do
elif [[ $1 = --enable-cpi-and-log-storage ]]; then # not enabled in net.sh
args+=("$1")
shift
elif [[ $1 = --enable-extended-tx-metadata-storage ]]; then # not enabled in net.sh
elif [[ $1 = --enable-extended-tx-metadata-storage ]]; then # enabled through full-rpc
args+=("$1")
shift
elif [[ $1 = --enable-rpc-bigtable-ledger-storage ]]; then # not enabled in net.sh
Expand All @@ -77,7 +77,7 @@ while [[ -n $1 ]]; do
elif [[ $1 = --rpc-send-batch-size ]]; then # not enabled in net.sh
args+=("$1" "$2")
shift 2
elif [[ $1 = --skip-poh-verify ]]; then
elif [[ $1 = --skip-poh-verify ]]; then # Done
args+=("$1")
shift
elif [[ $1 = --no-restart ]]; then # not enabled in net.sh
Expand All @@ -95,16 +95,16 @@ while [[ -n $1 ]]; do
elif [[ $1 == --maximum-snapshots-to-retain ]]; then # not enabled in net.sh
args+=("$1" "$2")
shift 2
elif [[ $1 == --no-snapshot-fetch ]]; then
elif [[ $1 == --no-snapshot-fetch ]]; then # Done
args+=("$1")
shift
elif [[ $1 == --accounts-db-skip-shrink ]]; then
args+=("$1")
shift
elif [[ $1 == --skip-require-tower ]]; then
elif [[ $1 == --skip-require-tower ]]; then # Done
maybeRequireTower=false
shift
elif [[ $1 = --log-messages-bytes-limit ]]; then
elif [[ $1 = --log-messages-bytes-limit ]]; then # not enabled in net.sh
args+=("$1" "$2")
shift 2
else
Expand Down

0 comments on commit d3ba7fc

Please sign in to comment.