Skip to content

Commit

Permalink
Enable wen restart from command line and update comments. (#2640)
Browse files Browse the repository at this point in the history
Enable wen_restart from command line and update comments.
  • Loading branch information
wen-coding authored Aug 25, 2024
1 parent c842b0d commit c8a839a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
19 changes: 10 additions & 9 deletions validator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1580,24 +1580,25 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
.required(false)
.conflicts_with("wait_for_supermajority")
.help(
"When specified, the validator will enter Wen Restart mode which \
"Only used during coordinated cluster restarts.\
\n\n\
When specified, the validator will enter Wen Restart mode which \
pauses normal activity. Validators in this mode will gossip their last \
vote to reach consensus on a safe restart slot and repair all blocks \
on the selected fork. The safe slot will be a descendant of the latest \
optimistically confirmed slot to ensure we do not roll back any \
optimistically confirmed slots. \
\n\n\
The progress in this mode will be saved in the file location provided. \
If consensus is reached, the validator will automatically exit and then \
execute wait_for_supermajority logic so the cluster will resume execution. \
The progress file will be kept around for future debugging. \
\n\n\
After the cluster resumes normal operation, the validator arguments can \
be adjusted to remove --wen_restart and update expected_shred_version to \
the new shred_version agreed on in the consensus. \
If consensus is reached, the validator will automatically exit with 200 \
status code. Then the operators are expected to restart the validator \
with --wait_for_supermajority and other arguments (including new shred_version, \
supermajority slot, and bankhash) given in the error log before the exit so \
the cluster will resume execution. The progress file will be kept around \
for future debugging. \
\n\n\
If wen_restart fails, refer to the progress file (in proto3 format) for \
further debugging.",
further debugging and watch the discord channel for instructions.",
),
)
.args(&thread_args(&default_args.thread_args))
Expand Down
6 changes: 6 additions & 0 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,7 @@ pub fn main() {
replay_transactions_threads,
delay_leader_block_for_pending_fork: matches
.is_present("delay_leader_block_for_pending_fork"),
wen_restart_proto_path: value_t!(matches, "wen_restart", PathBuf).ok(),
..ValidatorConfig::default()
};

Expand Down Expand Up @@ -1965,6 +1966,11 @@ pub fn main() {
let mut node = Node::new_with_external_ip(&identity_keypair.pubkey(), node_config);

if restricted_repair_only_mode {
if validator_config.wen_restart_proto_path.is_some() {
error!("--restricted-repair-only-mode is not compatible with --wen_restart");
exit(1);
}

// When in --restricted_repair_only_mode is enabled only the gossip and repair ports
// need to be reachable by the entrypoint to respond to gossip pull requests and repair
// requests initiated by the node. All other ports are unused.
Expand Down

0 comments on commit c8a839a

Please sign in to comment.