Skip to content

Commit 5399fe3

Browse files
authored
feat: Add logs for validator checkpoints in relayer (#5217)
### Description Add logs into relayer so than it logs validator and their store location for checkpoints ### Backward compatibility Yes ### Testing Running locally Co-authored-by: Danil Nemirovsky <[email protected]>
1 parent 394d10f commit 5399fe3

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

rust/main/agents/relayer/src/msg/metadata/base.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ impl BaseMetadataBuilder {
367367

368368
pub async fn build_checkpoint_syncer(
369369
&self,
370+
message: &HyperlaneMessage,
370371
validators: &[H256],
371372
app_context: Option<String>,
372373
) -> Result<MultisigCheckpointSyncer> {
@@ -375,9 +376,18 @@ impl BaseMetadataBuilder {
375376
.get_announced_storage_locations(validators)
376377
.await?;
377378

379+
debug!(
380+
hyp_message=?message,
381+
?validators,
382+
validators_len = ?validators.len(),
383+
?storage_locations,
384+
storage_locations_len = ?storage_locations.len(),
385+
"List of validators and their storage locations for message");
386+
378387
// Only use the most recently announced location for now.
379388
let mut checkpoint_syncers: HashMap<H160, Arc<dyn CheckpointSyncer>> = HashMap::new();
380389
for (&validator, validator_storage_locations) in validators.iter().zip(storage_locations) {
390+
debug!(hyp_message=?message, ?validator, ?validator_storage_locations, "Validator and its storage locations for message");
381391
for storage_location in validator_storage_locations.iter().rev() {
382392
let Ok(config) = CheckpointSyncerConf::from_str(storage_location) else {
383393
debug!(

rust/main/agents/relayer/src/msg/metadata/multisig/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ impl<T: MultisigIsmMetadataBuilder> MetadataBuilder for T {
115115
return Ok(None);
116116
}
117117

118+
info!(hyp_message=?message, ?validators, threshold, "List of validators and threshold for message");
119+
118120
let checkpoint_syncer = self
119121
.as_ref()
120-
.build_checkpoint_syncer(&validators, self.as_ref().app_context.clone())
122+
.build_checkpoint_syncer(message, &validators, self.as_ref().app_context.clone())
121123
.await
122124
.context(CTX)?;
123125

rust/main/hyperlane-base/src/types/multisig.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::sync::Arc;
33

44
use derive_new::new;
55
use eyre::Result;
6-
use tracing::{debug, instrument};
6+
use tracing::{debug, instrument, warn};
77

88
use hyperlane_core::{
99
HyperlaneDomain, MultisigSignedCheckpoint, SignedCheckpointWithMessageId, H160, H256,
@@ -40,6 +40,10 @@ impl MultisigCheckpointSyncer {
4040

4141
for validator in validators {
4242
let address = H160::from(*validator);
43+
debug!(
44+
?address,
45+
"Getting latest checkpoint from validator via checkpoint syncer",
46+
);
4347
if let Some(checkpoint_syncer) = self.checkpoint_syncers.get(&address) {
4448
// Gracefully handle errors getting the latest_index
4549
match checkpoint_syncer.latest_index().await {
@@ -56,6 +60,8 @@ impl MultisigCheckpointSyncer {
5660
latest_indices.insert(H160::from(*validator), None);
5761
}
5862
}
63+
} else {
64+
warn!(?address, "Checkpoint syncer is not provided for validator");
5965
}
6066
}
6167

0 commit comments

Comments
 (0)