Skip to content

Commit

Permalink
fix: sleep after submitting to cosmos chains
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-savu committed May 3, 2024
1 parent 5aeb83a commit de42c50
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions rust/agents/relayer/src/msg/serial_submitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use tracing::{info, warn};

use hyperlane_base::CoreMetrics;
use hyperlane_core::{
BatchItem, ChainCommunicationError, ChainResult, HyperlaneDomain, HyperlaneMessage,
MpmcReceiver, TxOutcome,
BatchItem, ChainCommunicationError, ChainResult, HyperlaneDomain, HyperlaneDomainProtocol,
HyperlaneMessage, MpmcReceiver, TxOutcome,
};

use crate::msg::pending_message::CONFIRM_DELAY;
Expand Down Expand Up @@ -274,10 +274,21 @@ async fn submit_single_operation(
confirm_queue: &mut OpQueue,
metrics: &SerialSubmitterMetrics,
) {
let destination = op.destination_domain().clone();
op.submit().await;
debug!(?op, "Operation submitted");
confirm_queue.push(op).await;
metrics.ops_submitted.inc();

if matches!(
destination.domain_protocol(),
HyperlaneDomainProtocol::Cosmos
) {
// On cosmos chains, sleep for 1 sec (the finality period).
// Otherwise we get `account sequence mismatch` errors, which have caused us
// to lose liveness.
sleep(Duration::from_secs(1)).await;
}
}

#[instrument(skip_all, fields(%domain))]
Expand Down

0 comments on commit de42c50

Please sign in to comment.