Skip to content

Commit f768df3

Browse files
committed
chore(gateway-contracts): remove backward compatibility code
1 parent f9671e1 commit f768df3

File tree

6 files changed

+76
-107
lines changed

6 files changed

+76
-107
lines changed

.github/workflows/gateway-contracts-upgrade-tests.yml

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
with:
4646
# This version should be updated whenever we release new contract versions or
4747
# touch a contract upgrade path.
48-
ref: v0.8.0
48+
ref: v0.8.1
4949
path: previous-fhevm
5050
persist-credentials: 'false'
5151

@@ -122,83 +122,83 @@ jobs:
122122
123123
# TODO: We should instead automatically detect if the contract needs to be upgraded
124124
# See https://github.com/zama-ai/fhevm-internal/issues/379
125-
- name: Upgrade GatewayConfig contract
126-
working-directory: current-fhevm/gateway-contracts
127-
env:
128-
DOTENV_CONFIG_PATH: .env
129-
HARDHAT_NETWORK: staging
130-
CHAIN_ID_GATEWAY: 54321
131-
RPC_URL: http://localhost:8546
132-
run: |
133-
npx hardhat task:upgradeGatewayConfig \
134-
--current-implementation previous-contracts/GatewayConfig.sol:GatewayConfig \
135-
--new-implementation contracts/GatewayConfig.sol:GatewayConfig \
136-
--use-internal-proxy-address true \
137-
--verify-contract false
125+
# - name: Upgrade GatewayConfig contract
126+
# working-directory: current-fhevm/gateway-contracts
127+
# env:
128+
# DOTENV_CONFIG_PATH: .env
129+
# HARDHAT_NETWORK: staging
130+
# CHAIN_ID_GATEWAY: 54321
131+
# RPC_URL: http://localhost:8546
132+
# run: |
133+
# npx hardhat task:upgradeGatewayConfig \
134+
# --current-implementation previous-contracts/GatewayConfig.sol:GatewayConfig \
135+
# --new-implementation contracts/GatewayConfig.sol:GatewayConfig \
136+
# --use-internal-proxy-address true \
137+
# --verify-contract false
138138

139139
# TODO: We should instead automatically detect if the contract needs to be upgraded
140140
# See https://github.com/zama-ai/fhevm-internal/issues/379
141-
- name: Upgrade Decryption contract
142-
working-directory: current-fhevm/gateway-contracts
143-
env:
144-
DOTENV_CONFIG_PATH: .env
145-
HARDHAT_NETWORK: staging
146-
CHAIN_ID_GATEWAY: 54321
147-
RPC_URL: http://localhost:8546
148-
run: |
149-
npx hardhat task:upgradeDecryption \
150-
--current-implementation previous-contracts/Decryption.sol:Decryption \
151-
--new-implementation contracts/Decryption.sol:Decryption \
152-
--use-internal-proxy-address true \
153-
--verify-contract false
141+
# - name: Upgrade Decryption contract
142+
# working-directory: current-fhevm/gateway-contracts
143+
# env:
144+
# DOTENV_CONFIG_PATH: .env
145+
# HARDHAT_NETWORK: staging
146+
# CHAIN_ID_GATEWAY: 54321
147+
# RPC_URL: http://localhost:8546
148+
# run: |
149+
# npx hardhat task:upgradeDecryption \
150+
# --current-implementation previous-contracts/Decryption.sol:Decryption \
151+
# --new-implementation contracts/Decryption.sol:Decryption \
152+
# --use-internal-proxy-address true \
153+
# --verify-contract false
154154

155155
# TODO: We should instead automatically detect if the contract needs to be upgraded
156156
# See https://github.com/zama-ai/fhevm-internal/issues/379
157-
- name: Upgrade CiphertextCommits contract
158-
working-directory: current-fhevm/gateway-contracts
159-
env:
160-
DOTENV_CONFIG_PATH: .env
161-
HARDHAT_NETWORK: staging
162-
CHAIN_ID_GATEWAY: 54321
163-
RPC_URL: http://localhost:8546
164-
run: |
165-
npx hardhat task:upgradeCiphertextCommits \
166-
--current-implementation previous-contracts/CiphertextCommits.sol:CiphertextCommits \
167-
--new-implementation contracts/CiphertextCommits.sol:CiphertextCommits \
168-
--use-internal-proxy-address true \
169-
--verify-contract false
157+
# - name: Upgrade CiphertextCommits contract
158+
# working-directory: current-fhevm/gateway-contracts
159+
# env:
160+
# DOTENV_CONFIG_PATH: .env
161+
# HARDHAT_NETWORK: staging
162+
# CHAIN_ID_GATEWAY: 54321
163+
# RPC_URL: http://localhost:8546
164+
# run: |
165+
# npx hardhat task:upgradeCiphertextCommits \
166+
# --current-implementation previous-contracts/CiphertextCommits.sol:CiphertextCommits \
167+
# --new-implementation contracts/CiphertextCommits.sol:CiphertextCommits \
168+
# --use-internal-proxy-address true \
169+
# --verify-contract false
170170

