diff --git a/lez/indexer/core/src/block_store.rs b/lez/indexer/core/src/block_store.rs index d88078e9..bd47d582 100644 --- a/lez/indexer/core/src/block_store.rs +++ b/lez/indexer/core/src/block_store.rs @@ -33,7 +33,7 @@ pub enum AcceptOutcome { /// ([`BlockIngestError::is_retryable`]); nothing recorded, tip and state /// untouched. The caller retries and parks via /// [`IndexerStore::record_stall`] once it gives up. - ApplyFailed(BlockIngestError), + RetryableFailure(BlockIngestError), } #[derive(Clone)] @@ -238,7 +238,7 @@ impl IndexerStore { /// Validates `block` against the tip and, if it chains, applies it atomically /// (scratch clone, commit only on full success) and advances the tip. - /// Retryable apply failures return `ApplyFailed` without recording a stall + /// Retryable apply failures return `RetryableFailure` without recording a stall /// or touching state; other failures record the stall and return `Parked`. pub async fn accept_block(&self, block: &Block, l1_slot: Slot) -> Result { let tip = self.validated_tip()?; @@ -261,7 +261,7 @@ impl IndexerStore { let mut scratch = self.current_state.read().await.clone(); if let Err(err) = apply_block_to_scratch(block, &mut scratch) { if err.is_retryable() { - return Ok(AcceptOutcome::ApplyFailed(err)); + return Ok(AcceptOutcome::RetryableFailure(err)); } self.record_stall(Some(&block.header), l1_slot, err.clone())?; return Ok(AcceptOutcome::Parked(err)); @@ -886,7 +886,7 @@ mod accept_tests { } #[tokio::test] - async fn transient_apply_failure_returns_apply_failed_without_stall() { + async fn transient_apply_failure_returns_retryable_failure_without_stall() { use testnet_initial_state::initial_pub_accounts_private_keys; let dir = tempfile::tempdir().expect("tempdir"); @@ -916,7 +916,7 @@ mod accept_tests { assert!(matches!( outcome, - AcceptOutcome::ApplyFailed(BlockIngestError::StateTransition { .. }) + AcceptOutcome::RetryableFailure(BlockIngestError::StateTransition { .. }) )); assert!( store.get_stall_reason().unwrap().is_none(), diff --git a/lez/indexer/core/src/lib.rs b/lez/indexer/core/src/lib.rs index fb9f7c31..fe5aec11 100644 --- a/lez/indexer/core/src/lib.rs +++ b/lez/indexer/core/src/lib.rs @@ -243,7 +243,7 @@ impl IndexerCore { // L1 proceeds regardless self.advance_cursor(&mut cursor, slot); } - Ok(AcceptOutcome::ApplyFailed(ingest_err)) => { + Ok(AcceptOutcome::RetryableFailure(ingest_err)) => { let attempts = retry_gate.register_failure(block.header.block_id); if attempts >= APPLY_RETRY_LIMIT { error!(