Skip to content

Commit

Permalink
fix(drive): drive and tenderdash are constantly restarting (#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov authored Jul 19, 2024
1 parent 4942906 commit cd07fd4
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,27 @@ where
request,
)?;

// We get core height early, as this also verifies mn_rr fork
let core_height =
self.initial_core_height(request.initial_core_height, platform_version)?;
// Wait until we have an initial core height to start the chain
let core_height = loop {
match self.initial_core_height(request.initial_core_height, platform_version) {
Ok(height) => break height,
Err(e) => match e {
Error::Execution(ExecutionError::InitializationForkNotActive(_))
| Error::Execution(ExecutionError::InitializationBadCoreLockedHeight {
..
}) => {
tracing::warn!(
error = ?e,
"Failed to obtain deterministic initial core height to start the chain. Retrying in 30 seconds.",
);

// We need to wait for the fork to be active
std::thread::sleep(std::time::Duration::from_secs(30));
}
e => return Err(e),
},
}
};

let genesis_time = request.genesis_time;

Expand Down

0 comments on commit cd07fd4

Please sign in to comment.