Skip to content

Commit f58092f

Browse files
authored
refactor: remove smsDebugURL and related debug configurations (#518)
1 parent 1c11825 commit f58092f

File tree

12 files changed

+11
-394
lines changed

12 files changed

+11
-394
lines changed

packages/sdk/src/config/config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export interface ChainConfig {
77
subgraphUrl?: string;
88
ipfsGateway?: string;
99
ipfsNode?: string;
10-
smsDebugURL?: string;
1110
workerpoolAddress?: string;
1211
isExperimental?: boolean;
1312
}
@@ -22,7 +21,6 @@ const CHAIN_CONFIG: Record<ChainId, ChainConfig> = {
2221
'https://thegraph.iex.ec/subgraphs/name/bellecour/dataprotector-v2',
2322
ipfsGateway: 'https://ipfs-gateway.v8-bellecour.iex.ec',
2423
ipfsNode: 'https://ipfs-upload.v8-bellecour.iex.ec',
25-
smsDebugURL: 'https://sms-debug.iex.ec',
2624
workerpoolAddress: 'prod-v8-bellecour.main.pools.iexec.eth',
2725
},
2826
// Arbitrum Sepolia
@@ -34,7 +32,6 @@ const CHAIN_CONFIG: Record<ChainId, ChainConfig> = {
3432
'https://thegraph.arbitrum-sepolia-testnet.iex.ec/api/subgraphs/id/5YjRPLtjS6GH6bB4yY55Qg4HzwtRGQ8TaHtGf9UBWWd',
3533
ipfsGateway: 'https://ipfs-gateway.arbitrum-sepolia-testnet.iex.ec',
3634
ipfsNode: 'https://ipfs-upload.arbitrum-sepolia-testnet.iex.ec',
37-
smsDebugURL: 'https://sms.arbitrum-sepolia-testnet.iex.ec', // ⚠️ default SMS is a debug SMS
3835
workerpoolAddress: '0xB967057a21dc6A66A29721d96b8Aa7454B7c383F',
3936
isExperimental: true,
4037
},
@@ -47,7 +44,6 @@ const CHAIN_CONFIG: Record<ChainId, ChainConfig> = {
4744
'https://thegraph.arbitrum.iex.ec/api/subgraphs/id/Ep5zs5zVr4tDiVuQJepUu51e5eWYJpka624X4DMBxe3u',
4845
ipfsGateway: 'https://ipfs-gateway.arbitrum-mainnet.iex.ec',
4946
ipfsNode: 'https://ipfs-upload.arbitrum-mainnet.iex.ec',
50-
smsDebugURL: 'https://sms-debug.arbitrum-mainnet.iex.ec',
5147
workerpoolAddress: '0x2C06263943180Cc024dAFfeEe15612DB6e5fD248',
5248
},
5349
};

packages/sdk/src/lib/IExecDataProtectorModule.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ interface IExecDataProtectorResolvedConfig {
2727
ipfsGateway: string;
2828
defaultWorkerpool: string;
2929
iexec: IExec;
30-
iexecDebug: IExec;
3130
}
3231

