Skip to content

Commit

Permalink
dont overshoot index
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Feb 3, 2025
1 parent 50436ce commit ace49fe
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,12 @@ func (i *BlocksInserterPacaya) InsertBlocks(
return fmt.Errorf("failed to create TaikoAnchor.anchorV3 transaction: %w", err)
}

var txs types.Transactions
if len(allTxs) > 0 {
txs = allTxs[txListCursor : txListCursor+int(blockInfo.NumTransactions)]
endIndex := txListCursor + int(blockInfo.NumTransactions)
if endIndex > len(allTxs) {
endIndex = len(allTxs) // Cap to the max available length
}

txs := allTxs[txListCursor:endIndex]
// Decompress the transactions list and try to insert a new head block to L2 EE.
if lastPayloadData, err = createPayloadAndSetHead(
ctx,
Expand Down

0 comments on commit ace49fe

Please sign in to comment.