Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit 9d70cae

Browse files
ToniRamirezMtclemosARR552arnaubennassaragnusmor
authored
Merges v0.0.6 into Develop (#2039)
* 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 <[email protected]> Co-authored-by: Thiago Coimbra Lemos <[email protected]> Co-authored-by: Alonso Rodriguez <[email protected]> Co-authored-by: bros <[email protected]> Co-authored-by: agnusmor <[email protected]> Co-authored-by: agnusmor <[email protected]> Co-authored-by: Thiago Lemos <[email protected]>
1 parent e728386 commit 9d70cae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+9320
-1151
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install Go
1616
uses: actions/setup-go@v3
1717
with:
18-
go-version: 1.18.x
18+
go-version: 1.19.x
1919
- name: Checkout code
2020
uses: actions/checkout@v3
2121
- name: Lint

.github/workflows/push-docker-tagged.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
id: docker_build
2727
uses: docker/build-push-action@v2
2828
with:
29+
context: .
2930
platforms: linux/amd64,linux/arm64
3031
push: true
3132
tags: |

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v3
1919
with:
20-
go-version: 1.18
20+
go-version: 1.19
2121

2222
- name: Get packr
2323
run: go install github.com/gobuffalo/packr/v2/[email protected]

.github/workflows/test-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
go-version: [ 1.18.x ]
18+
go-version: [ 1.19.x ]
1919
goarch: [ "amd64" ]
2020
e2e-group: [ 1, 2, 3, 4, 5, 6, 7 ]
2121
runs-on: ubuntu-latest
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Test from zkevm-prover call
2+
on:
3+
workflow_call:
4+
inputs:
5+
prover_image:
6+
required: true
7+
type: string
8+
secrets:
9+
DOCKERHUB_USERNAME:
10+
required: true
11+
DOCKERHUB_TOKEN:
12+
required: true
13+
14+
jobs:
15+
test-from-prover:
16+
runs-on: [self-hosted, linux, X64, hc]
17+
18+
strategy:
19+
matrix:
20+
go-version: [ 1.19.x ]
21+
goarch: [ "amd64" ]
22+
e2e-group: [ 2 ]
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v3
27+
with:
28+
repository: 0xPolygonHermez/zkevm-node
29+
30+
- name: Install Go
31+
uses: actions/setup-go@v3
32+
with:
33+
go-version: ${{ matrix.go-version }}
34+
env:
35+
GOARCH: ${{ matrix.goarch }}
36+
37+
- name: Login to DockerHub
38+
uses: docker/login-action@v2
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
43+
- name: Build Docker
44+
run: make build-docker
45+
46+
- name: Compile SCs
47+
run: make compile-scs
48+
working-directory: test
49+
50+
- name: Test
51+
run: make test-full-non-e2e
52+
working-directory: test

.github/workflows/test-full-non-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
test-full-non-e2e:
1515
strategy:
1616
matrix:
17-
go-version: [ 1.18.x ]
17+
go-version: [ 1.19.x ]
1818
goarch: [ "amd64" ]
1919
runs-on: ubuntu-latest
2020
steps:

.github/workflows/updatedeps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install Go
1515
uses: actions/setup-go@v3
1616
with:
17-
go-version: "1.18.x"
17+
go-version: "1.19.x"
1818
env:
1919
GOARCH: "amd64"
2020

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
run:
33
timeout: 5m
4+
skip-dirs:
5+
- state/runtime/fakevm
6+
- state/runtime/instrumentation
47

58
linters:
69
enable:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CONTAINER FOR BUILDING BINARY
2-
FROM golang:1.18 AS build
2+
FROM golang:1.19 AS build
33

44
# INSTALL DEPENDENCIES
55
RUN go install github.com/gobuffalo/packr/v2/[email protected]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ stop: ## Stops all services
4848

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

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

5757
.PHONY: update-external-dependencies
5858
update-external-dependencies: ## Updates external dependencies like images, test vectors or proto files

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ It's recommended to use `make` for building, and testing the code, ... Run `make
110110

111111
### Requirements
112112

113-
- Go 1.18
113+
- Go 1.19
114114
- Docker
115115
- Docker Compose
116116
- Make

config/environments/mainnet/public.prover.config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@
9797
"dbProgramTableName": "state.program",
9898
"dbAsyncWrite": false,
9999
"dbMultiWrite": true,
100+
"dbConnectionsPool": true,
101+
"dbNumberOfPoolConnections": 30,
102+
"dbMetrics": true,
103+
"dbClearCache": false,
104+
"dbGetTree": true,
105+
"dbReadOnly": false,
100106
"dbMTCacheSize": 8192,
101107
"dbProgramCacheSize": 1024,
102108
"cleanerPollingPeriod": 600,

config/environments/public/public.prover.config.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"saveDbReadsToFileOnChange": false,
3737
"saveOutputToFile": false,
3838
"saveResponseToFile": false,
39-
"loadDBToMemCache": false,
39+
"loadDBToMemCache": true,
4040
"opcodeTracer": false,
4141
"logRemoteDbReads": false,
4242
"logExecutorServerResponses": false,
@@ -97,10 +97,14 @@
9797
"dbProgramTableName": "state.program",
9898
"dbAsyncWrite": false,
9999
"dbMultiWrite": true,
100-
"dbMTCacheSize": 10240,
101-
"dbProgramCacheSize": 1024,
102100
"dbConnectionsPool": true,
103-
"dbNumberOfPoolConnections": 28,
101+
"dbNumberOfPoolConnections": 30,
102+
"dbMetrics": true,
103+
"dbClearCache": false,
104+
"dbGetTree": true,
105+
"dbReadOnly": false,
106+
"dbMTCacheSize": 8192,
107+
"dbProgramCacheSize": 1024,
104108
"cleanerPollingPeriod": 600,
105109
"requestsPersistence": 3600,
106110
"maxExecutorThreads": 20,

db/scripts/init_prover_db.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ CREATE TABLE state.program (hash BYTEA PRIMARY KEY, data BYTEA NOT NULL);
88

99
CREATE USER prover_user with password 'prover_pass';
1010
GRANT CONNECT ON DATABASE prover_db TO prover_user;
11-
GRANT USAGE ON SCHEMA state TO prover_user;
11+
GRANT ALL PRIVILEGES ON SCHEMA state TO prover_user;
1212
GRANT ALL PRIVILEGES ON TABLE state.nodes TO prover_user;
1313
GRANT ALL PRIVILEGES ON TABLE state.program TO prover_user;

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ services:
107107
zkevm-prover:
108108
container_name: zkevm-prover
109109
restart: unless-stopped
110-
image: hermeznetwork/zkevm-prover:6d6e3aa
110+
image: hermeznetwork/zkevm-prover:b6fe2db
111111
depends_on:
112112
zkevm-state-db:
113113
condition: service_healthy

docs/ci/groups.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ for each of the jobs looks like this:
3737
```
3838
strategy:
3939
matrix:
40-
go-version: [ 1.18.x ]
40+
go-version: [ 1.19.x ]
4141
goarch: [ "amd64" ]
4242
e2e-group: [ 1, 2, 3 ]
4343
```
@@ -54,15 +54,15 @@ groups 1 and 3, the matrix strategy config should look like:
5454
```
5555
strategy:
5656
matrix:
57-
go-version: [ 1.18.x ]
57+
go-version: [ 1.19.x ]
5858
goarch: [ "amd64" ]
5959
e2e-group: [ 2 ]
6060
```
6161
If we want to re-add group 1:
6262
```
6363
strategy:
6464
matrix:
65-
go-version: [ 1.18.x ]
65+
go-version: [ 1.19.x ]
6666
goarch: [ "amd64" ]
6767
e2e-group: [ 1, 2 ]
6868
```

etherman/etherman.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"github.com/ethereum/go-ethereum/accounts/abi/bind"
2929
"github.com/ethereum/go-ethereum/accounts/keystore"
3030
"github.com/ethereum/go-ethereum/common"
31+
"github.com/ethereum/go-ethereum/core"
3132
"github.com/ethereum/go-ethereum/core/types"
3233
"github.com/ethereum/go-ethereum/crypto"
3334
"github.com/ethereum/go-ethereum/ethclient"
@@ -594,11 +595,11 @@ func (etherMan *Client) forcedBatchEvent(ctx context.Context, vLog types.Log, bl
594595
} else if isPending {
595596
return fmt.Errorf("error: tx is still pending. TxHash: %s", tx.Hash().String())
596597
}
597-
msg, err := tx.AsMessage(types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
598+
msg, err := core.TransactionToMessage(tx, types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
598599
if err != nil {
599600
return err
600601
}
601-
if fb.Sequencer == msg.From() {
602+
if fb.Sequencer == msg.From {
602603
txData := tx.Data()
603604
// Extract coded txs.
604605
// Load contract ABI
@@ -661,11 +662,11 @@ func (etherMan *Client) sequencedBatchesEvent(ctx context.Context, vLog types.Lo
661662
} else if isPending {
662663
return fmt.Errorf("error tx is still pending. TxHash: %s", tx.Hash().String())
663664
}
664-
msg, err := tx.AsMessage(types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
665+
msg, err := core.TransactionToMessage(tx, types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
665666
if err != nil {
666667
return err
667668
}
668-
sequences, err := decodeSequences(tx.Data(), sb.NumBatch, msg.From(), vLog.TxHash, msg.Nonce())
669+
sequences, err := decodeSequences(tx.Data(), sb.NumBatch, msg.From, vLog.TxHash, msg.Nonce)
669670
if err != nil {
670671
return fmt.Errorf("error decoding the sequences: %v", err)
671672
}
@@ -786,15 +787,15 @@ func (etherMan *Client) forceSequencedBatchesEvent(ctx context.Context, vLog typ
786787
} else if isPending {
787788
return fmt.Errorf("error: tx is still pending. TxHash: %s", tx.Hash().String())
788789
}
789-
msg, err := tx.AsMessage(types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
790+
msg, err := core.TransactionToMessage(tx, types.NewLondonSigner(tx.ChainId()), big.NewInt(0))
790791
if err != nil {
791792
return err
792793
}
793794
fullBlock, err := etherMan.EthClient.BlockByHash(ctx, vLog.BlockHash)
794795
if err != nil {
795796
return fmt.Errorf("error getting hashParent. BlockNumber: %d. Error: %w", vLog.BlockNumber, err)
796797
}
797-
sequencedForceBatch, err := decodeSequencedForceBatches(tx.Data(), fsb.NumBatch, msg.From(), vLog.TxHash, fullBlock, msg.Nonce())
798+
sequencedForceBatch, err := decodeSequencedForceBatches(tx.Data(), fsb.NumBatch, msg.From, vLog.TxHash, fullBlock, msg.Nonce)
798799
if err != nil {
799800
return err
800801
}

go.mod

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/0xPolygonHermez/zkevm-node
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/didip/tollbooth/v6 v6.1.2
77
github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7
8-
github.com/ethereum/go-ethereum v1.11.0
8+
github.com/ethereum/go-ethereum v1.11.5
99
github.com/go-git/go-billy/v5 v5.4.1
1010
github.com/go-git/go-git/v5 v5.6.1
1111
github.com/gobuffalo/packr/v2 v2.8.3
@@ -41,7 +41,7 @@ require (
4141
github.com/VictoriaMetrics/fastcache v1.6.0 // indirect
4242
github.com/acomagu/bufpipe v1.0.4 // indirect
4343
github.com/beorn7/perks v1.0.1 // indirect
44-
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
44+
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
4545
github.com/cespare/xxhash/v2 v2.2.0 // indirect
4646
github.com/cloudflare/circl v1.1.0 // indirect
4747
github.com/cockroachdb/errors v1.9.1 // indirect
@@ -51,7 +51,7 @@ require (
5151
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
5252
github.com/davecgh/go-spew v1.1.1 // indirect
5353
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
54-
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
54+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
5555
github.com/dlclark/regexp2 v1.7.0 // indirect
5656
github.com/edsrzf/mmap-go v1.0.0 // indirect
5757
github.com/emirpasic/gods v1.18.1 // indirect
@@ -60,19 +60,18 @@ require (
6060
github.com/getsentry/sentry-go v0.18.0 // indirect
6161
github.com/go-git/gcfg v1.5.0 // indirect
6262
github.com/go-gorp/gorp/v3 v3.1.0 // indirect
63-
github.com/go-kit/kit v0.9.0 // indirect
6463
github.com/go-ole/go-ole v1.2.6 // indirect
6564
github.com/go-pkgz/expirable-cache v0.0.3 // indirect
6665
github.com/go-sourcemap/sourcemap v2.1.3+incompatible // indirect
6766
github.com/go-stack/stack v1.8.1 // indirect
6867
github.com/gobuffalo/logger v1.0.7 // indirect
6968
github.com/gobuffalo/packd v1.0.2 // indirect
69+
github.com/gofrs/flock v0.8.1 // indirect
7070
github.com/gogo/protobuf v1.3.2 // indirect
7171
github.com/golang/protobuf v1.5.3 // indirect
7272
github.com/golang/snappy v0.0.4 // indirect
7373
github.com/google/gofuzz v1.2.0 // indirect
7474
github.com/hashicorp/hcl v1.0.0 // indirect
75-
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
7675
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
7776
github.com/huin/goupnp v1.0.3 // indirect
7877
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
@@ -102,7 +101,6 @@ require (
102101
github.com/pkg/errors v0.9.1 // indirect
103102
github.com/pmezard/go-difflib v1.0.0 // indirect
104103
github.com/prometheus/procfs v0.9.0 // indirect
105-
github.com/prometheus/tsdb v0.7.1 // indirect
106104
github.com/rogpeppe/go-internal v1.9.0 // indirect
107105
github.com/russross/blackfriday/v2 v2.1.0 // indirect
108106
github.com/sergi/go-diff v1.2.0 // indirect

0 commit comments

Comments
 (0)