diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index e61289c0c2..9118edce07 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -589,7 +589,6 @@ func (c *Clique) FinalizeAndAssemble(chain consensus.ChainHeaderReader, header * // Assemble and return the final block for sealing. block := types.NewBlock(header, txs, nil, receipts, trie.NewStackTrie(nil)) - log.Info("block_size_in_bytes: %v", int64(block.Size())) if metrics.Enabled { metrics.GetOrRegisterGauge(blockSizeGaugeName, nil).Update(int64(block.Size())) } diff --git a/geth-poa/.env.example b/geth-poa/.env.example new file mode 100644 index 0000000000..d8def53399 --- /dev/null +++ b/geth-poa/.env.example @@ -0,0 +1,6 @@ +CONTRACT_DEPLOYER_PRIVATE_KEY= +NODE1_PRIVATE_KEY= +NODE2_PRIVATE_KEY= +RELAYER_PRIVATE_KEY= +NEXT_PUBLIC_WALLET_CONNECT_ID= +DD_KEY= diff --git a/geth-poa/.gitignore b/geth-poa/.gitignore new file mode 100644 index 0000000000..4c49bd78f1 --- /dev/null +++ b/geth-poa/.gitignore @@ -0,0 +1 @@ +.env diff --git a/geth-poa/Dockerfile b/geth-poa/Dockerfile new file mode 100644 index 0000000000..4e0c12b9fd --- /dev/null +++ b/geth-poa/Dockerfile @@ -0,0 +1,26 @@ +FROM golang:1.21-alpine AS builder + +RUN apk add --no-cache gcc musl-dev linux-headers git make + +COPY ../go.mod /go-ethereum/ +COPY ../go.sum /go-ethereum/ +RUN cd /go-ethereum && go mod download + +ADD .. /go-ethereum +RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth + +FROM alpine:latest + +RUN apk add --no-cache jq + +COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ + +COPY geth-poa/genesis.json /genesis.json + +COPY geth-poa/entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +EXPOSE 8545 6060 + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/geth-poa/Makefile b/geth-poa/Makefile new file mode 100644 index 0000000000..bfdab8ffcb --- /dev/null +++ b/geth-poa/Makefile @@ -0,0 +1,37 @@ +# Prod targets reg the amd agent image for this commit: +# https://github.com/hyperlane-xyz/hyperlane-monorepo/commit/69850642365251e16b9f23b87d6caf187036b3ee +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=gcr.io/abacus-labs-dev/hyperlane-agent@sha256:854f92966eac6b49e5132e152cc58168ecdddc76c2d390e657b81bdaf1396af0 L2_NODE_URL=http://34.215.163.180:8545 docker compose --profile settlement --profile bridge --profile prod_agents up -d + +up-prod-build: + @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 L2_NODE_URL=http://34.215.163.180:8545 docker compose --profile settlement --profile bridge --profile prod_agents up -d --build + +up-prod-settlement: + @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 L2_NODE_URL=nil docker compose --profile settlement up -d --build + +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=shaspitz/hyperlane-agent-mac:6985064 L2_NODE_URL=http://localhost:8545 docker compose --profile settlement --profile bridge up -d + +up-dev-build: + @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 L2_NODE_URL=http://localhost:8545 docker compose --profile settlement --profile bridge up -d --build + +up-dev-settlement: + @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 L2_NODE_URL=http://localhost:8545 docker compose --profile settlement up -d --build + +down: + AGENT_BASE_IMAGE=nil L2_NODE_URL=nil docker compose --profile settlement --profile bridge --profile prod_agents 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 down --rmi all --volumes + -docker compose --profile settlement --profile bridge rm -fv + docker image prune -f + +pull-image: + docker pull shaspitz/geth-poa:v0 diff --git a/geth-poa/README.md b/geth-poa/README.md new file mode 100644 index 0000000000..031d2481bc --- /dev/null +++ b/geth-poa/README.md @@ -0,0 +1,45 @@ +# geth-poa + +Tool for spinning up a POA ethereum sidechain bridged to goerli via [hyperlane](https://www.hyperlane.xyz/) token warp route. + +## TODOs + +* add container which stress tests network with txs +* merge branch with local anvil l1 once hyperlane v3 is released -> useful for mev-commit docker testing + +## Metrics + +Metrics recorded by bootnode are exposed to host at http://127.0.0.1:6060/debug/metrics + +## Key Summary + +Testnet private keys are in notion, and need to be copied into an .env. + +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). + +## Contract deployer + +Address: `0xBe3dEF3973584FdcC1326634aF188f0d9772D57D` + +Note if the relayer is emitting errors related to unexpected contract routing, try using a new deployer key pair. It's likely that the current bridge contract deployments are clashing with previous deployments. + +You'd need to replace `Address` above, the allocs field of `genesis.json`, and the `CONTRACT_DEPLOYER_PRIVATE_KEY` in `.env`. + +## Validator Accounts (also POA signers) + +### Node1 + +Address: `0xd9cd8E5DE6d55f796D980B818D350C0746C25b97` + +### Node2 + +Address: `0x788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee4` + +## Relayer + +Address: `0x0DCaa27B9E4Db92F820189345792f8eC5Ef148F6` + +## Local Run + +1. To run the local setup, set the .env file with the keys specified in .env.example. +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. diff --git a/geth-poa/docker-compose.yml b/geth-poa/docker-compose.yml new file mode 100644 index 0000000000..feb89657e4 --- /dev/null +++ b/geth-poa/docker-compose.yml @@ -0,0 +1,251 @@ +version: '3' +services: + bootnode: + build: + context: .. + dockerfile: geth-poa/Dockerfile + environment: + - GETH_NODE_TYPE=bootnode + - BOOT_KEY=7b548c1c0fbe80ef1eb0aaec2edf26fd20fb0d758e94948cf6c5f2a486e735f6 + networks: + poa_net: + ipv4_address: '172.13.0.100' + ports: + - 8545:8545 + - 8546:8546 + - 6060:6060 # metrics server @ /debug/metrics + volumes: + - geth-data-bootnode:/data + profiles: + - settlement + labels: + com.datadoghq.ad.check_names: '["openmetrics"]' + com.datadoghq.ad.init_configs: '[{}]' + com.datadoghq.ad.instances: | + [ + { + "openmetrics_endpoint": "http://%%host%%:6060/debug/metrics/prometheus", + "namespace": "geth-poa", + "metrics": [ + "txpool*", + "trie*", + "system*", + "state*", + "rpc*", + "p2p*", + "eth*", + "chain*" + ] + } + ] + + node1: + build: + context: .. + dockerfile: geth-poa/Dockerfile + environment: + - GETH_NODE_TYPE=signer + - BLOCK_SIGNER_ADDRESS=0xd9cd8E5DE6d55f796D980B818D350C0746C25b97 + - BLOCK_SIGNER_PRIVATE_KEY=${NODE1_PRIVATE_KEY} + networks: + poa_net: + ipv4_address: '172.13.0.2' + volumes: + - geth-data-node1:/data + profiles: + - settlement + labels: + com.datadoghq.ad.check_names: '["openmetrics"]' + com.datadoghq.ad.init_configs: '[{}]' + com.datadoghq.ad.instances: | + [ + { + "openmetrics_endpoint": "http://%%host%%:6060/debug/metrics/prometheus", + "namespace": "geth-poa", + "metrics": [ + "clique*" + ] + } + ] + + + node2: + build: + context: .. + dockerfile: geth-poa/Dockerfile + environment: + - GETH_NODE_TYPE=signer + - BLOCK_SIGNER_ADDRESS=0x788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee4 + - BLOCK_SIGNER_PRIVATE_KEY=${NODE2_PRIVATE_KEY} + networks: + poa_net: + ipv4_address: '172.13.0.3' + volumes: + - geth-data-node2:/data + profiles: + - settlement + labels: + com.datadoghq.ad.check_names: '["openmetrics"]' + com.datadoghq.ad.init_configs: '[{}]' + com.datadoghq.ad.instances: | + [ + { + "openmetrics_endpoint": "http://%%host%%:6060/debug/metrics/prometheus", + "namespace": "geth-poa", + "metrics": [ + "clique*" + ] + } + ] + + + 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: + - CONTRACT_DEPLOYER_PRIVATE_KEY=${CONTRACT_DEPLOYER_PRIVATE_KEY} + networks: + poa_net: + ipv4_address: '172.13.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} + # 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: + poa_net: + ipv4_address: '172.13.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} + # 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: + poa_net: + ipv4_address: '172.13.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: + poa_net: + ipv4_address: '172.13.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} + - L2_NODE_URL=${L2_NODE_URL} + networks: + poa_net: + ipv4_address: '172.13.0.90' + ports: + - 80:3000 + volumes: + - hyperlane-deploy-artifacts:/deploy-artifacts + profiles: + - bridge + + datadog-agent: + image: gcr.io/datadoghq/agent:latest + restart: always + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - /proc/:/host/proc/:ro + - /sys/fs/cgroup/:/host/sys/fs/cgroup:ro + environment: + - DD_API_KEY=${DD_KEY} + - DD_TAGS=env:test + - DD_SITE=datadoghq.com + - DD_LOGS_ENABLED=true + - DD_LOGS_CONFIG_CONTAINER_COLLECT_ALL=true + - DD_CONTAINER_EXCLUDE="name:datadog-agent" + ports: + - "5000:5000" + networks: + poa_net: + ipv4_address: 172.13.4.24 + profiles: + - prod_agents + +networks: + poa_net: + driver: bridge + ipam: + driver: default + config: + - subnet: 172.13.0.0/16 + +volumes: + geth-data-bootnode: + geth-data-node1: + geth-data-node2: + hyperlane-deploy-artifacts: + hyperlane-validator1-sigs: + hyperlane-validator2-sigs: + hyperlane-validator1-db: + hyperlane-validator2-db: + hyperlane-relayer-db: diff --git a/geth-poa/entrypoint.sh b/geth-poa/entrypoint.sh new file mode 100644 index 0000000000..610d1a36bc --- /dev/null +++ b/geth-poa/entrypoint.sh @@ -0,0 +1,115 @@ +#!/bin/sh +set -exu + +GENESIS_L1_PATH="/genesis.json" +VERBOSITY=3 +GETH_DATA_DIR=/data +GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata" +GETH_KEYSTORE_DIR="$GETH_DATA_DIR/keystore" +CHAIN_ID=$(cat "$GENESIS_L1_PATH" | jq -r .config.chainId) +RPC_PORT="${RPC_PORT:-8545}" +WS_PORT="${WS_PORT:-8546}" + +# Generate signer key if needed +if [ ! -d "$GETH_KEYSTORE_DIR" ] && [ "$GETH_NODE_TYPE" = "signer" ]; then + + echo "$GETH_KEYSTORE_DIR missing, running account import" + echo -n "pwd" > "$GETH_DATA_DIR"/password + echo -n "$BLOCK_SIGNER_PRIVATE_KEY" | sed 's/0x//' > "$GETH_DATA_DIR"/block-signer-key + geth --verbosity="$VERBOSITY" \ + --nousb \ + account import \ + --datadir="$GETH_DATA_DIR" \ + --password="$GETH_DATA_DIR"/password \ + "$GETH_DATA_DIR"/block-signer-key +else + echo "$GETH_KEYSTORE_DIR exists." +fi + +# Init geth if needed +if [ ! -d "$GETH_CHAINDATA_DIR" ]; then + echo "$GETH_CHAINDATA_DIR missing, running init" + echo "Initializing genesis." + geth --verbosity="$VERBOSITY" \ + --nousb \ + --datadir="$GETH_DATA_DIR" init \ + "$GENESIS_L1_PATH" +else + echo "$GETH_CHAINDATA_DIR exists." +fi + +# Obtain assigned container IP for p2p +NODE_IP=$(hostname -i) + +if [ "$GETH_NODE_TYPE" = "bootnode" ]; then + echo "Starting bootnode" + + # Generate boot.key + echo "$BOOT_KEY" > $GETH_DATA_DIR/boot.key + + exec geth \ + --verbosity="$VERBOSITY" \ + --datadir="$GETH_DATA_DIR" \ + --port 30301 \ + --http \ + --http.corsdomain="*" \ + --http.vhosts="*" \ + --http.addr=0.0.0.0 \ + --http.port="$RPC_PORT" \ + --http.api=web3,debug,eth,txpool,net,engine \ + --ws \ + --ws.addr=0.0.0.0 \ + --ws.port="$WS_PORT" \ + --ws.origins="*" \ + --ws.api=debug,eth,txpool,net,engine \ + --syncmode=full \ + --gcmode=archive \ + --networkid=$CHAIN_ID \ + --nousb \ + --metrics \ + --metrics.addr=0.0.0.0 \ + --metrics.port=6060 \ + --nodekey $GETH_DATA_DIR/boot.key \ + --netrestrict 172.13.0.0/24 \ + --nat extip:$NODE_IP + +elif [ "$GETH_NODE_TYPE" = "signer" ]; then + echo "Starting signer node" + + exec geth \ + --verbosity="$VERBOSITY" \ + --datadir="$GETH_DATA_DIR" \ + --port 30311 \ + --syncmode=full \ + --gcmode=full \ + --http \ + --http.corsdomain="*" \ + --http.vhosts="*" \ + --http.addr=0.0.0.0 \ + --http.port="$RPC_PORT" \ + --http.api=web3,debug,eth,txpool,net,engine \ + --bootnodes enode://34a2a388ad31ca37f127bb9ffe93758ee711c5c2277dff6aff2e359bcf2c9509ea55034196788dbd59ed70861f523c1c03d54f1eabb2b4a5c1c129d966fe1e65@172.13.0.100:30301 \ + --networkid=$CHAIN_ID \ + --unlock=$BLOCK_SIGNER_ADDRESS \ + --password="$GETH_DATA_DIR"/password \ + --mine \ + --miner.etherbase=$BLOCK_SIGNER_ADDRESS \ + --allow-insecure-unlock \ + --nousb \ + --netrestrict 172.13.0.0/24 \ + --metrics \ + --metrics.addr=0.0.0.0 \ + --metrics.port=6060 \ + --ws \ + --ws.addr=0.0.0.0 \ + --ws.port="$WS_PORT" \ + --ws.origins="*" \ + --ws.api=debug,eth,txpool,net,engine \ + --rpc.allow-unprotected-txs \ + --authrpc.addr="0.0.0.0" \ + --authrpc.port="8551" \ + --authrpc.vhosts="*" \ + --nat extip:$NODE_IP +else + echo "Invalid GETH_NODE_TYPE specified" +fi diff --git a/geth-poa/frontend/Dockerfile b/geth-poa/frontend/Dockerfile new file mode 100644 index 0000000000..80c79946b7 --- /dev/null +++ b/geth-poa/frontend/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:latest + +RUN apk add --no-cache git yarn jq + +RUN git clone https://github.com/primevprotocol/hyperlane-ui.git +WORKDIR /hyperlane-ui +RUN git checkout ff1586ed9cad6eeddba2cebc5f9b7828c74f25d1 + +RUN yarn + +ARG NEXT_PUBLIC_WALLET_CONNECT_ID + +RUN yarn build + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT [ "/entrypoint.sh" ] diff --git a/geth-poa/frontend/entrypoint.sh b/geth-poa/frontend/entrypoint.sh new file mode 100644 index 0000000000..6d63145d77 --- /dev/null +++ b/geth-poa/frontend/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -exu + +# Update src tokens.ts file with hypNativeAddress value from deploy config +ARTIFACT_PATH="/deploy-artifacts/warp-ui-token-config.json" +SRC_TOKENS_PATH="/hyperlane-ui/src/consts/tokens.ts" +HYP_NATIVE_ADDR=$(jq -r '.hypNativeAddress' $ARTIFACT_PATH) +sed -i "/hypNativeAddress/c\ hypNativeAddress: \"$HYP_NATIVE_ADDR\"," $SRC_TOKENS_PATH + +# Update src chains.ts file with L2 node url depending on dev vs prod +SRC_CHAINS_PATH="/hyperlane-ui/src/consts/chains.ts" +sed -i "s|http: 'http://[^']*'|http: '$L2_NODE_URL'|g" "$SRC_CHAINS_PATH" + +exec yarn dev diff --git a/geth-poa/genesis.json b/geth-poa/genesis.json new file mode 100644 index 0000000000..999c2db5f6 --- /dev/null +++ b/geth-poa/genesis.json @@ -0,0 +1,52 @@ +{ + "config": { + "chainId": 17864, + "homesteadBlock": 0, + "eip150Block": 0, + "eip155Block": 0, + "eip158Block": 0, + "byzantiumBlock": 0, + "constantinopleBlock": 0, + "petersburgBlock": 0, + "istanbulBlock": 0, + "muirGlacierBlock": 0, + "berlinBlock": 0, + "londonBlock": 0, + "arrowGlacierBlock": 0, + "grayGlacierBlock": 0, + "clique": { + "period": 200, + "epoch": 30000 + } + }, + "nonce": "0x0", + "timestamp": "0x6546df6d", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000d9cd8E5DE6d55f796D980B818D350C0746C25b97788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "gasLimit": "0x1c9c380", + "difficulty": "0x1", + "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "coinbase": "0x0000000000000000000000000000000000000000", + "alloc": { + "0xBe3dEF3973584FdcC1326634aF188f0d9772D57D": { + "balance": "10000000000000000000000" + }, + "d9cd8E5DE6d55f796D980B818D350C0746C25b97": { + "balance": "10000000000000000000000" + }, + "788EBABe5c3dD422Ef92Ca6714A69e2eabcE1Ee4": { + "balance": "10000000000000000000000" + }, + "0DCaa27B9E4Db92F820189345792f8eC5Ef148F6": { + "balance": "10000000000000000000000" + }, + "f39Fd6e51aad88F6F4ce6aB8827279cffFb92266": { + "balance": "10000000000000000000000" + } + }, + "number": "0x0", + "gasUsed": "0x0", + "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", + "baseFeePerGas": "0x3b9aca00", + "excessBlobGas": null, + "blobGasUsed": null + } diff --git a/geth-poa/hyperlane-deployer/Dockerfile b/geth-poa/hyperlane-deployer/Dockerfile new file mode 100644 index 0000000000..73203b2859 --- /dev/null +++ b/geth-poa/hyperlane-deployer/Dockerfile @@ -0,0 +1,25 @@ +FROM alpine:latest + +RUN apk update && apk add --no-cache git yarn expect + +WORKDIR / +RUN git clone https://github.com/primevprotocol/hyperlane-monorepo.git +WORKDIR /hyperlane-monorepo +# RUN git checkout v3-audit-remediations +RUN git checkout ca301c80861701e17b13b9a06454795b317696b2 +# TODO: checkout stable version, seemed like v3-audit-remediations changed build process +RUN yarn install +RUN yarn build + +RUN ln -s /hyperlane-monorepo/typescript/cli/dist/cli.js /usr/local/bin/hyperlane +RUN chmod +x /usr/local/bin/hyperlane + +COPY chain-config.yml /chain-config.yml +COPY multisig-ism.yml /multisig-ism.yml +COPY warp-tokens.yml /warp-tokens.yml + +COPY entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +ENTRYPOINT [ "/entrypoint.sh" ] + diff --git a/geth-poa/hyperlane-deployer/chain-config.yml b/geth-poa/hyperlane-deployer/chain-config.yml new file mode 100644 index 0000000000..49e5b414cf --- /dev/null +++ b/geth-poa/hyperlane-deployer/chain-config.yml @@ -0,0 +1,59 @@ +--- +mevcommitsettlement: + chainId: 17864 + domainId: 17864 + name: mevcommitsettlement + protocol: ethereum + rpcUrls: + # Only http field is required + - http: http://172.13.0.100:8545 + pagination: + maxBlockRange: 1000 + maxBlockAge: 1000 + minBlockNumber: 1000 + retry: + maxRequests: 5 + baseRetryMs: 1000 + isTestnet: true + # blockExplorers: # Array: List of BlockExplorer configs + # # Required fields: + # - name: My Chain Explorer # String: Human-readable name for the explorer + # url: https://mychain.com/explorer # String: Base URL for the explorer + # apiUrl: https://mychain.com/api # String: Base URL for the explorer API + # # Optional fields: + # apiKey: myapikey # String: API key for the explorer (optional) + # family: etherscan # ExplorerFamily: See ExplorerFamily for valid values + nativeToken: + name: cETH # String + symbol: cETH # String + decimals: 18 # Number + displayName: MEV Commit Settlement + displayNameShort: MEV Commit Settlement + logoURI: https://mychain.com/logo.png + blocks: + confirmations: 12 # Number: Blocks to wait before considering a transaction confirmed + reorgPeriod: 100 # Number: Blocks before a transaction has a near-zero chance of reverting + estimateBlockTime: 1 + +sepolia: + chainId: 11155111 + domainId: 11155111 + name: sepolia + protocol: ethereum + displayName: Sepolia + nativeToken: + name: Ether + symbol: ETH + decimals: 18 + rpcUrls: + - http: https://eth-sepolia.g.alchemy.com/v2/a0wg_g1X-Wz4IeVA-0SS3PsQhbyQNjc_ + blockExplorers: + - name: Etherscan + url: https://sepolia.etherscan.io + apiUrl: https://api-sepolia.etherscan.io/api + family: etherscan + blocks: + confirmations: 1 + reorgPeriod: 2 + estimateBlockTime: 13 + isTestnet: true diff --git a/geth-poa/hyperlane-deployer/entrypoint.sh b/geth-poa/hyperlane-deployer/entrypoint.sh new file mode 100644 index 0000000000..2c1c361ed9 --- /dev/null +++ b/geth-poa/hyperlane-deployer/entrypoint.sh @@ -0,0 +1,69 @@ +#!/bin/sh +set -exu + +# Sleep to ensure chain is up +sleep 10 + +if test -f /hyperlane-monorepo/artifacts/done; then + echo "Deploy artifacts already exist. Skipping deployment." +else + + # Define the expect script inline + /usr/bin/expect <