pub async fn get_raw_l2_blocks_transactions(
        &mut self,
        blocks: std::ops::Range<L2BlockNumber>,
    ) -> DalResult<HashMap<L2BlockNumber, Vec<Transaction>>> {
        // Check if range is non-empty, because BETWEEN in SQL in `unordered`.
        if blocks.is_empty() {
            return Ok(HashMap::default());
        }
        // We do an inner join with `miniblocks.number`, because
        // transaction insertions are not atomic with miniblock insertion.
        let rows = sqlx::query_as!(
            StorageTransaction,
            r#"
            SELECT
                transactions.*
            FROM
                transactions
            INNER JOIN miniblocks ON miniblocks.number = transactions.miniblock_number
            WHERE
                miniblocks.number BETWEEN $1 AND $2
            ORDER BY
                miniblock_number,
                index_in_block
            "#,
            i64::from(blocks.start.0),
            i64::from(blocks.end.0 - 1),
        )
        .try_map(|row| {
            let to_block_number = |n: Option<i64>| {
                anyhow::Ok(L2BlockNumber(
                    n.context("missing")?.try_into().context("overflow")?,
                ))
            };
            Ok((
                to_block_number(row.miniblock_number).decode_column("miniblock_number")?,
                Transaction::from(row),
            ))
        })
        .instrument("get_raw_l2_blocks_transactions")
        .with_arg("blocks", &blocks)
        .fetch_all(self.storage)
        .await?;
        let mut txs: HashMap<L2BlockNumber, Vec<Transaction>> = HashMap::new();
        for (n, tx) in rows {
            txs.entry(n).or_default().push(tx);
        }
        Ok(txs)
    }
Returns the server transactions (not API ones) from a L2 block range.
core/lib/dal/src/transactions_web3_dal.rs