Skip to content

Commit

Permalink
Merges v0.0.6 into Develop (#2039)
Browse files Browse the repository at this point in the history
* fix eventlog config check

* fix build version flags

* fix optional trace config; update prover docker image

* add callTracer (#2010)

* go 1.19

* add callTracer, 4byte, noop and prestate tracers

* workaround to fix linter problem related to the ruleguard, more details here: golangci/golangci-lint#3107

* fix eth_estimateGas response for reverted txs

* Improve claim checks (#2027)

* fix wrong state root when prevlastbatch & lastbatch are empty + restart (#2028)

* Update production config for prover

* Update prover version

* fix conflicts

* fix conflicts

* fix conflicts

* Add ALL PRIVILEGES to prover_user for prover_db.state schema

* update linter version

---------

Co-authored-by: tclemos <thiago@iden3.com>
Co-authored-by: Thiago Coimbra Lemos <tclemos@users.noreply.github.com>
Co-authored-by: Alonso Rodriguez <ARR552@users.noreply.github.com>
Co-authored-by: bros <arnaubennassar5@gmail.com>
Co-authored-by: agnusmor <agnusmor@gmail.com>
Co-authored-by: agnusmor <100322135+agnusmor@users.noreply.github.com>
Co-authored-by: Thiago Lemos <thiago@polygon.technology>
  • Loading branch information
8 people committed Apr 24, 2023
1 parent e728386 commit 9d70cae
Show file tree
Hide file tree
Showing 74 changed files with 9,320 additions and 1,151 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.19.x
- name: Checkout code
uses: actions/checkout@v3
- name: Lint
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push-docker-tagged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: Get packr
run: go install github.com/gobuffalo/packr/v2/packr2@v2.8.3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ 1.18.x ]
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
e2e-group: [ 1, 2, 3, 4, 5, 6, 7 ]
runs-on: ubuntu-latest
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/test-from-prover.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test from zkevm-prover call
on:
workflow_call:
inputs:
prover_image:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true

jobs:
test-from-prover:
runs-on: [self-hosted, linux, X64, hc]

strategy:
matrix:
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
e2e-group: [ 2 ]

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
repository: 0xPolygonHermez/zkevm-node

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
env:
GOARCH: ${{ matrix.goarch }}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker
run: make build-docker

- name: Compile SCs
run: make compile-scs
working-directory: test

- name: Test
run: make test-full-non-e2e
working-directory: test
2 changes: 1 addition & 1 deletion .github/workflows/test-full-non-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
test-full-non-e2e:
strategy:
matrix:
go-version: [ 1.18.x ]
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/updatedeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: "1.18.x"
go-version: "1.19.x"
env:
GOARCH: "amd64"

Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
run:
timeout: 5m
skip-dirs:
- state/runtime/fakevm
- state/runtime/instrumentation

linters:
enable:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CONTAINER FOR BUILDING BINARY
FROM golang:1.18 AS build
FROM golang:1.19 AS build

# INSTALL DEPENDENCIES
RUN go install github.com/gobuffalo/packr/v2/packr2@v2.8.3
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ stop: ## Stops all services

.PHONY: install-linter
install-linter: ## Installs the linter
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.46.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.52.2

.PHONY: lint
lint: ## Runs the linter
$$(go env GOPATH)/bin/golangci-lint run
export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/golangci-lint run

.PHONY: update-external-dependencies
update-external-dependencies: ## Updates external dependencies like images, test vectors or proto files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ It's recommended to use `make` for building, and testing the code, ... Run `make

### Requirements

- Go 1.18
- Go 1.19
- Docker
- Docker Compose
- Make
Expand Down
6 changes: 6 additions & 0 deletions config/environments/mainnet/public.prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@
"dbProgramTableName": "state.program",
"dbAsyncWrite": false,
"dbMultiWrite": true,
"dbConnectionsPool": true,
"dbNumberOfPoolConnections": 30,
"dbMetrics": true,
"dbClearCache": false,
"dbGetTree": true,
"dbReadOnly": false,
"dbMTCacheSize": 8192,
"dbProgramCacheSize": 1024,
"cleanerPollingPeriod": 600,
Expand Down
12 changes: 8 additions & 4 deletions config/environments/public/public.prover.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"saveDbReadsToFileOnChange": false,
"saveOutputToFile": false,
"saveResponseToFile": false,
"loadDBToMemCache": false,
"loadDBToMemCache": true,
"opcodeTracer": false,
"logRemoteDbReads": false,
"logExecutorServerResponses": false,
Expand Down Expand Up @@ -97,10 +97,14 @@
"dbProgramTableName": "state.program",
"dbAsyncWrite": false,
"dbMultiWrite": true,
"dbMTCacheSize": 10240,
"dbProgramCacheSize": 1024,
"dbConnectionsPool": true,
"dbNumberOfPoolConnections": 28,
"dbNumberOfPoolConnections": 30,
"dbMetrics": true,
"dbClearCache": false,
"dbGetTree": true,
"dbReadOnly": false,
"dbMTCacheSize": 8192,
"dbProgramCacheSize": 1024,
"cleanerPollingPeriod": 600,
"requestsPersistence": 3600,
"maxExecutorThreads": 20,
Expand Down
2 changes: 1 addition & 1 deletion db/scripts/init_prover_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CREATE TABLE state.program (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL);

CREATE USER prover_user with password 'prover_pass';
GRANT CONNECT ON DATABASE prover_db TO prover_user;
GRANT USAGE ON SCHEMA state TO prover_user;
GRANT ALL PRIVILEGES ON SCHEMA state TO prover_user;
GRANT ALL PRIVILEGES ON TABLE state.nodes TO prover_user;
GRANT ALL PRIVILEGES ON TABLE state.program TO prover_user;
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ services:
zkevm-prover:
container_name: zkevm-prover
restart: unless-stopped
image: hermeznetwork/zkevm-prover:6d6e3aa
image: hermeznetwork/zkevm-prover:b6fe2db
depends_on:
zkevm-state-db:
condition: service_healthy
Expand Down
6 changes: 3 additions & 3 deletions docs/ci/groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ for each of the jobs looks like this:
```
strategy:
matrix:
go-version: [ 1.18.x ]
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
e2e-group: [ 1, 2, 3 ]
```
Expand All @@ -54,15 +54,15 @@ groups 1 and 3, the matrix strategy config should look like:
```
strategy:
matrix:
go-version: [ 1.18.x ]
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
e2e-group: [ 2 ]
```
If we want to re-add group 1:
```
strategy:
matrix:
go-version: [ 1.18.x ]
go-version: [ 1.19.x ]
goarch: [ "amd64" ]
e2e-group: [ 1, 2 ]
```
Expand Down
13 changes: 7 additions & 6 deletions etherman/etherman.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
Expand Down Expand Up @@ -594,11 +595,11 @@ func (etherMan *Client) forcedBatchEvent(ctx context.Context, vLog types.Log, bl
} else if isPending {
return fmt.Errorf("error: tx is still pending. TxHash: %s", tx.Hash().String())
}
msg, err := tx.AsMessage(types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
msg, err := core.TransactionToMessage(tx, types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
if err != nil {
return err
}
if fb.Sequencer == msg.From() {
if fb.Sequencer == msg.From {
txData := tx.Data()
// Extract coded txs.
// Load contract ABI
Expand Down Expand Up @@ -661,11 +662,11 @@ func (etherMan *Client) sequencedBatchesEvent(ctx context.Context, vLog types.Lo
} else if isPending {
return fmt.Errorf("error tx is still pending. TxHash: %s", tx.Hash().String())
}
msg, err := tx.AsMessage(types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
msg, err := core.TransactionToMessage(tx, types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
if err != nil {
return err
}
sequences, err := decodeSequences(tx.Data(), sb.NumBatch, msg.From(), vLog.TxHash, msg.Nonce())
sequences, err := decodeSequences(tx.Data(), sb.NumBatch, msg.From, vLog.TxHash, msg.Nonce)
if err != nil {
return fmt.Errorf("error decoding the sequences: %v", err)
}
Expand Down Expand Up @@ -786,15 +787,15 @@ func (etherMan *Client) forceSequencedBatchesEvent(ctx context.Context, vLog typ
} else if isPending {
return fmt.Errorf("error: tx is still pending. TxHash: %s", tx.Hash().String())
}
msg, err := tx.AsMessage(types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
msg, err := core.TransactionToMessage(tx, types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
if err != nil {
return err
}
fullBlock, err := etherMan.EthClient.BlockByHash(ctx, vLog.BlockHash)
if err != nil {
return fmt.Errorf("error getting hashParent. BlockNumber: %d. Error: %w", vLog.BlockNumber, err)
}
sequencedForceBatch, err := decodeSequencedForceBatches(tx.Data(), fsb.NumBatch, msg.From(), vLog.TxHash, fullBlock, msg.Nonce())
sequencedForceBatch, err := decodeSequencedForceBatches(tx.Data(), fsb.NumBatch, msg.From, vLog.TxHash, fullBlock, msg.Nonce)
if err != nil {
return err
}
Expand Down
12 changes: 5 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/0xPolygonHermez/zkevm-node

go 1.18
go 1.19

require (
github.com/didip/tollbooth/v6 v6.1.2
github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7
github.com/ethereum/go-ethereum v1.11.0
github.com/ethereum/go-ethereum v1.11.5
github.com/go-git/go-billy/v5 v5.4.1
github.com/go-git/go-git/v5 v5.6.1
github.com/gobuffalo/packr/v2 v2.8.3
Expand Down Expand Up @@ -41,7 +41,7 @@ require (
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cloudflare/circl v1.1.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
Expand All @@ -51,7 +51,7 @@ require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
Expand All @@ -60,19 +60,18 @@ require (
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
github.com/go-kit/kit v0.9.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-pkgz/expirable-cache v0.0.3 // indirect
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gobuffalo/logger v1.0.7 // indirect
github.com/gobuffalo/packd v1.0.2 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
Expand Down Expand Up @@ -102,7 +101,6 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/tsdb v0.7.1 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
Expand Down
Loading

0 comments on commit 9d70cae

Please sign in to comment.