Skip to content

Commit

Permalink
Merge pull request #15 from primevprotocol/rm-bridge
Browse files Browse the repository at this point in the history
refactor: remove bridge
  • Loading branch information
shaspitz authored Jan 11, 2024
2 parents 78bef5e + 1995e16 commit 35aff84
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 394 deletions.
28 changes: 8 additions & 20 deletions geth-poa/Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
# Prod targets ref the amd agent image for this commit:
# https://github.com/hyperlane-xyz/hyperlane-monorepo/commit/69850642365251e16b9f23b87d6caf187036b3ee

up-prod-settlement:
up-prod:
@if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi
AGENT_BASE_IMAGE=nil SETTLEMENT_RPC_URL=nil docker compose --profile settlement up -d --build
DD_KEY=nil docker compose --profile settlement up -d --build

up-dev-settlement:
up-dev:
@if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi
AGENT_BASE_IMAGE=nil SETTLEMENT_RPC_URL=nil docker compose --profile settlement up -d --build

up-dev-bridge:
@if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi
AGENT_BASE_IMAGE=shaspitz/hyperlane-agent-mac:6985064 SETTLEMENT_RPC_URL=http://172.29.0.98:8545 docker compose --profile bridge up -d --build

up-prod-bridge:
@if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi
AGENT_BASE_IMAGE=gcr.io/abacus-labs-dev/hyperlane-agent@sha256:854f92966eac6b49e5132e152cc58168ecdddc76c2d390e657b81bdaf1396af0 SETTLEMENT_RPC_URL=http://172.29.0.98:8545 docker compose --profile bridge up -d --build
DD_KEY=nil docker compose --profile settlement up -d --build

up-dev-local-l1:
@if [ ! -f .env ]; then echo "Error: .env file not found. Please populate the .env file before running this command."; exit 1; fi
AGENT_BASE_IMAGE=nil SETTLEMENT_RPC_URL=nil docker compose --profile settlement --profile local_l1 up -d
DD_KEY=nil docker compose --profile settlement --profile local_l1 up -d

down:
AGENT_BASE_IMAGE=nil SETTLEMENT_RPC_URL=nil docker compose --profile settlement --profile bridge --profile prod_agents --profile local_l1 down
docker compose --profile settlement --profile prod_agents --profile local_l1 down

clean-dbs:
@read -p "WARNING: This command will wipe all persistent disk data relevant to the containers. Press enter to continue or Ctrl+C to cancel." _
-docker compose --profile settlement --profile bridge --profile local_l1 down --rmi all --volumes
-docker compose --profile settlement --profile bridge --profile local_l1 rm -fv
-docker compose --profile settlement --profile local_l1 down --rmi all --volumes
-docker compose --profile settlement --profile local_l1 rm -fv
docker image prune -f

pull-image:
Expand All @@ -45,7 +37,3 @@ create-docker-network:
deploy-create2:
@echo "Deploying create2 deployment proxy..."
./util/deploy_create2.sh "http://localhost:8545"

print-warp-deploy:
@echo "Printing hyperlane warp deployment artifact"
docker run --rm -v geth-poa_hyperlane-deploy-artifacts:/data alpine cat /data/warp-deployment.json
34 changes: 12 additions & 22 deletions geth-poa/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# geth-poa

