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

fixes #3

Closed
wants to merge 91 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
6dd7c82
accounts documentation
tsahee Feb 2, 2024
4acf143
perf: remove chrome
gzeoneth Feb 5, 2024
65c135a
chore: switch token-bridge-contracts main
gzeoneth Feb 5, 2024
ed8331d
perf: use slim image
gzeoneth Feb 5, 2024
70066a8
chore: add missing help parameters
TucksonDev Feb 6, 2024
8335e04
Add CI for testnode that starts up nitro test node and rans l2 transa…
anodar Feb 9, 2024
6c1acc4
Merge branch 'master' into nitro-testnode-ci
anodar Feb 9, 2024
5219ee2
Fix typo
anodar Feb 9, 2024
5237610
Fix script path in testnode.bash
anodar Feb 9, 2024
d62114c
Add beacon client URL
PlasmaPower Feb 15, 2024
a22f63a
Disable blob reader for now
PlasmaPower Feb 15, 2024
ffa1ff3
Merge pull request #40 from OffchainLabs/beacon-client-url
tsahee Feb 20, 2024
3922df9
Merge pull request #35 from OffchainLabs/remove-chrome
tsahee Feb 20, 2024
ec4fce0
Drop send-l2-tx flag
anodar Feb 21, 2024
47ce5d2
replace github.workspace with GITHUB_WORKSPACE
anodar Feb 21, 2024
eb8e05d
Fix script path
anodar Feb 21, 2024
3cbcbf2
wait for 3min before trying to send l2 transaction
anodar Feb 22, 2024
3ed91b5
Wait 5min until sending l2 transactions
anodar Feb 22, 2024
03e24b2
Increase wait time
anodar Feb 22, 2024
ff7ff3a
Run testnode using latest release (without --dev)
anodar Feb 23, 2024
74e07df
Increase timeout
anodar Feb 23, 2024
b9588a1
Poll until timeout or until send-l2 succeeds
anodar Feb 26, 2024
76c0616
Merge pull request #44 from OffchainLabs/testnode-ci
tsahee Mar 5, 2024
2d770c8
Merge pull request #37 from OffchainLabs/chore-add-missing-help-param…
tsahee Mar 5, 2024
32c5f7f
Add rollupcreator container
gvladika Mar 20, 2024
d269f8c
Update Dockerfile
gvladika Mar 21, 2024
bf17161
Draft rollup creation call
gvladika Mar 21, 2024
ea79929
Update create rollup call
gvladika Mar 26, 2024
8885c42
Update rollupcreator config
gvladika Mar 27, 2024
999eb38
Fix command
gvladika Mar 27, 2024
c3d3d64
Adjust l3node creation command
gvladika Mar 27, 2024
7ea4b74
Fund deployers with fee token
gvladika Mar 28, 2024
de506e1
Properly provide fee token arg
gvladika Mar 28, 2024
3b3ce1a
Use latest wasmroot
gvladika Mar 28, 2024
6f70432
Make nitro-contracts branch configurable
gvladika Mar 28, 2024
8246819
Temp change for test
gvladika Mar 28, 2024
00862c2
Add option to customize token bridge branch
gvladika Mar 28, 2024
4197b54
Unused
gvladika Mar 28, 2024
f82e25c
fix relay service
diegoximenes Apr 19, 2024
6172c4d
update nitro version
tsahee Apr 19, 2024
a2bad35
add init-force option that isn't interactive
tsahee Apr 19, 2024
b493760
fix ci script
tsahee Apr 19, 2024
e530842
Merge pull request #50 from OffchainLabs/ci_fix
tsahee Apr 19, 2024
c97a489
Merge branch 'release' into decouple-contracts
gvladika Apr 23, 2024
c258219
Separate checkout step
gvladika Apr 23, 2024
fb6eac3
Disable blobs
gvladika Apr 23, 2024
2d516bc
Temporary use custom nitro-contracts branch 'e2e-to-ci'
gvladika Apr 23, 2024
8f9881c
Use nitro-contract's develop temporary
gvladika Apr 23, 2024
9636355
Merge pull request #47 from OffchainLabs/decouple-contracts
gvladika Apr 24, 2024
138c4d1
enable poster's output feed
diegoximenes Apr 25, 2024
04ada28
Set default contracts versions in the test-node.bash
gvladika Apr 26, 2024
5efefbe
Use default version
gvladika Apr 26, 2024
1e3e4ab
Merge pull request #52 from OffchainLabs/default-versions
gvladika Apr 29, 2024
c88e2ed
update blockscout pin
tsahee May 7, 2024
b42aae0
Bump default nitro-contracts version to include fix for a blocker
gvladika May 8, 2024
6c23d79
Merge pull request #54 from OffchainLabs/bump-nitro-contracts
gvladika May 8, 2024
31c4a2c
Merge pull request #53 from OffchainLabs/blockscout_pin
tsahee May 18, 2024
74bbb97
Revert "enable poster's output feed"
diegoximenes May 23, 2024
7b85cfe
Merge pull request #49 from OffchainLabs/fix/relay_service
tsahee May 23, 2024
c334820
Merge remote-tracking branch 'origin/release' into HEAD
tsahee May 23, 2024
b97efc4
Fix typo in --l3node flag in test-node.bash options
ariskk May 27, 2024
ed3cda6
Merge pull request #58 from ariskk/master
tsahee Jun 4, 2024
1195715
add EigenDA field and enable in the l2 and l3 chainconfigs
afkbyte Jun 10, 2024
1f83198
use nitro 3.0 and arbos v30
tsahee Jun 10, 2024
014b44e
update readme for by-default stylus
tsahee Jun 10, 2024
dec82b6
docker-compose: use nitro entrypoint
tsahee Jun 10, 2024
73a4583
Merge remote-tracking branch 'origin/master' into use_v3.0
tsahee Jun 10, 2024
22ecaea
fix docker-compose
tsahee Jun 10, 2024
94fe5a7
Merge pull request #60 from OffchainLabs/use_v3.0
tsahee Jun 10, 2024
ff0e517
return to nitro 2.3.3
tsahee Jun 14, 2024
b8475ce
Merge pull request #62 from OffchainLabs/return-to-nitro2.3
tsahee Jun 14, 2024
962d6c0
Deploy CacheManager on L2
gvladika Jun 17, 2024
a294ad3
re-enable stylus on 3.0.1-rc.2
tsahee Jun 17, 2024
365e01e
fix wrongfully changed entry-points
tsahee Jun 17, 2024
d389fbc
nitro 3.0.1 released
tsahee Jun 17, 2024
7e490fd
Merge pull request #64 from OffchainLabs/use-3.0.1-rc2
tsahee Jun 17, 2024
9777c4d
Merge branch 'release' into cache-manager-deploy
gvladika Jun 18, 2024
caa897c
Deploy CacheManager to L3
gvladika Jun 18, 2024
703bf6a
Bump nitro-contracts to support CacheManager deployment
gvladika Jun 18, 2024
f223401
Format
gvladika Jun 18, 2024
89b4cbc
Removes deprecated version field from docker-compose
diegoximenes Jun 21, 2024
9d527ab
Runs CI with l3node and no-simple
diegoximenes Jun 21, 2024
b3d1960
Merge pull request #66 from OffchainLabs/ci_more_complex_topology
tsahee Jun 24, 2024
d4cc8e7
Merge branch 'release' into cache-manager-deploy
tsahee Jun 24, 2024
9dc0588
Merge pull request #65 from OffchainLabs/cache-manager-deploy
tsahee Jun 26, 2024
8302b11
support eigenda proxy
epociask Jul 3, 2024
f0be43a
feat: EigenDA support
epociask May 31, 2024
a6b331a
clear
epociask Jul 8, 2024
a2442f1
fix merge conflict
epociask Jul 8, 2024
0323381
commit bind
epociask Jul 9, 2024
f34647d
remove nitro binary
epociask Jul 9, 2024
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
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
run-name: CI triggered from @${{ github.actor }} of ${{ github.head_ref }}

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


