Skip to content

Commit

Permalink
Merge pull request #606 from chainbound/jonas/fix/slot-check
Browse files Browse the repository at this point in the history
fix(sidecar): discard inclusion requests for past slots
  • Loading branch information
mempirate authored Dec 23, 2024
2 parents 6416551 + 9c2c4db commit 95e3a54
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bolt-sidecar/src/state/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ impl ConsensusState {
/// If the request is valid, return the validator public key for the target slot.
pub fn validate_request(&self, req: &InclusionRequest) -> Result<BlsPublicKey, ConsensusError> {
// Check if the slot is in the current epoch or next epoch (if unsafe lookahead is enabled)
if req.slot < self.epoch.start_slot || req.slot >= self.furthest_slot() {
if req.slot < self.epoch.start_slot ||
req.slot >= self.furthest_slot() ||
req.slot <= self.latest_slot
{
return Err(ConsensusError::InvalidSlot(req.slot));
}

Expand Down

0 comments on commit 95e3a54

Please sign in to comment.