Skip to content

Commit e092ac3

Browse files
authored
Merge branch 'main' into jeff/evm-confirm
2 parents dfea50c + 70354d6 commit e092ac3

47 files changed

Lines changed: 2006 additions & 133 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/long-adults-repeat.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@hyperlane-xyz/cli": patch
3+
"@hyperlane-xyz/sdk": patch
4+
---
5+
6+
Restore foreignDeployment field behaviour to allow enrollment of unsupported chains during deployment

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818
env:
1919
CARGO_TERM_COLOR: always
2020
RUST_BACKTRACE: full
21-
MIN_LANDERCOVERAGE_PERCENTAGE: 18
21+
MIN_LANDERCOVERAGE_PERCENTAGE: 19
2222
RUSTC_WRAPPER: sccache
2323

2424
jobs:

.github/workflows/test.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,43 @@ jobs:
393393
env:
394394
CLI_E2E_TEST: ${{ matrix.test }}
395395

396+
cli-cross-chain-e2e-matrix:
397+
runs-on: depot-ubuntu-latest
398+
needs: [rust-only]
399+
if: needs.rust-only.outputs.only_rust == 'false'
400+
strategy:
401+
fail-fast: false
402+
matrix:
403+
test:
404+
# Warp Commands
405+
- warp-apply
406+
- warp-deploy
407+
steps:
408+
- uses: actions/checkout@v4
409+
with:
410+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
411+
submodules: recursive
412+
fetch-depth: 0
413+
414+
- name: install-hyperlane-cli
415+
id: install-hyperlane-cli
416+
uses: ./.github/actions/install-cli
417+
with:
418+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
419+
cache-provider: github
420+
421+
- name: Checkout registry
422+
uses: ./.github/actions/checkout-registry
423+
424+
- name: CLI cross chain e2e tests (${{ matrix.test }})
425+
run: yarn --cwd typescript/cli test:cross-chain:e2e
426+
env:
427+
CLI_E2E_TEST: ${{ matrix.test }}
428+
396429
cli-e2e:
397430
runs-on: ubuntu-latest
398-
needs: [cli-evm-e2e-matrix, cli-cosmos-e2e-matrix]
431+
needs:
432+
[cli-evm-e2e-matrix, cli-cosmos-e2e-matrix, cli-cross-chain-e2e-matrix]
399433
if: always()
400434
steps:
401435
- uses: actions/checkout@v4
@@ -409,6 +443,11 @@ jobs:
409443
with:
410444
job_name: 'CLI CosmosNative E2E'
411445
result: ${{ needs.cli-cosmos-e2e-matrix.result }}
446+
- name: Check CLI Cross Chain E2E status
447+
uses: ./.github/actions/check-job-status
448+
with:
449+
job_name: 'CLI Cross Chain E2E'
450+
result: ${{ needs.cli-cross-chain-e2e-matrix.result }}
412451

413452
cosmos-sdk-e2e-run:
414453
runs-on: depot-ubuntu-latest

.registryrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
186efa0e671f247a4e1468c56825561ded35756e
1+
03c3b95350583598b2f323b52d1335e64309095c

rust/main/chains/hyperlane-sealevel/src/provider.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ pub trait SealevelProviderForLander: Send + Sync {
100100
commitment: CommitmentConfig,
101101
) -> ChainResult<bool>;
102102

103-
/// Request account with finalized commitment level
103+
/// Request account with processed commitment level
104+
/// We use this method to identify if payload was or was not reverted
105+
/// by checking if the account exists. That's why if the account
106+
/// exits at the processed commitment level (as opposite to finalized),
107+
/// it should be enough.
104108
async fn get_account(&self, account: Pubkey) -> ChainResult<Option<Account>>;
105109
}
106110

@@ -321,7 +325,7 @@ impl SealevelProviderForLander for SealevelProvider {
321325

322326
async fn get_account(&self, account: Pubkey) -> ChainResult<Option<Account>> {
323327
self.rpc_client()
324-
.get_account_option_with_finalized_commitment(account)
328+
.get_account_option_with_commitment(account, CommitmentConfig::processed())
325329
.await
326330
}
327331
}

