Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(drive): drive and tenderdash are constantly restarting #1978

Merged
merged 1 commit into from
Jul 19, 2024
Merged
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
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
Loading