diff --git a/packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/pacaya.go b/packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/pacaya.go index fe5df62367..a911382537 100644 --- a/packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/pacaya.go +++ b/packages/taiko-client/driver/chain_syncer/blob/blocks_inserter/pacaya.go @@ -188,6 +188,12 @@ func (i *BlocksInserterPacaya) InsertBlocks( return fmt.Errorf("failed to create TaikoAnchor.anchorV3 transaction: %w", err) } + // Get transactions in the block. + txs := types.Transactions{} + if txListCursor+int(blockInfo.NumTransactions) > len(allTxs) { + txs = allTxs[txListCursor : txListCursor+int(blockInfo.NumTransactions)] + } + // Decompress the transactions list and try to insert a new head block to L2 EE. if lastPayloadData, err = createPayloadAndSetHead( ctx, @@ -207,7 +213,7 @@ func (i *BlocksInserterPacaya) InsertBlocks( L1BlockHeight: meta.GetRawBlockHeight(), L1BlockHash: meta.GetRawBlockHash(), }, - Txs: allTxs[txListCursor : txListCursor+int(blockInfo.NumTransactions)], + Txs: txs, Withdrawals: make([]*types.Withdrawal, 0), BaseFee: baseFee, },