Skip to content

Commit 14031bc

Browse files
authored
fix: Lander nonce add logs (#7260)
Co-authored-by: Danil Nemirovsky <[email protected]>
1 parent 61c7ac7 commit 14031bc

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

rust/main/chains/hyperlane-ethereum/src/rpc_clients/fallback.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ where
178178
}
179179
}
180180

181-
// we don't add a warning with all errors since an error will be logged later on
181+
let errors_count = retryable_errors
182+
.len()
183+
.saturating_add(non_retryable_errors.len());
184+
warn!(errors_count, ?retryable_errors, ?non_retryable_errors, providers=?self.inner.providers, "multicast_request, all providers failed");
185+
182186
retryable_errors.extend(non_retryable_errors);
183187
Err(FallbackError::AllProvidersFailed(retryable_errors).into())
184188
}

rust/main/lander/src/adapter/chains/ethereum/adapter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,12 @@ impl AdaptsChain for EthereumAdapter {
622622
let hash = match send_result {
623623
Ok(hash) => hash,
624624
Err(e) => {
625+
warn!(?e, "submitting transaction error");
625626
return if e.to_string().contains(NONCE_TOO_LOW_ERROR) {
626627
Err(TxAlreadyExists)
627628
} else {
628629
Err(e.into())
629-
}
630+
};
630631
}
631632
};
632633

rust/main/lander/src/adapter/chains/ethereum/nonce/state/assign.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use tracing::{debug, warn};
1+
use tracing::{debug, instrument, warn};
22

33
use hyperlane_core::U256;
44

@@ -9,6 +9,7 @@ use super::super::status::NonceStatus;
99
use super::NonceManagerState;
1010

1111
impl NonceManagerState {
12+
#[instrument(skip(self), fields(?tx_uuid, ?old_nonce))]
1213
pub(crate) async fn assign_next_nonce(
1314
&self,
1415
tx_uuid: &TransactionUuid,
@@ -51,6 +52,7 @@ impl NonceManagerState {
5152
Ok(next_nonce)
5253
}
5354

55+
#[instrument(skip(self), fields(?finalized_nonce, ?upper_nonce))]
5456
async fn identify_next_nonce(
5557
&self,
5658
finalized_nonce: Option<U256>,
@@ -72,7 +74,10 @@ impl NonceManagerState {
7274

7375
if tracked_tx_uuid == TransactionUuid::default() {
7476
// If the nonce is not tracked, we can use it.
75-
debug!("There is no tracked transaction for nonce, reusing it");
77+
debug!(
78+
?next_nonce,
79+
"There is no tracked transaction for nonce, reusing it"
80+
);
7681
break;
7782
}
7883

rust/main/lander/src/adapter/chains/ethereum/precursor.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ pub struct EthereumTxPrecursor {
1919
impl Debug for EthereumTxPrecursor {
2020
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2121
let gas_price = self.extract_gas_price();
22+
let tx_type = self.extract_transaction_type();
2223
f.debug_struct("EthereumTxPrecursor")
24+
.field("tx.type", &tx_type)
2325
.field("tx.from", &self.tx.from())
2426
.field("tx.to", &self.tx.to())
2527
.field("tx.nonce", &self.tx.nonce())
@@ -90,4 +92,12 @@ impl EthereumTxPrecursor {
9092
},
9193
}
9294
}
95+
96+
pub fn extract_transaction_type(&self) -> String {
97+
match &self.tx {
98+
Legacy(_) => "legacy".to_string(),
99+
Eip2930(_) => "eip2930".to_string(),
100+
Eip1559(_) => "eip1559".to_string(),
101+
}
102+
}
93103
}

0 commit comments

Comments
 (0)