Skip to content

[#4886] Widen LibRandomness.SEED_WINDOW to 8191, the EIP-2935 window - #92

Open
isaacdoidge wants to merge 1 commit into
feature/evm_automationfrom
task/issue-4886
Open

isaacdoidge wants to merge 1 commit into
feature/evm_automationfrom
task/issue-4886

Conversation

@isaacdoidge

Copy link
Copy Markdown
Collaborator

Summary

  • LibRandomness.SEED_WINDOW is 8191, up from 256. isServable reads the constant, so it follows.
  • The seedAt NatSpec in LibRandomness and ISupraRandomness states the window as [block.number - 8191, block.number - 1], the window of the EIP-2935 block hash history, instead of BLOCKHASH's 256 blocks.

Motivation

smr-moonshot#4886 stores block seeds in their own table and widens the randomness precompile's seedAt window to 8191 blocks. At the block intervals measured on 2026-11-13 (Devnet about 0.1 s, Testnet 0.22 s, Mainnet 1.08 s), 256 blocks is 30 s to 4.6 min; 8191 is about 14 min at 0.1 s per block. The companion smr-moonshot PR changes the precompile, the node's seed storage and the Integration book.

Notes for review

  • No contract under src/ uses LibRandomness, so no deployed bytecode changes.
  • Contracts compiled against SEED_WINDOW = 256 keep working: the window they assume lies inside the new one.

Test plan

  • forge build
  • forge test --match-path test/LibRandomness.t.sol: 2 passed
  • forge fmt --check on both files

🤖 Generated with Claude Code

`seedAt` serves the seeds of the 8191 blocks below the current one from
smr-moonshot#4886. `SEED_WINDOW`, `isServable` and the `seedAt` NatSpec in
`LibRandomness` and `ISupraRandomness` state the new window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isaacdoidge

Copy link
Copy Markdown
Collaborator Author

Companion smr-moonshot PR: https://github.com/Entropy-Foundation/smr-moonshot/pull/5035 (widens SEED_AT_WINDOW to 8191 and serves seedAt from a node-local seed table). smr-moonshot does not compile LibRandomness, so it needs no pin change for this PR.

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.

1 participant