@@ -257,58 +257,6 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
257257 FeeLib.initialize (_config.manaTarget, _config.provingCostPerMana, _config.initialEthPerFeeAsset);
258258 }
259259
260- function _deploySlasher (RollupConfigInput memory _config , address _governance ) internal returns (ISlasher slasher ) {
261- // We call one external library or another based on the slasher flavor
262- // This allows us to keep the slash flavors in separate external libraries so we do not exceed max contract size
263- // Note that we do not deploy a slasher if we run with no committees (i.e. targetCommitteeSize == 0)
264- if (_config.targetCommitteeSize == 0 || _config.slasherFlavor == SlasherFlavor.NONE) {
265- return ISlasher (address (0 ));
266- }
267-
268- if (_config.slasherFlavor == SlasherFlavor.TALLY) {
269- return TallySlasherDeploymentExtLib.deployTallySlasher (address (this ), _governance, _config);
270- }
271-
272- return EmpireSlasherDeploymentExtLib.deployEmpireSlasher (address (this ), _governance, _config);
273- }
274-
275- function _initializeRewards (RollupConfigInput memory _config ) internal {
276- RewardConfig memory rewardConfig = _config.rewardConfig;
277-
278- if (address (rewardConfig.booster) == address (0 )) {
279- rewardConfig.booster = RewardExtLib.deployRewardBooster (_config.rewardBoostConfig);
280- }
281-
282- RewardExtLib.initialize (_config.earliestRewardsClaimableTimestamp);
283- RewardExtLib.setConfig (rewardConfig);
284- }
285-
286- function _initializeStore (
287- IERC20 _feeAsset ,
288- IVerifier _epochProofVerifier ,
289- GenesisState memory _genesisState ,
290- RollupConfigInput memory _config
291- ) internal {
292- STFLib.initialize (_genesisState);
293- RollupStore storage rollupStore = STFLib.getStorage ();
294-
295- rollupStore.config.feeAsset = _feeAsset;
296- rollupStore.config.epochProofVerifier = _epochProofVerifier;
297- rollupStore.config.version = _config.version;
298-
299- IInbox inbox = IInbox (
300- address (
301- new Inbox (
302- address (this ), _feeAsset, _config.version, Constants.L1_TO_L2_MSG_SUBTREE_HEIGHT, _config.inboxLag
303- )
304- )
305- );
306-
307- rollupStore.config.inbox = inbox;
308- rollupStore.config.outbox = IOutbox (address (new Outbox (address (this ), _config.version)));
309- rollupStore.config.feeAssetPortal = IFeeJuicePortal (inbox.getFeeAssetPortal ());
310- }
311-
312260 /**
313261 * @notice Updates the reward configuration for sequencers and provers
314262 * @dev Only callable by the contract owner. Updates how rewards are calculated and distributed.
@@ -642,4 +590,54 @@ contract RollupCore is EIP712("Aztec Rollup", "1"), Ownable, IStakingCore, IVali
642590 function getActiveAttesterCount () public view override (IStakingCore) returns (uint256 ) {
643591 return StakingLib.getAttesterCountAtTime (Timestamp.wrap (block .timestamp ));
644592 }
593+
594+ function _deploySlasher (RollupConfigInput memory _config , address _governance ) internal returns (ISlasher slasher ) {
595+ // We call one external library or another based on the slasher flavor
596+ // This allows us to keep the slash flavors in separate external libraries so we do not exceed max contract size
597+ // Note that we do not deploy a slasher if we run with no committees (i.e. targetCommitteeSize == 0)
598+ if (_config.targetCommitteeSize == 0 || _config.slasherFlavor == SlasherFlavor.NONE) {
599+ return ISlasher (address (0 ));
600+ }
601+
602+ if (_config.slasherFlavor == SlasherFlavor.TALLY) {
603+ return TallySlasherDeploymentExtLib.deployTallySlasher (address (this ), _governance, _config);
604+ }
605+
606+ return EmpireSlasherDeploymentExtLib.deployEmpireSlasher (address (this ), _governance, _config);
607+ }
608+
609+ function _initializeRewards (RollupConfigInput memory _config ) internal {
610+ RewardConfig memory rewardConfig = _config.rewardConfig;
611+
612+ if (address (rewardConfig.booster) == address (0 )) {
613+ rewardConfig.booster = RewardExtLib.deployRewardBooster (_config.rewardBoostConfig);
614+ }
615+
616+ RewardExtLib.initialize (_config.earliestRewardsClaimableTimestamp);
617+ RewardExtLib.setConfig (rewardConfig);
618+ }
619+
620+ function _initializeStore (
621+ IERC20 _feeAsset ,
622+ IVerifier _epochProofVerifier ,
623+ GenesisState memory _genesisState ,
624+ RollupConfigInput memory _config
625+ ) internal {
626+ STFLib.initialize (_genesisState);
627+ RollupStore storage rollupStore = STFLib.getStorage ();
628+
629+ rollupStore.config.feeAsset = _feeAsset;
630+ rollupStore.config.epochProofVerifier = _epochProofVerifier;
631+ rollupStore.config.version = _config.version;
632+
633+ IInbox inbox = IInbox (
634+ address (
635+ new Inbox (address (this ), _feeAsset, _config.version, Constants.L1_TO_L2_MSG_SUBTREE_HEIGHT, _config.inboxLag)
636+ )
637+ );
638+
639+ rollupStore.config.inbox = inbox;
640+ rollupStore.config.outbox = IOutbox (address (new Outbox (address (this ), _config.version)));
641+ rollupStore.config.feeAssetPortal = IFeeJuicePortal (inbox.getFeeAssetPortal ());
642+ }
645643}
0 commit comments