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

support new smc and node fflonk #315

Merged
merged 6 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions config/config.debug.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ BridgeVersion = "v1"

[NetworkConfig]
GenBlockNumber = 1
PoEAddr = "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
BridgeAddr = "0x60627AC8Ba44F4438186B4bCD5F1cb5E794e19fe"
GlobalExitRootManAddr = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
PoEAddr = "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
BridgeAddr = "0xAD1eA25D1133095d20D5C3f269ed887aC0a2496C"
GlobalExitRootManAddr = "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
MaticAddr = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
L2BridgeAddrs = ["0xd0a3d58d135e2ee795dFB26ec150D339394254B9"]
L2BridgeAddrs = ["0xfC5b0c5F677a3f3E29DB2e98c9eD455c7ACfCf03"]
L1ChainID = 1337
8 changes: 4 additions & 4 deletions config/config.local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ BridgeVersion = "v1"

[NetworkConfig]
GenBlockNumber = 1
PoEAddr = "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
BridgeAddr = "0x60627AC8Ba44F4438186B4bCD5F1cb5E794e19fe"
GlobalExitRootManAddr = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
PoEAddr = "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
BridgeAddr = "0xAD1eA25D1133095d20D5C3f269ed887aC0a2496C"
GlobalExitRootManAddr = "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
MaticAddr = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
L2BridgeAddrs = ["0xd0a3d58d135e2ee795dFB26ec150D339394254B9"]
L2BridgeAddrs = ["0xfC5b0c5F677a3f3E29DB2e98c9eD455c7ACfCf03"]
L1ChainID = 1337
8 changes: 4 additions & 4 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ BridgeVersion = "v1"

