Skip to content

Commit 92e1c88

Browse files
committed
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo into xeno/usdc-fpwr-bsc+katana-extension
2 parents 2072407 + 959c42a commit 92e1c88

674 files changed

Lines changed: 94488 additions & 39016 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/cuddly-meals-retire.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/late-wolves-repeat.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.changeset/metrics-port-validation.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hyperlane-xyz/rebalancer': patch
3+
---
4+
5+
Mixed-decimal inventory follow-ups were fixed by failing fast on missing bridged supply, tightening bridge plan coverage, and formatting monitored inventory balances with token-aware decimals.

.changeset/skip-unknown-fee-domains.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/svm-signer-deploy-improvements.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/utils-yaml-exports.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/warp-widget-initial.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.claude/skills/verify-warp-contracts/SKILL.md

Lines changed: 348 additions & 0 deletions
Large diffs are not rendered by default.

.claude/skills/warp-route-check/skill.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,117 @@ hyperlane warp check \
398398

399399
**NOTE**: Warp check may show provider errors for newly added chains - this is expected.
400400

401+
### Step 8b: Test transferRemote on Fork
402+
403+
After verifying configuration with `warp check`, test that an actual token transfer works on the forked chains. This catches issues that config checks miss: broken `transferRemote` calldata, token accounting bugs (lock/mint/burn/unlock), and message dispatch failures.
404+
405+
#### 8b.1 Pick an Origin → Destination Pair
406+
407+
Choose one origin → destination pair from the warp route. Prefer a pair where both chains have transactions (i.e., both were modified), so you're testing the freshly configured path.
408+
409+
#### 8b.2 Bypass ISM on Destination (Required for Self-Relay)
410+
411+
Forked mainnet chains have real multisig ISMs that require validator signatures. Since there are no validators on anvil forks, you must set a permissive ISM on the destination so self-relay can deliver the message.
412+
413+
```bash
414+
# 1. Get the mailbox address for the destination chain from the forked registry
415+
DEST_MAILBOX=$(cast call <warp-router-address> "mailbox()(address)" --rpc-url http://localhost:<DEST-PORT>)
416+
417+
# 2. Get the mailbox owner
418+
MAILBOX_OWNER=$(cast call $DEST_MAILBOX "owner()(address)" --rpc-url http://localhost:<DEST-PORT>)
419+
420+
# 3. Get the current default ISM (to restore later if needed)
421+
OLD_ISM=$(cast call $DEST_MAILBOX "defaultIsm()(address)" --rpc-url http://localhost:<DEST-PORT>)
422+
423+
# 4. Deploy Hyperlane's TestIsm.
424+
# TestIsm returns Types.NULL from moduleType() and true from verify(bytes,bytes),
425+
# so `hyperlane warp send --relay` uses null metadata instead of trying to derive
426+
# multisig/routing metadata on the fork.
427+
TEST_DEPLOYER_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
428+
# Ensure Foundry dependencies are materialized in fresh worktrees/checkouts.
429+
pnpm -C solidity deps:soldeer
430+
TEST_ISM_ADDRESS=$(forge create \
431+
--root solidity \
432+
--broadcast \
433+
--rpc-url http://localhost:<DEST-PORT> \
434+
--private-key $TEST_DEPLOYER_KEY \
435+
contracts/test/TestIsm.sol:TestIsm \
436+
| awk '/Deployed to:/ {print $3}')
437+
438+
# Confirm the fork bypass ISM has the expected Hyperlane behavior:
439+
# moduleType() == 6 (Types.NULL) and verify(...) == true.
440+
cast call $TEST_ISM_ADDRESS "moduleType()(uint8)" --rpc-url http://localhost:<DEST-PORT>
441+
cast call $TEST_ISM_ADDRESS "verify(bytes,bytes)(bool)" 0x 0x --rpc-url http://localhost:<DEST-PORT>
442+
443+
# 5. Impersonate mailbox owner and set the permissive ISM
444+
cast rpc anvil_impersonateAccount $MAILBOX_OWNER --rpc-url http://localhost:<DEST-PORT>
445+
BALANCE="0x56BC75E2D63100000"
446+
cast rpc anvil_setBalance $MAILBOX_OWNER $BALANCE --rpc-url http://localhost:<DEST-PORT>
447+
cast send $DEST_MAILBOX "setDefaultIsm(address)" $TEST_ISM_ADDRESS --from $MAILBOX_OWNER --rpc-url http://localhost:<DEST-PORT> --unlocked
448+
cast rpc anvil_stopImpersonatingAccount $MAILBOX_OWNER --rpc-url http://localhost:<DEST-PORT>
449+
```
450+
451+
**NOTE**: If the warp router has a custom ISM set (not using the mailbox default), you'll need to impersonate the router owner and call `setInterchainSecurityModule(address)` on the router instead.
452+
453+
#### 8b.3 Fund the Test Sender
454+
455+
```bash
456+
# Generate a test private key (or use a well-known anvil key)
457+
TEST_KEY="0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
458+
TEST_SENDER="0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" # Anvil account 0
459+
460+
# Fund with native gas on origin
461+
cast rpc anvil_setBalance $TEST_SENDER "0x56BC75E2D63100000" --rpc-url http://localhost:<ORIGIN-PORT>
462+
463+
# For collateral/ERC20 routes: mint or transfer tokens to the test sender
464+
# Option A: If the token has a mint function (e.g., test tokens)
465+
# cast send <token-address> "mint(address,uint256)" $TEST_SENDER 1000000000000000000 ...
466+
467+
# Option B: Impersonate a whale holder and transfer
468+
# Find a top holder from the fork state, impersonate, and transfer
469+
# cast rpc anvil_impersonateAccount <whale> --rpc-url http://localhost:<ORIGIN-PORT>
470+
# cast send <token-address> "transfer(address,uint256)" $TEST_SENDER <amount> --from <whale> --rpc-url http://localhost:<ORIGIN-PORT> --unlocked
471+
472+
# Option C: For native token routes, setBalance is sufficient (already done above)
473+
474+
# Also fund on destination for self-relay gas
475+
cast rpc anvil_setBalance $TEST_SENDER "0x56BC75E2D63100000" --rpc-url http://localhost:<DEST-PORT>
476+
```
477+
478+
#### 8b.4 Run the Transfer
479+
480+
```bash
481+
HYP_KEY=$TEST_KEY \
482+
hyperlane warp send \
483+
--registry <YOUR-ACTUAL-forked-registry-url-from-step-4> \
484+
--warp-route-id <warp-route-id> \
485+
--origin <origin-chain> \
486+
--destination <destination-chain> \
487+
--amount 1 \
488+
--relay \
489+
--skip-validation \
490+
--yes
491+
```
492+
493+
**Key flags:**
494+
495+
- `--relay` — Self-relay the message (no real relayer on forks)
496+
- `--skip-validation` — Skip balance/collateral checks that may fail on forks
497+
- `--amount 1` — Use smallest practical amount (1 wei or 1 unit)
498+
499+
#### 8b.5 Verify Result
500+
501+
- **Success**: The CLI should log `Transfer was self-relayed!` and show the message ID
502+
- **Failure**: Check the error output. Common issues:
503+
- `Ownable: caller is not the owner` on ISM bypass → wrong mailbox owner or router has custom ISM
504+
- `insufficient funds` → test sender not funded with tokens (for collateral routes)
505+
- `message already delivered`ISM bypass not working, retry with router-level ISM override
506+
- Timeout waiting for delivery → self-relay failed, check ISM was properly set
507+
508+
**Capture output** to `/tmp/warp-transfer-test.log` for the final report.
509+
510+
**NOTE**: This step is optional but strongly recommended. If it fails due to ISM complexity (e.g., routing ISMs, aggregation ISMs), document the failure and move on — the config check in Step 8 still validates the deployment.
511+
401512
### Step 9: Interpret Results
402513

403514
Analyze the warp check output carefully:
@@ -516,6 +627,14 @@ Create a comprehensive markdown report with the following sections:
516627

517628
[List of chains not modified and their expected violations]
518629

630+
## Transfer Test Results
631+
632+
- **Origin → Destination**: <chain-a><chain-b>
633+
- **Amount**: <amount>
634+
- **Result**: ✅ Success / ❌ Failed (reason)
635+
- **Message ID**: <id> (if successful)
636+
- **ISM Bypass**: Yes (TestIsm deployed at <address> set on destination mailbox)
637+
519638
## Decoded Transactions (Heimdall Output)
520639

521640
```json

0 commit comments

Comments
 (0)