Skip to content

Commit ea59cfc

Browse files
authored
FIX: Do not fail if status doesn't respond in the interpreter (#455)
1 parent 101e872 commit ea59cfc

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

fendermint/vm/interpreter/src/fvm/exec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ where
141141
// Asynchronously broadcast signature, if validating.
142142
if let Some(ref ctx) = self.validator_ctx {
143143
// Do not resend past signatures.
144-
if !self.syncing().await? {
144+
if !self.syncing().await {
145145
// Fetch any incomplete checkpoints synchronously because the state can't be shared across threads.
146146
let incomplete_checkpoints =
147147
checkpoint::unsigned_checkpoints(&self.gateway, &mut state, ctx.public_key)

fendermint/vm/interpreter/src/fvm/mod.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub mod store;
1616
pub mod bundle;
1717
pub(crate) mod topdown;
1818

19-
use anyhow::Context;
2019
pub use check::FvmCheckRet;
2120
pub use checkpoint::PowerUpdates;
2221
pub use exec::FvmApplyRet;
@@ -101,13 +100,15 @@ where
101100
C: Client + Sync,
102101
{
103102
/// Indicate that the node is syncing with the rest of the network and hasn't caught up with the tip yet.
104-
async fn syncing(&self) -> anyhow::Result<bool> {
105-
let status: tendermint_rpc::endpoint::status::Response = self
106-
.client
107-
.status()
108-
.await
109-
.context("failed to get Tendermint status")?;
110-
111-
Ok(status.sync_info.catching_up)
103+
async fn syncing(&self) -> bool {
104+
match self.client.status().await {
105+
Ok(status) => status.sync_info.catching_up,
106+
Err(e) => {
107+
// CometBFT often takes a long time to boot, e.g. while it's replaying blocks it won't
108+
// respond to JSON-RPC calls. Let's treat this as an indication that we are syncing.
109+
tracing::warn!(error =? e, "failed to get CometBFT sync status");
110+
true
111+
}
112+
}
112113
}
113114
}

0 commit comments

Comments
 (0)