[NetworkConfig]
GenBlockNumber = 1
PoEAddr = "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
BridgeAddr = "0x60627AC8Ba44F4438186B4bCD5F1cb5E794e19fe"
GlobalExitRootManAddr = "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
PoEAddr = "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
BridgeAddr = "0xAD1eA25D1133095d20D5C3f269ed887aC0a2496C"
GlobalExitRootManAddr = "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
MaticAddr = "0x5FbDB2315678afecb367f032d93F642f64180aa3"
L2BridgeAddrs = ["0xd0a3d58d135e2ee795dFB26ec150D339394254B9"]
L2BridgeAddrs = ["0xfC5b0c5F677a3f3E29DB2e98c9eD455c7ACfCf03"]
L1ChainID = 1337
`
10 changes: 5 additions & 5 deletions config/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ var (
BridgeAddr: common.HexToAddress("0x47c1090bc966280000Fe4356a501f1D0887Ce840"),
GlobalExitRootManAddr: common.HexToAddress("0xA379Dd55Eb12e8FCdb467A814A15DE2b29677066"),
MaticAddr: common.HexToAddress("0x94Ca2BbE1b469f25D3B22BDf17Fc80ad09E7F662"),
L2BridgeAddrs: []common.Address{common.HexToAddress("0xd0a3d58d135e2ee795dFB26ec150D339394254B9")},
L2BridgeAddrs: []common.Address{common.HexToAddress("0xfC5b0c5F677a3f3E29DB2e98c9eD455c7ACfCf03")},
L1ChainID: 5, //Goerli
}
localConfig = NetworkConfig{
GenBlockNumber: 1,
PoEAddr: common.HexToAddress("0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"),
BridgeAddr: common.HexToAddress("0x60627AC8Ba44F4438186B4bCD5F1cb5E794e19fe"),
GlobalExitRootManAddr: common.HexToAddress("0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"),
PoEAddr: common.HexToAddress("0x610178dA211FEF7D417bC0e6FeD39F05609AD788"),
BridgeAddr: common.HexToAddress("0xAD1eA25D1133095d20D5C3f269ed887aC0a2496C"),
GlobalExitRootManAddr: common.HexToAddress("0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"),
MaticAddr: common.HexToAddress("0x5FbDB2315678afecb367f032d93F642f64180aa3"),
L2BridgeAddrs: []common.Address{common.HexToAddress("0xd0a3d58d135e2ee795dFB26ec150D339394254B9")},
L2BridgeAddrs: []common.Address{common.HexToAddress("0xfC5b0c5F677a3f3E29DB2e98c9eD455c7ACfCf03")},
L1ChainID: 1337,
}
)
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ services:

zkevm-node:
container_name: zkevm-node
image: hermeznetwork/zkevm-node:testdev
image: hermeznetwork/zkevm-node:v0.0.3-RC4
ports:
- 8123:8123
- 61090:61090
Expand Down Expand Up @@ -102,7 +102,7 @@ services:

zkevm-prover:
container_name: zkevm-prover
image: hermeznetwork/zkevm-prover:88f3835
image: hermeznetwork/zkevm-prover:8b07f44
ports:
- 50051:50051 # Prover
- 50052:50052 # MockProver
Expand Down
8 changes: 4 additions & 4 deletions docs/running_local.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ make test-edge

| Address | Description |
|---|---|
| 0x8A791620dd6260079BF849Dc5567aDC3F2FdC318 | Proof of Efficiency |
| 0x60627AC8Ba44F4438186B4bCD5F1cb5E794e19fe | L1 Bridge |
| 0xd0a3d58d135e2ee795dFB26ec150D339394254B9 | L2 Bridge |
| 0x610178dA211FEF7D417bC0e6FeD39F05609AD788 | Proof of Efficiency |
| 0xAD1eA25D1133095d20D5C3f269ed887aC0a2496C | L1 Bridge |
| 0xfC5b0c5F677a3f3E29DB2e98c9eD455c7ACfCf03 | L2 Bridge |
| 0x5FbDB2315678afecb367f032d93F642f64180aa3 | Matic token |
| 0xa513E6E4b8f2a923D98304ec87F64353C4D5C853 | GlobalExitRootManager |
| 0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6 | GlobalExitRootManager |
13 changes: 4 additions & 9 deletions etherman/etherman_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestGEREvent(t *testing.T) {

amount := big.NewInt(1000000000000000)
auth.Value = amount
_, err = etherman.Bridge.BridgeAsset(auth, common.Address{}, 1, auth.From, amount, []byte{})
_, err = etherman.Bridge.BridgeAsset(auth, 1, auth.From, amount, common.Address{}, true, []byte{})
require.NoError(t, err)

// Mine the tx in a block
Expand Down Expand Up @@ -82,7 +82,7 @@ func TestSequencedBatchesEvent(t *testing.T) {
// Make a bridge tx
a := auth
a.Value = big.NewInt(1000000000000000)
_, err = etherman.Bridge.BridgeAsset(a, common.Address{}, 1, a.From, a.Value, []byte{})
_, err = etherman.Bridge.BridgeAsset(a, 1, a.From, a.Value, common.Address{}, true, []byte{})
require.NoError(t, err)
ethBackend.Commit()
a.Value = big.NewInt(0)
Expand Down Expand Up @@ -163,12 +163,7 @@ func TestVerifyBatchEvent(t *testing.T) {
// Mine the tx in a block
ethBackend.Commit()

var (
proofA = [2]*big.Int{big.NewInt(1), big.NewInt(1)}
proofC = [2]*big.Int{big.NewInt(1), big.NewInt(1)}
proofB = [2][2]*big.Int{proofC, proofC}
)
_, err = etherman.PoE.VerifyBatchesTrustedAggregator(auth, 0, 0, 1, common.Hash{}, common.Hash{}, proofA, proofB, proofC)
_, err = etherman.PoE.VerifyBatchesTrustedAggregator(auth, 0, 0, 1, common.Hash{}, common.Hash{}, []byte{})
require.NoError(t, err)

// Mine the tx in a block
Expand Down Expand Up @@ -254,7 +249,7 @@ func TestBridgeEvents(t *testing.T) {
amount := big.NewInt(9000000000000000000)
var destNetwork uint32 = 1 // 0 is reserved to mainnet. This variable is set in the smc
destinationAddr := common.HexToAddress("0x61A1d716a74fb45d29f148C6C20A2eccabaFD753")
_, err = bridge.BridgeAsset(auth, maticAddr, destNetwork, destinationAddr, amount, []byte{})
_, err = bridge.BridgeAsset(auth, destNetwork, destinationAddr, amount, maticAddr, true, []byte{})
require.NoError(t, err)

// Mine the tx in a block
Expand Down
75 changes: 45 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ module github.com/0xPolygonHermez/zkevm-bridge-service
go 1.18

require (
github.com/0xPolygonHermez/zkevm-node v0.0.2-RC2.0.20230207185420-6600655c71cd
github.com/ethereum/go-ethereum v1.10.26
github.com/0xPolygonHermez/zkevm-node v0.0.3-RC3
github.com/ethereum/go-ethereum v1.11.0
github.com/gobuffalo/packr/v2 v2.8.3
github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0
github.com/hashicorp/golang-lru/v2 v2.0.1
github.com/iden3/go-iden3-crypto v0.0.14-0.20220413123345-edc36bfa5247
github.com/jackc/pgconn v1.13.0
github.com/jackc/pgx/v4 v4.17.2
github.com/jackc/pgconn v1.14.0
github.com/jackc/pgx/v4 v4.18.0
github.com/lib/pq v1.10.7
github.com/mitchellh/mapstructure v1.5.0
github.com/rubenv/sql-migrate v0.0.0-20211023115951-9f02b1e13857
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.1
github.com/urfave/cli/v2 v2.24.1
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef
google.golang.org/grpc v1.52.3
github.com/urfave/cli/v2 v2.24.3
golang.org/x/crypto v0.6.0
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.28.1
)

require (
github.com/DataDog/zstd v1.5.2 // indirect
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
Expand All @@ -33,49 +34,60 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/cespare/cp v1.1.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.9.1 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/didip/tollbooth/v6 v6.1.2 // indirect
github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect
github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf // indirect
github.com/dlclark/regexp2 v1.7.0 // indirect
github.com/dop251/goja v0.0.0-20230122112309-96b1610dd4f7 // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/getsentry/sentry-go v0.18.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.4.0 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-git/go-git/v5 v5.4.2 // indirect
github.com/go-kit/kit v0.10.0 // indirect
github.com/go-ole/go-ole v1.2.4 // 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.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gobuffalo/logger v1.0.6 // indirect
github.com/gobuffalo/packd v1.0.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.1-0.20180906183839-65a6292f0157 // indirect
github.com/hermeznetwork/tracerr v0.3.2 // indirect
github.com/holiman/big v0.0.0-20221017200358-a027dc42d04e // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.1 // indirect
github.com/huin/goupnp v1.0.3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgtype v1.12.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/puddle v1.3.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/klauspost/compress v1.15.15 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/markbates/errx v1.1.0 // indirect
Expand All @@ -91,23 +103,24 @@ require (
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.39.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect
github.com/rjeczalik/notify v0.9.2 // 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.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/status-im/keycard-go v0.0.0-20190424133014-d95853db0f48 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tklauser/go-sysconf v0.3.5 // indirect
github.com/tklauser/numcpus v0.2.2 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/umbracle/ethgo v0.1.3 // indirect
github.com/umbracle/fastrlp v0.0.0-20220527094140-59d5dd30e722 // indirect
github.com/valyala/fastjson v1.4.1 // indirect
Expand All @@ -116,10 +129,12 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/net v0.4.0 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/term v0.3.0 // indirect
golang.org/x/text v0.5.0 // indirect
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect
golang.org/x/net v0.6.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.1.0 // indirect
gopkg.in/gorp.v1 v1.7.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
Expand Down
Loading