sui_indexer/backfill/backfill_instances/ingestion_backfills/
digest_task.rs

1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use crate::backfill::backfill_instances::ingestion_backfills::IngestionBackfillTrait;
5use crate::database::ConnectionPool;
6use sui_types::full_checkpoint_content::CheckpointData;
7use tracing::info;
8
9/// Dummy backfill that only prints the sequence number and checkpoint of the digest. Intended to
10/// benchmark backfill performance.
11pub struct DigestBackfill;
12
13#[async_trait::async_trait]
14impl IngestionBackfillTrait for DigestBackfill {
15    type ProcessedType = ();
16
17    fn process_checkpoint(checkpoint: &CheckpointData) -> Vec<Self::ProcessedType> {
18        let cp = checkpoint.checkpoint_summary.sequence_number;
19        let digest = checkpoint.checkpoint_summary.content_digest;
20        info!("{cp}: {digest}");
21
22        vec![]
23    }
24
25    async fn commit_chunk(_pool: ConnectionPool, _processed_data: Vec<Self::ProcessedType>) {}
26}