jobs:
build_and_run:
runs-on: ubuntu-8

steps:
- 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: 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
54 changes: 54 additions & 0 deletions .github/workflows/testnode.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash
# The script starts up the test node and waits until the timeout (10min) or
# until send-l2 succeeds.

# 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

START=$(date +%s)
L2_TRANSACTION_SUCCEEDED=false
L3_TRANSACTION_SUCCEEDED=false
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
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
echo "Sending l3 transaction succeeded"
L3_TRANSACTION_SUCCEEDED=true
fi
fi

if [ "$L2_TRANSACTION_SUCCEEDED" = true ] && [ "$L3_TRANSACTION_SUCCEEDED" = true ]; then
SUCCEEDED=true
break
fi

# Check if the timeout (10 min) has been reached.
NOW=$(date +%s)
DIFF=$((NOW - START))
if [ "$DIFF" -ge 600 ]; then
echo "Timed out"
break
fi

sleep 10
done

docker-compose stop

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

exit 0
36 changes: 2 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nitro Testnode

Nitro-testnode brings up a full environment for local nitro testing (with or without Stylus support) including a dev-mode geth L1, and multiple instances with different roles.
Nitro-testnode brings up a full environment for local nitro testing (with Stylus support) including a dev-mode geth L1, and multiple instances with different roles.

