Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.
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 fendermint/vm/interpreter/src/fvm/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ where
// Asynchronously broadcast signature, if validating.
if let Some(ref ctx) = self.validator_ctx {
// Do not resend past signatures.
if !self.syncing().await? {
if !self.syncing().await {
// Fetch any incomplete checkpoints synchronously because the state can't be shared across threads.
let incomplete_checkpoints =
checkpoint::unsigned_checkpoints(&self.gateway, &mut state, ctx.public_key)
Expand Down
19 changes: 10 additions & 9 deletions fendermint/vm/interpreter/src/fvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub mod store;
pub mod bundle;
pub(crate) mod topdown;

use anyhow::Context;
pub use check::FvmCheckRet;
pub use checkpoint::PowerUpdates;
pub use exec::FvmApplyRet;
Expand Down Expand Up @@ -101,13 +100,15 @@ where
C: Client + Sync,
{
/// Indicate that the node is syncing with the rest of the network and hasn't caught up with the tip yet.
async fn syncing(&self) -> anyhow::Result<bool> {
let status: tendermint_rpc::endpoint::status::Response = self
.client
.status()
.await
.context("failed to get Tendermint status")?;

Ok(status.sync_info.catching_up)
async fn syncing(&self) -> bool {
match self.client.status().await {
Ok(status) => status.sync_info.catching_up,
Err(e) => {
// CometBFT often takes a long time to boot, e.g. while it's replaying blocks it won't
// respond to JSON-RPC calls. Let's treat this as an indication that we are syncing.
tracing::warn!(error =? e, "failed to get CometBFT sync status");
true
}
}
}
}