3332
abstract class IExecDataProtectorModule {
@@ -47,8 +46,6 @@ abstract class IExecDataProtectorModule {
4746

4847
protected iexec!: IExec;
4948

50-
protected iexecDebug!: IExec;
51-
5249
private initPromise: Promise<void> | null = null;
5350

5451
private ethProvider: EthersCompatibleProvider;
@@ -73,7 +70,6 @@ abstract class IExecDataProtectorModule {
7370
this.ipfsGateway = config.ipfsGateway;
7471
this.defaultWorkerpool = config.defaultWorkerpool;
7572
this.iexec = config.iexec;
76-
this.iexecDebug = config.iexecDebug;
7773
});
7874
}
7975
return this.initPromise;
@@ -97,9 +93,6 @@ abstract class IExecDataProtectorModule {
9793
this.options?.ipfsGateway || chainDefaultConfig?.ipfsGateway;
9894
const defaultWorkerpool = chainDefaultConfig?.workerpoolAddress;
9995
const ipfsNode = this.options?.ipfsNode || chainDefaultConfig?.ipfsNode;
100-
const smsURL =
101-
this.options?.iexecOptions?.smsDebugURL ||
102-
chainDefaultConfig?.smsDebugURL;
10396

10497
const missing = [];
10598
if (!subgraphUrl) missing.push('subgraphUrl');
@@ -109,7 +102,6 @@ abstract class IExecDataProtectorModule {
109102
if (!ipfsGateway) missing.push('ipfsGateway');
110103
if (!defaultWorkerpool) missing.push('defaultWorkerpool');
111104
if (!ipfsNode) missing.push('ipfsNode');
112-
if (!smsURL) missing.push('smsDebugURL');
113105

114106
if (missing.length > 0) {
115107
throw new Error(
@@ -119,7 +111,7 @@ abstract class IExecDataProtectorModule {
119111
);
120112
}
121113

122-
let iexec: IExec, iexecDebug: IExec, graphQLClient: GraphQLClient;
114+
let iexec: IExec, graphQLClient: GraphQLClient;
123115

124116
try {
125117
iexec = new IExec(
@@ -130,16 +122,6 @@ abstract class IExecDataProtectorModule {
130122
allowExperimentalNetworks: this.options.allowExperimentalNetworks,
131123
}
132124
);
133-
134-
iexecDebug = new IExec(
135-
{ ethProvider: this.ethProvider },
136-
{
137-
ipfsGatewayURL: ipfsGateway,
138-
...this.options?.iexecOptions,
139-
smsURL,
140-
allowExperimentalNetworks: this.options.allowExperimentalNetworks,
141-
}
142-
);
143125
} catch (e: any) {
144126
throw new Error(`Unsupported ethProvider: ${e.message}`);
145127
}
@@ -158,7 +140,6 @@ abstract class IExecDataProtectorModule {
158140
ipfsNode,
159141
ipfsGateway,
160142
iexec,
161-
iexecDebug,
162143
};
163144
}
164145
}

packages/sdk/src/lib/dataProtectorCore/IExecDataProtectorCore.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class IExecDataProtectorCore extends IExecDataProtectorModule {
4141
ipfsGateway: this.ipfsGateway,
4242
arweaveUploadApi: this.arweaveUploadApi,
4343
iexec: this.iexec,
44-
iexecDebug: this.iexecDebug,
4544
});
4645
}
4746

packages/sdk/src/lib/dataProtectorCore/protectData.ts

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
ArweaveUploadConsumer,
3636
DataProtectorContractConsumer,
3737
IExecConsumer,
38-
IExecDebugConsumer,
3938
} from '../types/internalTypes.js';
4039
import { getDataProtectorCoreContract } from './smartContract/getDataProtectorCoreContract.js';
4140

@@ -45,18 +44,15 @@ export type ProtectData = typeof protectData;
4544

4645
export const protectData = async ({
4746
iexec = throwIfMissing(),
48-
iexecDebug = throwIfMissing(),
4947
dataprotectorContractAddress,
5048
name = DEFAULT_DATA_NAME,
5149
uploadMode = 'ipfs',
5250
ipfsNode,
5351
ipfsGateway,
5452
arweaveUploadApi,
55-
allowDebug = false,
5653
data,
5754
onStatusUpdate = () => {},
5855
}: IExecConsumer &
59-
IExecDebugConsumer &
6056
DataProtectorContractConsumer &
6157
IpfsNodeAndGateway &
6258
ArweaveUploadConsumer &
@@ -287,35 +283,6 @@ export const protectData = async ({
287283
},
288284
});
289285