171171
# TODO: We should instead automatically detect if the contract needs to be upgraded
172172
# See https://github.com/zama-ai/fhevm-internal/issues/379
173-
- name: Upgrade InputVerification contract
174-
working-directory: current-fhevm/gateway-contracts
175-
env:
176-
DOTENV_CONFIG_PATH: .env
177-
HARDHAT_NETWORK: staging
178-
CHAIN_ID_GATEWAY: 54321
179-
RPC_URL: http://localhost:8546
180-
run: |
181-
npx hardhat task:upgradeInputVerification \
182-
--current-implementation previous-contracts/InputVerification.sol:InputVerification \
183-
--new-implementation contracts/InputVerification.sol:InputVerification \
184-
--use-internal-proxy-address true \
185-
--verify-contract false
173+
# - name: Upgrade InputVerification contract
174+
# working-directory: current-fhevm/gateway-contracts
175+
# env:
176+
# DOTENV_CONFIG_PATH: .env
177+
# HARDHAT_NETWORK: staging
178+
# CHAIN_ID_GATEWAY: 54321
179+
# RPC_URL: http://localhost:8546
180+
# run: |
181+
# npx hardhat task:upgradeInputVerification \
182+
# --current-implementation previous-contracts/InputVerification.sol:InputVerification \
183+
# --new-implementation contracts/InputVerification.sol:InputVerification \
184+
# --use-internal-proxy-address true \
185+
# --verify-contract false
186186

187187
# TODO: We should instead automatically detect if the contract needs to be upgraded
188188
# See https://github.com/zama-ai/fhevm-internal/issues/379
189-
- name: Upgrade MultichainAcl contract
190-
working-directory: current-fhevm/gateway-contracts
191-
env:
192-
DOTENV_CONFIG_PATH: .env
193-
HARDHAT_NETWORK: staging
194-
CHAIN_ID_GATEWAY: 54321
195-
RPC_URL: http://localhost:8546
196-
run: |
197-
npx hardhat task:upgradeMultichainAcl \
198-
--current-implementation previous-contracts/MultichainAcl.sol:MultichainAcl \
199-
--new-implementation contracts/MultichainAcl.sol:MultichainAcl \
200-
--use-internal-proxy-address true \
201-
--verify-contract false
189+
# - name: Upgrade MultichainAcl contract
190+
# working-directory: current-fhevm/gateway-contracts
191+
# env:
192+
# DOTENV_CONFIG_PATH: .env
193+
# HARDHAT_NETWORK: staging
194+
# CHAIN_ID_GATEWAY: 54321
195+
# RPC_URL: http://localhost:8546
196+
# run: |
197+
# npx hardhat task:upgradeMultichainAcl \
198+
# --current-implementation previous-contracts/MultichainAcl.sol:MultichainAcl \
199+
# --new-implementation contracts/MultichainAcl.sol:MultichainAcl \
200+
# --use-internal-proxy-address true \
201+
# --verify-contract false
202202

203203
# TODO: We should instead automatically detect if the contract needs to be upgraded
204204
# See https://github.com/zama-ai/fhevm-internal/issues/379

gateway-contracts/contracts/CiphertextCommits.sol

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,8 @@ contract CiphertextCommits is
282282
bytes32 addCiphertextHash = $._ctHandleConsensusHash[ctHandles[i]];
283283

284284
// Get the transaction sender addresses and the context ID associated to the consensus
285-
// If the consensus has been reached but the hash is 0x0, it means that the handle has been
286-
// added in V1: the handle was used to retrieve the list of transaction sender addresses
287-
// instead of the hash, under the first context (`contextId=1`).
288-
// We therefore consider this in order to be backward compatible.
289-
// DEPRECATED: to remove before mainnet
290-
// See https://github.com/zama-ai/fhevm-internal/issues/381
291-
address[] memory coprocessorTxSenderAddresses;
292-
uint256 contextId;
293-
if (addCiphertextHash == bytes32(0)) {
294-
coprocessorTxSenderAddresses = $._coprocessorTxSenderAddresses[ctHandles[i]];
295-
contextId = 1;
296-
} else {
297-
coprocessorTxSenderAddresses = $._coprocessorTxSenderAddresses[addCiphertextHash];
298-
contextId = $.addCiphertextContextId[addCiphertextHash];
299-
}
285+
address[] memory coprocessorTxSenderAddresses = $._coprocessorTxSenderAddresses[addCiphertextHash];
286+
uint256 contextId = $.addCiphertextContextId[addCiphertextHash];
300287

301288
// Get the list of storage URLs associated to the transaction sender addresses
302289
string[] memory coprocessorStorageUrls = new string[](coprocessorTxSenderAddresses.length);

gateway-contracts/contracts/GatewayConfig.sol

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ contract GatewayConfig is IGatewayConfig, Ownable2StepUpgradeable, UUPSUpgradeab
5151
mapping(address kmsTxSenderAddress => bool isKmsTxSender) _isKmsTxSender;
5252
/// @notice The KMS nodes' signer addresses
5353
mapping(address kmsSignerAddress => bool isKmsSigner) _isKmsSigner;
54-
/// @notice DEPRECATED: coprocessors are stored in `CoprocessorContexts` contract
55-
mapping(address coprocessorTxSenderAddress => bool isCoprocessorTxSender) _isCoprocessorTxSender; // DEPRECATED
56-
/// @notice DEPRECATED: coprocessors are stored in `CoprocessorContexts` contract
57-
mapping(address coprocessorSignerAddress => bool isCoprocessorSigner) _isCoprocessorSigner; // DEPRECATED
5854
// ----------------------------------------------------------------------------------------------
5955
// Host chains state variables:
6056
// ----------------------------------------------------------------------------------------------
@@ -81,15 +77,6 @@ contract GatewayConfig is IGatewayConfig, Ownable2StepUpgradeable, UUPSUpgradeab
8177
/// @notice The threshold to consider for user decryption consensus
8278
uint256 userDecryptionThreshold;
8379
// ----------------------------------------------------------------------------------------------
84-
// Coprocessors state variables (DEPRECATED):
85-
// ----------------------------------------------------------------------------------------------
86-
/// @notice DEPRECATED: coprocessors are stored in `CoprocessorContexts` contract
87-
mapping(address coprocessorTxSenderAddress => CoprocessorV1 coprocessor) coprocessors; // DEPRECATED
88-
/// @notice DEPRECATED: coprocessors are stored in `CoprocessorContexts` contract
89-
address[] coprocessorTxSenderAddresses; // DEPRECATED
90-
/// @notice DEPRECATED: coprocessors are stored in `CoprocessorContexts` contract
91-
address[] coprocessorSignerAddresses; // DEPRECATED
92-
// ----------------------------------------------------------------------------------------------
9380
// Host chains state variables:
9481
// ----------------------------------------------------------------------------------------------
9582
/// @notice The host chains' metadata

gateway-contracts/contracts/examples/GatewayConfigV3Example.sol

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ contract GatewayConfigV3Example is Ownable2StepUpgradeable, UUPSUpgradeable, Pau
2626
address pauser;
2727
mapping(address kmsTxSenderAddress => bool isKmsTxSender) _isKmsTxSender;
2828
mapping(address kmsSignerAddress => bool isKmsSigner) _isKmsSigner;
29-
mapping(address coprocessorTxSenderAddress => bool isCoprocessorTxSender) _isCoprocessorTxSender;
30-
mapping(address coprocessorSignerAddress => bool isCoprocessorSigner) _isCoprocessorSigner;
3129
mapping(uint256 chainId => bool isRegistered) _isHostChainRegistered;
3230
ProtocolMetadata protocolMetadata; // deprecated, use protocolMetadataV2 instead
3331
mapping(address kmsTxSenderAddress => KmsNode kmsNode) kmsNodes;
@@ -36,9 +34,6 @@ contract GatewayConfigV3Example is Ownable2StepUpgradeable, UUPSUpgradeable, Pau
3634
uint256 mpcThreshold;
3735
uint256 publicDecryptionThreshold;
3836
uint256 userDecryptionThreshold;
39-
mapping(address coprocessorTxSenderAddress => CoprocessorV1 coprocessor) coprocessors;
40-
address[] coprocessorTxSenderAddresses;
41-
address[] coprocessorSignerAddresses;
4237
HostChain[] hostChains;
4338
mapping(address custodianTxSenderAddress => Custodian custodian) custodians;
4439
address[] custodianTxSenderAddresses;

gateway-contracts/rust_bindings/src/ciphertext_commits.rs

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

gateway-contracts/rust_bindings/src/gateway_config.rs

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)