kleros-interaction icon indicating copy to clipboard operation
kleros-interaction copied to clipboard

Historical Beacon RNG

Open jaybuidl opened this issue 5 months ago • 2 comments

Adapted from @kevincharm's RandaoAccessor

Specifications

https://docs.google.com/document/d/1hKlzk51z-ULnfSL4sQ7aCl70IQBxObtr1i8ZfsYl6MY/edit

Usage

  1. Court is in Staking phase. The bot calls passPhase(), which makes the RNG emit a Request(_blockNumber) event,
  2. Court is now in Generating phase. The bot listens to the Request event and retrieves the requested block number, then retrieves the block header from RPC with the eth_getblockbynumber method, then RLP-encodes the header using getBlockWithRLP(), finally provides the header to the RNG by calling verifyRecent(),
  3. The bot calls passPhase(), the Court is now in Drawing phase.

jaybuidl avatar Sep 05 '24 12:09 jaybuidl