pub async fn get_l2_blocks_to_execute_for_l1_batch(
        &mut self,
        l1_batch_number: L1BatchNumber,
    ) -> DalResult<Vec<L2BlockExecutionData>> {
        let transactions = sqlx::query_as!(
            StorageTransaction,
            r#"
            SELECT
                *
            FROM
                transactions
            WHERE
                miniblock_number BETWEEN (
                    SELECT
                        MIN(number)
                    FROM
                        miniblocks
                    WHERE
                        miniblocks.l1_batch_number = $1
                ) AND (
                    SELECT
                        MAX(number)
                    FROM
                        miniblocks
                    WHERE
                        miniblocks.l1_batch_number = $1
                )
            ORDER BY
                miniblock_number,
                index_in_block
            "#,
            i64::from(l1_batch_number.0)
        )
        .instrument("get_l2_blocks_to_execute_for_l1_batch")
        .with_arg("l1_batch_number", &l1_batch_number)
        .fetch_all(self.storage)
        .await?;

        let fictive_l2_block = sqlx::query!(
            r#"
            SELECT
                number
            FROM
                miniblocks
            WHERE
                miniblocks.l1_batch_number = $1
                AND l1_tx_count = 0
                AND l2_tx_count = 0
            ORDER BY
                number
            "#,
            i64::from(l1_batch_number.0)
        )
        .instrument("get_l2_blocks_to_execute_for_l1_batch#fictive_l2_block")
        .with_arg("l1_batch_number", &l1_batch_number)
        .fetch_optional(self.storage)
        .await?
        .map(|row| L2BlockNumber(row.number as u32));

        self.map_transactions_to_execution_data(transactions, fictive_l2_block)
            .await
    }
Returns L2 blocks with their transactions to be used in VM execution.
The order of the transactions is the same as it was during previous execution.
All L2 blocks are retrieved for the given l1_batch.
core/lib/dal/src/transactions_dal.rs