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

fix(reth): use reth instead of geth #1410

Merged
merged 20 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 17 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
6 changes: 1 addition & 5 deletions bin/ci_localnet_up
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ set -e

cd $ZKSYNC_HOME

mkdir -p ./volumes/postgres ./volumes/geth/keystore ./volumes/prysm/beacon ./volumes/prysm/validator
cp ./docker/prysm/config.yml ./volumes/prysm/config.yml
cp ./docker/geth/jwtsecret ./volumes/geth/jwtsecret
cp ./docker/geth/password.sec ./volumes/geth/password.sec
cp ./docker/geth/keystore/UTC--2019-04-06T21-13-27.692266000Z--8a91dc2d28b689474298d91899f0c1baf62cb85b ./volumes/geth/keystore/
mkdir -p ./volumes/postgres ./volumes/reth/data ./volumes/reth/logs
docker-compose --profile runner up -d --wait
2 changes: 1 addition & 1 deletion contracts
2 changes: 1 addition & 1 deletion core/tests/loadnext/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fn default_l1_rpc_address() -> String {

fn default_master_wallet_pk() -> String {
// Use this key only for localhost because it is compromised!
// Using this key for Rinkeby will result in losing Rinkeby ETH.
// Using this key for Testnet will result in losing Testnet ETH.
// Corresponding wallet is `0x36615Cf349d7F6344891B1e7CA7C72883F5dc049`
let result = "7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110".to_string();
tracing::info!("Using default MASTER_WALLET_PK: {result}");
Expand Down
30 changes: 22 additions & 8 deletions core/tests/revert-test/tests/revert-and-restart-en.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,21 +239,35 @@ describe('Block reverting test', function () {
const lastExecuted: BigNumber = await main_contract.getTotalBlocksExecuted();
// One is not enough to test the reversion of sk cache because
// it gets updated with some batch logs only at the start of the next batch.
for (let i = 0; i < 2; i++) {
const h: zkweb3.types.PriorityOpResponse = await extNode.tester.syncWallet.deposit({
token: zkweb3.utils.ETH_ADDRESS,
amount: depositAmount,
to: alice.address
});
await h.waitL1Commit();
const initialL1BatchNumber = (await main_contract.getTotalBlocksCommitted()).toNumber();
const firstDepositHandle = await extNode.tester.syncWallet.deposit({
token: zkweb3.utils.ETH_ADDRESS,
amount: depositAmount,
to: alice.address
});

await firstDepositHandle.wait();
while ((await extNode.tester.web3Provider.getL1BatchNumber()) <= initialL1BatchNumber) {
await utils.sleep(0.1);
}

const secondDepositHandle = await extNode.tester.syncWallet.deposit({
token: zkweb3.utils.ETH_ADDRESS,
amount: depositAmount,
to: alice.address
});
await secondDepositHandle.wait();
while ((await extNode.tester.web3Provider.getL1BatchNumber()) <= initialL1BatchNumber + 1) {
await utils.sleep(0.3);
}

while (true) {
const lastCommitted: BigNumber = await main_contract.getTotalBlocksCommitted();
console.log(`lastExecuted = ${lastExecuted}, lastCommitted = ${lastCommitted}`);
if (lastCommitted.sub(lastExecuted).gte(2)) {
break;
}
await utils.sleep(1);
await utils.sleep(0.3);
}
const alice2 = await alice.getBalance();
console.log('Terminate the main node');
Expand Down
4 changes: 2 additions & 2 deletions core/tests/ts-integration/tests/custom-erc20-bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ describe('Tests for the custom bridge behavior', () => {
const gasPrice = await scaledGasPrice(alice);

let l1Bridge = await l1bridgeFactory.deploy(process.env.CONTRACTS_DIAMOND_PROXY_ADDR!);
await l1Bridge.deployTransaction.wait(2);
await l1Bridge.deployTransaction.wait();
let l1BridgeProxyFactory = new TransparentUpgradeableProxyFactory(alice._signerL1());
let l1BridgeProxy = await l1BridgeProxyFactory.deploy(l1Bridge.address, bob.address, '0x');
const amount = 1000; // 1000 wei is enough.
await l1BridgeProxy.deployTransaction.wait(2);
await l1BridgeProxy.deployTransaction.wait();

const isLocalSetup = process.env.ZKSYNC_LOCAL_SETUP;
const baseCommandL1 = isLocalSetup
Expand Down
23 changes: 18 additions & 5 deletions docker-compose-cpu-runner.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
version: '3.2'
services:
geth:
image: "matterlabs/geth:latest"
environment:
- PLUGIN_CONFIG
reth:
restart: always
image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.1"
volumes:
- type: bind
source: ./volumes/reth/data
target: /rethdata
- type: bind
source: ./volumes/reth/logs
target: /rethlogs
- type: bind
source: ./etc/test_config/
target: /chaindata

command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --dev.block-time 300ms --chain /chaindata/reth_config
ports:
- 127.0.0.1:8545:8545

zk:
image: "matterlabs/zk-environment:latest2.0-lightweight-nightly"
depends_on:
- geth
- reth
- postgres
security_opt:
- seccomp:unconfined
Expand Down
23 changes: 18 additions & 5 deletions docker-compose-gpu-runner-cuda-12-0.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
version: '3.2'
services:
geth:
image: "matterlabs/geth:latest"
environment:
- PLUGIN_CONFIG
reth:
restart: always
image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.1"
volumes:
- type: bind
source: ./volumes/reth/data
target: /rethdata
- type: bind
source: ./volumes/reth/logs
target: /rethlogs
Deniallugo marked this conversation as resolved.
Show resolved Hide resolved
- type: bind
source: ./etc/test_config/
Deniallugo marked this conversation as resolved.
Show resolved Hide resolved
target: /chaindata

command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --dev.block-time 300ms --chain /chaindata/reth_config
ports:
- 127.0.0.1:8545:8545

zk:
image: matterlabs/zk-environment:cuda-12-0-latest
depends_on:
- geth
- reth
- postgres
security_opt:
- seccomp:unconfined
Expand Down
23 changes: 18 additions & 5 deletions docker-compose-gpu-runner.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
version: '3.2'
services:
geth:
image: "matterlabs/geth:latest"
environment:
- PLUGIN_CONFIG
reth:
restart: always
image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.1"
volumes:
- type: bind
source: ./volumes/reth/data
target: /rethdata
- type: bind
source: ./volumes/reth/logs
target: /rethlogs
- type: bind
source: ./etc/test_config/
target: /chaindata

command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --dev.block-time 300ms --chain /chaindata/reth_config
ports:
- 127.0.0.1:8545:8545

zk:
image: "matterlabs/zk-environment:cuda-11-8-latest"
container_name: zk
depends_on:
- geth
- reth
- postgres
security_opt:
- seccomp:unconfined
Expand Down
24 changes: 2 additions & 22 deletions docker-compose-runner-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,7 @@ services:
file: docker-compose.yml
service: postgres

geth:
reth:
extends:
file: docker-compose.yml
service: geth

create-beacon-chain-genesis:
extends:
file: docker-compose.yml
service: create-beacon-chain-genesis

validator:
extends:
file: docker-compose.yml
service: validator

beacon:
extends:
file: docker-compose.yml
service: beacon

geth-genesis:
extends:
file: docker-compose.yml
service: geth-genesis
service: reth
116 changes: 16 additions & 100 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,23 @@
version: '3.2'
services:
create-beacon-chain-genesis:
image: "gcr.io/prysmaticlabs/prysm/cmd/prysmctl:HEAD-c6801d"
command:
- testnet
- generate-genesis
- --fork=deneb
- --num-validators=64
- --genesis-time-delay=5
- --output-ssz=/consensus/genesis.ssz
- --chain-config-file=/prysm/config.yml
- --geth-genesis-json-in=/geth/standard-dev.json
- --geth-genesis-json-out=/execution/genesis.json
reth:
restart: always
image: "ghcr.io/paradigmxyz/reth:v0.2.0-beta.1"
volumes:
- ./docker/geth:/geth/:ro
- ./docker/prysm:/prysm/:ro
- ./volumes/geth:/execution
- ./volumes/prysm:/consensus
geth-genesis:
image: "ethereum/client-go:v1.13.5"
command: --datadir=/execution init /execution/genesis.json
volumes:
- ./volumes/geth:/execution
depends_on:
create-beacon-chain-genesis:
condition: service_completed_successfully
geth:
image: "ethereum/client-go:v1.13.5"
ports:
- 8551:8551
- 8545:8545
- 8546:8546
volumes:
- ./volumes/geth:/var/lib/geth/data
- ./docker/geth/:/geth/:ro
command:
- --networkid=9
- --datadir=/var/lib/geth/data
- --http
- --http.api=engine,eth,web3,personal,net,debug
- --http.addr=0.0.0.0
- --http.corsdomain=*
- --http.vhosts=*
- --ws
- --ws.addr=0.0.0.0
- --ws.port=8546
- --ws.origins=*
- --nodiscover
- --authrpc.addr=0.0.0.0
- --authrpc.vhosts=*
- --authrpc.jwtsecret=/var/lib/geth/data/jwtsecret
- --allow-insecure-unlock
- --unlock=0x8a91dc2d28b689474298d91899f0c1baf62cb85b
- --password=/var/lib/geth/data/password.sec
- --syncmode=full
depends_on:
beacon:
condition: service_started
geth-genesis:
condition: service_completed_successfully
beacon:
image: "gcr.io/prysmaticlabs/prysm/beacon-chain:HEAD-c6801d"
command:
- --datadir=/consensus/beacon/
- --min-sync-peers=0
- --genesis-state=/consensus/genesis.ssz
- --bootstrap-node=
- --interop-eth1data-votes
- --chain-config-file=/consensus/config.yml
- --contract-deployment-block=0
- --chain-id=9
- --rpc-host=0.0.0.0
- --grpc-gateway-host=0.0.0.0
- --execution-endpoint=http://geth:8551
- --accept-terms-of-use
- --jwt-secret=/execution/jwtsecret
- --suggested-fee-recipient=0x8a91dc2d28b689474298d91899f0c1baf62cb85b
- --minimum-peers-per-subnet=0
- --enable-debug-rpc-endpoints
- type: bind
source: ./volumes/reth/data
target: /rethdata
- type: bind
source: ./volumes/reth/logs
target: /rethlogs
- type: bind
source: ./etc/test_config/
target: /chaindata

command: node --dev --datadir /rethdata --http --http.addr 0.0.0.0 --http.port 8545 --dev.block-time 300ms --chain /chaindata/reth_config
ports:
- 4000:4000
- 3500:3500
- 6060:6060
volumes:
- ./volumes/prysm:/consensus
- ./volumes/geth:/execution
depends_on:
create-beacon-chain-genesis:
condition: service_completed_successfully
validator:
image: "gcr.io/prysmaticlabs/prysm/validator:HEAD-c6801d"
command:
- --beacon-rpc-provider=beacon:4000
- --datadir=/consensus/validatordata
- --accept-terms-of-use
- --interop-num-validators=64
- --interop-start-index=0
- --chain-config-file=/consensus/config.yml
depends_on:
beacon:
condition: service_started
volumes:
- ./volumes/prysm:/consensus
- 127.0.0.1:8545:8545

postgres:
image: "postgres:14"
command: postgres -c 'max_connections=200'
Expand Down
13 changes: 0 additions & 13 deletions docker/geth/Dockerfile

This file was deleted.

48 changes: 0 additions & 48 deletions docker/geth/geth-entry.sh

This file was deleted.

1 change: 0 additions & 1 deletion docker/geth/jwtsecret

This file was deleted.

Loading
Loading