### Requirements

Expand All @@ -11,8 +11,6 @@ All must be installed in PATH.

## Using latest nitro release (recommended)

### Without Stylus support

Check out the release branch of the repository.

> Notice: release branch may be force-pushed at any time.
Expand All @@ -29,30 +27,12 @@ Initialize the node
```
To see more options, use `--help`.

### With Stylus support

Check out the stylus branch of the repository.
> Notice: stylus branch may be force-pushed at any time.

```bash
git clone -b stylus --recurse-submodules https://github.com/OffchainLabs/nitro-testnode.git
cd nitro-testnode
```

Initialize the node

```bash
./test-node.bash --init
```
To see more options, use `--help`.

## Using current nitro code (local compilation)

Check out the nitro or stylus repository. Use the test-node submodule of nitro repository.
Check out the nitro repository. Use the test-node submodule of nitro repository.

> Notice: testnode may not always be up-to-date with config options of current nitro node, and is not considered stable when operated in that way.

### Without Stylus support
```bash
git clone --recurse-submodules https://github.com/OffchainLabs/nitro.git
cd nitro/nitro-testnode
Expand All @@ -64,18 +44,6 @@ Initialize the node in dev-mode (this will build the docker images from source)
```
To see more options, use `--help`.

### With Stylus support
```bash
git clone --recurse-submodules https://github.com/OffchainLabs/stylus.git
cd stylus/nitro-testnode
```

Initialize the node in dev-mode (this will build the docker images from source)
```bash
./test-node.bash --init --dev
```
To see more options, use `--help`.

## Further information

### Working with docker containers
Expand Down
49 changes: 43 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: "3.9"
services:
blockscout:
depends_on:
Expand Down Expand Up @@ -67,7 +66,7 @@ services:
- --authrpc.port=8551
- --authrpc.addr=0.0.0.0
- --http.vhosts=*
- --http.api=engine,personal,eth,net,web3
- --http.api=engine,personal,eth,net,web3,debug
- --http.corsdomain=*
- --ws
- --ws.addr=0.0.0.0
Expand Down Expand Up @@ -152,6 +151,7 @@ services:
sequencer:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:8547:8547"
- "127.0.0.1:8548:8548"
Expand All @@ -168,6 +168,7 @@ services:
sequencer_b:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:8647:8547"
- "127.0.0.1:8648:8548"
Expand All @@ -182,6 +183,7 @@ services:
sequencer_c:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:8747:8547"
- "127.0.0.1:8748:8548"
Expand All @@ -196,6 +198,7 @@ services:
sequencer_d:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:8847:8547"
- "127.0.0.1:8848:8548"
Expand All @@ -210,6 +213,7 @@ services:
staker-unsafe:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:8047:8547"
- "127.0.0.1:8048:8548"
Expand All @@ -226,6 +230,7 @@ services:
poster:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:8147:8547"
- "127.0.0.1:8148:8548"
Expand All @@ -241,6 +246,7 @@ services:
poster_b:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:9147:8547"
- "127.0.0.1:9148:8548"
Expand All @@ -256,6 +262,7 @@ services:
poster_c:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:9247:8547"
- "127.0.0.1:9248:8548"
Expand All @@ -271,6 +278,7 @@ services:
validator:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:8247:8547"
- "127.0.0.1:8248:8548"
Expand All @@ -286,6 +294,7 @@ services:
l3node:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro
ports:
- "127.0.0.1:3347:3347"
- "127.0.0.1:3348:3348"
Expand All @@ -301,12 +310,12 @@ services:
validation_node:
pid: host # allow debugging
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/nitro-val
ports:
- "127.0.0.1:8949:8549"
volumes:
- "config:/config"
command: --conf.file /config/validation_node_config.json
entrypoint: /usr/local/bin/nitro-val

scripts:
build: scripts/
Expand All @@ -318,24 +327,52 @@ services:
relay:
pid: host
image: nitro-node-dev-testnode
entrypoint: /usr/local/bin/relay
ports:
- "127.0.0.1:9652:9652"
entrypoint: bin/relay
command: --node.feed.output.port 9652 --node.feed.input.url ws://sequencer:9652
command: --chain.id 412346 --node.feed.input.url ws://sequencer:9642 --node.feed.output.port 9652

tokenbridge:
depends_on:
- geth
- sequencer
pid: host
build: tokenbridge/
build:
context: tokenbridge/
args:
TOKEN_BRIDGE_BRANCH: ${TOKEN_BRIDGE_BRANCH:-}
environment:
- ARB_URL=http://sequencer:8547
- ETH_URL=http://geth:8545
volumes:
- "tokenbridge-data:/workspace"
- /var/run/docker.sock:/var/run/docker.sock

rollupcreator:
depends_on:
- geth
- sequencer
pid: host
build:
context: rollupcreator/
args:
NITRO_CONTRACTS_BRANCH: ${NITRO_CONTRACTS_BRANCH:-}
volumes:
- "config:/config"
- /var/run/docker.sock:/var/run/docker.sock

# eigenda-proxy:
# container_name: eigenda-proxy
# image: eigenda-proxy
# environment:
# - EIGENDA_PROXY_ADDR=0.0.0.0
# - EIGENDA_PROXY_PORT=4242
# - MEMSTORE_ENABLED=true
# - MEMSTORE_EXPIRATION=2m
# - EIGENDA_PROXY_TARGET_KZG_G1_PATH=../../../eigenlayer/eigenda-proxy/operator-setup/resources/g1.point
# ports:
# - 4242:4242
#
volumes:
l1data:
consensus:
Expand Down
29 changes: 29 additions & 0 deletions rollupcreator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM node:18-bullseye-slim


# Install necessary packages
RUN apt-get update && \
apt-get install -y git docker.io python3 build-essential curl jq

# Create workspace
WORKDIR /workspace
# Clone the repository and checkout the specified branch
RUN git clone --no-checkout https://[email protected]/layr-labs/nitro-contracts-private ./
RUN git checkout a450cd9278f067b480671e5658804f029da38ea1

# ensure create-rollup-testnode command is in package.json
RUN jq -e '.scripts["create-rollup-testnode"]' package.json > /dev/null || (echo "Error: 'create-rollup-testnode' not found in package.json" && exit 1)


# Install Foundry
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="${PATH}:/root/.foundry/bin"
RUN foundryup

# Setup scripts and dependencies
RUN touch scripts/config.ts
RUN yarn install
RUN yarn build:all


ENTRYPOINT ["yarn"]
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
FROM node:18-bullseye-slim
WORKDIR /workspace
COPY ./package.json ./yarn.lock ./
RUN yarn
Expand Down
11 changes: 6 additions & 5 deletions scripts/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ export function namedAddress(

export const namedAccountHelpString =
"Valid account names:\n" +
" funnel | sequencer | validator - known keys\n" +
" user_[Alphanumeric] - key will be generated from username\n" +
" threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" +
" key_0x[full private key] - user with specified private key\n" +
" funnel | sequencer | validator | l2owner - known keys used by l2\n" +
" l3owner | l3sequencer - known keys used by l3\n" +
" user_[Alphanumeric] - key will be generated from username\n" +
" threaduser_[Alphanumeric] - same as user_[Alphanumeric]_thread_[thread-id]\n" +
" key_0x[full private key] - user with specified private key\n" +
"\n" +
"Valid addresses: any account name, or\n" +
" address_0x[full eth address]\n" +
Expand Down Expand Up @@ -123,7 +124,7 @@ export const printPrivateKeyCommand = {
builder: {
account: {
string: true,
describe: "address (see general help)",
describe: "account (see general help)",
default: "funnel",
},
},
Expand Down
Loading
Loading