Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync upstream master #62

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .clabot
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"contributors": "https://api.github.com/repos/OffchainLabs/clabot-config/contents/nitro-contributors.json",
"message": "We require contributors to sign our Contributor License Agreement. In order for us to review and merge your code, please sign the linked documents below to get yourself added. https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=b15c81cc-b5ea-42a6-9107-3992526f2898&env=na3&acct=6e152afc-6284-44af-a4c1-d8ef291db402&v=2",
"label": "s"
}
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
88 changes: 74 additions & 14 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
- sequencer
image: blockscout-testnode
restart: always
container_name: 'blockscout'
container_name: "blockscout"
links:
- postgres:database
command:
Expand All @@ -16,11 +16,11 @@ services:
node init/install.js postgres 5432
bin/blockscout start
extra_hosts:
- 'host.docker.internal:host-gateway'
- "host.docker.internal:host-gateway"
env_file:
- ./blockscout/nitro.env
environment:
ETHEREUM_JSONRPC_VARIANT: 'geth'
ETHEREUM_JSONRPC_VARIANT: "geth"
ETHEREUM_JSONRPC_HTTP_URL: http://sequencer:8547/
INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER: "true"
DATABASE_URL: postgresql://postgres:@postgres:5432/blockscout
Expand All @@ -31,11 +31,11 @@ services:
postgres:
image: postgres:13.6
restart: always
container_name: 'postgres'
container_name: "postgres"
environment:
POSTGRES_PASSWORD: ''
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
POSTGRES_PASSWORD: ""
POSTGRES_USER: "postgres"
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- "postgres-data:/var/lib/postgresql/data"
ports:
Expand All @@ -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 Expand Up @@ -169,7 +175,7 @@ services:
pid: host # allow debugging
image: espresso-integration-testnode
entrypoint: /usr/local/bin/nitro
ports:
ports:
- "127.0.0.1:8547:8547"
- "127.0.0.1:8548:8548"
- "127.0.0.1:9642:9642"
Expand All @@ -181,7 +187,7 @@ services:
command: --conf.file /config/sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain *
depends_on:
- geth

sequencer-espresso-finality:
pid: host # allow debugging
image: nitro-node-dev-testnode
Expand All @@ -198,7 +204,7 @@ services:
command: --conf.file /config/espresso_finality_sequencer_config.json --node.feed.output.enable --node.feed.output.port 9642 --http.api net,web3,eth,txpool,debug --node.seq-coordinator.my-url ws://sequencer:8548 --graphql.enable --graphql.vhosts * --graphql.corsdomain *
depends_on:
- geth

sequencer_b:
pid: host # allow debugging
image: nitro-node-dev-testnode
Expand Down Expand Up @@ -429,7 +435,11 @@ services:
- geth
- sequencer
healthcheck:
test: ["CMD-SHELL", "curl -fL http://localhost:$ESPRESSO_DEV_NODE_PORT || exit 1"]
test:
[
"CMD-SHELL",
"curl -fL http://localhost:$ESPRESSO_DEV_NODE_PORT || exit 1",
]
interval: 30s
timeout: 10s
retries: 5
Expand Down Expand Up @@ -459,6 +469,53 @@ services:
timeout: 10s
retries: 5
start_period: 40s
datool:
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/datool
volumes:
- "config:/config"
- "das-committee-a-data:/das-committee-a"
- "das-committee-b-data:/das-committee-b"
- "das-mirror-data:/das-mirror"
command:

das-committee-a:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/daserver
ports:
- "127.0.0.1:9876:9876"
- "127.0.0.1:9877:9877"
volumes:
- "config:/config"
- "das-committee-a-data:/das"
command:
- --conf.file=/config/l2_das_committee.json

das-committee-b:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/daserver
ports:
- "127.0.0.1:8876:9876"
- "127.0.0.1:8877:9877"
volumes:
- "config:/config"
- "das-committee-b-data:/das"
command:
- --conf.file=/config/l2_das_committee.json

das-mirror:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/daserver
ports:
- "127.0.0.1:7877:9877"
volumes:
- "config:/config"
- "das-mirror-data:/das"
command:
- --conf.file=/config/l2_das_mirror.json

volumes:
l1data:
Expand All @@ -478,3 +535,6 @@ volumes:
espresso-config:
postgres-data:
tokenbridge-data:
das-committee-a-data:
das-committee-b-data:
das-mirror-data:
Loading
Loading