Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip draft] use lighter commitment for delivered #5297

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rust/main/chains/hyperlane-sealevel/src/mailbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,10 @@ impl Mailbox for SealevelMailbox {

let account = self
.rpc()
.get_account_option_with_finalized_commitment(&processed_message_account_key)
.get_account_option_with_commitment(
&processed_message_account_key,
CommitmentConfig::processed(),
)
.await?;

Ok(account.is_some())
Expand Down
14 changes: 14 additions & 0 deletions rust/main/chains/hyperlane-sealevel/src/rpc/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,20 @@ impl SealevelRpcClient {
Ok(account)
}

pub async fn get_account_option_with_commitment(
&self,
pubkey: &Pubkey,
commitment: CommitmentConfig,
) -> ChainResult<Option<Account>> {
let account = self
.0
.get_account_with_commitment(pubkey, commitment)
.await
.map_err(ChainCommunicationError::from_other)?
.value;
Ok(account)
}

pub async fn get_balance(&self, pubkey: &Pubkey) -> ChainResult<U256> {
let balance = self
.0
Expand Down
Loading