Skip to content

Commit efc0bbb

Browse files
danwtclaude
andcommitted
claude: address third round of review feedback
- Downgrade error! to debug! for best-effort delivery tx storage - Fix idempotency: store_message_with_dispatch_tx now returns actual store_message result and only stores dispatch tx mapping for new messages - Remove unused warn import from hyperlane_db.rs - Fix spurious blank lines in hyperlane_db.rs and contract_sync/mod.rs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8af3e37 commit efc0bbb

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

rust/main/agents/relayer/src/msg/pending_message.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,13 +925,13 @@ impl PendingMessage {
925925
if let Some(outcome) = &self.submission_outcome {
926926
let message_id = self.message.id();
927927

928-
// Store on destination: message_id -> tx_hash (for /delivered endpoint)
928+
// Best-effort: store delivery tx hash for /delivered endpoint
929929
if let Err(e) = self
930930
.ctx
931931
.destination_db
932932
.store_delivery_tx(&message_id, &outcome.transaction_id)
933933
{
934-
error!(
934+
debug!(
935935
message_id = ?message_id,
936936
tx_id = ?outcome.transaction_id,
937937
destination = ?self.message.destination,

rust/main/hyperlane-base/src/contract_sync/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ where
9696
self.broadcast_sender.clone()
9797
}
9898

99-
10099
/// Sync logs and write them to the LogStore
101100
#[instrument(name = "ContractSync", fields(domain=self.domain().name()), skip(self, opts))]
102101
pub async fn sync(&self, label: &'static str, opts: SyncOptions<T>) {

rust/main/hyperlane-base/src/db/rocks/hyperlane_db.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use std::ops::Add;
22

33
use async_trait::async_trait;
44
use eyre::{bail, Result};
5-
use tracing::{debug, instrument, trace, warn};
6-
5+
use tracing::{debug, instrument, trace};
76

87
use hyperlane_core::{
98
identifiers::UniqueIdentifier, Decode, Encode, GasPaymentKey, HyperlaneDomain,
@@ -82,18 +81,20 @@ impl HyperlaneRocksDB {
8281
}
8382

8483
/// Store a message with its dispatch transaction ID.
84+
/// Returns true if the message was newly stored, false if it already existed.
8585
pub fn store_message_with_dispatch_tx(
8686
&self,
8787
message: &HyperlaneMessage,
8888
dispatched_block_number: u64,
8989
dispatch_tx_id: &H512,
9090
) -> DbResult<bool> {
91-
self.store_message(message, dispatched_block_number)?;
92-
self.store_message_id_by_dispatch_tx(dispatch_tx_id, &message.id())?;
93-
Ok(true)
91+
let newly_stored = self.store_message(message, dispatched_block_number)?;
92+
if newly_stored {
93+
self.store_message_id_by_dispatch_tx(dispatch_tx_id, &message.id())?;
94+
}
95+
Ok(newly_stored)
9496
}
9597

96-
9798
/// Store a raw committed message. If message already exists, then do nothing.
9899
///
99100
/// Keys --> Values:

0 commit comments

Comments
 (0)