From ad482883c70788048b5028188f35fa215a066ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Ram=C3=ADrez?= <58293609+ToniRamirezM@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:33:33 +0200 Subject: [PATCH] Update l1 sync lib to support validium (#88) * update l1 sync to support validium --- config/default.go | 29 ++++++++++++---------- go.mod | 4 +-- go.sum | 8 +++--- test/config/test.aggregator.config.toml | 33 +++++++++++++++---------- 4 files changed, 42 insertions(+), 32 deletions(-) diff --git a/config/default.go b/config/default.go index 2c2ab26..d2d2d87 100644 --- a/config/default.go +++ b/config/default.go @@ -57,20 +57,23 @@ SequencerPrivateKey = {} HTTPHeaders = [] [Aggregator.Synchronizer] [Aggregator.Synchronizer.DB] - Name = "sync_db" - User = "sync_user" - Password = "sync_password" - Host = "zkevm-db" - Port = "5432" - EnableLog = false - MaxConns = 10 + Name = "sync_db" + User = "sync_user" + Password = "sync_password" + Host = "zkevm-db" + Port = "5432" + EnableLog = false + MaxConns = 10 [Aggregator.Synchronizer.Synchronizer] - SyncInterval = "10s" - SyncChunkSize = 1000 - GenesisBlockNumber = 5511080 - SyncUpToBlock = "finalized" - BlockFinality = "finalized" - + SyncInterval = "10s" + SyncChunkSize = 1000 + GenesisBlockNumber = 5511080 + SyncUpToBlock = "finalized" + BlockFinality = "finalized" + OverrideStorageCheck = false + [Aggregator.Synchronizer.Etherman] + [Aggregator.Synchronizer.Etherman.Validium] + Enabled = false [EventLog] [EventLog.DB] ` diff --git a/go.mod b/go.mod index 8f08ae2..810f270 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/0xPolygon/cdk-rpc v0.0.0-20240419104226-c0a62ba0f49d github.com/0xPolygonHermez/zkevm-data-streamer v0.2.2 github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.9 - github.com/0xPolygonHermez/zkevm-synchronizer-l1 v0.5.4 + github.com/0xPolygonHermez/zkevm-synchronizer-l1 v0.6.0 github.com/ethereum/go-ethereum v1.14.5 github.com/gobuffalo/packr/v2 v2.8.3 github.com/hermeznetwork/tracerr v0.3.2 @@ -115,7 +115,7 @@ require ( github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect go.uber.org/multierr v1.10.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect - golang.org/x/net v0.24.0 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.21.0 // indirect golang.org/x/term v0.21.0 // indirect diff --git a/go.sum b/go.sum index c8256b6..6c96237 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/0xPolygonHermez/zkevm-data-streamer v0.2.2 h1:XRMTk+W6vtJVGVjuEznfWyN github.com/0xPolygonHermez/zkevm-data-streamer v0.2.2/go.mod h1:0QkAXcFa92mFJrCbN3UPUJGJYes851yEgYHLONnaosE= github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.9 h1:vrAezzwTNke6NroDAltGh1k2AJ6ibmZPBsG0bCltbRc= github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.9/go.mod h1:pRqfLQVM3nbzdhy3buqjAgcVyNDKAXOHqTSgkwiKpic= -github.com/0xPolygonHermez/zkevm-synchronizer-l1 v0.5.4 h1:ovSpYnlOjraL33J61knxVGc20PHdPQaO1BCEDAqZSpg= -github.com/0xPolygonHermez/zkevm-synchronizer-l1 v0.5.4/go.mod h1:fAwP9VXeKdUY7gJu6S4sus72CtPFUEB7+BYFSJYMu8s= +github.com/0xPolygonHermez/zkevm-synchronizer-l1 v0.6.0 h1:tFO0wHDOxBGlhaczxKbwYsbRq6kIx6P9qBo3VAN1SL4= +github.com/0xPolygonHermez/zkevm-synchronizer-l1 v0.6.0/go.mod h1:RmDFoqIKWhuhTOXwIUrhGGLCVi03SnXDMVL6NOVTlvE= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -718,8 +718,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/test/config/test.aggregator.config.toml b/test/config/test.aggregator.config.toml index 6848919..56abc21 100644 --- a/test/config/test.aggregator.config.toml +++ b/test/config/test.aggregator.config.toml @@ -54,19 +54,26 @@ UseFullWitness = false HTTPHeaders = [] [Aggregator.Synchronizer] [Aggregator.Synchronizer.DB] - Name = "sync_db" - User = "sync_user" - Password = "sync_password" - Host = "zkevm-db" - Port = "5432" - EnableLog = false - MaxConns = 10 + Name = "sync_db" + User = "sync_user" + Password = "sync_password" + Host = "zkevm-db" + Port = "5432" + EnableLog = false + MaxConns = 10 [Aggregator.Synchronizer.Synchronizer] - SyncInterval = "10s" - SyncChunkSize = 1000 - GenesisBlockNumber = 5511080 - SyncUpToBlock = "finalized" - BlockFinality = "finalized" + SyncInterval = "10s" + SyncChunkSize = 1000 + GenesisBlockNumber = 5511080 + SyncUpToBlock = "finalized" + BlockFinality = "finalized" + [Aggregator.Synchronizer.Etherman] + [Aggregator.Synchronizer.Etherman.Validium] + Enabled = false + TrustedSequencerURL = "" + DataSourcePriority = ["trusted", "external"] + [Aggregator.Synchronizer.Etherman.Validium.Translator] + FullMatchRules = [] [EventLog] - [EventLog.DB] \ No newline at end of file + [EventLog.DB]