Skip to content

Commit

Permalink
Move ethereum-relayer to relayer/ethereum
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Apr 3, 2024
1 parent 28667a5 commit dbccf92
Show file tree
Hide file tree
Showing 95 changed files with 30 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/bitcoin/ @evan-gray
/cosmwasm/ @nik-suri @kcsongor @a5-pickle
/ethereum/ @a5-pickle @gator-boi @kcsongor
/ethereum-relayer @nonergodic @gator-boi
/relayer/ethereum @nonergodic @gator-boi
/near/ @evan-gray @kcsongor
/solana/ @kcsongor @a5-pickle
/sui/ @kcsongor @a5-pickle @gator-boi
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ jobs:
uses: foundry-rs/foundry-toolchain@v1
- run: cd ethereum && make test-push0 && make test

relayer-ethereum:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16"
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- run: cd relayer/ethereum && make test-push0 && make test

ethereum-upgrade:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 3 additions & 3 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,11 @@ if solana or pythnet:
docker_build(
ref = "eth-node",
context = ".",
only = ["./ethereum", "./ethereum-relayer"],
only = ["./ethereum", "./relayer/ethereum"],
dockerfile = "./ethereum/Dockerfile",

# ignore local node_modules (in case they're present)
ignore = ["./ethereum/node_modules","./ethereum-relayer/node_modules"],
ignore = ["./ethereum/node_modules","./relayer/ethereum/node_modules"],
build_args = {"num_guardians": str(num_guardians), "dev": str(not ci)},

# sync external scripts for incremental development
Expand Down Expand Up @@ -523,7 +523,7 @@ if generic_relayer:
docker_build(
ref = "relayer-engine",
context = ".",
only = ["./relayer/generic_relayer", "./ethereum-relayer/ts-scripts/relayer/config"],
only = ["./relayer/generic_relayer", "./relayer/ethereum/ts-scripts/relayer/config"],
dockerfile = "relayer/generic_relayer/relayer-engine-v2/Dockerfile",
build_args = {"dev": str(not ci)}
)
Expand Down
4 changes: 2 additions & 2 deletions devnet/eth-devnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
command:
- /bin/sh
- -c
- "cd ../ethereum && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && cd ../ethereum-relayer && npm run deploy-relayers-evm1 && nc -lkn 2000"
- "cd ethereum && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && cd ../relayer/ethereum && npm run deploy-relayers-evm1 && nc -lkn 2000"
readinessProbe:
periodSeconds: 1
failureThreshold: 300
Expand All @@ -69,6 +69,6 @@ spec:
command:
- /bin/sh
- -c
- "cd ../ethereum && npx truffle exec mine.js"
- "cd ethereum && npx truffle exec mine.js"
---

4 changes: 2 additions & 2 deletions devnet/eth-devnet2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
command:
- /bin/sh
- -c
- "cd ../ethereum && sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1337/EVM_CHAIN_ID=1397/g' .env && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && cd ../ethereum-relayer && sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1337/EVM_CHAIN_ID=1397/g' .env && npm run deploy-relayers-evm2 && nc -lkn 2000"
- "cd ethereum && sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1337/EVM_CHAIN_ID=1397/g' .env && npm run migrate && npx truffle exec scripts/deploy_test_token.js && npx truffle exec scripts/register_all_chains.js && cd ../relayer/ethereum && sed -i 's/CHAIN_ID=0x2/CHAIN_ID=0x4/g;s/EVM_CHAIN_ID=1337/EVM_CHAIN_ID=1397/g' .env && npm run deploy-relayers-evm2 && nc -lkn 2000"
readinessProbe:
periodSeconds: 1
failureThreshold: 300
Expand All @@ -70,4 +70,4 @@ spec:
command:
- /bin/sh
- -c
- "cd ../ethereum && npx truffle exec mine.js"
- "cd ethereum && npx truffle exec mine.js"
9 changes: 5 additions & 4 deletions ethereum/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ RUN make build

### RELAYER ###

WORKDIR /home/node/app/ethereum-relayer
WORKDIR /home/node/app/relayer/ethereum

COPY --chown=node:node ethereum-relayer/package.json .
COPY --chown=node:node ethereum-relayer/package-lock.json .
COPY --chown=node:node relayer/ethereum/package.json .
COPY --chown=node:node relayer/ethereum/package-lock.json .
COPY --from=const-export --chown=node:node .env.0x .env


Expand All @@ -71,8 +71,9 @@ RUN rm -rf node_modules && mv node_modules_cache node_modules
ARG dev
ENV DEV=$dev

COPY --chown=node:node ethereum-relayer .
COPY --chown=node:node relayer/ethereum .
RUN make build

WORKDIR /home/node/app
ARG num_guardians
ENV NUM_GUARDIANS=$num_guardians
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion relayer/generic_relayer/relayer-engine-v2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ WORKDIR /home/node/app
# Fix git ssh error
RUN git config --global url."https://".insteadOf ssh://

COPY --chown=node:node ./ethereum-relayer/ts-scripts/relayer/config/ ./ethereum/ts-scripts/relayer/config/
COPY --chown=node:node ./relayer/ethereum/ts-scripts/relayer/config/ ./ethereum/ts-scripts/relayer/config/

#Path matters so as to not break imports
WORKDIR /home/node/app/relayer/generic_relayer/relayer-engine-v2/
Expand Down
2 changes: 1 addition & 1 deletion sdk/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"sideEffects": false,
"repository": "https://github.com/certusone/wormhole/tree/main/sdk/js",
"scripts": {
"build-contracts": "cd ../../ethereum && make forge_dependencies && npm run build && cd ../ethereum-relayer && make forge_dependencies && npm run build && cd ../sdk/js && node scripts/copyContracts.js",
"build-contracts": "cd ../../ethereum && make forge_dependencies && npm run build && cd ../relayer/ethereum && make forge_dependencies && npm run build && cd ../../sdk/js && node scripts/copyContracts.js",
"build-abis": "typechain --target=ethers-v5 --out-dir=src/ethers-contracts/abi src/abi/Wormhole.abi.json",
"build-idl": "node scripts/compileAnchorIdls.js",
"build-deps": "npm run build-abis && npm run build-contracts && npm run build-idl",
Expand Down
2 changes: 1 addition & 1 deletion sdk/js/scripts/copyContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ const copydir = require("copy-dir");
console.log("Copying from ../../ethereum/ethers-contracts");
copydir.sync("../../ethereum/ethers-contracts", "src/ethers-contracts");
copydir.sync(
"../../ethereum-relayer/ethers-contracts",
"../../relayer/ethereum/ethers-contracts",
"src/ethers-relayer-contracts"
);
6 changes: 3 additions & 3 deletions testing/Dockerfile.sdk.test
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
npm ci --prefix ethereum
COPY ethereum ./ethereum

COPY ethereum-relayer/package.json ethereum-relayer/package-lock.json ./ethereum-relayer/
COPY relayer/ethereum/package.json relayer/ethereum/package-lock.json ./relayer/ethereum/
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
npm ci --prefix ethereum-relayer
COPY ethereum-relayer ./ethereum-relayer
npm ci --prefix relayer/ethereum
COPY relayer/ethereum ./relayer/ethereum

COPY solana/idl ./solana/idl/

Expand Down

0 comments on commit dbccf92

Please sign in to comment.