Skip to content

Conversation

@bzawisto
Copy link
Contributor

@bzawisto bzawisto commented Dec 12, 2025

This PR introduces randao - which works as follows:

  1. validators include RANDAO_REVEAL(block) = BLS_SIGN(proposer.privkey, block.view) in the randao_reveal field of block they propose
  2. validator include RANDAO_MIX(block) = RANDAO_MIX(block.parent) XOR KECCAK256(RANDAO_REVEAL(block)) in the mixHash field of block they propose
  3. nodes check if BLS_VERIFY(proposer.pubkey, block.view, RANDAO_REVEAL(block)) is true
  4. nodes compute RANDAO_MIX(block) = RANDAO_MIX(block.parent) XOR KECCAK256(RANDAO_REVEAL(block)) and check if included mixHash included in a block is the same

@bzawisto bzawisto marked this pull request as draft December 12, 2025 08:24
.get_block(&proposal.parent_hash())?
.ok_or_else(|| anyhow!("missing parent block"))?;

let prev_randa_mix = parent.header.mix_hash.unwrap_or(Hash::ZERO);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, should be prev_randao_mix

&mut state,
tx.clone(),
proposal.header,
prev_randa_mix,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same typo as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants