Skip to content

Improve RANDAO derivation logic in PureEngineClient #2270

@coderabbitai

Description

@coderabbitai

Background

In PR evstack/go-execution-evm#30, we identified that the current implementation of derivePrevRandao in PureEngineClient simply returns the block height as a hash:

func (c *PureEngineClient) derivePrevRandao(blockHeight uint64) common.Hash {
    return common.BigToHash(new(big.Int).SetUint64(blockHeight))
}

Issue

While this implementation is feasible for test networks, production consensus protocols typically require actual random values. Using block height as a deterministic input for RANDAO doesn't provide the randomness properties expected in a production environment.

Potential Solutions

  1. Implement a proper Verifiable Random Function (VRF)
  2. Integrate with a secure random source
  3. Implement a more sophisticated deterministic but unpredictable algorithm

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions