From 96107ccd76d7bc1359be5e11fc45f5eef43cbe34 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 27 Oct 2023 12:50:20 +0100 Subject: [PATCH 1/2] fix build --- .../hyperlane-cosmos/src/payloads/validator_announce.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/chains/hyperlane-cosmos/src/payloads/validator_announce.rs b/rust/chains/hyperlane-cosmos/src/payloads/validator_announce.rs index 64624a2f38..fdf449c7c4 100644 --- a/rust/chains/hyperlane-cosmos/src/payloads/validator_announce.rs +++ b/rust/chains/hyperlane-cosmos/src/payloads/validator_announce.rs @@ -17,12 +17,12 @@ pub struct GetAnnounceStorageLocationsRequestInner { pub validators: Vec, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct AnnouncementRequest { pub announce: AnnouncementRequestInner, } -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Clone)] pub struct AnnouncementRequestInner { pub validator: String, pub storage_location: String, From a48a0d6d326c97add009aada53a9e288173123f5 Mon Sep 17 00:00:00 2001 From: Trevor Porter Date: Fri, 27 Oct 2023 14:47:40 +0100 Subject: [PATCH 2/2] Some more logs for funding the chain signer --- rust/agents/validator/src/validator.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rust/agents/validator/src/validator.rs b/rust/agents/validator/src/validator.rs index 900b87405a..e70a50a69f 100644 --- a/rust/agents/validator/src/validator.rs +++ b/rust/agents/validator/src/validator.rs @@ -202,12 +202,13 @@ impl Validator { tasks } - fn log_on_announce_failure(result: ChainResult) { + fn log_on_announce_failure(result: ChainResult, chain_signer: &String) { match result { Ok(outcome) => { if outcome.executed { info!( tx_outcome=?outcome, + ?chain_signer, "Successfully announced validator", ); } else { @@ -215,6 +216,7 @@ impl Validator { txid=?outcome.transaction_id, gas_used=?outcome.gas_used, gas_price=?outcome.gas_price, + ?chain_signer, "Transaction attempting to announce validator reverted. Make sure you have enough funds in your account to pay for transaction fees." ); } @@ -222,6 +224,7 @@ impl Validator { Err(err) => { error!( ?err, + ?chain_signer, "Failed to announce validator. Make sure you have enough funds in your account to pay for gas." ); } @@ -274,6 +277,8 @@ impl Validator { .chain_signer() .await? { + let chain_signer = chain_signer.address_string(); + info!(eth_validator_address=?announcement.validator, ?chain_signer, "Attempting self announce"); let balance_delta = self .validator_announce .announce_tokens_needed(signed_announcement.clone()) @@ -283,7 +288,7 @@ impl Validator { warn!( tokens_needed=%balance_delta, eth_validator_address=?announcement.validator, - chain_signer=?chain_signer.address_string(), + ?chain_signer, "Please send tokens to your chain signer address to announce", ); } else { @@ -291,7 +296,7 @@ impl Validator { .validator_announce .announce(signed_announcement.clone(), None) .await; - Self::log_on_announce_failure(result); + Self::log_on_announce_failure(result, &chain_signer); } } else { warn!(origin_chain=%self.origin_chain, "Cannot announce validator without a signer; make sure a signer is set for the origin chain");