Skip to content

Commit 4e2d58f

Browse files
authored
Merge pull request #508 from fpco/ethereum-bridge-3-exec-action
Ethereum bridge milestone 3: execute bridge actions
2 parents 81470ba + 63e0f82 commit 4e2d58f

File tree

20 files changed

+1725
-374
lines changed

20 files changed

+1725
-374
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ jobs:
9090
run: just anvil
9191
- name: Ethereum contract tests
9292
run: just cargo-contract-tests-ethereum
93-
- name: Ethereum Anvil CLI smoke
94-
run: just ethereum-anvil-cli-smoke
9593

9694
solana-contract:
9795
name: Solana Tests

contracts/ethereum/e2e/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Bridge E2E (Anvil)
22

33
This setup runs a deterministic local Ethereum JSON-RPC node for end-to-end testing.
4-
During image build, `Bridge` is deployed and Anvil state is snapshotted.
5-
Container startup loads that snapshot, so the contract is already deployed.
4+
Container startup runs Anvil with a deterministic mnemonic.
5+
The bridge is not pre-deployed; tests or smoke checks should deploy it explicitly.
66

77
## Start
88

@@ -18,13 +18,13 @@ cd e2e
1818
docker compose -f compose.yaml down
1919
```
2020

21-
## Rebuild (redeploy contract into snapshot)
21+
## Rebuild
2222

2323
```bash
2424
cd e2e
2525
docker compose -f compose.yaml build --no-cache
2626
```
27-
Note: image build compiles contracts internally with `forge build` before deployment.
27+
Note: image build compiles contracts internally with `forge build`.
2828

2929
## Quick Check
3030

@@ -48,4 +48,3 @@ Check the actual mnemonic in the `/bootstrap/mnemonic.txt` file.
4848

4949
- `<admin_address>`: `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266`
5050
- `<admin_private_key>`: `0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`
51-
- `<bridge_contract_address>`: `0x5FbDB2315678afecb367f032d93F642f64180aa3`

contracts/ethereum/e2e/bridge/Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN curl -L https://github.com/ethereum/solidity/releases/download/v0.8.30/solc-
1818

1919
ENV PATH="/root/.foundry/bin:${PATH}"
2020

21-
FROM foundry AS state_builder
21+
FROM foundry AS contract_builder
2222

2323
WORKDIR /app
2424

@@ -27,18 +27,20 @@ ARG ANVIL_MNEMONIC="test test test test test test test test test test test junk"
2727
COPY foundry.toml foundry.lock ./
2828
COPY lib ./lib
2929
COPY src ./src
30-
COPY e2e/bridge/bootstrap-state.sh /usr/local/bin/bootstrap-state.sh
3130

3231
# Build contract artifacts inside the image.
3332
RUN forge build --use /usr/local/bin/solc
3433

35-
# Bootstrap chain state and deploy Bridge.
36-
RUN chmod +x /usr/local/bin/bootstrap-state.sh
37-
RUN /usr/local/bin/bootstrap-state.sh
38-
3934
FROM foundry
4035

41-
COPY --from=state_builder /bootstrap /bootstrap
36+
WORKDIR /app
37+
38+
ARG ANVIL_MNEMONIC="test test test test test test test test test test test junk"
39+
40+
RUN mkdir -p /bootstrap && \
41+
printf "%s" "${ANVIL_MNEMONIC}" > /bootstrap/mnemonic.txt
42+
43+
COPY --from=contract_builder /app/out /app/out
4244
COPY e2e/bridge/entrypoint.sh /entrypoint.sh
4345

4446
RUN chmod +x /entrypoint.sh

contracts/ethereum/e2e/bridge/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ then
3030

3131
elif [[ "$1" == "run" ]] || [[ "$1" == "" ]]
3232
then
33-
exec anvil --mnemonic "$ANVIL_MNEMONIC" --host 0.0.0.0 --port 8545 --chain-id 31337 --load-state /bootstrap/state.json
33+
exec anvil --mnemonic "$ANVIL_MNEMONIC" --host 0.0.0.0 --port 8545 --chain-id 31337
3434
fi
3535

3636
exec "$@"

contracts/ethereum/e2e/compose.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ services:
66
container_name: bridge-anvil
77
ports:
88
- "8545:8545"
9-
volumes:
10-
- ./ethereum-anvil-cli-smoke.sh:/bootstrap/ethereum-anvil-cli-smoke.sh:ro
119
restart: unless-stopped

contracts/ethereum/e2e/ethereum-anvil-cli-smoke.sh

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)