Skip to content

Commit 7cb1c5d

Browse files
PelleKrabclaude
andcommitted
refactor(L1): rename chainTeam to incidentResponder, combine config, no-op setTimestamp
Apply @jackchuma review nits on ProtocolVersions: - Rename the chainTeam role to incidentResponder; delaying a bad hardfork activation is an incident-response action. NatSpec scopes the power so the shared name doesn't imply SuperchainConfig's pause authority. - Drop the redundant chainTeam deploy config key and source the role from superchainConfigIncidentResponder (same entity). - setTimestamp: short-circuit no-op writes ahead of the change-validation guards so idempotent resubmissions succeed. Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2257727 commit 7cb1c5d

10 files changed

Lines changed: 125 additions & 103 deletions

File tree

interfaces/L1/IProtocolVersions.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface IProtocolVersions is IProxyAdminOwnedBase, ISemver, IReinitializableBa
1111
error ProtocolVersions_UnknownUpgrade(uint256 id);
1212
error ProtocolVersions_InvalidProtocolVersion();
1313
error ProtocolVersions_ActivationAlreadyPassed(uint256 id, uint64 activationTimestamp);
14-
error ProtocolVersions_NotChainTeam();
14+
error ProtocolVersions_NotIncidentResponder();
1515
error ProtocolVersions_NotScheduled(uint256 id);
1616
error ProtocolVersions_DelayMustBeLater(uint64 currentTimestamp, uint64 newTimestamp);
1717
error ProtocolVersions_NotInitialized();
@@ -21,23 +21,23 @@ interface IProtocolVersions is IProxyAdminOwnedBase, ISemver, IReinitializableBa
2121
event MinimumProtocolVersionUpdated(uint256 indexed protocolVersion);
2222
event TimestampSet(uint256 indexed id, uint256 timestamp);
2323
event ScheduleIdUpdated(bytes32 indexed newScheduleId);
24-
event ChainTeamUpdated(address indexed previousChainTeam, address indexed newChainTeam);
24+
event IncidentResponderUpdated(address indexed previousIncidentResponder, address indexed newIncidentResponder);
2525
event Initialized(uint8 version);
2626

2727
function MIN_NOTICE() external view returns (uint64);
2828

29-
function chainTeam() external view returns (address);
29+
function incidentResponder() external view returns (address);
3030
function scheduleId() external view returns (bytes32);
3131
function scheduleId(uint256 id) external view returns (bytes32);
3232
function minimumProtocolVersion() external view returns (uint256);
3333

3434
function getSchedule() external view returns (uint64[] memory);
3535

36-
function initialize(address _chainTeam) external;
36+
function initialize(address _incidentResponder) external;
3737
function registerUpgrade(uint64 timestamp, uint256 minProtocolVersion) external returns (uint256);
3838
function setMinimumProtocolVersion(uint256 protocolVersion) external;
3939
function setTimestamp(uint256 id, uint64 timestamp) external;
40-
function setChainTeam(address newChainTeam) external;
40+
function setIncidentResponder(address newIncidentResponder) external;
4141
function delayTimestamp(uint256 id, uint64 newTimestamp) external;
4242

4343
function __constructor__() external;

