Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
515 changes: 272 additions & 243 deletions .gas-snapshot

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions scripts/proposals/sec-council-upgrade-rotation/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"actionChainIds": [
42161
],
"actionAddresses": [
"0xeF98Fc7A7F08De47Ed01f3F11f07319c22106445"
],
"arbSysSendTxToL1Args": {
"l1Timelock": "0xE6841D92B0C345144506576eC13ECf5103aC7f49",
"calldata": "0x8f2a0bb000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000d078d01ffb5a3a5eac98137cbe898b2f21c1114069936d04a90b74ee9806e3f5000000000000000000000000000000000000000000000000000000000003f4800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a723c008e76e379c55599d2e4d93879beafda79c000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001800000000000000000000000004dbd4fc535ac27206064b68ffcf827b0a60bab3f000000000000000000000000cf57572261c7c2bcf21ffd220ea7d1a27d40a82700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000841cff79cd000000000000000000000000ef98fc7a7f08de47ed01f3f11f07319c2210644500000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000004b147f40c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import "../../../security-council-mgmt/governors/SecurityCouncilNomineeElectionG
/// - Upgrade the sec council manager to allow member rotation and sets min rotation vars
/// - Upgrade the sec council nominee election governor to allow modifying the cadence of election
/// - Adjusting the qualification threshold of the Member Election phase from 0.2% to 0.1%
/// - Allowing existing sec council members to automatically progress from the Nominee Selection phase
/// - Updating the ArbitrumDAO Constitution to reflect these changes
contract SecurityCouncilUpgradeAction {
IL2AddressRegistry public immutable l2AddressRegistry;
Expand Down Expand Up @@ -47,7 +46,7 @@ contract SecurityCouncilUpgradeAction {
payable(address(l2AddressRegistry.scNomineeElectionGovernor()))
);
require(
scNomineeElectionGovernor.electionCount() == 5,
scNomineeElectionGovernor.electionCount() == 6,
"SecurityCouncilUpgradeAction: not expected timing"
);

Expand All @@ -73,7 +72,6 @@ contract SecurityCouncilUpgradeAction {
);

// Upgrade the sec council nominee election governor to allow modifying the cadence of election
// Allowing existing sec council members to automatically progress from the Nominee Selection phase
l2AddressRegistry.govProxyAdmin().upgradeAndCall(
TransparentUpgradeableProxy(payable(address(scNomineeElectionGovernor))),
scNomineeElectionGovernorImpl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ contract SecurityCouncilNomineeElectionGovernor is
error ProposalNotInVettingPeriod(uint256 blockNumber, uint256 vettingDeadline);
error ProposalNotInRotationPeriod(uint256 blockNumber, uint256 rotationDeadline);
error NomineeAlreadyExcluded(address nominee);
error OnlyContenderNomineeCanRotate();
error NewNomineeIsContender(address newNominee);
error CompliantNomineeTargetHit(uint256 nomineeCount, uint256 expectedCount);
error ProposalInVettingPeriod(uint256 blockNumber, uint256 vettingDeadline);
error InsufficientCompliantNomineeCount(uint256 compliantNomineeCount, uint256 expectedCount);
Expand Down Expand Up @@ -277,12 +279,6 @@ contract SecurityCouncilNomineeElectionGovernor is
election.isContender[signer] = true;

emit ContenderAdded(proposalId, signer);

// if the signer is part of the outgoing cohort, we automatically add them as a nominee
if (securityCouncilManager.cohortIncludes(currentCohort(), signer)) {
// no need to check for duplicate nominees as we already checked
_addNominee(proposalId, signer);
}
}

/// @notice Allows the owner to change the nomineeVetter
Expand Down Expand Up @@ -383,6 +379,14 @@ contract SecurityCouncilNomineeElectionGovernor is
revert InvalidSignature();
}

if (!isContender(proposalId, msg.sender)) {
revert OnlyContenderNomineeCanRotate();
}

if (isContender(proposalId, newNomineeAddress)) {
revert NewNomineeIsContender(newNomineeAddress);
}

// rotation by first excluding the nominee and then adding the new nominee
election.isExcluded[msg.sender] = true;
election.excludedNomineeCount++;
Expand Down
13 changes: 8 additions & 5 deletions test/gov-actions/CancelTimelockAndRemoveMemberActionTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,21 @@ contract CancelTimelockAndRemoveMemberActionTest is Test {
}

function ensureLatestScm(L2AddressRegistry reg) internal {
ISecurityCouncilManager scm = reg.securityCouncilManager();
if (
proxyAdmin.getProxyImplementation(TransparentUpgradeableProxy(payable(address(scm))))
!= oldImplementation
) {
return; // already upgraded on-chain
}

address newImplementation = address(new SecurityCouncilManager());
address newNomineeElectionGovernorImplementation =
address(new SecurityCouncilNomineeElectionGovernor());
address rotationSetter = address(1337);
uint256 minRotationPeriod = 1 weeks;
uint256 cadenceInMonths = 12;

SecurityCouncilNomineeElectionGovernor scNomineeElectionGovernor =
SecurityCouncilNomineeElectionGovernor(payable(address(reg.scNomineeElectionGovernor())));
vm.warp(1_757_937_601); // After the 2025 Sep election

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to warp and create the election anymore

scNomineeElectionGovernor.createElection();

SecurityCouncilUpgradeAction action = new SecurityCouncilUpgradeAction(
reg,
newImplementation,
Expand Down
6 changes: 2 additions & 4 deletions test/gov-actions/SecurityCouncilUpgradeAction.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ contract SecurityCouncilUpgradeActionTest is Test {

SecurityCouncilNomineeElectionGovernor scNomineeElectionGovernor =
SecurityCouncilNomineeElectionGovernor(payable(address(reg.scNomineeElectionGovernor())));
vm.warp(1_757_937_601); // After the 2025 Sep election

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to warp and create the election anymore

scNomineeElectionGovernor.createElection();

address newImplementation = address(new SecurityCouncilManager());
address newNomineeElectionGovernorImplementation =
Expand Down Expand Up @@ -82,8 +80,8 @@ contract SecurityCouncilUpgradeActionTest is Test {
uint256 electionCount = scNomineeElectionGovernor.electionCount();
assertEq(
scNomineeElectionGovernor.electionToTimestamp(electionCount),
1_789_473_600,
"not September 15, 2026 12:00:00 PM"
1_805_112_000,
"not March 15, 2027 12:00:00 PM"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,35 +308,6 @@ contract SecurityCouncilNomineeElectionGovernorTest is Test {
)
);
governor.addContender(proposalId, sig);

// adding a member up for reelection should succeed and automatically add them as a nominee
_mockCohortIncludes(Cohort.FIRST, _contender(1), true);
_mockCohortIncludes(Cohort.SECOND, _contender(1), false);
sig = sigUtils.signAddContenderMessage(proposalId, _contenderPrivKey(1));
governor.addContender(proposalId, sig);

// check that it correctly mutated the state
assertTrue(governor.isContender(proposalId, _contender(1)));
assertTrue(governor.isNominee(proposalId, _contender(1)));

// reelection member should not be able to receive votes
vm.roll(governor.proposalSnapshot(proposalId) + 1);
_mockGetPastVotes(_voter(0), governor.quorum(proposalId));
vm.prank(_voter(0));
vm.expectRevert(
abi.encodeWithSelector(
SecurityCouncilNomineeElectionGovernorCountingUpgradeable
.NomineeAlreadyAdded
.selector,
_contender(1)
)
);
governor.castVoteWithReasonAndParams({
proposalId: proposalId,
support: 1,
reason: "",
params: abi.encode(_contender(1), 1)
});
}

function testSetNomineeVetter() public {
Expand Down
Loading