Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaubennassar committed Dec 12, 2023
1 parent 468b809 commit 797d93b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
27 changes: 27 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DOCKERCOMPOSEEXPLORERRPC := zkevm-explorer-json-rpc
DOCKERCOMPOSEZKPROVER := zkevm-prover
DOCKERCOMPOSEPERMISSIONLESSDB := zkevm-permissionless-db
DOCKERCOMPOSEPERMISSIONLESSNODE := zkevm-permissionless-node
DOCKERCOMPOSEPERMISSIONLESSNODEDAC := zkevm-node-forced-DAC
DOCKERCOMPOSEPERMISSIONLESSZKPROVER := zkevm-permissionless-prover
DOCKERCOMPOSENODEAPPROVE := zkevm-approve
DOCKERCOMPOSEMETRICS := zkevm-metrics
Expand Down Expand Up @@ -45,6 +46,7 @@ RUNZKPROVER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEZKPROVER)

RUNPERMISSIONLESSDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSDB)
RUNPERMISSIONLESSNODE := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSNODE)
RUNPERMISSIONLESSNODEDAC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSNODEDAC)
RUNPERMISSIONLESSZKPROVER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPERMISSIONLESSZKPROVER)

RUNAPPROVE := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSENODEAPPROVE)
Expand Down Expand Up @@ -75,6 +77,7 @@ STOPZKPROVER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEZKPROVER) && $(DOCKERCOMPOS

STOPPERMISSIONLESSDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSDB)
STOPPERMISSIONLESSNODE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSNODE) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSNODE)
STOPPERMISSIONLESSNODEDAC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSNODEDAC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSNODEDAC)
STOPPERMISSIONLESSZKPROVER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPERMISSIONLESSZKPROVER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPERMISSIONLESSZKPROVER)

STOPAPPROVE := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSENODEAPPROVE) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSENODEAPPROVE)
Expand All @@ -83,6 +86,9 @@ STOPMETRICS := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEMETRICS) && $(DOCKERCOMPOSE)

STOP := $(DOCKERCOMPOSE) down --remove-orphans

RUNDACDB := docker-compose up -d zkevm-data-node-db
STOPDACDB := docker-compose stop zkevm-data-node-db && docker-compose rm -f zkevm-data-node-db

.PHONY: test-full-non-e2e
test-full-non-e2e: stop ## Runs non-e2e tests checking race conditions
$(RUNSTATEDB)
Expand Down Expand Up @@ -603,6 +609,27 @@ generate-mocks-aggregator: ## Generates mocks for aggregator , using mockery too
run-benchmarks: run-db ## Runs benchmars
go test -bench=. ./state/tree

.PHONY: run-dac-db
run-dac-db: ## Suns the DAC DB
$(RUNDACDB)

.PHONY: stop-dac-db
stop-dac-db: ## Stops the DAC DB
$(STOPDACDB)

.PHONY: run-permissionless-dac
run-permissionless-dac: ## Runs a permissionless node that is forced to sync through DAC
$(RUNPERMISSIONLESSDB)
sleep 1
$(RUNPERMISSIONLESSZKPROVER)
$(RUNPERMISSIONLESSNODEDAC)

.PHONY: stop-permissionless-dac
stop-permissionless-dac: ## Stops the permissionless node that is forced to sync through DAC
$(STOPPERMISSIONLESSNODEDAC)
$(STOPPERMISSIONLESSZKPROVER)
$(STOPPERMISSIONLESSDB)

.PHONY: compile-scs
compile-scs: ## Compiles smart contracts, configuration in test/contracts/index.yaml
go run ./scripts/cmd... compilesc --input ./contracts
Expand Down
2 changes: 1 addition & 1 deletion test/config/test.genesis.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"cdkDataCommitteeContract": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
},
"root": "0xd88680f1b151dd67518f9aca85161424c0cac61df2f5424a3ddc04ea25adecc7",
"genesisBlockNumber": 76,
"genesisBlockNumber": 75,
"genesis": [
{
"contractName": "PolygonZkEVMDeployer",
Expand Down
20 changes: 20 additions & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -486,3 +486,23 @@ services:
- "/bin/sh"
- "-c"
- "/app/zkevm-node run --network custom --custom-network-file /app/genesis.json --cfg /app/config.toml --components \"rpc,synchronizer\""

zkevm-data-node-db:
container_name: zkevm-data-node-db
restart: unless-stopped
image: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 10s
timeout: 5s
retries: 5
ports:
- 5444:5432
environment:
- POSTGRES_USER=committee_user
- POSTGRES_PASSWORD=committee_password
- POSTGRES_DB=committee_db
command:
- "postgres"
- "-N"
- "500"
2 changes: 1 addition & 1 deletion test/e2e/datacommittee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func TestDataCommittee(t *testing.T) {
"--name", "cdk-data-availability-"+strconv.Itoa(m.i),
"-v", cfgFile+":/app/config.json",
"-v", ksFile+":"+ksFile,
"--network", "cdk-validium",
"--network", "zkevm",
dacNodeContainer,
"/bin/sh", "-c",
"/app/cdk-data-availability run --cfg /app/config.json",
Expand Down
2 changes: 1 addition & 1 deletion test/operations/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const (
DefaultSequencerPrivateKey = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
DefaultSequencerBalance = 400000
DefaultMaxCumulativeGasUsed = 800000
DefaultL1ZkEVMSmartContract = "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
DefaultL1ZkEVMSmartContract = "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
DefaultL1DataCommitteeContract = "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
DefaultL1NetworkURL = "http://localhost:8545"
DefaultL1NetworkWebSocketURL = "ws://localhost:8546"
Expand Down

0 comments on commit 797d93b

Please sign in to comment.