Skip to content

Commit

Permalink
revert usage of slot randomness for epoch nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslavaur committed Sep 3, 2024
1 parent 0ed2cd8 commit d50633b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cryptarchia/cryptarchia.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def verify_slot_leader(
) -> bool:
threshold_0, threshold_1 = lottery_threshold(self.config.active_slot_coeff, epoch_state.total_active_stake())
return (
proof.verify(slot, current_state.nonce, threshold_0, threshold_1, current_state.commitments_lead, parent) # verify slot leader proof
proof.verify(slot, epoch_state.nonce() , threshold_0, threshold_1, current_state.commitments_lead, parent) # verify slot leader proof
# TODO: remove it because membership verification is included in the proof verification along with the PoS lottery:
and (
current_state.verify_eligible_to_lead(proof.commitment)
Expand Down
2 changes: 1 addition & 1 deletion cryptarchia/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def on_slot(self, slot: Slot) -> BlockHeader | None:
parent = self.follower.tip_id()
epoch_state = self.epoch_state(slot)
# TODO: use the correct leader commitment set
if leader_proof := self.leader.try_prove_slot_leader(epoch_state.total_active_stake(), self.follower.tip_state().nonce, slot, {self.leader.coin.commitment()}, parent):
if leader_proof := self.leader.try_prove_slot_leader(epoch_state.total_active_stake(), epoch_state.nonce(), slot, {self.leader.coin.commitment()}, parent):
orphans = self.follower.unimported_orphans(parent)
self.leader.coin = self.leader.coin.evolve()
return BlockHeader(
Expand Down

0 comments on commit d50633b

Please sign in to comment.