Tool for spinning up a POA ethereum sidechain bridged to sepolia via [hyperlane](https://www.hyperlane.xyz/) token warp route.
Tool for spinning up a POA ethereum sidechain.

## Metrics

Expand All @@ -10,22 +10,7 @@ Metrics recorded by bootnode are exposed to host at http://127.0.0.1:6060/debug/

All relevant accounts are funded on sidechain genesis, you may need to fund these accounts on L1 with faucets. See [hyperlane docs](https://docs.hyperlane.xyz/docs/deploy/deploy-hyperlane#1.-setup-keys).

## Hyperlane Contract deployer

Address: `0xBcA333b67fb805aB18B4Eb7aa5a0B09aB25E5ce2`

Note if the relayer is emitting errors related to unexpected contract routing, try redeploying the hyperlane contracts using a new key pair. It's likely the current deployments are clashing with previous deployments on Sepolia.

To properly set a new hyperlane deployer:
* Generate a new key pair (ex: `cast wallet new`)
* Send or [mine](https://sepolia-faucet.pk910.de/) some Sepolia ETH to `Address`
* replace `Address` above for book keeping
* replace `CONTRACT_DEPLOYER_PRIVATE_KEY` in `.env`
* allocate funds to `Address` in the allocs field of `genesis.json`

Note the deployer of [primev contracts](https://github.com/primevprotocol/contracts) can be a separate account.

## Validator Accounts (also POA signers)
## POA signers

### Node1

Expand All @@ -35,10 +20,6 @@ Address: `0xd9cd8E5DE6d55f796D980B818D350C0746C25b97`

Address: `0x788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee4`

## Relayer

Address: `0x0DCaa27B9E4Db92F820189345792f8eC5Ef148F6`

## Create2 Deployment Proxy

A Create2 deployment proxy is can be deployed to this chain at `0x4e59b44847b379578588920ca78fbf26c0b4956c`. see more [here](https://github.com/primevprotocol/deterministic-deployment-proxy). Note this proxy is required to deploy the whitelist bridge contract, and is consistent to foundry's suggested process for create2 deployment. The deployment signer, `0x3fab184622dc19b6109349b94811493bf2a45362` is funded on genesis.
Expand All @@ -49,4 +30,13 @@ A Create2 deployment proxy is can be deployed to this chain at `0x4e59b44847b379
2. Run `$ make up-dev-build` to run the whole stack including bridge, or `$ make up-dev-settlement` to bring up only the settlement layer.

## Starter .env file
To get a standard starter .env file from primev internal development, [click here.](https://www.notion.so/Private-keys-and-env-for-settlement-layer-245a4f3f4fe040a7b72a6be91131d9c2?pvs=4)

The chain must be started with two private keys for POA signers.

.env file should look like:
```
NODE1_PRIVATE_KEY=0xpk1
NODE2_PRIVATE_KEY=0xpk2
```

To get a standard starter .env file from primev internal development, [click here.](https://www.notion.so/Private-keys-and-env-for-settlement-layer-245a4f3f4fe040a7b72a6be91131d9c2?pvs=4), populate only the `NODE1_PRIVATE_KEY` and `NODE2_PRIVATE_KEY` fields.
120 changes: 1 addition & 119 deletions geth-poa/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,119 +218,6 @@ services:
profiles:
- local_l1

hyperlane-deployer:
build:
context: ./hyperlane-deployer
dockerfile: Dockerfile
healthcheck:
test: ["CMD-SHELL", "test -f /hyperlane-monorepo/artifacts/done-warp-route || exit 1"]
interval: 5s
retries: 100
environment:
- HYPERLANE_DEPLOYER_PRIVATE_KEY=${HYPERLANE_DEPLOYER_PRIVATE_KEY}
networks:
primev_net:
ipv4_address: '172.29.0.50'
volumes:
- hyperlane-deploy-artifacts:/hyperlane-monorepo/artifacts
profiles:
- bridge

hyperlane-validator1:
build:
context: ./hyperlane-validator
dockerfile: Dockerfile
args:
# Image can be built for arm64 with https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/build.sh
- AGENT_BASE_IMAGE=${AGENT_BASE_IMAGE}
- SETTLEMENT_RPC_URL=${SETTLEMENT_RPC_URL}
# Reuse geth private key for validator
command: ./validator --validator.key ${NODE1_PRIVATE_KEY} --chains.mevcommitsettlement.signer.key ${NODE1_PRIVATE_KEY} --checkpointSyncer.path /val1-sigs
# TODO: evaluate why container needs to run as root
user: "0:0"
depends_on:
hyperlane-deployer:
condition: service_healthy
networks:
primev_net:
ipv4_address: '172.29.0.75'
volumes:
- hyperlane-deploy-artifacts:/deploy-artifacts
- hyperlane-validator1-sigs:/val1-sigs
- hyperlane-validator1-db:/val-db
profiles:
- bridge

hyperlane-validator2:
build:
context: ./hyperlane-validator
dockerfile: Dockerfile
args:
- AGENT_BASE_IMAGE=${AGENT_BASE_IMAGE}
- SETTLEMENT_RPC_URL=${SETTLEMENT_RPC_URL}
# Reuse geth private key for validator
command: ./validator --validator.key ${NODE2_PRIVATE_KEY} --chains.mevcommitsettlement.signer.key ${NODE2_PRIVATE_KEY} --checkpointSyncer.path /val2-sigs
# TODO: evaluate why container needs to run as root
user: "0:0"
depends_on:
hyperlane-deployer:
condition: service_healthy
networks:
primev_net:
ipv4_address: '172.29.0.76'
volumes:
- hyperlane-deploy-artifacts:/deploy-artifacts
- hyperlane-validator2-sigs:/val2-sigs
- hyperlane-validator2-db:/val-db
profiles:
- bridge

hyperlane-relayer:
build:
context: ./hyperlane-relayer
dockerfile: Dockerfile
args:
- AGENT_BASE_IMAGE=${AGENT_BASE_IMAGE}
user: "0:0"
depends_on:
hyperlane-deployer:
condition: service_healthy
environment:
- RELAYER_PRIVATE_KEY=${RELAYER_PRIVATE_KEY}
networks:
primev_net:
ipv4_address: '172.29.0.77'
volumes:
- hyperlane-deploy-artifacts:/deploy-artifacts
- hyperlane-validator1-sigs:/val1-sigs
- hyperlane-validator2-sigs:/val2-sigs
- hyperlane-relayer-db:/relayer-db
profiles:
- bridge

frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_WALLET_CONNECT_ID=${NEXT_PUBLIC_WALLET_CONNECT_ID}
depends_on:
hyperlane-deployer:
condition: service_healthy
environment:
- NEXT_PUBLIC_WALLET_CONNECT_ID=${NEXT_PUBLIC_WALLET_CONNECT_ID}
- SETTLEMENT_RPC_URL=${SETTLEMENT_RPC_URL}
- PUBLIC_SETTLEMENT_RPC_URL=${PUBLIC_SETTLEMENT_RPC_URL}
networks:
primev_net:
ipv4_address: '172.29.0.90'
ports:
- 80:3000
volumes:
- hyperlane-deploy-artifacts:/deploy-artifacts
profiles:
- bridge

datadog-agent:
image: gcr.io/datadoghq/agent:latest
restart: always
Expand Down Expand Up @@ -371,9 +258,4 @@ volumes:
geth-data-l1-bootnode:
geth-data-l1-first-signer:
geth-data-l1-second-signer:
hyperlane-deploy-artifacts:
hyperlane-validator1-sigs:
hyperlane-validator2-sigs:
hyperlane-validator1-db:
hyperlane-validator2-db:
hyperlane-relayer-db:

18 changes: 0 additions & 18 deletions geth-poa/frontend/Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions geth-poa/frontend/entrypoint.sh

This file was deleted.

27 changes: 0 additions & 27 deletions geth-poa/hyperlane-deployer/Dockerfile

This file was deleted.

41 changes: 0 additions & 41 deletions geth-poa/hyperlane-deployer/chain-config.yml

This file was deleted.

Loading

0 comments on commit 35aff84

Please sign in to comment.