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

update proto and add gasoffset #23

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ MaxTxSizeForL1 = 131072
L2Coinbase = "0xfa3b44587990f97ba8b6ba7e230a5f0e95d14b3d"
PrivateKey = {Path = "./test/sequencer.keystore", Password = "testonly"}
SequencesTxFileName = "sequencesender.json"
GasOffset = 80000
WaitPeriodPurgeTxFile = "15m"
MaxPendingTx = 1
[SequenceSender.StreamClient]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ require (
)

require (
github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.1
github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.3
github.com/0xPolygonHermez/zkevm-node v0.5.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/0xPolygonHermez/zkevm-data-streamer v0.2.0 h1:W4s0ICVQ2477quI0trjvPTae3kNgkPXINyG4NOBR6VQ=
github.com/0xPolygonHermez/zkevm-data-streamer v0.2.0/go.mod h1:0QkAXcFa92mFJrCbN3UPUJGJYes851yEgYHLONnaosE=
github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.1 h1:hcF/rmRQ+j7Rd06Qr6bQhk+8h/pfcgiwuV+2nAO+mj0=
github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.1/go.mod h1:GbITwHh15LH9AGLmash06/pM1I1Kaf/XwB8O7J4s1WI=
github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.3 h1:OphoV4oozIU2hIM+B/zrSXCrT4Atq0anvo5qHC0MgF8=
github.com/0xPolygonHermez/zkevm-ethtx-manager v0.1.3/go.mod h1:GbITwHh15LH9AGLmash06/pM1I1Kaf/XwB8O7J4s1WI=
github.com/0xPolygonHermez/zkevm-node v0.5.0 h1:qoqBQ5dBUcJqH98/+iZpZXwpIg73AnVs4EsGikxAj7o=
github.com/0xPolygonHermez/zkevm-node v0.5.0/go.mod h1:ODnoTsv5wai6GdXKEQV4eo/GAvwtk9TBnhbeD5TvnXE=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
Expand Down
34 changes: 27 additions & 7 deletions proto/src/proto/datastream/v1/datastream.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ option go_package = "github.com/0xPolygonHermez/zkevm-sequence-sender/state/data

message BatchStart {
uint64 number = 1;
uint64 fork_id = 4;
uint64 chain_id = 5;
BatchType type = 2;
uint64 fork_id = 3;
uint64 chain_id = 4;
Debug debug = 5;
}

message BatchEnd {
uint64 number = 1;
bytes local_exit_root = 2;
bytes state_root = 3;
Debug debug = 4;
}

message L2Block {
Expand All @@ -28,14 +31,19 @@ message L2Block {
bytes state_root = 9;
bytes global_exit_root = 10;
bytes coinbase = 11;
uint64 block_gas_limit = 12;
bytes block_info_root = 13;
Debug debug = 14;
}

message Transaction {
uint64 l2block_number = 1;
bool is_valid = 2;
bytes encoded = 3;
uint32 effective_gas_price_percentage = 4;
bytes im_state_root = 5;
uint64 index = 2;
bool is_valid = 3;
bytes encoded = 4;
uint32 effective_gas_price_percentage = 5;
bytes im_state_root = 6;
Debug debug = 7;
}

message UpdateGER {
Expand All @@ -46,13 +54,18 @@ message UpdateGER {
uint64 fork_id = 5;
uint64 chain_id = 6;
bytes state_root = 7;
Debug debug = 8;
}

message BookMark {
BookmarkType type = 1;
uint64 value = 2;
}

message Debug {
string message = 1;
}

enum BookmarkType {
BOOKMARK_TYPE_UNSPECIFIED = 0;
BOOKMARK_TYPE_BATCH = 1;
Expand All @@ -66,4 +79,11 @@ enum EntryType {
ENTRY_TYPE_TRANSACTION = 3;
ENTRY_TYPE_BATCH_END = 4;
ENTRY_TYPE_UPDATE_GER = 5;
}
}

enum BatchType {
BATCH_TYPE_UNSPECIFIED = 0;
BATCH_TYPE_REGULAR = 1;
BATCH_TYPE_FORCED = 2;
BATCH_TYPE_INJECTED = 3;
}
4 changes: 2 additions & 2 deletions sequencesender/sequencesender.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (s *SequenceSender) sendTx(ctx context.Context, resend bool, txOldHash *com
}

// Add sequence tx
txHash, err := s.ethTxManager.Add(ctx, paramTo, paramNonce, big.NewInt(0), paramData, nil)
txHash, err := s.ethTxManager.Add(ctx, paramTo, paramNonce, big.NewInt(0), paramData, s.cfg.GasOffset, nil)
if err != nil {
log.Errorf("[SeqSender] error adding sequence to ethtxmanager: %v", err)
return err
Expand Down Expand Up @@ -899,7 +899,7 @@ func (s *SequenceSender) addNewSequenceBatch(l2Block *datastream.L2Block) {
// addInfoSequenceBatchStart adds info from the batch start
func (s *SequenceSender) addInfoSequenceBatchStart(batch *datastream.BatchStart) {
s.mutexSequence.Lock()
log.Infof("[SeqSender] batch %d Start: forkId %d chainId %d", batch.Number, batch.ForkId, batch.ChainId)
log.Infof("[SeqSender] batch %d (type %d) Start: forkId %d chainId %d", batch.Number, batch.Type, batch.ForkId, batch.ChainId)
dpunish3r marked this conversation as resolved.
Show resolved Hide resolved

// Current batch
data := s.sequenceData[s.wipBatch]
Expand Down
Loading
Loading