pub async fn max_enumeration_index_by_l1_batch(
        &mut self,
        l1_batch_number: L1BatchNumber,
    ) -> DalResult<Option<u64>> {
        Ok(sqlx::query!(
            r#"
            SELECT
                MAX(INDEX) AS "max?"
            FROM
                INITIAL_WRITES
            WHERE
                L1_BATCH_NUMBER = (
                    SELECT
                        MAX(L1_BATCH_NUMBER) AS "max?"
                    FROM
                        INITIAL_WRITES
                    WHERE
                        L1_BATCH_NUMBER <= $1
                )
            "#,
            i64::from(l1_batch_number.0)
        )
        .instrument("max_enumeration_index_by_l1_batch")
        .fetch_one(self.storage)
        .await?
        .max
        .map(|max| max as u64))
    }
Returns the max enumeration index by the provided L1 batch number.
core/lib/dal/src/storage_logs_dedup_dal.rs