Skip to content

Commit 1796892

Browse files
committed
fix: add not active slot in overlay error
1 parent 9fedc00 commit 1796892

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

common/src/validation.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ pub enum VrfValidationError {
6363
/// The pool lost the slot lottery
6464
#[error("VRF Leader Value Too Big")]
6565
VrfLeaderValueTooBig(#[from] VrfLeaderValueTooBigError),
66+
/// **Cause:** This slot is in the overlay schedule but marked as non-active.
67+
/// It's an intentional gap slot where no blocks should be produced.
68+
#[error("Not Active slot in overlay schedule: {slot}")]
69+
NotActiveSlotInOverlaySchedule { slot: Slot },
6670
/// **Cause:** Some data has incorrect bytes
6771
#[error("TryFromSlice: {0}")]
6872
TryFromSlice(String),

modules/block_vrf_validator/src/ouroboros/tpraos.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ pub fn validate_vrf_tpraos<'a>(
152152
}
153153
Some(OBftSlot::NonActiveSlot) => {
154154
// This is a non-active slot; nobody may produce a block
155-
Ok(vec![])
155+
Ok(vec![Box::new(|| {
156+
Err(VrfValidationError::NotActiveSlotInOverlaySchedule {
157+
slot: block_info.slot,
158+
})
159+
})])
156160
}
157161
}
158162
}

0 commit comments

Comments
 (0)