Skip to content

Commit cd20957

Browse files
committed
fix: remove v1 route and update tests for devnet v0.12
fix: remove v1 route and update tests for devnet v0.12 Drop support for the v1 relayer API route and migrate all routing logic to v2 only, in preparation for devnet v0.12. Core changes: - relayerUrl.ts: parseRelayerUrl no longer accepts fallbackVersion or relayerRouteVersion. Always returns version 2. v1 Zama URLs (Sepolia/Mainnet) are automatically upgraded to their v2 equivalents. - createRelayerProvider.ts: drops defaultRelayerVersion parameter and unconditionally returns a RelayerV2Provider. RelayerV1Provider removed. - createRelayerFhevm.ts: simplified, v1 provider wiring removed. Test cleanup: - Deleted RelayerV1Fhevm.test.ts and RelayerV1Provider.test.ts. - Pruned index.test.ts, relayerUrl.test.ts, and v2 test files to remove v1 test cases and update URL expectations. - Added src/test/scripts/test-devnet.sh for devnet integration testing. - Simplified test-testnet.sh to remove v1-specific test paths. CLI / bin updates: - Removed "--version" option from bin/ commands (input-proof.js, public-decrypt.js, user-decrypt.js, etc.) and bin/utils.js.
1 parent e833b38 commit cd20957

35 files changed

+379
-834
lines changed

bin/commands/input-proof.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import {
88
valueColumnTypeListToFheTypedValues,
99
} from '../utils.js';
1010

11-
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress --version 2 --network testnet --rpc-url https://sepolia.drpc.org
12-
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress --version 2
13-
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress --version 1
11+
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress --network testnet --rpc-url https://sepolia.drpc.org
12+
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress
13+
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress
1414
// npx . input-proof --contract-address 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9 --user-address 0x37AC010c1c566696326813b840319B58Bb5840E4 --values 123:euint32
15-
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress --version 2 --network mainnet
15+
// npx . input-proof --values 123:euint32 true:ebool 1234567890123456789:euint256 0xb2a8A265dD5A27026693Aa6cE87Fb21Ac197b6b9:eaddress --network mainnet
1616
export async function inputProofCommand(options) {
1717
const { config, zamaFhevmApiKey } = parseCommonOptions(options);
1818

bin/commands/public-decrypt.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import { parseCommonOptions, parseHandles } from '../utils.js';
1010
// 0xfd82b3d4bc3318f57189a5841e248e24b59453a168ff0000000000aa36a70400
1111

1212
// npx . public-decrypt --handles 0xfd82b3d4bc3318f57189a5841e248e24b59453a168ff0000000000aa36a70400
13-
// npx . public-decrypt --version 2 --handles 0xfd82b3d4bc3318f57189a5841e248e24b59453a168ff0000000000aa36a70400
14-
// npx . public-decrypt --version 2 --handles 0xc49cf03ffa2768ee7ca49fb8b1fe930c6b43075ed0000000000000aa36a70000
15-
// npx . public-decrypt --version 2 --handles 0xe85c2a81338b8542a6c0a99a5a794f158f4fb0f6a2ff0000000000aa36a70400
16-
// npx . public-decrypt --version 2 --handles 0x7abb4a6c63af220fcd7da6bba4a0891fbe77e576efff00000000000000010500
13+
// npx . public-decrypt --handles 0xfd82b3d4bc3318f57189a5841e248e24b59453a168ff0000000000aa36a70400
14+
// npx . public-decrypt --handles 0xc49cf03ffa2768ee7ca49fb8b1fe930c6b43075ed0000000000000aa36a70000
15+
// npx . public-decrypt --handles 0xe85c2a81338b8542a6c0a99a5a794f158f4fb0f6a2ff0000000000aa36a70400
16+
// npx . public-decrypt --handles 0x7abb4a6c63af220fcd7da6bba4a0891fbe77e576efff00000000000000010500
1717
export async function publicDecryptCommand(options) {
1818
const { config, zamaFhevmApiKey } = parseCommonOptions(options);
1919

bin/commands/test/test-add.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export async function testFHETestAddCommand(options) {
1515
parseCommonOptions(options);
1616

1717
logCLI('🚚 network: ' + config.name, options);
18-
logCLI('🚀 route: v' + config.version, options);
1918
logCLI(`🍔 signer: ${signer.address}`);
2019
logCLI(`🧀 value: ${BigInt(options.value)}`);
2120
logCLI(`🍉 type: ${options.type}`);

bin/commands/test/test-make-publicly-decryptable.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export async function testFHETestMakePubliclyDecryptableCommand(options) {
1212
const { config, provider, signer } = parseCommonOptions(options);
1313

1414
logCLI('🚚 network: ' + config.name, options);
15-
logCLI('🚀 route: v' + config.version, options);
1615
logCLI(`🍔 signer: ${signer.address}`);
1716

1817
if (!FHETestAddresses[config.name]) {

bin/commands/test/test-public-decrypt.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@ import { safeJSONstringify } from '../../../lib/internal.js';
1515
// 0x9d430a3e950560ba22013ce885d6d90f0da36efdf1ff0000000000aa36a70600 euint128 308429577281045301472547520724787086512
1616
// 0xf6751d547a5c06123575aad93f22f76b7d841c4cacff0000000000aa36a70000 ebool false
1717
//
18-
// npx . test public-decrypt --types euint32 --network testnet --version 1
19-
// npx . test public-decrypt --types euint32 --network testnet --version 2
20-
// npx . test public-decrypt --types euint32 --network mainnet --version 2
18+
// npx . test public-decrypt --types euint32 --network testnet
19+
// npx . test public-decrypt --types euint32 --network testnet
20+
// npx . test public-decrypt --types euint32 --network mainnet
2121
export async function testFHETestPublicDecryptCommand(options) {
2222
const { config, provider, signer, zamaFhevmApiKey } =
2323
parseCommonOptions(options);
2424

2525
logCLI('🚚 network: ' + config.name, options);
26-
logCLI('🚀 route: v' + config.version, options);
2726
logCLI(`🍔 signer: ${signer.address}`, options);
2827

2928
if (!FHETestAddresses[config.name]) {

bin/commands/test/test-random.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export async function testFHETestRandomCommand(options) {
1515
}
1616

1717
logCLI('🚚 network: ' + config.name, options);
18-
logCLI('🚀 route: v' + config.version, options);
1918
logCLI(`🍔 signer: ${signer.address}`);
2019

2120
if (!FHETestAddresses[config.name]) {

bin/commands/test/test-user-decrypt.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ import { FHETestAddresses } from './fheTest.js';
55
import { ethers } from 'ethers';
66
import { userDecrypt } from '../../userDecrypt.js';
77

8-
// npx . test user-decrypt --types euint32 --network devnet --version 2
9-
// npx . test user-decrypt --types euint32 --network testnet --version 1
10-
// npx . test user-decrypt --types euint32 --network testnet --version 2
11-
// npx . test user-decrypt --types euint32 --network mainnet --version 2
8+
// npx . test user-decrypt --types euint32 --network devnet
9+
// npx . test user-decrypt --types euint32 --network testnet
10+
// npx . test user-decrypt --types euint32 --network testnet
11+
// npx . test user-decrypt --types euint32 --network mainnet
1212
export async function testFHETestUserDecryptCommand(options) {
1313
const { config, provider, signer, zamaFhevmApiKey } =
1414
parseCommonOptions(options);
1515

1616
logCLI('🚚 network: ' + config.name, options);
17-
logCLI('🚀 route: v' + config.version, options);
1817
logCLI(`🍔 signer: ${signer.address}`);
1918

2019
if (!FHETestAddresses[config.name]) {

bin/commands/user-decrypt.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
import { userDecrypt } from '../userDecrypt.js';
44
import { logCLI, parseCommonOptions } from '../utils.js';
55

6-
// npx . user-decrypt --version 2 --handle 0xe85c2a81338b8542a6c0a99a5a794f158f4fb0f6a2ff0000000000aa36a70400 --contract-address 0x1E7eA8fE4877E6ea5dc8856f0dA92da8d5066241 --network testnet
6+
// npx . user-decrypt --handle 0xe85c2a81338b8542a6c0a99a5a794f158f4fb0f6a2ff0000000000aa36a70400 --contract-address 0x1E7eA8fE4877E6ea5dc8856f0dA92da8d5066241 --network testnet
77
export async function userDecryptCommand(options) {
88
const { config, signer, zamaFhevmApiKey } = parseCommonOptions(options);
99

1010
logCLI('🚚 network: ' + config.name, options);
11-
logCLI('🚀 route: v' + config.version, options);
1211
logCLI(`🍔 signer: ${signer.address}`);
1312

1413
const handle = options.handle;

bin/pubkeyCache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function loadFhevmPublicKeyConfig(
5656

5757
const fhevm = await createRelayerFhevm({
5858
...config.fhevmInstanceConfig,
59-
defaultRelayerVersion: config.version,
59+
defaultRelayerVersion: 2,
6060
...instanceOptions,
6161
});
6262

bin/userDecrypt.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ export async function userDecrypt({
4747

4848
const startTimeStamp = Math.floor(Date.now() / 1000);
4949
const durationDays = 1;
50+
const extraData = await instance.getExtraData();
5051

5152
const eip712 = instance.createEIP712(
5253
keypair.publicKey,
5354
contractAddresses,
5455
startTimeStamp,
5556
durationDays,
57+
extraData,
5658
);
5759

5860
const signature = await signer.signTypedData(
@@ -73,6 +75,7 @@ export async function userDecrypt({
7375
signer.address,
7476
startTimeStamp,
7577
durationDays,
78+
extraData,
7679
{
7780
timeout,
7881
//signal: abortController.signal,

0 commit comments

Comments
 (0)