Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release'
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Sep 25, 2024
2 parents 1d0a37c + 43861b0 commit d4244cd
Show file tree
Hide file tree
Showing 11 changed files with 280 additions and 105 deletions.
54 changes: 29 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,40 @@ name: CI
run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }}

on:
workflow_dispatch:
merge_group:
pull_request:
push:
branches:
- master
- develop

workflow_dispatch:
merge_group:
pull_request:
push:
branches:
- master
- develop

jobs:
build_and_run:
runs-on: ubuntu-8
strategy:
matrix:
pos: [pos, no-pos]
l3node: [l3node, l3node-token-6, no-l3node]
tokenbridge: [tokenbridge, no-tokenbridge]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: ${{ runner.os }}-buildx-
- name: Startup Nitro testnode
run: ${{ github.workspace }}/.github/workflows/testnode.bash
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile') }}
restore-keys: ${{ runner.os }}-buildx-

- name: Startup Nitro testnode
run: ${{ github.workspace }}/.github/workflows/testnode.bash --init-force ${{ (matrix.l3node == 'l3node' && '--l3node') || (matrix.l3node == 'l3node-token-6' && '--l3node --l3-fee-token --l3-token-bridge --l3-fee-token-decimals 6') || '' }} ${{ matrix.tokenbridge == 'tokenbridge' && '--tokenbridge' || '--no-tokenbridge' }} --no-simple --detach ${{ matrix.pos == 'pos' && '--pos' || '' }}
26 changes: 19 additions & 7 deletions .github/workflows/testnode.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,36 @@
# Start the test node and get PID, to terminate it once send-l2 is done.
cd ${GITHUB_WORKSPACE}

# TODO once develop is merged into nitro-contract's master, remove the NITRO_CONTRACTS_BRANCH env var
./test-node.bash --init-force --l3node --no-simple --detach
./test-node.bash "$@"

if [ $? -ne 0 ]; then
echo "test-node.bash failed"
docker compose logs --tail=1000
exit 1
fi


START=$(date +%s)
L2_TRANSACTION_SUCCEEDED=false
L3_TRANSACTION_SUCCEEDED=false
# if we're not running an l3node then we just set l3 to success by default
L3_TRANSACTION_SUCCEEDED=true
for arg in "$@"; do
if [ "$arg" = "--l3node" ]; then
L3_TRANSACTION_SUCCEEDED=false
fi
done
SUCCEEDED=false

while true; do
if [ "$L2_TRANSACTION_SUCCEEDED" = false ]; then
if ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 100 --to user_l2user --wait; then
if ${GITHUB_WORKSPACE}/test-node.bash script send-l2 --ethamount 2 --to user_l2user --wait; then
echo "Sending l2 transaction succeeded"
L2_TRANSACTION_SUCCEEDED=true
fi
fi

if [ "$L3_TRANSACTION_SUCCEEDED" = false ]; then
if ${GITHUB_WORKSPACE}/test-node.bash script send-l3 --ethamount 100 --to user_l3user --wait; then
if ${GITHUB_WORKSPACE}/test-node.bash script send-l3 --ethamount 2 --to user_l3user --wait; then
echo "Sending l3 transaction succeeded"
L3_TRANSACTION_SUCCEEDED=true
fi
Expand All @@ -44,10 +56,10 @@ while true; do
sleep 10
done

docker-compose stop
docker compose stop

if [ "$SUCCEEDED" = false ]; then
docker-compose logs
docker compose logs
exit 1
fi

Expand Down
12 changes: 9 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
- "127.0.0.1:6379:6379"

