Skip to content

Commit

Permalink
test(taiko-client): introduce taiko-reth as another L2 node in test…
Browse files Browse the repository at this point in the history
…ing (#18223)

Co-authored-by: David <[email protected]>
  • Loading branch information
mask-pp and davidtaikocha authored Oct 13, 2024
1 parent ea55bc2 commit e856273
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 12 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/taiko-client--test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
runs-on: [ubuntu-latest]
timeout-minutes: 15

strategy:
matrix:
execution_node: [l2_geth, l2_reth]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand All @@ -55,8 +59,10 @@ jobs:
- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies

- name: Test
- name: Run Tests on ${{ matrix.execution_node }} execution engine
working-directory: packages/taiko-client
env:
L2_NODE: ${{ matrix.execution_node }}
run: make test

- name: Codecov.io
Expand Down
3 changes: 2 additions & 1 deletion packages/taiko-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ lint:
&& goimports -local "github.com/taikoxyz/taiko-mono/packages/taiko-client" -w ./ \
&& golangci-lint run

test: lint
test:
@PACKAGE=${PACKAGE} \
L2_NODE=$${L2_NODE:-l2_geth} \
RUN_TESTS=true \
./integration_test/entrypoint.sh

Expand Down
8 changes: 8 additions & 0 deletions packages/taiko-client/driver/chain_syncer/blob/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ func (s *BlobSyncerTestSuite) TestInsertNewHead() {
}

func (s *BlobSyncerTestSuite) TestTreasuryIncomeAllAnchors() {
// TODO: Temporarily skip this test case when using l2_reth node.
if os.Getenv("L2_NODE") == "l2_reth" {
s.T().Skip()
}
treasury := common.HexToAddress(os.Getenv("TREASURY"))
s.NotZero(treasury.Big().Uint64())

Expand All @@ -133,6 +137,10 @@ func (s *BlobSyncerTestSuite) TestTreasuryIncomeAllAnchors() {
}

func (s *BlobSyncerTestSuite) TestTreasuryIncome() {
// TODO: Temporarily skip this test case when using l2_reth node.
if os.Getenv("L2_NODE") == "l2_reth" {
s.T().Skip()
}
treasury := common.HexToAddress(os.Getenv("TREASURY"))
s.NotZero(treasury.Big().Uint64())

Expand Down
4 changes: 4 additions & 0 deletions packages/taiko-client/driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ func (s *DriverTestSuite) TestProcessL1Blocks() {
}

func (s *DriverTestSuite) TestCheckL1ReorgToHigherFork() {
// TODO: Temporarily skip this test case when use l2_reth node.
if os.Getenv("L2_NODE") == "l2_reth" {
s.T().Skip()
}
var (
testnetL1SnapshotID = s.SetL1Snapshot()
)
Expand Down
12 changes: 6 additions & 6 deletions packages/taiko-client/internal/docker/docker_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ until cast chain-id --rpc-url "$L1_PROBE_URL" 2> /dev/null; do
done

# check until L2 chain is ready
L2_PROBE_URL=ws://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==2 {print $2}')
L2_PROBE_URL=ws://localhost:$(docker port $L2_NODE | grep "0.0.0.0" | awk -F ':' 'NR==2 {print $2}')
until cast chain-id --rpc-url "$L2_PROBE_URL" 2> /dev/null; do
sleep 1
done
Expand All @@ -18,13 +18,13 @@ L1_NODE_PORT=$(docker port l1_node | grep '0.0.0.0' | awk -F ':' '{print $2}')
export L1_HTTP=http://localhost:$L1_NODE_PORT
export L1_WS=ws://localhost:$L1_NODE_PORT

export L2_HTTP=http://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==1 {print $2}')
export L2_WS=ws://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==2 {print $2}')
export L2_AUTH=http://localhost:$(docker port l2_node | grep "0.0.0.0" | awk -F ':' 'NR==3 {print $2}')
export L2_HTTP=http://localhost:$(docker port $L2_NODE | grep "0.0.0.0" | awk -F ':' 'NR==1 {print $2}')
export L2_WS=ws://localhost:$(docker port $L2_NODE | grep "0.0.0.0" | awk -F ':' 'NR==2 {print $2}')
export L2_AUTH=http://localhost:$(docker port $L2_NODE | grep "0.0.0.0" | awk -F ':' 'NR==3 {print $2}')
export JWT_SECRET=$DIR/nodes/jwt.hex

echo -e "L1_NODE PORTS: \n$(docker port l1_node)"
echo -e "L2_NODE PORTS: \n$(docker port l2_node)"
echo -e "L1_NODE PORTS: \n\t$(docker port l1_node)"
echo -e "L2_NODE PORTS: \n\t$(docker port $L2_NODE)"

echo "L1_HTTP: $L1_HTTP"
echo "L1_WS: $L1_WS"
Expand Down
42 changes: 40 additions & 2 deletions packages/taiko-client/internal/docker/nodes/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ services:
- --hardfork
- cancun

l2_execution_engine:
container_name: l2_node
l2_geth:
container_name: l2_geth
image: us-docker.pkg.dev/evmchain/images/taiko-geth:taiko
restart: unless-stopped
pull_policy: always
Expand Down Expand Up @@ -67,3 +67,41 @@ services:
- --ws.api
- admin,debug,eth,net,web3,txpool,miner,taiko
- --taiko

l2_reth:
container_name: l2_reth
image: us-docker.pkg.dev/evmchain/images/taiko-reth:v1.0.0
restart: unless-stopped
pull_policy: always
volumes:
- .:/host
ports:
- "8545"
- "8546"
- "8551"
command:
- node
- --datadir
- /data/taiko-geth
- --chain
- "167001"
- --http
- --http.addr
- "0.0.0.0"
- --http.corsdomain
- "*"
- --ws
- --ws.addr
- "0.0.0.0"
- --ws.origins
- "*"
- --authrpc.addr
- "0.0.0.0"
- --authrpc.port
- "8551"
- --authrpc.jwtsecret
- /host/jwt.hex
- --http.api
- admin,debug,eth,net,web3,txpool,taiko
- --ws.api
- admin,debug,eth,net,web3,txpool,taiko
9 changes: 8 additions & 1 deletion packages/taiko-client/internal/docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

source scripts/common.sh

DOCKER_SERVICE_LIST=("l1_node" "l2_execution_engine")
if [ "$L2_NODE" == "l2_reth" ];then
DOCKER_SERVICE_LIST=("l1_node" "l2_reth")
elif [ "$L2_NODE" == "l2_geth" ];then
DOCKER_SERVICE_LIST=("l1_node" "l2_geth")
else
echo "unsupported L2_NODE: $L2_NODE"
exit 1
fi

# start docker compose service list
echo "start docker compose service: ${DOCKER_SERVICE_LIST[*]}"
Expand Down
9 changes: 8 additions & 1 deletion packages/taiko-client/internal/docker/stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

source scripts/common.sh

DOCKER_SERVICE_LIST=("l1_node" "l2_execution_engine")
if [ "$L2_NODE" == "l2_reth" ];then
DOCKER_SERVICE_LIST=("l1_node" "l2_reth")
elif [ "$L2_NODE" == "l2_geth" ];then
DOCKER_SERVICE_LIST=("l1_node" "l2_geth")
else
echo "unsupported L2_NODE: $L2_NODE"
exit 1
fi

echo "stop docker compose service: ${DOCKER_SERVICE_LIST[*]}"

Expand Down
4 changes: 4 additions & 0 deletions packages/taiko-client/proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ func (s *ProposerTestSuite) TestProposeTxLists() {
}

func (s *ProposerTestSuite) TestProposeOpNoEmptyBlock() {
// TODO: Temporarily skip this test case when using l2_reth node.
if os.Getenv("L2_NODE") == "l2_reth" {
s.T().Skip()
}
defer s.Nil(s.s.ProcessL1Blocks(context.Background()))

p := s.p
Expand Down

0 comments on commit e856273

Please sign in to comment.