Skip to content

Commit

Permalink
Merge branch 'main' into kunal/fix-fallback-ism-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Dec 4, 2023
2 parents 72823d2 + d0c1f8f commit f9af464
Show file tree
Hide file tree
Showing 36 changed files with 735 additions and 551 deletions.
7 changes: 7 additions & 0 deletions .changeset/odd-keys-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@hyperlane-xyz/cli': minor
'@hyperlane-xyz/infra': patch
'@hyperlane-xyz/sdk': patch
---

Allow CLI to accept hook as a config
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"no-extra-boolean-cast": ["error"],
"no-ex-assign": ["error"],
"no-constant-condition": ["off"],
"guard-for-in": ["error"],
"@typescript-eslint/ban-ts-comment": ["off"],
"@typescript-eslint/explicit-module-boundary-types": ["off"],
"@typescript-eslint/no-explicit-any": ["off"],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"clean": "yarn workspaces foreach --all --parallel run clean",
"prettier": "yarn workspaces foreach --since --parallel run prettier",
"lint": "yarn workspaces foreach --since --parallel run lint",
"test": "yarn workspaces foreach --since --parallel run test",
"test": "yarn workspaces foreach --all --parallel run test",
"coverage": "yarn workspaces foreach --since --parallel run coverage",
"version:prepare": "yarn changeset version && yarn workspaces foreach --all --parallel run version:update && yarn install --no-immutable",
"version:check": "yarn changeset status",
Expand Down
2 changes: 1 addition & 1 deletion typescript/cli/ci-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ yarn workspace @hyperlane-xyz/cli run hyperlane deploy core \
--chains ./examples/anvil-chains.yaml \
--artifacts /tmp/empty-artifacts.json \
--ism ./examples/ism.yaml \
--hook ./examples/hook-config.yaml \
--hook ./examples/hooks.yaml \
--out /tmp \
--key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--yes
Expand Down
18 changes: 0 additions & 18 deletions typescript/cli/examples/hook-config.yaml

This file was deleted.

66 changes: 66 additions & 0 deletions typescript/cli/examples/hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# A config to define the hooks for core contract deployments
# Ideally, use the `hyperlane config create hooks` command to generate this file
# but you we can refer to https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/hook/types.ts for the matching types

# HooksConfig:
# required: HookConfig
# default: HookConfig

# HookConfig:
# type: HookType
# ... hook-specific config

# HookType:
# - merkleTreeHook
# - domainRoutingHook
# - interchainGasPaymaster
# - protocolFee
# - aggregationHook
# - opStack (not yet supported)

anvil1:
required:
type: protocolFee
maxProtocolFee: '1000000000000000000' # in wei (string)
protocolFee: '200000000000000' # in wei (string)
beneficiary: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
owner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
default:
type: domainRoutingHook
owner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
domains:
anvil2:
type: aggregationHook
hooks:
- type: merkleTreeHook
- type: interchainGasPaymaster
beneficiary: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
owner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
oracleKey: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
overhead:
anvil2: 50000 # gas amount (number)
gasOracleType:
anvil2: StorageGasOracle
anvil2:
required:
type: protocolFee
maxProtocolFee: '1000000000000000000'
protocolFee: '200000000000000'
beneficiary: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
owner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
default:
type: domainRoutingHook
owner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
domains:
anvil1:
type: aggregationHook
hooks:
- type: merkleTreeHook
- type: interchainGasPaymaster
beneficiary: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
owner: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
oracleKey: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'
overhead:
anvil1: 50000
gasOracleType:
anvil1: StorageGasOracle
8 changes: 4 additions & 4 deletions typescript/cli/src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CommandModule } from 'yargs';

import { log, logGreen } from '../../logger.js';
import { createChainConfig, readChainConfigs } from '../config/chain.js';
import { createHookConfig } from '../config/hooks.js';
import { createHooksConfigMap } from '../config/hooks.js';
import { createIsmConfigMap, readIsmConfig } from '../config/ism.js';
import {
createMultisigConfig,
Expand Down Expand Up @@ -96,8 +96,8 @@ const createIsmConfigCommand: CommandModule = {
};

const createHookConfigCommand: CommandModule = {
command: 'hook',
describe: 'Create a new Hook config',
command: 'hooks',
describe: 'Create a new hooks config (required & default)',
builder: (yargs) =>
yargs.options({
output: outputFileOption('./configs/hooks.yaml'),
Expand All @@ -108,7 +108,7 @@ const createHookConfigCommand: CommandModule = {
const format: FileFormat = argv.format;
const outPath: string = argv.output;
const chainConfigPath: string = argv.chains;
await createHookConfig({ format, outPath, chainConfigPath });
await createHooksConfigMap({ format, outPath, chainConfigPath });
process.exit(0);
},
};
Expand Down
Loading

0 comments on commit f9af464

Please sign in to comment.