From f7e9cd5a8dd21ab3f49b3e547b84a7bfebd61954 Mon Sep 17 00:00:00 2001 From: Cardinal Date: Fri, 22 May 2026 12:40:38 +0200 Subject: [PATCH] fix(redis): extract virtual randomness hook for fuzz harnesses Expose _nextSeedValue so test wrappers can pin post-reveal randomness without changing production seed update semantics. --- src/Redistribution.sol | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Redistribution.sol b/src/Redistribution.sol index e168aa05..d4d5c234 100644 --- a/src/Redistribution.sol +++ b/src/Redistribution.sol @@ -671,8 +671,13 @@ contract Redistribution is AccessControl, Pausable { * @notice Updates the source of randomness. Uses block.difficulty in pre-merge chains, this is substituted * to block.prevrandao in post merge chains. */ - function updateRandomness() private { - seed = keccak256(abi.encode(seed, block.prevrandao)); + function updateRandomness() internal virtual { + seed = _nextSeedValue(); + } + + /// @dev Extracted for fuzz harnesses that must pin post-reveal randomness to fixture data. + function _nextSeedValue() internal view virtual returns (bytes32) { + return keccak256(abi.encode(seed, block.prevrandao)); } /**