@@ -432,6 +432,24 @@ library ValidatorSelectionLib {
432432 }
433433 }
434434
435+ /**
436+ * @notice Computes the index of the committee member that acts as proposer for a given slot
437+ *
438+ * @param _epoch - The epoch to compute the proposer index for
439+ * @param _slot - The slot to compute the proposer index for
440+ * @param _seed - The seed to use for the computation
441+ * @param _size - The size of the committee
442+ *
443+ * @return The index of the proposer
444+ */
445+ function computeProposerIndex (Epoch _epoch , Slot _slot , uint256 _seed , uint256 _size )
446+ internal
447+ pure
448+ returns (uint256 )
449+ {
450+ return uint256 (keccak256 (abi.encode (_epoch, _slot, _seed))) % _size;
451+ }
452+
435453 /**
436454 * @notice Samples a validator set for a specific epoch and returns their indices within the set.
437455 *
@@ -486,22 +504,4 @@ library ValidatorSelectionLib {
486504 function computeCommitteeCommitment (address [] memory _committee ) private pure returns (bytes32 ) {
487505 return keccak256 (abi.encode (_committee));
488506 }
489-
490- /**
491- * @notice Computes the index of the committee member that acts as proposer for a given slot
492- *
493- * @param _epoch - The epoch to compute the proposer index for
494- * @param _slot - The slot to compute the proposer index for
495- * @param _seed - The seed to use for the computation
496- * @param _size - The size of the committee
497- *
498- * @return The index of the proposer
499- */
500- function computeProposerIndex (Epoch _epoch , Slot _slot , uint256 _seed , uint256 _size )
501- internal
502- pure
503- returns (uint256 )
504- {
505- return uint256 (keccak256 (abi.encode (_epoch, _slot, _seed))) % _size;
506- }
507507}
0 commit comments