Skip to content

Commit b0bd30a

Browse files
authored
fix: get highest IndexL1InfoTree inside batchl2data (#315)
1 parent 5098172 commit b0bd30a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sequencesender/sequencesender.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ func (s *SequenceSender) populateSequenceData(rpcBatch *types.RPCBatch, batchNum
214214
}
215215

216216
if len(batchRaw.Blocks) > 0 {
217-
rpcBatch.SetL1InfoTreeIndex(batchRaw.Blocks[len(batchRaw.Blocks)-1].IndexL1InfoTree)
217+
maxIndex := uint32(0)
218+
for _, block := range batchRaw.Blocks {
219+
if block.IndexL1InfoTree > maxIndex {
220+
maxIndex = block.IndexL1InfoTree
221+
}
222+
}
223+
rpcBatch.SetL1InfoTreeIndex(maxIndex)
218224
}
219225

220226
s.sequenceData[batchNumber] = &sequenceData{

0 commit comments

Comments
 (0)