Skip to content

Commit

Permalink
feat: SVM agents - use the transaction submission URL for polling tx …
Browse files Browse the repository at this point in the history
…status (#5298)

### Description

- context:
https://discord.com/channels/935678348330434570/1333035743622336614
- uses the RPC URL used for tx submission (if it's possible) to poll tx
status. We use a Helius tx submission URL on solana mainnet so this now
uses Helius for polling the status as well

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->

### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
  • Loading branch information
tkporter authored Jan 27, 2025
1 parent 48573cc commit a569a59
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 4 additions & 3 deletions rust/main/chains/hyperlane-sealevel/src/mailbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,17 +490,18 @@ impl Mailbox for SealevelMailbox {

let send_instant = std::time::Instant::now();

let rpc = self.tx_submitter.rpc_client().unwrap_or_else(|| self.rpc());

// Wait for the transaction to be confirmed.
self.rpc().wait_for_transaction_confirmation(&tx).await?;
rpc.wait_for_transaction_confirmation(&tx).await?;

// We expect time_to_confirm to fluctuate depending on the commitment level when submitting the
// tx, but still use it as a proxy for tx latency to help debug.
tracing::info!(?tx, ?signature, time_to_confirm=?send_instant.elapsed(), "Sealevel transaction confirmed");

// TODO: not sure if this actually checks if the transaction was executed / reverted?
// Confirm the transaction.
let executed = self
.rpc()
let executed = rpc
.confirm_transaction_with_commitment(&signature, commitment)
.await
.map_err(|err| warn!("Failed to confirm inbox process transaction: {}", err))
Expand Down
8 changes: 8 additions & 0 deletions rust/main/chains/hyperlane-sealevel/src/tx_submitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ pub trait TransactionSubmitter: Send + Sync {
transaction: &Transaction,
skip_preflight: bool,
) -> ChainResult<Signature>;

fn rpc_client(&self) -> Option<&SealevelRpcClient> {
None
}
}

/// A transaction submitter that uses the vanilla RPC to submit transactions.
Expand Down Expand Up @@ -60,6 +64,10 @@ impl TransactionSubmitter for RpcTransactionSubmitter {
.send_transaction(transaction, skip_preflight)
.await
}

fn rpc_client(&self) -> Option<&SealevelRpcClient> {
Some(&self.rpc_client)
}
}

/// A transaction submitter that uses the Jito API to submit transactions.
Expand Down
2 changes: 1 addition & 1 deletion typescript/infra/config/environments/mainnet3/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ const hyperlane: RootAgentConfig = {
rpcConsensusType: RpcConsensusType.Fallback,
docker: {
repo,
tag: 'f6b682c-20250124-144126',
tag: 'a54c98e-20250126-113529',
},
blacklist,
gasPaymentEnforcement: gasPaymentEnforcement,
Expand Down

0 comments on commit a569a59

Please sign in to comment.