Skip to content

Commit ae9057e

Browse files
committed
feat(block_producer): discard slot if staking ledger changed
1 parent 53b29da commit ae9057e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

node/src/block_producer/block_producer_state.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,10 @@ impl BlockProducerCurrentState {
223223
if won_slot.global_slot_since_genesis.as_u32() < best_tip.global_slot() {
224224
return Some(BlockProducerWonSlotDiscardReason::BestTipGlobalSlotHigher);
225225
}
226-
// TODO(binier): check if staking ledger changed
226+
227+
if &won_slot.staking_ledger_hash != best_tip.staking_epoch_ledger_hash() {
228+
return Some(BlockProducerWonSlotDiscardReason::BestTipStakingLedgerDifferent);
229+
}
227230

228231
if won_slot < best_tip
229232
|| self.produced_block().map_or(false, |block| {

0 commit comments

Comments
 (0)