fix:populate igp in agent config from cli regardless of hook config (#3237)

### Description

- add igp as the zero address at the last step right writing it to file

### Drive-by changes

None

### Related issues

- fixes https://github.com/hyperlane-xyz/issues/issues/1030

### Backward compatibility

Yes

### Testing

e2e
pull/3232/head
Kunal Arora 9 months ago committed by GitHub
parent f11878ad08
commit 7ff826a8f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      .changeset/fifty-chicken-compete.md
  2. 73
      .github/workflows/test.yml
  3. 11
      typescript/cli/ci-test.sh
  4. 6
      typescript/cli/src/deploy/core.ts

@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---
Merged agent addresses will now include igp as the zero address if not configured as the hook

@ -236,8 +236,77 @@ jobs:
E2E_CI_TIMEOUT_SEC: '600'
E2E_KATHY_MESSAGES: '20'
- name: cli e2e tests
run: ./typescript/cli/ci-test.sh
cli-e2e:
runs-on: larger-runner
needs: [yarn-build]
strategy:
matrix:
include:
- hook: preset_hook_enabled
- hook: configure_hook_enabled
steps:
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
- name: foundry-install
uses: onbjerg/foundry-toolchain@v1
- name: setup rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Free disk space
run: |
# Based on https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install mold linker
uses: rui314/setup-mold@v1
with:
mold-version: 2.0.0
make-default: true
- name: yarn-cache
uses: actions/cache@v3
with:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
- name: build-cache
uses: actions/cache@v3
with:
path: |
./*
!./rust
key: ${{ github.event.pull_request.head.sha || github.sha }}
- name: cargo-cache
uses: actions/cache@v3
with:
path: |
~/.cargo
key: ${{ runner.os }}-cargo-cache-${{ hashFiles('./rust/Cargo.lock') }}
- name: cli e2e tests with preset hook config
run: ./typescript/cli/ci-test.sh false
if: matrix.hook == 'preset_hook_enabled'
- name: cli e2e tests with configured hook config
run: ./typescript/cli/ci-test.sh true
if: matrix.hook == 'configure_hook_enabled'
env-test:
runs-on: ubuntu-latest

@ -2,6 +2,14 @@
# NOTE: This script is intended to be run from the root of the repo
# the first arg to this script is a flag to enable the hook config as part of core deployment
# motivation is to test both the bare bone deployment (included in the docs) and the deployment with the routing over igp hook (which is closer to production deployment)
HOOK_FLAG=$1
if [ -z "$HOOK_FLAG" ]; then
echo "Usage: fork.sh <hook>"
exit 1
fi
# Optional cleanup for previous runs, useful when running locally
pkill -f anvil
rm -rf /tmp/anvil*
@ -33,13 +41,14 @@ export DEBUG=hyperlane:*
DEPLOYER=$(cast rpc eth_accounts | jq -r '.[0]')
BEFORE=$(cast balance $DEPLOYER --rpc-url http://localhost:8545)
echo "Deploying contracts to anvil1 and anvil2"
yarn workspace @hyperlane-xyz/cli run hyperlane deploy core \
--targets anvil1,anvil2 \
--chains ./examples/anvil-chains.yaml \
--artifacts /tmp/empty-artifacts.json \
$(if [ "$HOOK_FLAG" == "true" ]; then echo "--hook ./examples/hooks.yaml"; fi) \
--ism ./examples/ism.yaml \
--hook ./examples/hooks.yaml \
--out /tmp \
--key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--yes

@ -484,6 +484,12 @@ async function writeAgentConfig(
artifacts,
) as ChainMap<HyperlaneDeploymentArtifacts>;
for (const chain of chains) {
if (!mergedAddressesMap[chain].interchainGasPaymaster) {
mergedAddressesMap[chain].interchainGasPaymaster =
ethers.constants.AddressZero;
}
}
const agentConfig = buildAgentConfig(
chains, // Use only the chains that were deployed to
multiProvider,

Loading…
Cancel
Save