Skip to content

Commit

Permalink
Merge pull request #3592 from 0xPolygonHermez/feature/extralogdslib
Browse files Browse the repository at this point in the history
Feature/extralogdslib
  • Loading branch information
dpunish3r authored Apr 24, 2024
2 parents ec6691a + b7a2484 commit 05a4826
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 20 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/0xPolygonHermez/zkevm-node
go 1.21

require (
github.com/0xPolygonHermez/zkevm-data-streamer v0.1.18
github.com/0xPolygonHermez/zkevm-data-streamer v0.2.3-0.20240422135400-0df0d27226b3
github.com/didip/tollbooth/v6 v6.1.2
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127
github.com/ethereum/go-ethereum v1.13.11
Expand Down Expand Up @@ -171,7 +171,6 @@ require (

require (
github.com/fatih/color v1.16.0
github.com/joho/godotenv v1.5.1
github.com/prometheus/client_golang v1.18.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
)
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/0xPolygonHermez/zkevm-data-streamer v0.1.18 h1:InqeTcHrNbfj1OUfn2aFplFay7ibd7KhYqvmMZYZfn0=
github.com/0xPolygonHermez/zkevm-data-streamer v0.1.18/go.mod h1:0QkAXcFa92mFJrCbN3UPUJGJYes851yEgYHLONnaosE=
github.com/0xPolygonHermez/zkevm-data-streamer v0.2.3-0.20240422135400-0df0d27226b3 h1:g5IMJalQxVRNfnXrzQG7bx2COktaFBf1mNuF4SLuQss=
github.com/0xPolygonHermez/zkevm-data-streamer v0.2.3-0.20240422135400-0df0d27226b3/go.mod h1:0QkAXcFa92mFJrCbN3UPUJGJYes851yEgYHLONnaosE=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
Expand Down Expand Up @@ -483,8 +483,6 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
Expand Down
20 changes: 6 additions & 14 deletions tools/datastreamer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,13 @@ func decodeEntry(cliCtx *cli.Context) error {
os.Exit(1)
}

client.FromEntry = cliCtx.Uint64("entry")
err = client.ExecCommand(datastreamer.CmdEntry)
entry, err := client.ExecCommandGetEntry(cliCtx.Uint64("entry"))
if err != nil {
log.Error(err)
os.Exit(1)
}

printEntry(client.Entry)
printEntry(entry)
return nil
}

Expand Down Expand Up @@ -597,35 +596,28 @@ func decodeL2Block(cliCtx *cli.Context) error {
Value: l2BlockNumber,
}

client.FromBookmark = bookMark.Encode()
err = client.ExecCommand(datastreamer.CmdBookmark)
firstEntry, err := client.ExecCommandGetBookmark(bookMark.Encode())
if err != nil {
log.Error(err)
os.Exit(1)
}

firstEntry := client.Entry
printEntry(firstEntry)

client.FromEntry = firstEntry.Number + 1
err = client.ExecCommand(datastreamer.CmdEntry)
secondEntry, err := client.ExecCommandGetEntry(firstEntry.Number + 1)
if err != nil {
log.Error(err)
os.Exit(1)
}

secondEntry := client.Entry
printEntry(secondEntry)

i := uint64(2) //nolint:gomnd
for secondEntry.Type == state.EntryTypeL2Tx {
client.FromEntry = firstEntry.Number + i
err = client.ExecCommand(datastreamer.CmdEntry)
entry, err := client.ExecCommandGetEntry(firstEntry.Number + i)
if err != nil {
log.Error(err)
os.Exit(1)
}
secondEntry = client.Entry
secondEntry = entry
printEntry(secondEntry)
i++
}
Expand Down

0 comments on commit 05a4826

Please sign in to comment.