Skip to content

Commit

Permalink
Feature/zkprover mock (0xPolygonHermez#946)
Browse files Browse the repository at this point in the history
* Remove in repo mock prover to use the zkprover mock

* Remove explorer from the make run
  • Loading branch information
arnaubennassar authored Jul 28, 2022
1 parent ed99a96 commit 844a4a2
Show file tree
Hide file tree
Showing 16 changed files with 7 additions and 2,303 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/push-docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,6 @@ jobs:
tags: |
hermeznetwork/zkevm-node:develop
- name: Check changes in prover
id: prover_changes
uses: dorny/paths-filter@v2
with:
filters: |
proverservice:
- 'proverservice/**'
- name: Build and push prover mock
if: steps.prover_changes.outputs.proverservice == 'true'
id: docker_build_prover_mock
uses: docker/build-push-action@v2
with:
context: ./proverservice
platforms: linux/amd64,linux/arm64
push: true
tags: |
hermeznetwork/zkevm-mock-prover:latest
- name: Check changes in zkevmprovermock
id: zkevmprovermock_changes
uses: dorny/paths-filter@v2
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/push-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,6 @@ jobs:
tags: |
hermeznetwork/zkevm-node:latest
- name: Check changes in mock prover
id: prover_changes
uses: dorny/paths-filter@v2
with:
filters: |
proverservice:
- 'proverservice/**'
- name: Build and push prover mock
if: steps.prover_changes.outputs.proverservice == 'true'
id: docker_build_prover_mock
uses: docker/build-push-action@v2
with:
context: ./proverservice
platforms: linux/amd64,linux/arm64
push: true
tags: |
hermeznetwork/zkevm-mock-prover:latest
- name: Check changes in zkevmprovermock
id: zkevmprovermock_changes
uses: dorny/paths-filter@v2
Expand Down
17 changes: 0 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ DOCKERCOMPOSEAPPSYNC := zkevm-sync
DOCKERCOMPOSEAPPBROADCAST := zkevm-broadcast
DOCKERCOMPOSEDB := zkevm-db
DOCKERCOMPOSENETWORK := zkevm-mock-l1-network
DOCKERCOMPOSEPROVER := zkevm-mock-prover
DOCKERCOMPOSEEXPLORER := zkevm-explorer
DOCKERCOMPOSEEXPLORERDB := zkevm-explorer-db
DOCKERCOMPOSEEXPLORERRPC := zkevm-explorer-json-rpc
Expand All @@ -22,7 +21,6 @@ RUNSYNC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPSYNC)
RUNBROADCAST := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEAPPBROADCAST)

RUNL1NETWORK := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSENETWORK)
RUNPROVER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEPROVER)
RUNEXPLORER := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORER)
RUNEXPLORERDB := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERDB)
RUNEXPLORERJSONRPC := $(DOCKERCOMPOSE) up -d $(DOCKERCOMPOSEEXPLORERRPC)
Expand All @@ -41,7 +39,6 @@ STOPSYNC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPSYNC) && $(DOCKERCOMPOSE) rm
STOPBROADCAST := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEAPPBROADCAST) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEAPPBROADCAST)

STOPNETWORK := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSENETWORK) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSENETWORK)
STOPPROVER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEPROVER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEPROVER)
STOPEXPLORER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORER)
STOPEXPLORERDB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERDB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERDB)
STOPEXPLORERRPC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERRPC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERRPC)
Expand Down Expand Up @@ -171,14 +168,6 @@ run-network: ## Runs the l1 network
stop-network: ## Stops the l1 network
$(STOPNETWORK)

.PHONY: run-prover
run-prover: ## Runs the zk prover
$(RUNPROVER)

.PHONY: stop-prover
stop-prover: ## Stops the zk prover
$(STOPPROVER)

.PHONY: run-zkprover
run-zkprover: ## Runs zkprover
$(RUNZKPROVER)
Expand Down Expand Up @@ -208,19 +197,14 @@ stop-explorer-db: ## Stops the explorer database
.PHONY: run
run: compile-scs ## Runs all the services
$(RUNDB)
$(RUNEXPLORERDB)
$(RUNL1NETWORK)
sleep 5
$(RUNZKPROVER)
sleep 5
$(RUNPROVER)
sleep 2
$(RUNSEQUENCER)
$(RUNAGGREGATOR)
$(RUNJSONRPC)
$(RUNEXPLORERJSONRPC)
$(RUNSYNC)
$(RUNEXPLORER)

