Skip to content

Commit 6c9c113

Browse files
authored
chore(host-contracts): bump reinitializer version in input/kms verifier contracts (#755)
1 parent c9d65fd commit 6c9c113

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

host-contracts/contracts/InputVerifier.sol

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ contract InputVerifier is UUPSUpgradeableEmptyProxy, Ownable2StepUpgradeable, EI
119119

120120
/// Constant used for making sure the version number used in the `reinitializer` modifier is
121121
/// identical between `initializeFromEmptyProxy` and the `reinitializeVX` method
122-
uint64 private constant REINITIALIZER_VERSION = 2;
122+
uint64 private constant REINITIALIZER_VERSION = 3;
123123

124124
/// keccak256(abi.encode(uint256(keccak256("fhevm.storage.InputVerifier")) - 1)) & ~bytes32(uint256(0xff))
125125
bytes32 private constant InputVerifierStorageLocation =
@@ -153,6 +153,11 @@ contract InputVerifier is UUPSUpgradeableEmptyProxy, Ownable2StepUpgradeable, EI
153153
}
154154
}
155155

156+
/**
157+
* @notice Re-initializes the contract from V1.
158+
*/
159+
function reinitializeV2() public virtual reinitializer(REINITIALIZER_VERSION) {}
160+
156161
/**
157162
* @dev This function removes the transient allowances, which could be useful for
158163
integration with Account Abstraction when bundling several UserOps calling InputVerifier.

host-contracts/contracts/KMSVerifier.sol

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ contract KMSVerifier is UUPSUpgradeableEmptyProxy, Ownable2StepUpgradeable, EIP7
9494

9595
/// Constant used for making sure the version number used in the `reinitializer` modifier is
9696
/// identical between `initializeFromEmptyProxy` and the `reinitializeVX` method
97-
uint64 private constant REINITIALIZER_VERSION = 2;
97+
uint64 private constant REINITIALIZER_VERSION = 3;
9898

9999
/// keccak256(abi.encode(uint256(keccak256("fhevm.storage.KMSVerifier")) - 1)) & ~bytes32(uint256(0xff))
100100
bytes32 private constant KMSVerifierStorageLocation =
@@ -124,6 +124,11 @@ contract KMSVerifier is UUPSUpgradeableEmptyProxy, Ownable2StepUpgradeable, EIP7
124124
defineNewContext(initialSigners, initialThreshold);
125125
}
126126

127+
/**
128+
* @notice Re-initializes the contract from V1.
129+
*/
130+
function reinitializeV2() public virtual reinitializer(REINITIALIZER_VERSION) {}
131+
127132
/**
128133
* @notice Sets a new context (i.e. new set of unique signers and new threshold).
129134
* @dev Only the owner can set a new context.

0 commit comments

Comments
 (0)