Skip to content

Commit 70f9510

Browse files
committed
feat: check dropped transactions
1 parent 1c4fc1a commit 70f9510

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

rust/main/utils/run-locally/src/invariants/termination_invariants.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ pub fn lander_metrics_invariants_met(
348348
)?
349349
.iter()
350350
.sum::<u32>();
351-
let _dropped_transactions = fetch_metric(
351+
let dropped_transactions = fetch_metric(
352352
relayer_port,
353353
"hyperlane_lander_dropped_transactions",
354354
filter_hashmap,
@@ -410,6 +410,15 @@ pub fn lander_metrics_invariants_met(
410410
);
411411
return Ok(false);
412412
}
413+
// Dropped transactions should not exceed half of messages expected
414+
if dropped_transactions > params.total_messages_expected.div_ceil(2) {
415+
log!(
416+
"hyperlane_lander_dropped_transactions {} count, expected less than {}",
417+
dropped_transactions,
418+
0
419+
);
420+
return Ok(false);
421+
}
413422

414423
// resubmissions are possible because it takes a while for the local
415424
// solana validator to report a tx hash as included once broadcast

0 commit comments

Comments
 (0)