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

Upgrade zkevm data streamer version #948

Merged
merged 7 commits into from
Aug 12, 2024
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
2 changes: 1 addition & 1 deletion cmd/erigon-el/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ func NewBackend(stack *node.Node, config *ethconfig.Config, logger log.Logger) (
Level: "warn",
Outputs: nil,
}
backend.dataStream, err = datastreamer.NewServer(uint16(httpRpcCfg.DataStreamPort), uint8(2), 1, datastreamer.StreamType(1), file, httpRpcCfg.DataStreamWriteTimeout, logConfig)
backend.dataStream, err = datastreamer.NewServer(uint16(httpRpcCfg.DataStreamPort), uint8(2), 1, datastreamer.StreamType(1), file, httpRpcCfg.DataStreamWriteTimeout, httpRpcCfg.DataStreamInactivityTimeout, httpRpcCfg.DataStreamInactivityCheckInterval, logConfig)
if err != nil {
return nil, err
}
Expand Down
10 changes: 6 additions & 4 deletions cmd/rpcdaemon/cli/httpcfg/http_cfg.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ type HttpCfg struct {
ReturnDataLimit int // Maximum number of bytes returned from calls (like eth_call)

// zkevm
DataStreamPort int
DataStreamHost string
DataStreamWriteTimeout time.Duration
L2RpcUrl string
DataStreamPort int
DataStreamHost string
DataStreamWriteTimeout time.Duration
DataStreamInactivityTimeout time.Duration
DataStreamInactivityCheckInterval time.Duration
L2RpcUrl string
}
10 changes: 10 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,16 @@ var (
Usage: "Define the TCP write timeout when sending data to a datastream client",
Value: 5 * time.Second,
}
DataStreamInactivityTimeout = cli.DurationFlag{
Name: "zkevm.data-stream-inactivity-timeout",
Usage: "Define the inactivity timeout when interacting with a data stream server",
Value: 10 * time.Second,
}
DataStreamInactivityCheckInterval = cli.DurationFlag{
Name: "zkevm.data-stream-inactivity-check-interval",
Usage: "Define the inactivity check interval timeout when interacting with a data stream server",
Value: 2 * time.Second,
}
Limbo = cli.BoolFlag{
Name: "zkevm.limbo",
Usage: "Enable limbo processing on batches that failed verification",
Expand Down
9 changes: 5 additions & 4 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ import (

"github.com/ledgerwatch/erigon/chain"

"net/url"
"path"

"github.com/0xPolygonHermez/zkevm-data-streamer/datastreamer"
log2 "github.com/0xPolygonHermez/zkevm-data-streamer/log"
"github.com/ledgerwatch/erigon/cl/clparams"
Expand Down Expand Up @@ -114,15 +117,13 @@ import (
"github.com/ledgerwatch/erigon/zk/contracts"
"github.com/ledgerwatch/erigon/zk/datastream/client"
"github.com/ledgerwatch/erigon/zk/hermez_db"
"github.com/ledgerwatch/erigon/zk/l1_cache"
"github.com/ledgerwatch/erigon/zk/legacy_executor_verifier"
zkStages "github.com/ledgerwatch/erigon/zk/stages"
"github.com/ledgerwatch/erigon/zk/syncer"
txpool2 "github.com/ledgerwatch/erigon/zk/txpool"
"github.com/ledgerwatch/erigon/zk/witness"
"github.com/ledgerwatch/erigon/zkevm/etherman"
"github.com/ledgerwatch/erigon/zk/l1_cache"
"net/url"
"path"
)

// Config contains the configuration options of the ETH protocol.
Expand Down Expand Up @@ -734,7 +735,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
Outputs: nil,
}
// todo [zkevm] read the stream version from config and figure out what system id is used for
backend.dataStream, err = datastreamer.NewServer(uint16(httpCfg.DataStreamPort), uint8(backend.config.DatastreamVersion), 1, datastreamer.StreamType(1), file, httpCfg.DataStreamWriteTimeout, logConfig)
backend.dataStream, err = datastreamer.NewServer(uint16(httpCfg.DataStreamPort), uint8(backend.config.DatastreamVersion), 1, datastreamer.StreamType(1), file, httpCfg.DataStreamWriteTimeout, httpCfg.DataStreamInactivityTimeout, httpCfg.DataStreamInactivityCheckInterval, logConfig)
if err != nil {
return nil, err
}
Expand Down
2 changes: 2 additions & 0 deletions eth/ethconfig/config_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ type Zk struct {
DataStreamHost string
DataStreamPort uint
DataStreamWriteTimeout time.Duration
DataStreamInactivityTimeout time.Duration
DataStreamInactivityCheckInterval time.Duration

RebuildTreeAfter uint64
IncrementTreeAlways bool
Expand Down
10 changes: 4 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
)

require (
github.com/0xPolygonHermez/zkevm-data-streamer v0.2.3-RC4
github.com/0xPolygonHermez/zkevm-data-streamer v0.2.5
github.com/99designs/gqlgen v0.17.29
github.com/Giulio2002/bls v0.0.0-20230217173148-c87a29266b6c
github.com/RoaringBitmap/roaring v1.2.3
Expand Down Expand Up @@ -84,16 +84,16 @@ require (
github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
github.com/status-im/keycard-go v0.2.0
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e
github.com/tidwall/btree v1.6.0
github.com/ugorji/go/codec v1.1.13
github.com/ugorji/go/codec/codecgen v1.1.13
github.com/urfave/cli/v2 v2.25.7
github.com/urfave/cli/v2 v2.27.1
github.com/valyala/fastjson v1.6.4
github.com/vektah/gqlparser/v2 v2.5.1
github.com/xsleonard/go-merkle v1.1.0
go.uber.org/zap v1.26.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.22.0
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
golang.org/x/net v0.24.0
Expand Down Expand Up @@ -182,7 +182,6 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/ledgerwatch/interfaces v0.0.0-20230412092010-e1c4a1a4279e // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect
Expand All @@ -198,7 +197,6 @@ require (
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/matryer/moq v0.3.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
Expand Down
Loading
Loading