diff --git a/beacon_node/store/src/hot_cold_store.rs b/beacon_node/store/src/hot_cold_store.rs index 4105c393f..02a88b331 100644 --- a/beacon_node/store/src/hot_cold_store.rs +++ b/beacon_node/store/src/hot_cold_store.rs @@ -106,6 +106,11 @@ pub enum HotColdDBError { IterationError { unexpected_key: BytesKey, }, + AttestationStateIsFinalized { + split_slot: Slot, + request_slot: Option, + state_root: Hash256, + }, } impl HotColdDB, MemoryStore> { @@ -345,8 +350,15 @@ impl, Cold: ItemStore> HotColdDB ) -> Result>, Error> { metrics::inc_counter(&metrics::BEACON_STATE_GET_COUNT); - if slot.map_or(false, |slot| slot < self.get_split_slot()) { - Ok(None) + let split_slot = self.get_split_slot(); + + if slot.map_or(false, |slot| slot < split_slot) { + Err(HotColdDBError::AttestationStateIsFinalized { + split_slot, + request_slot: slot, + state_root: *state_root, + } + .into()) } else { self.load_hot_state(state_root, BlockReplay::InconsistentStateRoots) }