Skip to content

Commit 75d2282

Browse files
fix: deprecate SGX SCONE and propose migration to TDX when possible (#269)
1 parent 1635077 commit 75d2282

2 files changed

Lines changed: 51 additions & 8 deletions

File tree

cli/src/cmd/deploy.ts

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { askForWallet } from '../cli-helpers/askForWallet.js';
2020
import { getIExec } from '../utils/iexec.js';
2121
import { goToProjectRoot } from '../cli-helpers/goToProjectRoot.js';
2222
import * as color from '../cli-helpers/color.js';
23-
import { hintBox } from '../cli-helpers/box.js';
23+
import { hintBox, warnBox } from '../cli-helpers/box.js';
2424
import { addDeploymentData } from '../utils/cacheExecutions.js';
2525
import { useTdx } from '../utils/featureFlags.js';
2626
import { ensureBalances } from '../cli-helpers/ensureBalances.js';
@@ -37,24 +37,47 @@ export async function deploy({ chain }: { chain?: string }) {
3737
defaultChain,
3838
spinner,
3939
});
40-
await warnBeforeTxFees({ spinner, chain: chainConfig.name });
41-
42-
const signer = await askForWallet({ spinner });
43-
const userAddress = await signer.getAddress();
4440

4541
// initialize iExec
46-
const iexec = getIExec({ ...chainConfig, signer });
42+
const iexecReadonly = getIExec({ ...chainConfig });
4743
// determine TEE framework based on feature flag
4844
const teeFramework = useTdx ? 'tdx' : 'scone';
4945
// check TEE framework compatibility with selected chain
5046
try {
51-
await iexec.config.resolveSmsURL({ teeFramework });
47+
await iexecReadonly.config.resolveSmsURL({ teeFramework });
5248
} catch {
5349
throw new Error(
5450
`TEE framework ${teeFramework.toUpperCase()} is not supported on the selected chain`
5551
);
5652
}
5753

54+
if (teeFramework === 'scone') {
55+
try {
56+
await iexecReadonly.config.resolveSmsURL({ teeFramework: 'tdx' });
57+
spinner.log(
58+
warnBox(
59+
`SGX SCONE TEE framework is deprecated in favor of TDX and will be removed in future versions.
60+
Please consider redeploying your app with TDX instead.
61+
62+
run ${color.command('EXPERIMENTAL_TDX_APP=1 iapp deploy')} to deploy your app with TDX now.`
63+
)
64+
);
65+
} catch {
66+
spinner.warn(
67+
'SGX SCONE TEE framework is deprecated and will be removed in a future version, please contact iExec support to know more about TDX and how to migrate your app.'
68+
);
69+
}
70+
}
71+
72+
await warnBeforeTxFees({ spinner, chain: chainConfig.name });
73+
74+
const signer = await askForWallet({ spinner });
75+
const userAddress = await signer.getAddress();
76+
77+
// initialize iExec
78+
const iexec = getIExec({ ...chainConfig, signer });
79+
// determine TEE framework based on feature flag
80+
5881
await ensureBalances({ spinner, iexec, warnOnlyRlc: true });
5982

6083
const dockerhubUsername = await askForDockerhubUsername({ spinner });

cli/src/cmd/run.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { ensureBalances } from '../cli-helpers/ensureBalances.js';
1919
import { askForAcknowledgment } from '../cli-helpers/askForAcknowledgment.js';
2020
import { warnBeforeTxFees } from '../cli-helpers/warnBeforeTxFees.js';
2121
import { resolveChainConfig } from '../cli-helpers/resolveChainConfig.js';
22+
import { warnBox } from '../cli-helpers/box.js';
2223

2324
export async function run({
2425
iAppAddress,
@@ -46,7 +47,6 @@ export async function run({
4647
defaultChain,
4748
spinner,
4849
});
49-
await warnBeforeTxFees({ spinner, chain: chainConfig.name });
5050

5151
spinner.start('checking inputs...');
5252
// initialize iExec
@@ -70,6 +70,24 @@ export async function run({
7070
);
7171
}
7272

73+
if (teeFramework === 'scone') {
74+
try {
75+
await readOnlyIexec.config.resolveSmsURL({ teeFramework: 'tdx' });
76+
spinner.log(
77+
warnBox(
78+
`SGX SCONE TEE framework is deprecated in favor of TDX and will be removed in future versions.
79+
Please consider redeploying your app with TDX instead.
80+
81+
run ${color.command('EXPERIMENTAL_TDX_APP=1 iapp deploy')} to redeploy your app with TDX.`
82+
)
83+
);
84+
} catch {
85+
spinner.warn(
86+
'SGX SCONE TEE framework is deprecated and will be removed in a future version, please contact iExec support to know more about TDX and how to migrate your app.'
87+
);
88+
}
89+
}
90+
7391
if (protectedData.length > 0) {
7492
await Promise.all(
7593
protectedData.map(async (dataset) => {
@@ -92,6 +110,8 @@ export async function run({
92110
);
93111
}
94112

113+
await warnBeforeTxFees({ spinner, chain: chainConfig.name });
114+
95115
// Get wallet from privateKey
96116
const signer = await askForWallet({ spinner });
97117
const userAddress = await signer.getAddress();

0 commit comments

Comments
 (0)