rust/main/chains/hyperlane-sealevel/src/rpc/client.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,20 @@ impl SealevelRpcClient {
7373
pub async fn get_account_option_with_finalized_commitment(
7474
&self,
7575
pubkey: &Pubkey,
76+
) -> ChainResult<Option<Account>> {
77+
self.get_account_option_with_commitment(pubkey, CommitmentConfig::finalized())
78+
.await
79+
}
80+
81+
/// get account option with the given commitment
82+
pub async fn get_account_option_with_commitment(
83+
&self,
84+
pubkey: &Pubkey,
85+
commitment: CommitmentConfig,
7686
) -> ChainResult<Option<Account>> {
7787
let account = self
7888
.0
79-
.get_account_with_commitment(pubkey, CommitmentConfig::finalized())
89+
.get_account_with_commitment(pubkey, commitment)
8090
.await
8191
.map_err(ChainCommunicationError::from_other)?
8292
.value;

rust/main/chains/hyperlane-sealevel/src/rpc/fallback.rs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,21 @@ impl SealevelFallbackRpcClient {
168168
.await
169169
}
170170

171+
/// get account with finalized commitment
172+
pub async fn get_account_with_finalized_commitment(
173+
&self,
174+
pubkey: Pubkey,
175+
) -> ChainResult<Account> {
176+
self.fallback_provider
177+
.call(move |client| {
178+
let pubkey = pubkey;
179+
let future =
180+
async move { client.get_account_with_finalized_commitment(&pubkey).await };
181+
Box::pin(future)
182+
})
183+
.await
184+
}
185+
171186
/// get account option with finalized commitment
172187
pub async fn get_account_option_with_finalized_commitment(
173188
&self,
@@ -186,16 +201,20 @@ impl SealevelFallbackRpcClient {
186201
.await
187202
}
188203

189-
/// get account with finalized commitment
190-
pub async fn get_account_with_finalized_commitment(
204+
/// get account option with a commitment
205+
pub async fn get_account_option_with_commitment(
191206
&self,
192207
pubkey: Pubkey,
193-
) -> ChainResult<Account> {
208+
commitment: CommitmentConfig,
209+
) -> ChainResult<Option<Account>> {
194210
self.fallback_provider
195211
.call(move |client| {
196212
let pubkey = pubkey;
197-
let future =
198-
async move { client.get_account_with_finalized_commitment(&pubkey).await };
213+
let future = async move {
214+
client
215+
.get_account_option_with_commitment(&pubkey, commitment)
216+
.await
217+
};
199218
Box::pin(future)
200219
})
201220
.await

rust/main/hyperlane-base/src/settings/parser/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ fn parse_chain(
268268
let submitter = match submitter {
269269
Some(submitter_type) => submitter_type,
270270
None => match connection.protocol() {
271-
HyperlaneDomainProtocol::Ethereum | HyperlaneDomainProtocol::Radix => {
272-
SubmitterType::Lander
273-
}
271+
HyperlaneDomainProtocol::Ethereum
272+
| HyperlaneDomainProtocol::Radix
273+
| HyperlaneDomainProtocol::Sealevel => SubmitterType::Lander,
274274
_ => Default::default(),
275275
},
276276
};

typescript/cli/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"prettier": "^3.5.3",
4444
"prom-client": "^14.0.1",
4545
"terminal-link": "^3.0.0",
46+
"testcontainers": "11.7.0",
4647
"tsx": "^4.19.1",
4748
"typescript": "5.3.3",
4849
"yaml": "2.4.5",
@@ -62,6 +63,7 @@
6263
"prettier": "prettier --write ./src ./examples",
6364
"test:ci": "yarn mocha --config .mocharc.json",
6465
"test:ethereum:e2e": "./src/tests/ethereum/run-e2e-test.sh",
66+
"test:cross-chain:e2e": "./src/tests/cross-chain/run-e2e-test.sh",
6567
"test:cosmosnative:e2e": "./src/tests/cosmosnative/run-e2e-test.sh",
6668
"version:update": "echo \"export const VERSION = '$npm_package_version';\" > src/version.ts",
6769
"prepack": "yarn bundle"

typescript/cli/src/deploy/warp.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ export async function runWarpRouteApply(
373373
params: WarpApplyParams,
374374
): Promise<void> {
375375
const { warpDeployConfig, warpCoreConfig, context } = params;
376-
const { chainMetadata, skipConfirmation } = context;
376+
const { chainMetadata, skipConfirmation, multiProvider } = context;
377377

378378
WarpRouteDeployConfigSchema.parse(warpDeployConfig);
379379
WarpCoreConfigSchema.parse(warpCoreConfig);
@@ -394,10 +394,18 @@ export async function runWarpRouteApply(
394394
// temporarily configure deployer as owner so that warp update after extension
395395
// can leverage JSON RPC submitter on new chains
396396
const intermediateOwnerConfig = await promiseObjAll(
397-
objMap(params.warpDeployConfig, async (chain, config) => ({
398-
...config,
399-
owner: await multiProtocolSigner.getSignerAddress(chain),
400-
})),
397+
objMap(params.warpDeployConfig, async (chain, config) => {
398+
const protocolType = multiProvider.getProtocol(chain);
399+
400+
if (!COMPATIBLE_PROTOCOLS.includes(protocolType)) {
401+
return config;
402+
}
403+
404+
return {
405+
...config,
406+
owner: await multiProtocolSigner.getSignerAddress(chain),
407+
};
408+
}),
401409
);
402410

403411
// Extend the warp route and get the updated configs
@@ -636,14 +644,20 @@ async function updateExistingWarpRoute(
636644
await promiseObjAll(
637645
objMap(expandedWarpDeployConfig, async (chain, config) => {
638646
await retryAsync(async () => {
647+
const protocolType = multiProvider.getProtocol(chain);
648+
if (!COMPATIBLE_PROTOCOLS.includes(protocolType)) {
649+
logBlue(`Skipping non-compatible chain ${chain}`);
650+
return;
651+
}
652+
639653
const deployedTokenRoute = deployedRoutersAddresses[chain];
640654
assert(deployedTokenRoute, `Missing artifacts for ${chain}.`);
641655
const configWithMailbox = {
642656
...config,
643657
mailbox: registryAddresses[chain].mailbox,
644658
};
645659

646-
switch (multiProvider.getProtocol(chain)) {
660+
switch (protocolType) {
647661
case ProtocolType.Ethereum: {
648662
const evmERC20WarpModule = new EvmERC20WarpModule(
649663
multiProvider,
@@ -683,10 +697,6 @@ async function updateExistingWarpRoute(
683697
updateTransactions[chain] = transactions;
684698
break;
685699
}
686-
default: {
687-
logBlue(`Skipping non-compatible chain ${chain}`);
688-
return;
689-
}
690700
}
691701
});
692702
}),

0 commit comments

Comments
 (0)