pub async fn check_storage_log_count(
        &mut self,
        l2_block_number: L2BlockNumber,
        min_count: NonZeroU32,
    ) -> DalResult<bool> {
        let offset = min_count.get() - 1; // Cannot underflow

        let row = sqlx::query_scalar!(
            r#"
                SELECT TRUE
                FROM storage_logs
                WHERE miniblock_number <= $1
                LIMIT 1 OFFSET $2
            "#,
            i64::from(l2_block_number.0),
            i64::from(offset)
        )
        .instrument("check_storage_log_count")
        .with_arg("l2_block_number", &l2_block_number)
        .with_arg("offset", &offset)
        .fetch_optional(self.storage)
        .await?;

        Ok(row.is_some())
    }
Returns `true` if the number of logs at the specified L2 block is greater or equal to `min_count`.
core/lib/dal/src/storage_logs_dal.rs