@@ -52,7 +52,7 @@ import {G1Point, G2Point} from "@aztec/shared/libraries/BN254Lib.sol";
5252 * - Slots are grouped into epochs (configurable size, e.g., 32 slots)
5353 * - Each slot has one designated proposer from the validator set
5454 * - Each block is expected to include attestations from committee members
55- * - Committees remain stable throughout an epoch
55+ * - There is one committee per epoch
5656 *
5757 * Key invariants:
5858 * - The L2 chain is linear (no forks) but can be rolled back
@@ -73,8 +73,8 @@ import {G1Point, G2Point} from "@aztec/shared/libraries/BN254Lib.sol";
7373 * purposes:
7474 * - Attest to data availability for transaction data not posted on L1, which is required by provers to generate
7575 * epoch proofs
76- * - Re-execute everything and attest to the resulting state root, acting as training wheels for the proving
77- * system
76+ * - Re-execute everything and attest to the resulting state root, acting as training wheels for the public
77+ * part of the system (proving systems used in public and AVM)
7878 *
7979 * 3) Proposers: Drafted from the validator set (currently proposers are part of the committee for the epoch,
8080 * though this may change). They have exclusive rights to propose a block at a given slot, ensuring orderly
@@ -135,7 +135,7 @@ import {G1Point, G2Point} from "@aztec/shared/libraries/BN254Lib.sol";
135135 * `prune()` manually, or automatically on the next proposal.
136136 * - The committee for the epoch is expected to disseminate transaction data to allow proving, so a prune is
137137 * considered a slashable offense, that causes validators to vote for slashing the committee of the unproven
138- * epoch.
138+ * epoch.
139139 * - When the pending chain is pruned, all unproven blocks are removed from the pending chain, and the chain
140140 * resumes from the last proven block.
141141 *
@@ -199,7 +199,7 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
199199 bool public isRewardsClaimable = false ;
200200
201201 /**
202- * @notice Initializes the Aztec rollup with all required configuration
202+ * @notice Initializes the Aztec rollup with all required configurations
203203 * @dev Sets up time parameters, deploys auxiliary contracts (slasher, reward booster),
204204 * initializes staking, validator selection, and creates inbox/outbox contracts
205205 * @param _feeAsset The ERC20 token used for transaction fees
@@ -236,7 +236,7 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
236236 StakingLib.initialize (_stakingAsset, _gse, exitDelay, address (slasher), _config.stakingQueueConfig);
237237 ExtRollupLib2.initializeValidatorSelection (_config.targetCommitteeSize);
238238
239- // If no booster specifically provided deploy one.
239+ // If no booster is specifically provided, deploy one.
240240 if (address (_config.rewardConfig.booster) == address (0 )) {
241241 _config.rewardConfig.booster = ExtRollupLib3.deployRewardBooster (_config.rewardBoostConfig);
242242 }
@@ -520,12 +520,22 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
520520
521521 /**
522522 * @notice Sets up validator selection for the current epoch
523- * @dev Can be called by anyone at the start of an epoch. Samples the committee
524- * and determines proposers for all slots in the epoch. Also stores a seed
525- * that is used for future sampling. Automatically called during `propose`.
526- * External mainly for testing and to setup an epoch if there were no block proposals.
523+ * @dev Can be called by anyone at the start of an epoch. Samples the committee and determines proposers for all
524+ * slots in the epoch. Also stores a seed that is used for future sampling. The corresponding library
525+ * functionality is automatically called when `RollupCore.propose(...)` is called (via the
526+ * `ExtRollupLib.propose(...)` -> `ProposeLib.propose(...)` -> `ValidatorSelectionLib.setupEpoch(...)`).
527+ *
528+ * If there are missed proposals then setupEpoch does not get called automatically. Since the next committee
529+ * selection is computed based on the latest stored seed and the epoch number, we would only fail to get a
530+ * fresh seed if:
531+ * 1. All the proposals in the epoch were missed
532+ * 2. Nobody called setupEpoch on the Rollup contract
533+ *
534+ * While an attacker might theoretically benefit from preventing a fresh seed (e.g. by DoSing all proposers),
535+ * preventing anyone from calling this function directly is not really feasible. This makes attacks on seed
536+ * generation impractical.
527537 */
528- function setupEpoch () public override (IValidatorSelectionCore) {
538+ function setupEpoch () external override (IValidatorSelectionCore) {
529539 ExtRollupLib2.setupEpoch ();
530540 }
531541
0 commit comments