scripts/deploy/DeployConfig.s.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ contract DeployConfig is Script {
1212

1313
address public baseFeeVaultRecipient;
1414
address public batchSenderAddress;
15-
address public chainTeam;
1615
address public finalSystemOwner;
1716
address public l1FeeVaultRecipient;
1817
address public nitroEnclaveVerifier;
@@ -66,7 +65,6 @@ contract DeployConfig is Script {
6665

6766
baseFeeVaultRecipient = _json.readAddress("$.baseFeeVaultRecipient");
6867
batchSenderAddress = _json.readAddress("$.batchSenderAddress");
69-
chainTeam = _json.readAddressOr("$.chainTeam", address(0));
7068
finalSystemOwner = _json.readAddress("$.finalSystemOwner");
7169
l1FeeVaultRecipient = _json.readAddress("$.l1FeeVaultRecipient");
7270
nitroEnclaveVerifier = _json.readAddress("$.nitroEnclaveVerifier");

scripts/deploy/SystemDeploy.s.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ contract SystemDeploy is Script {
282282
systemConfigOwner: cfg.finalSystemOwner(),
283283
batcher: cfg.batchSenderAddress(),
284284
unsafeBlockSigner: cfg.p2pSequencerAddress(),
285-
chainTeam: cfg.chainTeam()
285+
incidentResponder: cfg.superchainConfigIncidentResponder()
286286
}),
287287
basefeeScalar: cfg.basefeeScalar(),
288288
blobBasefeeScalar: cfg.blobbasefeeScalar(),
@@ -630,7 +630,7 @@ contract SystemDeploy is Script {
630630
_output.opChainProxyAdmin,
631631
address(_output.protocolVersionsProxy),
632632
_impls.protocolVersionsImpl,
633-
abi.encodeCall(IProtocolVersions.initialize, (_input.roles.chainTeam))
633+
abi.encodeCall(IProtocolVersions.initialize, (_input.roles.incidentResponder))
634634
);
635635
}
636636

scripts/libraries/Types.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ library Types {
2929
address systemConfigOwner;
3030
address batcher;
3131
address unsafeBlockSigner;
32-
address chainTeam;
32+
address incidentResponder;
3333
}
3434

3535
/// @notice The full set of inputs to deploy a new OP Stack chain.

