PREVRANDAO should be able to return value of a public input instead of difficulty/0
pgebheim opened this issue · comments
Discussion today was that this could be added with the value as an external input.
@wborgeaud could you elaborate?
So currently our implementation of PREVRANDAO (0x44) returns the difficulty
field of the block header (which is always 0 post-merge).
As explained in EIP-4399, we should instead return the mixHash
field of the block header. So to fix this issue we just have to add mixHash
to the block metadata and return it in sys_prevrandao
.
I think we can just have mixHash
be unconstrained in Plonky2 and assume it's been verified upstream in the consensus layer.