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

Fix data stream tool performance (#2785) #2796

Merged
merged 1 commit into from
Nov 16, 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
2 changes: 1 addition & 1 deletion 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.9
github.com/0xPolygonHermez/zkevm-data-streamer v0.1.11
github.com/didip/tollbooth/v6 v6.1.2
github.com/dop251/goja v0.0.0-20230806174421-c933cf95e127
github.com/ethereum/go-ethereum v1.13.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f
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.9 h1:x6Xg3/gfMA1+1cWmF/PXwOFbIOP7t6RnNUE3A5P68QY=
github.com/0xPolygonHermez/zkevm-data-streamer v0.1.9/go.mod h1:853hkExOKPpMqbyEGqF8cuobSlbVd2OLVEZoRFTGRzo=
github.com/0xPolygonHermez/zkevm-data-streamer v0.1.11 h1:cZCxmpj5zT8Zibva6JbT1YuJJRVR8kkj/23TXaF2HtA=
github.com/0xPolygonHermez/zkevm-data-streamer v0.1.11/go.mod h1:853hkExOKPpMqbyEGqF8cuobSlbVd2OLVEZoRFTGRzo=
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
7 changes: 4 additions & 3 deletions sequencer/dbmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (d *dbManager) sendDataToStreamer() {
// Read data from channel
fullL2Block := <-d.dataToStream

l2Block := fullL2Block.L2Block
l2Block := fullL2Block
l2Transactions := fullL2Block.Txs

if d.streamServer != nil {
Expand Down Expand Up @@ -339,15 +339,16 @@ func (d *dbManager) StoreProcessedTxAndDeleteFromPool(ctx context.Context, tx tr
}

l2Transaction := state.DSL2Transaction{
L2BlockNumber: l2Block.L2BlockNumber,
EffectiveGasPricePercentage: uint8(tx.response.EffectivePercentage),
IsValid: 1,
EncodedLength: uint32(len(binaryTxData)),
Encoded: binaryTxData,
}

d.dataToStream <- state.DSL2FullBlock{
L2Block: l2Block,
Txs: []state.DSL2Transaction{l2Transaction},
DSL2Block: l2Block,
Txs: []state.DSL2Transaction{l2Transaction},
}
}

Expand Down
6 changes: 3 additions & 3 deletions sequencer/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ type stateInterface interface {
GetStoredFlushID(ctx context.Context) (uint64, string, error)
GetForkIDByBatchNumber(batchNumber uint64) uint64
GetDSGenesisBlock(ctx context.Context, dbTx pgx.Tx) (*state.DSL2Block, error)
GetDSBatch(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) (*state.DSBatch, error)
GetDSL2Blocks(ctx context.Context, batchNumber uint64, dbTx pgx.Tx) ([]*state.DSL2Block, error)
GetDSL2Transactions(ctx context.Context, minL2Block, maxL2Block uint64, dbTx pgx.Tx) ([]*state.DSL2Transaction, error)
GetDSBatches(ctx context.Context, firstBatchNumber, lastBatchNumber uint64, dbTx pgx.Tx) ([]*state.DSBatch, error)
GetDSL2Blocks(ctx context.Context, firstBatchNumber, lastBatchNumber uint64, dbTx pgx.Tx) ([]*state.DSL2Block, error)
GetDSL2Transactions(ctx context.Context, firstL2Block, lastL2Block uint64, dbTx pgx.Tx) ([]*state.DSL2Transaction, error)
}

type workerInterface interface {
Expand Down
52 changes: 26 additions & 26 deletions sequencer/mock_state.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading