From e3f5590ad3bcf43b46ccdbeeaea1ac3906336f68 Mon Sep 17 00:00:00 2001 From: Ulrich Petri Date: Tue, 24 Sep 2024 09:33:35 +0200 Subject: [PATCH] Fix gnosh deploy script post merge It seems due to the merge some changes were necessary: - Add a call to `AccessControl.initialize()` in the `KeyperSetManager` constructor to set up access control roles - Supply a bootstrap Keyper to the initial KeyperSet --- lib/forge-std | 2 +- lib/openzeppelin | 2 +- script/Deploy.gnosh.s.sol | 16 +++++++++++----- src/common/KeyperSetManager.sol | 4 +++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/forge-std b/lib/forge-std index f73c73d..e04104a 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit f73c73d2018eb6a111f35e4dae7b4f27401e9421 +Subproject commit e04104ab93e771441eab03fb76eda1402cb5927b diff --git a/lib/openzeppelin b/lib/openzeppelin index 932fddf..6e22430 160000 --- a/lib/openzeppelin +++ b/lib/openzeppelin @@ -1 +1 @@ -Subproject commit 932fddf69a699a9a80fd2396fd1a2ab91cdda123 +Subproject commit 6e224307b44bc4bd0cb60d408844e028cfa3e485 diff --git a/script/Deploy.gnosh.s.sol b/script/Deploy.gnosh.s.sol index 64723bc..a0db339 100644 --- a/script/Deploy.gnosh.s.sol +++ b/script/Deploy.gnosh.s.sol @@ -10,14 +10,19 @@ import "../src/gnosh/ValidatorRegistry.sol"; contract Deploy is Script { function deployKeyperSetManager( - address deployerAddress + address deployerAddress, + address bootstrapKeyper ) public returns (KeyperSetManager) { KeyperSetManager ksm = new KeyperSetManager(deployerAddress); + address[] memory bootstrapMembers = new address[](1); + bootstrapMembers[0] = bootstrapKeyper; + // add bootstrap keyper set - KeyperSet fakeKeyperset = new KeyperSet(); - fakeKeyperset.setFinalized(); - ksm.addKeyperSet(0, address(fakeKeyperset)); + KeyperSet bootstrapKeyperset = new KeyperSet(); + bootstrapKeyperset.addMembers(bootstrapMembers); + bootstrapKeyperset.setFinalized(); + ksm.addKeyperSet(0, address(bootstrapKeyperset)); console.log("KeyperSetManager:", address(ksm)); return ksm; @@ -45,11 +50,12 @@ contract Deploy is Script { function run() external { uint256 deployKey = vm.envUint("DEPLOY_KEY"); + address bootstrapKeyper = vm.envAddress("BOOTSTRAP_KEYPER"); address deployerAddress = vm.addr(deployKey); console.log("Deployer:", deployerAddress); vm.startBroadcast(deployKey); - KeyperSetManager ksm = deployKeyperSetManager(deployerAddress); + KeyperSetManager ksm = deployKeyperSetManager(deployerAddress, bootstrapKeyper); deployKeyBroadcastContract(ksm); deploySequencer(); deployValidatorRegistry(); diff --git a/src/common/KeyperSetManager.sol b/src/common/KeyperSetManager.sol index 98de4fd..233492d 100644 --- a/src/common/KeyperSetManager.sol +++ b/src/common/KeyperSetManager.sol @@ -14,7 +14,9 @@ contract KeyperSetManager is RestrictedPausable, IKeyperSetManager { address contractAddress; } - constructor(address initializer) RestrictedPausable(initializer) {} + constructor(address initializer) RestrictedPausable(initializer) { + initialize(msg.sender, msg.sender); + } KeyperSetData[] private keyperSets;