Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/oe/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ impl RunningClient {
.name("diamond-node-force-quit".to_string())
.spawn(move || {

let duration_soft = 5;
let duration_soft = 15;
// we make a force quit if after 90 seconds, if this shutdown routine
std::thread::sleep(Duration::from_secs(duration_soft));
warn!(target: "shutdown", "shutdown not happened within {duration_soft} seconds, starting force exiting the process.");
Expand Down
21 changes: 20 additions & 1 deletion crates/ethcore/src/engines/hbbft/hbbft_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,29 @@ impl HbbftState {
}

if sks.is_none() {
info!(target: "engine", "We are not part of the HoneyBadger validator set - running as regular node.");
info!(target: "engine", "We are not part of the HoneyBadger validator set - Running as regular node.");
peers_service
.send_message(HbbftConnectToPeersMessage::DisconnectAllValidators)
.ok()?;

if self.is_validator() {
let is_syncing = if let Some(full) = client.as_full_client() {
full.is_major_syncing()
} else {
info!(target: "engine", "Node was a validator: cannot be determinated, because client is not a full client. (https://github.com/DMDcoin/diamond-node/issues/322.)");
return Some(());
};

if is_syncing {
debug!(target: "engine", "Node was a validator, and became regular node, but we are syncing, not shutting down Node as defined in https://github.com/DMDcoin/diamond-node/issues/322.");
} else {
info!(target: "engine", "Node was a validator, and became regular node. shutting down Node as defined in https://github.com/DMDcoin/diamond-node/issues/322.");
// for unit tests no problem, demand shutddown won't to anything if its a unit test.
// e2e tests needs adaptation.
// this gracefully shuts down a node, if it was a validator before, but now it is not anymore.
client.demand_shutdown();
}
}
return Some(());
}

Expand Down
Loading