290-
if (allowDebug === true) {
291-
// share secret with scone debug SMS
292-
vOnStatusUpdate({
293-
title: 'PUSH_SECRET_TO_DEBUG_SMS',
294-
isDone: false,
295-
payload: {
296-
teeFramework: 'scone',
297-
},
298-
});
299-
await iexecDebug.dataset
300-
.pushDatasetSecret(protectedDataAddress, encryptionKey, {
301-
teeFramework: 'scone',
302-
})
303-
.catch((e: Error) => {
304-
handleIfProtocolError(e);
305-
throw new WorkflowError({
306-
message: 'Failed to push protected data encryption key',
307-
errorCause: e,
308-
});
309-
});
310-
vOnStatusUpdate({
311-
title: 'PUSH_SECRET_TO_DEBUG_SMS',
312-
isDone: true,
313-
payload: {
314-
teeFramework: 'scone',
315-
},
316-
});
317-
}
318-
319286
return {
320287
name,
321288
address: protectedDataAddress,

packages/sdk/src/lib/types/commonTypes.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export type DataProtectorConfigOptions = {
6969
* Options specific to iExec integration.
7070
* If not provided, default iexec options will be used.
7171
*/
72-
iexecOptions?: IExecConfigOptionsExtended;
72+
iexecOptions?: IExecConfigOptions;
7373

7474
/**
7575
* if true allows using a provider connected to an experimental networks (default false)
@@ -79,11 +79,6 @@ export type DataProtectorConfigOptions = {
7979
allowExperimentalNetworks?: boolean;
8080
};
8181

82-
interface IExecConfigOptionsExtended extends IExecConfigOptions {
83-
// adds smsDebugURL to possible options, used ton configure an IExec debug instance seamlessly (no JS doc test purpose only)
84-
smsDebugURL?: string;
85-
}
86-
8782
// ---------------------ProtectedData Schema Types------------------------------------
8883
export type MimeType =
8984
| 'application/octet-stream'

packages/sdk/src/lib/types/coreTypes.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ export type ProtectDataStatuses =
4040
| 'ENCRYPT_FILE'
4141
| 'UPLOAD_ENCRYPTED_FILE'
4242
| 'DEPLOY_PROTECTED_DATA'
43-
| 'PUSH_SECRET_TO_SMS'
44-
| 'PUSH_SECRET_TO_DEBUG_SMS';
43+
| 'PUSH_SECRET_TO_SMS';
4544

4645
export type OneProtectDataStatus = {
4746
title: ProtectDataStatuses;
@@ -62,16 +61,6 @@ export type ProtectDataParams = {
6261
*/
6362
name?: string;
6463

65-
/**
66-
* allow to use the protected data in TEE debug apps (default `false`)
67-
*
68-
* ⚠️ TEE debug apps runs in enclave simulation mode which does not prevent the worker host to inspect data or temper the app output.
69-
* You should never set this parameter to `true` with real data, use it for development purpose only.
70-
*
71-
* setting this parameter to `true` adds a signature request to the protectData workflow, this signature is used to push the protected data encryption key to the debug Secret Management System
72-
*/
73-
allowDebug?: boolean;
74-
7564
/**
7665
* specify the platform used for storing the encrypted payload of the protected data
7766
*

packages/sdk/src/lib/types/internalTypes.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ export type IExecConsumer = {
66
iexec: IExec;
77
};
88

9-
export type IExecDebugConsumer = {
10-
/**
11-
* iexec instance connected to debug SMS
12-
*/
13-
iexecDebug: IExec;
14-
};
15-
169
export type DataProtectorContractConsumer = {
1710
dataprotectorContractAddress: AddressOrENS;
1811
};

packages/sdk/tests/docker-compose.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,6 @@ services:
3737
bellecour-fork:
3838
condition: service_healthy
3939

40-
sms-debug:
41-
image: iexechub/iexec-sms:8.7.0
42-
restart: unless-stopped
43-
environment:
44-
JAVA_TOOL_OPTIONS: '-Xmx256M'
45-
IEXEC_SMS_BLOCKCHAIN_NODE_ADDRESS: http://bellecour-fork:8545
46-
IEXEC_HUB_ADDRESS: '0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f'
47-
IEXEC_SMS_TEE_RUNTIME_FRAMEWORK: scone
48-
IEXEC_SMS_IMAGE_LAS_IMAGE: 'las-image'
49-
IEXEC_TEE_WORKER_PRE_COMPUTE_IMAGE: 'pre-compute-image'
50-
IEXEC_TEE_WORKER_PRE_COMPUTE_FINGERPRINT: 'pre-compute-fingerprint'
51-
IEXEC_TEE_WORKER_POST_COMPUTE_IMAGE: 'post-compute-image'
52-
IEXEC_TEE_WORKER_POST_COMPUTE_FINGERPRINT: 'post-compute-fingerprint'
53-
ports:
54-
- 13301:13300
55-
healthcheck:
56-
test: curl -f localhost:13300/actuator/health || exit 1
57-
depends_on:
58-
bellecour-fork:
59-
condition: service_healthy
60-
6140
result-proxy:
6241
image: iexechub/iexec-result-proxy:7.1.0
6342
restart: unless-stopped
@@ -245,8 +224,6 @@ services:
245224
condition: service_healthy
246225
sms:
247226
condition: service_healthy
248-
sms-debug:
249-
condition: service_healthy
250227
market-watcher:
251228
condition: service_started
252229
market-api:

0 commit comments

Comments
 (0)