Skip to content

Commit

Permalink
Merge branch 'hyperlane-xyz:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mshojaei-txfusion authored Jan 15, 2025
2 parents 8090e97 + 28becff commit af971af
Show file tree
Hide file tree
Showing 87 changed files with 3,168 additions and 1,738 deletions.
5 changes: 0 additions & 5 deletions .changeset/cold-cows-grow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/eleven-carrots-shave.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/flat-lamps-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/infra': minor
---

Add Artela/Base USDC and WETH warp route config
5 changes: 0 additions & 5 deletions .changeset/rare-windows-deny.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/serious-kangaroos-chew.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tall-starfishes-hunt.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/violet-knives-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Fixing the chain resolver checks and handling for argv.chain
1 change: 1 addition & 0 deletions .github/actions/checkout-registry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ runs:
with:
repository: hyperlane-xyz/hyperlane-registry
ref: ${{ env.REGISTRY_VERSION }}
fetch-depth: 0
path: ./hyperlane-registry

- name: Move hyperlane-registry to parent directory
Expand Down
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2184e5e3064ddec2734aa53c1aff6d9f7d958bdf
47aba98bdd78ecb5a3f756dca6dc2e28325bab43
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ ENV REGISTRY_URI="/hyperlane-registry"
ARG REGISTRY_COMMIT="main"
RUN git clone https://github.com/hyperlane-xyz/hyperlane-registry.git "$REGISTRY_URI" \
&& cd "$REGISTRY_URI" \
&& git fetch origin "$REGISTRY_COMMIT" \
&& git checkout "$REGISTRY_COMMIT"
44 changes: 39 additions & 5 deletions rust/main/agents/relayer/src/settings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,50 @@ impl FromRawConf<RawRelayerSettings> for RelayerSettings {
.parse_from_str("Expected database path")
.unwrap_or_else(|| std::env::current_dir().unwrap().join("hyperlane_db"));

let (raw_gas_payment_enforcement_path, raw_gas_payment_enforcement) = p
.get_opt_key("gasPaymentEnforcement")
.take_config_err_flat(&mut err)
.and_then(parse_json_array)
.unwrap_or_else(|| (&p.cwp + "gas_payment_enforcement", Value::Array(vec![])));
// is_gas_payment_enforcement_set determines if we should be checking for the correct gas payment enforcement policy has been provided with "gasPaymentEnforcement" key
let (
raw_gas_payment_enforcement_path,
raw_gas_payment_enforcement,
is_gas_payment_enforcement_set,
) = {
match p.get_opt_key("gasPaymentEnforcement") {
Ok(Some(parser)) => match parse_json_array(parser) {
Some((path, value)) => (path, value, true),
None => (
&p.cwp + "gas_payment_enforcement",
Value::Array(vec![]),
true,
),
},
Ok(None) => (
&p.cwp + "gas_payment_enforcement",
Value::Array(vec![]),
false,
),
Err(_) => (
&p.cwp + "gas_payment_enforcement",
Value::Array(vec![]),
false,
),
}
};

let gas_payment_enforcement_parser = ValueParser::new(
raw_gas_payment_enforcement_path,
&raw_gas_payment_enforcement,
);

if is_gas_payment_enforcement_set
&& gas_payment_enforcement_parser
.val
.as_array()
.unwrap()
.is_empty()
{
Err::<(), eyre::Report>(eyre!("GASPAYMENTENFORCEMENT policy cannot be parsed"))
.take_err(&mut err, || cwp + "gas_payment_enforcement");
}

let mut gas_payment_enforcement = gas_payment_enforcement_parser.into_array_iter().map(|itr| {
itr.filter_map(|policy| {
let policy_type = policy.chain(&mut err).get_opt_key("type").parse_string().end();
Expand Down
14 changes: 10 additions & 4 deletions rust/main/chains/hyperlane-sealevel/src/interchain_gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,17 @@ impl Indexer<InterchainGasPayment> for SealevelInterchainGasPaymasterIndexer {
for nonce in range {
if let Ok(sealevel_payment) = self.get_payment_with_sequence(nonce.into()).await {
let igp_account_filter = self.igp.igp_account;
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");
let mut payment = *sealevel_payment.payment.inner();
// If fees is paid to a different IGP account, we zero out the payment to make sure the db entries are contiguous, but at the same time, gasEnforcer will reject the message (if not set to none policy)
if igp_account_filter != sealevel_payment.igp_account_pubkey {
tracing::debug!(sealevel_payment=?sealevel_payment, igp_account_filter=?igp_account_filter, "Found interchain gas payment for a different IGP account, neutralizing payment");

payment.payment = U256::from(0);
}
payments.push((
Indexed::new(payment).with_sequence(nonce),
sealevel_payment.log_meta,
));
}
}
Ok(payments)
Expand Down
Loading

0 comments on commit af971af

Please sign in to comment.