.PHONY: run-broadcast
run-broadcast: ## Runs the broadcast service
Expand Down Expand Up @@ -292,7 +276,6 @@ generate-mocks: ## Generates mocks for the tests, using mockery tool
generate-code-from-proto: ## Generates code from proto files
cd proto/src/proto/statedb/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../merkletree/pb --go-grpc_out=../../../../../merkletree/pb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative statedb.proto
cd proto/src/proto/zkprover/v1 && protoc --proto_path=. --go_out=../../../../../proverclient/pb --go-grpc_out=../../../../../proverclient/pb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative zk-prover.proto
cd proto/src/proto/zkprover/v1 && protoc --proto_path=. --go_out=../../../../../proverservice/pb --go-grpc_out=../../../../../proverservice/pb --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative zk-prover.proto
cd proto/src/proto/executor/v1 && protoc --proto_path=. --go_out=../../../../../state/runtime/executor/pb --go-grpc_out=../../../../../state/runtime/executor/pb --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative executor.proto
cd proto/src/proto/broadcast/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../sequencer/broadcast/pb --go-grpc_out=../../../../../sequencer/broadcast/pb --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative broadcast.proto

Expand Down
7 changes: 1 addition & 6 deletions aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,7 @@ func (a *Aggregator) Start() {
}
newLocalExitRoot := batchToVerify.LocalExitRoot
// TODO: change this, once it will be clear, what db means
db := map[string]string{
"0540ae2a259cb9179561cffe6a0a3852a2c1806ad894ed396a2ef16e1f10e9c7": "0000000000000000000000000000000000000000000000056bc75e2d63100000",
"061927dd2a72763869c1d5d9336a42d12a9a2f22809c9cf1feeb2a6d1643d950": "0000000000000000000000000000000000000000000000000000000000000000",
"03ae74d1bbdff41d14f155ec79bb389db716160c1766a49ee9c9707407f80a11": "00000000000000000000000000000000000000000000000ad78ebc5ac6200000",
"18d749d7bcc2bc831229c19256f9e933c08b6acdaff4915be158e34cbbc8a8e1": "0000000000000000000000000000000000000000000000000000000000000000",
}
db := map[string]string{}

batchChainIDByte := make([]byte, 4) //nolint:gomnd
blockTimestampByte := make([]byte, 8) //nolint:gomnd
Expand Down
2 changes: 1 addition & 1 deletion config/config.local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Type = "default"
DefaultGasPriceWei = 1000000000

[Prover]
ProverURI = "zkevm-mock-prover:50051"
ProverURI = "zkevm-prover:50052"

[MTServer]
Host = "0.0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion config/prover.config.local.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"runProverServer": false,
"runProverServerMock": false,
"runProverServerMock": true,
"runProverClient": false,

"runExecutorServer": true,
Expand Down
22 changes: 4 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,27 +180,14 @@ services:
ports:
- 8545:8545

zkevm-mock-prover:
container_name: zkevm-mock-prover
image: hermeznetwork/zkevm-mock-prover@sha256:5a702c225c89f1dc9b54efc779541b7dc8d181eecad3320a918f1dc5a6521b18
ports:
- 50051:50051
- 50052:50052
environment:
- POSTGRES_USER=test_user
- POSTGRES_PASSWORD=test_password
- POSTGRES_DB=test_db
- POSTGRES_HOST=zkevm-db
- POSTGRES_PORT=5432
- PROOF_TIME=1000

zkevm-prover:
container_name: zkevm-prover
image: hermeznetwork/zkprover-local@sha256:8d99a22794531ff92cc7d6f5a722db02427bf66d4b76656de432b430b39a4418
ports:
# - 50051:50051 # Uncoment once the prover integration is ready, and enable the mock in the config file (and remove the zkevm-mock-prover)
- 50061:50061
- 50071:50071
# - 50051:50051 # Prover
- 50052:50052 # Mock prover
- 50061:50061 # MT
- 50071:50071 # Executor
volumes:
- ./config/prover.config.local.json:/usr/src/app/config.json
command: >
Expand Down Expand Up @@ -260,4 +247,3 @@ services:
- "/bin/sh"
- "-c"
- "/app/zkevm-node run --network local --cfg /app/config.toml --components \"rpc,synchronizer\""

13 changes: 0 additions & 13 deletions proverservice/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions proverservice/Makefile

This file was deleted.

16 changes: 0 additions & 16 deletions proverservice/go.mod

This file was deleted.

Loading

0 comments on commit 844a4a2

Please sign in to comment.