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

fix(agents/sealevel): handle non configured igp account payments #5075

Draft
wants to merge 28 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion rust/main/chains/hyperlane-sealevel/src/interchain_gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,17 @@ impl Indexer<InterchainGasPayment> for SealevelInterchainGasPaymasterIndexer {
if igp_account_filter == sealevel_payment.igp_account_pubkey {
payments.push((sealevel_payment.payment, sealevel_payment.log_meta));
} else {
tracing::debug!(sealevel_payment=?sealevel_payment, igp_account_filter=?igp_account_filter, "Found interchain gas payment for a different IGP account, skipping");
tracing::debug!(sealevel_payment=?sealevel_payment, igp_account_filter=?igp_account_filter, "Found interchain gas payment for a different IGP account, neutralizing payment");

let non_matching_payment = InterchainGasPayment {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting a little hard to read, could we change the logic around here starting with line 249 to be something like:

if let Ok(mut sealevel_payment) = self.get_payment_with_sequence(nonce.into()).await {
  // Comment explaining why we do this
  if sealevel_payment.igp_account_pubkey != self.igp.igp_account {
    sealevel_payment.gas_amount = U256::zero();
    sealevel_payment.payment = U256::zero();
  }
  payments.push((sealevel_payment.payment, sealevel_payment.log_meta));
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

gas_amount: U256::from(0),
payment: U256::from(0),
..*sealevel_payment.payment.inner()
};
payments.push((
Indexed::new(non_matching_payment).with_sequence(nonce.into()),
sealevel_payment.log_meta,
));
}
}
}
Expand Down
Loading