geth:
image: ethereum/client-go:v1.10.23
image: ethereum/client-go:latest
ports:
- "127.0.0.1:8545:8545"
- "127.0.0.1:8551:8551"
Expand Down Expand Up @@ -77,6 +77,7 @@ services:
- --authrpc.jwtsecret=/config/jwt.hex
- --nodiscover
- --syncmode=full
- --state.scheme=hash
- --dev
- --dev.period=1
- --mine
Expand All @@ -91,9 +92,13 @@ services:
command:
- testnet
- generate-genesis
- --fork=deneb
- --num-validators=64
- --genesis-time-delay=15
- --output-ssz=/consensus/genesis.ssz
- --chain-config-file=/config/prysm.yaml
- --geth-genesis-json-in=/config/geth_genesis.json
- --geth-genesis-json-out=/config/geth_genesis.json
volumes:
- "consensus:/consensus"
- "config:/config"
Expand All @@ -108,16 +113,17 @@ services:
- --datadir=/consensus/beacondata
- --rpc-port=5000
- --min-sync-peers=0
- --interop-genesis-state=/consensus/genesis.ssz
- --genesis-state=/consensus/genesis.ssz
- --interop-eth1data-votes
- --bootstrap-node=
- --chain-config-file=/config/prysm.yaml
- --rpc-host=0.0.0.0
- --grpc-gateway-host=0.0.0.0
- --chain-id=32382
- --chain-id=1337
- --execution-endpoint=http://geth:8551
- --accept-terms-of-use
- --jwt-secret=/config/jwt.hex
- --suggested-fee-recipient=0x000000000000000000000000000000000000dEaD
depends_on:
geth:
condition: service_started
Expand Down
2 changes: 1 addition & 1 deletion rollupcreator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.20.3-bullseye-slim
FROM node:18-bullseye-slim
ARG NITRO_CONTRACTS_BRANCH=main
RUN apt-get update && \
apt-get install -y git docker.io python3 build-essential curl jq
Expand Down
2 changes: 1 addition & 1 deletion scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-bullseye-slim
FROM node:18-bullseye-slim
WORKDIR /workspace
COPY ./package.json ./yarn.lock ./
RUN yarn
Expand Down
32 changes: 21 additions & 11 deletions scripts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,28 @@ PRESET_BASE: interop
GENESIS_FORK_VERSION: 0x20000089
# Altair
ALTAIR_FORK_EPOCH: 1
ALTAIR_FORK_EPOCH: 0
ALTAIR_FORK_VERSION: 0x20000090
# Merge
BELLATRIX_FORK_EPOCH: 2
BELLATRIX_FORK_EPOCH: 0
BELLATRIX_FORK_VERSION: 0x20000091
TERMINAL_TOTAL_DIFFICULTY: 50
# Capella
CAPELLA_FORK_EPOCH: 0
CAPELLA_FORK_VERSION: 0x20000092
MAX_WITHDRAWALS_PER_PAYLOAD: 16
# DENEB
DENEB_FORK_EPOCH: 0
DENEB_FORK_VERSION: 0x20000093
# ELECTRA
ELECTRA_FORK_VERSION: 0x20000094
# Time parameters
SECONDS_PER_SLOT: 12
SECONDS_PER_SLOT: 2
SLOTS_PER_EPOCH: 6
# Deposit contract
Expand All @@ -36,8 +48,7 @@ function writeGethGenesisConfig(argv: any) {
{
"config": {
"ChainName": "l1_chain",
"chainId": 32382,
"consensus": "clique",
"chainId": 1337,
"homesteadBlock": 0,
"daoForkSupport": true,
"eip150Block": 0,
Expand All @@ -54,13 +65,12 @@ function writeGethGenesisConfig(argv: any) {
"terminalBlockHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"arrowGlacierBlock": 0,
"grayGlacierBlock": 0,
"clique": {
"period": 5,
"epoch": 30000
},
"terminalTotalDifficulty": 50
"shanghaiTime": 0,
"cancunTime": 1706778826,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true
},
"difficulty": "1",
"difficulty": "0",
"extradata": "0x00000000000000000000000000000000000000000000000000000000000000003f1Eae7D46d88F08fc2F8ed27FCb2AB183EB2d0E0B0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x42",
"timestamp": "0x0",
Expand Down
2 changes: 2 additions & 0 deletions scripts/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ export const tokenbridgedatapath = "/tokenbridge-data";
// Not secure. Do not use for production purposes
export const l1mnemonic =
"indoor dish desk flag debris potato excuse depart ticket judge file exit";

export const ARB_OWNER = "0x0000000000000000000000000000000000000070";
Loading

0 comments on commit d4244cd

Please sign in to comment.