Skip to content

Commit 64c7093

Browse files
committed
Enter ExtRollupLib3
1 parent c08a610 commit 64c7093

File tree

5 files changed

+47
-31
lines changed

5 files changed

+47
-31
lines changed

l1-contracts/src/core/RollupCore.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {CommitteeAttestations} from "@aztec/shared/libraries/SignatureLib.sol";
2020
import {Errors} from "@aztec/core/libraries/Errors.sol";
2121
import {ExtRollupLib} from "@aztec/core/libraries/rollup/ExtRollupLib.sol";
2222
import {ExtRollupLib2} from "@aztec/core/libraries/rollup/ExtRollupLib2.sol";
23+
import {ExtRollupLib3} from "@aztec/core/libraries/rollup/ExtRollupLib3.sol";
2324
import {EthValue, FeeLib} from "@aztec/core/libraries/rollup/FeeLib.sol";
2425
import {ProposeArgs} from "@aztec/core/libraries/rollup/ProposeLib.sol";
2526
import {STFLib, GenesisState} from "@aztec/core/libraries/rollup/STFLib.sol";
@@ -86,7 +87,7 @@ contract RollupCore is
8687
);
8788

8889
Timestamp exitDelay = Timestamp.wrap(_config.exitDelaySeconds);
89-
ISlasher slasher = ExtRollupLib2.deploySlasher(
90+
ISlasher slasher = ExtRollupLib3.deploySlasher(
9091
_config.slashingQuorum,
9192
_config.slashingRoundSize,
9293
_config.slashingLifetimeInRounds,
@@ -101,7 +102,7 @@ contract RollupCore is
101102

102103
// If no booster specifically provided deploy one.
103104
if (address(_config.rewardConfig.booster) == address(0)) {
104-
_config.rewardConfig.booster = ExtRollupLib2.deployRewardBooster(_config.rewardBoostConfig);
105+
_config.rewardConfig.booster = ExtRollupLib3.deployRewardBooster(_config.rewardBoostConfig);
105106
}
106107

107108
RewardLib.setConfig(_config.rewardConfig);

l1-contracts/src/core/libraries/rollup/ExtRollupLib2.sol

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,10 @@ import {StakingLib} from "./StakingLib.sol";
99
import {InvalidateLib} from "./InvalidateLib.sol";
1010
import {ValidatorSelectionLib} from "./ValidatorSelectionLib.sol";
1111
import {CommitteeAttestations} from "@aztec/shared/libraries/SignatureLib.sol";
12-
import {
13-
RewardBooster,
14-
RewardBoostConfig,
15-
IBoosterCore,
16-
IValidatorSelection
17-
} from "@aztec/core/reward-boost/RewardBooster.sol";
18-
import {Slasher, ISlasher} from "@aztec/core/slashing/Slasher.sol";
1912

2013
library ExtRollupLib2 {
2114
using TimeLib for Timestamp;
2215

23-
function deployRewardBooster(RewardBoostConfig memory _config) external returns (IBoosterCore) {
24-
RewardBooster booster = new RewardBooster(IValidatorSelection(address(this)), _config);
25-
return IBoosterCore(address(booster));
26-
}
27-
28-
function deploySlasher(
29-
uint256 _slashingQuorum,
30-
uint256 _slashingRoundSize,
31-
uint256 _slashingLifetimeInRounds,
32-
uint256 _slashingExecutionDelayInRounds,
33-
address _slashingVetoer
34-
) external returns (ISlasher) {
35-
Slasher slasher = new Slasher(
36-
_slashingQuorum,
37-
_slashingRoundSize,
38-
_slashingLifetimeInRounds,
39-
_slashingExecutionDelayInRounds,
40-
_slashingVetoer
41-
);
42-
return ISlasher(address(slasher));
43-
}
44-
4516
function setSlasher(address _slasher) external {
4617
StakingLib.setSlasher(_slasher);
4718
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Copyright 2024 Aztec Labs.
3+
// solhint-disable imports-order
4+
pragma solidity >=0.8.27;
5+
6+
import {
7+
RewardBooster,
8+
RewardBoostConfig,
9+
IBoosterCore,
10+
IValidatorSelection
11+
} from "@aztec/core/reward-boost/RewardBooster.sol";
12+
import {Slasher, ISlasher} from "@aztec/core/slashing/Slasher.sol";
13+
14+
library ExtRollupLib3 {
15+
function deployRewardBooster(RewardBoostConfig memory _config) external returns (IBoosterCore) {
16+
RewardBooster booster = new RewardBooster(IValidatorSelection(address(this)), _config);
17+
return IBoosterCore(address(booster));
18+
}
19+
20+
function deploySlasher(
21+
uint256 _slashingQuorum,
22+
uint256 _slashingRoundSize,
23+
uint256 _slashingLifetimeInRounds,
24+
uint256 _slashingExecutionDelayInRounds,
25+
address _slashingVetoer
26+
) external returns (ISlasher) {
27+
Slasher slasher = new Slasher(
28+
_slashingQuorum,
29+
_slashingRoundSize,
30+
_slashingLifetimeInRounds,
31+
_slashingExecutionDelayInRounds,
32+
_slashingVetoer
33+
);
34+
return ISlasher(address(slasher));
35+
}
36+
}

yarn-project/ethereum/src/l1_artifacts.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import {
33
CoinIssuerBytecode,
44
ExtRollupLib2Abi,
55
ExtRollupLib2Bytecode,
6+
ExtRollupLib3Abi,
7+
ExtRollupLib3Bytecode,
68
ExtRollupLibAbi,
79
ExtRollupLibBytecode,
810
FeeAssetHandlerAbi,
@@ -88,6 +90,11 @@ export const RollupArtifact = {
8890
contractAbi: ExtRollupLib2Abi,
8991
contractBytecode: ExtRollupLib2Bytecode as Hex,
9092
},
93+
ExtRollupLib3: {
94+
name: 'ExtRollupLib3',
95+
contractAbi: ExtRollupLib3Abi,
96+
contractBytecode: ExtRollupLib3Bytecode as Hex,
97+
},
9198
},
9299
},
93100
};

yarn-project/l1-artifacts/scripts/generate-artifacts.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ contracts=(
1515
"EmpireBase"
1616
"ExtRollupLib"
1717
"ExtRollupLib2"
18+
"ExtRollupLib3"
1819
"FeeJuicePortal"
1920
"Governance"
2021
"GovernanceProposer"

0 commit comments

Comments
 (0)