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
byeongsu-hong authored May 13, 2024
2 parents b31375d + e37bd8a commit adbb81b
Show file tree
Hide file tree
Showing 808 changed files with 50,226 additions and 22,819 deletions.
5 changes: 5 additions & 0 deletions .changeset/green-ads-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Default to home directory for local registry
5 changes: 5 additions & 0 deletions .changeset/lemon-horses-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': patch
---

Improve defaults in chain config command
5 changes: 0 additions & 5 deletions .changeset/orange-kangaroos-allow.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/sour-bats-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hyperlane-xyz/utils': minor
'@hyperlane-xyz/sdk': minor
---

Implement aggregation and multisig ISM metadata encoding
5 changes: 5 additions & 0 deletions .codespell/.codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = .git,node_modules,yarn.lock,Cargo.lock,./typescript/helloworld
count =
quiet-level = 3
ignore-words = ./.codespell/ignore.txt
7 changes: 7 additions & 0 deletions .codespell/ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
crate
receipient
received
receivedFrom
ser
readded
re-use
1 change: 1 addition & 0 deletions .codespell/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
codespell==2.2.6
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
coverage
coverage
*.cts
9 changes: 7 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint","jest"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
Expand Down Expand Up @@ -47,6 +47,11 @@
},
"extendDefaults": true
}
]
],
"jest/no-disabled-tests": "warn",
"jest/no-focused-tests": "error",
"jest/no-identical-title": "error",
"jest/prefer-to-have-length": "warn",
"jest/valid-expect": "error"
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
typescript/sdk/src/cw-types/*.types.ts linguist-generated=true
rust/chains/hyperlane-ethereum/abis/*.abi.json linguist-generated=true
solidity/contracts/interfaces/avs/*.sol linguist-vendored=true
solidity/contracts/avs/ECDSA*.sol linguist-vendored=true
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# File extension owners

*.sol @yorhodes @tkporter @aroralanuk
*.ts @yorhodes @jmrossy @nambrot
*.sol @yorhodes @tkporter @aroralanuk @nbayindirli
*.ts @yorhodes @jmrossy @nambrot @nbayindirli
*.rs @tkporter @daniel-savu
*.md @Skunkchain @nambrot @avious00

# Package owners

## Contracts
solidity/ @yorhodes @tkporter @aroralanuk
solidity/ @yorhodes @tkporter @aroralanuk @nbayindirli

## Agents
rust/ @tkporter @daniel-savu
Expand All @@ -17,13 +17,13 @@ rust/ @tkporter @daniel-savu
typescript/sdk @yorhodes @jmrossy

## Token
typescript/token @yorhodes @jmrossy @tkporter @aroralanuk
typescript/token @yorhodes @jmrossy @tkporter @aroralanuk @nbayindirli

## Hello World
typescript/helloworld @yorhodes @nambrot

## CLI
typescript/cli @jmrossy @yorhodes @aroralanuk
typescript/cli @jmrossy @yorhodes @aroralanuk @nbayindirli

## Infra
typescript/infra @tkporter @nambrot
35 changes: 35 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# A Github action that using codespell to check spelling.
# see .codespell/* for configs
# https://github.com/codespell-project/codespell

name: codespell

on:
# Triggers the workflow on push or pull request against main
push:
branches: [main]
pull_request:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
codespell:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- name: Install prerequisites
run: sudo pip install -r ./.codespell/requirements.txt

- name: Spell check
run: codespell --config=./.codespell/.codespellrc
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
node-version: 18.x

- name: Install Dependencies
run: yarn
run: yarn install --immutable

- name: Create Release PR or Publish to NPM
id: changesets
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: static-analysis

on:
# Triggers the workflow on pull request against main
pull_request:
push:
# Triggers the workflow on push to main
branches: [main]
paths:
- 'solidity/**'
- '.github/workflows/static-analysis.yml'
# Triggers the workflow on pull request
pull_request:
paths:
- 'solidity/**'
- '.github/workflows/static-analysis.yml'

jobs:
slither:
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/storage-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,4 @@ jobs:

# Compare outputs
- name: Compare outputs
continue-on-error: true # diff exits with 1 if files differ
run: diff --unified solidity/base-storage solidity/HEAD-storage > layout.diff

- name: Comment PR with layout diff
uses: yorhodes/[email protected]
with:
header: Storage Layout Diff
filePath: layout.diff
mdLanguage: diff
comment_tag: storagelayoutdiff
run: diff --unified solidity/base-storage solidity/HEAD-storage
82 changes: 51 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
branches:
- '*' # run against all branches
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand All @@ -14,9 +15,11 @@ concurrency:
cancel-in-progress: ${{ github.ref_name != 'main' }}

env:
DEBUG: 'hyperlane:*'
LOG_LEVEL: DEBUG
LOG_FORMAT: PRETTY
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
REGISTRY_URI: ../../node_modules/@hyperlane-xyz/registry/dist

jobs:
yarn-install:
Expand Down Expand Up @@ -132,14 +135,17 @@ jobs:
- name: Unit Tests
run: yarn test:ci

metadata-check:
agent-configs:
runs-on: ubuntu-latest
needs: [yarn-build]
strategy:
fail-fast: false
matrix:
environment: [mainnet3, testnet4]
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
submodules: recursive
fetch-depth: 0

- name: yarn-cache
Expand All @@ -158,12 +164,23 @@ jobs:
!./rust
key: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Metadata Health Check
run: DEBUG=hyperlane yarn workspace @hyperlane-xyz/sdk run test:metadata
- name: Generate ${{ matrix.environment }} agent config
run: |
cd typescript/infra
yarn tsx ./scripts/agents/update-agent-config.ts -e ${{ matrix.environment }}
CHANGES=$(git status -s)
if [[ ! -z $CHANGES ]]; then
echo "Changes found in agent config: $CHANGES"
exit 1
fi
e2e:
e2e-matrix:
runs-on: larger-runner
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main')
needs: [yarn-build]
strategy:
matrix:
e2e-type: [cosmwasm, non-cosmwasm]
steps:
- uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -220,30 +237,43 @@ jobs:
~/.cargo
key: ${{ runner.os }}-cargo-cache-${{ hashFiles('./rust/Cargo.lock') }}

- name: agent build
run: cargo build --release --bin run-locally
working-directory: ./rust

- name: agent tests with CosmWasm
run: RUST_BACKTRACE=1 cargo test --release --package run-locally --bin run-locally --features cosmos -- cosmos::test --nocapture
run: cargo test --release --package run-locally --bin run-locally --features cosmos -- cosmos::test --nocapture
if: matrix.e2e-type == 'cosmwasm'
working-directory: ./rust
env:
RUST_BACKTRACE: 'full'

- name: agent tests excluding CosmWasm
run: ./target/release/run-locally
run: cargo run --release --bin run-locally
if: matrix.e2e-type == 'non-cosmwasm'
working-directory: ./rust
env:
E2E_CI_MODE: 'true'
E2E_CI_TIMEOUT_SEC: '600'
E2E_KATHY_MESSAGES: '20'
RUST_BACKTRACE: 'full'

e2e:
runs-on: ubuntu-latest
needs: [e2e-matrix]
if: always() # This ensures that the job runs even if the e2e jobs fail
steps:
- name: Report Matrix Result
run: |
echo "All e2e-matrix jobs have completed."
# You can add additional commands here to report the result as needed
cli-e2e:
runs-on: larger-runner
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main')
needs: [yarn-build]
strategy:
matrix:
include:
- hook: preset_hook_enabled
- hook: configure_hook_enabled
- test-type: preset_hook_enabled
- test-type: configure_hook_enabled
- test-type: pi_with_core_chain
steps:
- uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -300,32 +330,22 @@ jobs:
~/.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'
- name: cli e2e tests
run: ./typescript/cli/ci-test.sh ${{ matrix.test-type }}

env-test:
runs-on: ubuntu-latest
needs: [yarn-build]
strategy:
fail-fast: false
matrix:
environment: [mainnet3]
chain: [ethereum, arbitrum, optimism, inevm, viction]
module: [core, igp]
include:
- environment: testnet4
chain: sepolia
module: core
- environment: mainnet3
chain: arbitrum
module: core
- environment: mainnet3
chain: inevm
module: core
- environment: mainnet3
chain: viction
module: core

steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "solidity/lib/forge-std"]
path = solidity/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "solidity/lib/fx-portal"]
path = solidity/lib/fx-portal
url = https://github.com/0xPolygon/fx-portal
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

yarn lint-staged

echo "📝 If you haven't yet, please add a changeset for your changes via 'yarn changeset'"

# if any *.rs files have changed
if git diff --staged --exit-code --name-only | grep -q -E ".*\.rs$"; then
echo "Running cargo fmt pre-commit hook"
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"importOrder": ["^@hyperlane-xyz/(.*)$", "^../(.*)$", "^./(.*)$"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrderParserPlugins": ["importAssertions", "typescript", "jsx"],
"plugins": ["prettier-plugin-solidity", "@trivago/prettier-plugin-sort-imports"]
}
Loading

0 comments on commit adbb81b

Please sign in to comment.