pub async fn next_priority_id(&mut self) -> PriorityOpId {
        {
            sqlx::query!(
                r#"
                SELECT
                    MAX(priority_op_id) AS "op_id"
                FROM
                    transactions
                WHERE
                    is_priority = TRUE
                    AND transactions.miniblock_number <= (
                        SELECT
                            MAX(number)
                        FROM
                            miniblocks
                    )
                "#
            )
            .fetch_optional(self.storage.conn())
            .await
            .unwrap()
            .and_then(|row| row.op_id)
            .map(|value| PriorityOpId((value + 1) as u64))
            .unwrap_or_default()
        }
    }
Returns the next ID after the ID of the last sealed priority operation.
Doesn't work if node was recovered from snapshot because transaction history is not recovered.
core/lib/dal/src/transactions_dal.rs