snapshots/abi/ProtocolVersions.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@
1717
"stateMutability": "view",
1818
"type": "function"
1919
},
20-
{
21-
"inputs": [],
22-
"name": "chainTeam",
23-
"outputs": [
24-
{
25-
"internalType": "address",
26-
"name": "",
27-
"type": "address"
28-
}
29-
],
30-
"stateMutability": "view",
31-
"type": "function"
32-
},
3320
{
3421
"inputs": [
3522
{
@@ -61,6 +48,19 @@
6148
"stateMutability": "view",
6249
"type": "function"
6350
},
51+
{
52+
"inputs": [],
53+
"name": "incidentResponder",
54+
"outputs": [
55+
{
56+
"internalType": "address",
57+
"name": "",
58+
"type": "address"
59+
}
60+
],
61+
"stateMutability": "view",
62+
"type": "function"
63+
},
6464
{
6565
"inputs": [],
6666
"name": "initVersion",
@@ -78,7 +78,7 @@
7878
"inputs": [
7979
{
8080
"internalType": "address",
81-
"name": "_chainTeam",
81+
"name": "_incidentResponder",
8282
"type": "address"
8383
}
8484
],
@@ -186,11 +186,11 @@
186186
"inputs": [
187187
{
188188
"internalType": "address",
189-
"name": "newChainTeam",
189+
"name": "newIncidentResponder",
190190
"type": "address"
191191
}
192192
],
193-
"name": "setChainTeam",
193+
"name": "setIncidentResponder",
194194
"outputs": [],
195195
"stateMutability": "nonpayable",
196196
"type": "function"
@@ -245,17 +245,17 @@
245245
{
246246
"indexed": true,
247247
"internalType": "address",
248-
"name": "previousChainTeam",
248+
"name": "previousIncidentResponder",
249249
"type": "address"
250250
},
251251
{
252252
"indexed": true,
253253
"internalType": "address",
254-
"name": "newChainTeam",
254+
"name": "newIncidentResponder",
255255
"type": "address"
256256
}
257257
],
258-
"name": "ChainTeamUpdated",
258+
"name": "IncidentResponderUpdated",
259259
"type": "event"
260260
},
261261
{
@@ -379,7 +379,7 @@
379379
},
380380
{
381381
"inputs": [],
382-
"name": "ProtocolVersions_NotChainTeam",
382+
"name": "ProtocolVersions_NotIncidentResponder",
383383
"type": "error"
384384
},
385385
{

snapshots/semver-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"sourceCodeHash": "0xa1281f5da03fa0431eabad33da23f51a8d835b0dd04554603fd59e11efe9fa51"
2121
},
2222
"src/L1/ProtocolVersions.sol:ProtocolVersions": {
23-
"initCodeHash": "0x201b442493a591859132351e024a6edbb99d76bd5a6672a0587652038fad3f52",
24-
"sourceCodeHash": "0x20d923ffd5a5a871a49901546e8d83a0f048a2e985371e40a099262713c0c8b1"
23+
"initCodeHash": "0x0d47628779e604e08a8787c299411ca1f9ed411052921aec53047748a5d7e40f",
24+
"sourceCodeHash": "0x34ad9da6bd0a217a9a8cd0751954ecb9ea2fcb546fecd512f15625c79ff27b1e"
2525
},
2626
"src/L1/SuperchainConfig.sol:SuperchainConfig": {
2727
"initCodeHash": "0x9b1f3555b499709485d51d5d9665002c0eb1e5eb893be1fb978a30749e894858",

snapshots/storageLayout/ProtocolVersions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
},
3737
{
3838
"bytes": "20",
39-
"label": "chainTeam",
39+
"label": "incidentResponder",
4040
"offset": 0,
4141
"slot": "4",
4242
"type": "address"

src/L1/ProtocolVersions.sol

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ contract ProtocolVersions is ProxyAdminOwnedBase, Initializable, Reinitializable
4444
error ProtocolVersions_InvalidProtocolVersion();
4545
/// @notice Thrown when modifying a timestamp whose activation has already passed.
4646
error ProtocolVersions_ActivationAlreadyPassed(uint256 id, uint64 activationTimestamp);
47-
/// @notice Thrown when the caller is not the chainTeam.
48-
error ProtocolVersions_NotChainTeam();
47+
/// @notice Thrown when the caller is not the incidentResponder.
48+
error ProtocolVersions_NotIncidentResponder();
4949
/// @notice Thrown when delaying an upgrade that has no scheduled activation.
5050
error ProtocolVersions_NotScheduled(uint256 id);
5151
/// @notice Thrown when a new timestamp is not sufficiently later than the current one.
@@ -63,8 +63,8 @@ contract ProtocolVersions is ProxyAdminOwnedBase, Initializable, Reinitializable
6363
event TimestampSet(uint256 indexed id, uint256 timestamp);
6464
/// @notice Emitted when the schedule commitment changes.
6565
event ScheduleIdUpdated(bytes32 indexed newScheduleId);
66-
/// @notice Emitted when the chainTeam role changes.
67-
event ChainTeamUpdated(address indexed previousChainTeam, address indexed newChainTeam);
66+
/// @notice Emitted when the incidentResponder role changes.
67+
event IncidentResponderUpdated(address indexed previousIncidentResponder, address indexed newIncidentResponder);
6868

6969
/// @notice Minimum notice period required when scheduling or modifying an activation timestamp.
7070
uint64 public constant MIN_NOTICE = 1 hours;
@@ -90,7 +90,7 @@ contract ProtocolVersions is ProxyAdminOwnedBase, Initializable, Reinitializable
9090
/// only move an already-scheduled, not-yet-activated upgrade further into the future via
9191
/// `delayTimestamp`. It cannot register upgrades, clear timestamps, pull an activation
9292
/// earlier, or schedule a brand-new activation. Unset (zero) by default.
93-
address public chainTeam;
93+
address public incidentResponder;
9494

9595
/// @notice Semantic version.
9696
/// @custom:semver 1.0.0
@@ -104,9 +104,9 @@ contract ProtocolVersions is ProxyAdminOwnedBase, Initializable, Reinitializable
104104
}
105105

106106
/// @notice Initializes the registry by seeding the hash chain and appointing the initial
107-
/// chainTeam. Callable only by the ProxyAdmin or its owner.
108-
/// @param _chainTeam Initial chainTeam allowed to delay activations, or address(0) to leave unset.
109-
function initialize(address _chainTeam) external reinitializer(initVersion()) {
107+
/// incidentResponder. Callable only by the ProxyAdmin or its owner.
108+
/// @param _incidentResponder Initial incidentResponder allowed to delay activations, or address(0) to leave unset.
109+
function initialize(address _incidentResponder) external reinitializer(initVersion()) {
110110
// Initialization transactions must come from the ProxyAdmin or its owner.
111111
_assertOnlyProxyAdminOrProxyAdminOwner();
112112

@@ -116,8 +116,8 @@ contract ProtocolVersions is ProxyAdminOwnedBase, Initializable, Reinitializable
116116
_upgradeScheduleId.push(bytes32(0));
117117
emit ScheduleIdUpdated(bytes32(0));
118118

119-
chainTeam = _chainTeam;
120-
emit ChainTeamUpdated(address(0), _chainTeam);
119+
incidentResponder = _incidentResponder;
120+
emit IncidentResponderUpdated(address(0), _incidentResponder);
121121
}
122122

123123
/// @notice Returns the canonical schedule commitment.
@@ -202,26 +202,26 @@ contract ProtocolVersions is ProxyAdminOwnedBase, Initializable, Reinitializable
202202
_assertOnlyProxyAdminOwner();
203203
_assertRegistered(id);
204204
uint64 current = _timestamps[id];
205+
if (current == timestamp) return;
205206
if (current != 0 && uint64(block.timestamp) >= current) {
206207
revert ProtocolVersions_ActivationAlreadyPassed(id, current);
207208
}
208209
if (timestamp != 0 && timestamp < uint64(block.timestamp) + MIN_NOTICE) {
209210
revert ProtocolVersions_InsufficientNotice(timestamp);
210211
}
211-
if (current == timestamp) return;
212212
_writeTimestamp(id, timestamp);
213213
}
214214

215-
/// @notice Appoints, replaces, or clears (set to zero) the chainTeam role. Owner only.
216-
/// @param newChainTeam New chainTeam address, or address(0) to revoke the role.
217-
function setChainTeam(address newChainTeam) external {
215+
/// @notice Appoints, replaces, or clears (set to zero) the incidentResponder role. Owner only.
216+
/// @param newIncidentResponder New incidentResponder address, or address(0) to revoke the role.
217+
function setIncidentResponder(address newIncidentResponder) external {
218218
_assertOnlyProxyAdminOwner();
219-
emit ChainTeamUpdated(chainTeam, newChainTeam);
220-
chainTeam = newChainTeam;
219+
emit IncidentResponderUpdated(incidentResponder, newIncidentResponder);
220+
incidentResponder = newIncidentResponder;
221221
}
222222

223223
/// @notice Pushes an already-scheduled upgrade's activation timestamp further into the future.
224-
/// Can only be called by the chainTeam.
224+
/// Can only be called by the incidentResponder.
225225
/// @dev The upgrade must already have a non-zero activation timestamp that has not yet passed,
226226
/// and `newTimestamp` must be strictly later than the current value. This role can only
227227
/// delay an activation; it cannot pull one earlier, clear it, or schedule a new one — use
@@ -230,7 +230,7 @@ contract ProtocolVersions is ProxyAdminOwnedBase, Initializable, Reinitializable
230230
/// @param id The upgrade whose activation to delay.
231231
/// @param newTimestamp New activation timestamp, must be strictly later than the current one.
232232
function delayTimestamp(uint256 id, uint64 newTimestamp) external {
233-
if (msg.sender != chainTeam) revert ProtocolVersions_NotChainTeam();
233+
if (msg.sender != incidentResponder) revert ProtocolVersions_NotIncidentResponder();
234234
_assertRegistered(id);
235235
uint64 current = _timestamps[id];
236236

0 commit comments

Comments
 (0)