@aztec/end-to-end 0.0.1-commit.e3c1de76 → 0.0.1-commit.e57c76e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dest/bench/client_flows/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +17 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +3 -3
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +36 -39
- package/dest/bench/client_flows/config.d.ts +2 -2
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +18 -0
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +8 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +8 -5
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +36 -17
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +16 -5
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +42 -9
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -4
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -1
- package/dest/e2e_epochs/epochs_test.d.ts +33 -8
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +143 -44
- package/dest/e2e_fees/fees_test.d.ts +6 -3
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +50 -17
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +6 -7
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +4 -3
- package/dest/e2e_p2p/p2p_network.d.ts +14 -12
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +70 -34
- package/dest/e2e_p2p/reqresp/utils.d.ts +3 -3
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/reqresp/utils.js +67 -14
- package/dest/e2e_p2p/shared.d.ts +37 -8
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +91 -51
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts +2 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fetcher.js +184 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts +18 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.d.ts.map +1 -0
- package/dest/e2e_storage_proof/fixtures/storage_proof_fixture.js +120 -0
- package/dest/e2e_token_contract/token_contract_test.d.ts +6 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +23 -11
- package/dest/fixtures/authwit_proxy.d.ts +15 -0
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -0
- package/dest/fixtures/authwit_proxy.js +34 -0
- package/dest/fixtures/e2e_prover_test.d.ts +9 -8
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +39 -50
- package/dest/fixtures/elu_monitor.d.ts +21 -0
- package/dest/fixtures/elu_monitor.d.ts.map +1 -0
- package/dest/fixtures/elu_monitor.js +102 -0
- package/dest/fixtures/fixtures.d.ts +74 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +71 -0
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +71 -0
- package/dest/fixtures/ha_setup.d.ts.map +1 -0
- package/dest/fixtures/ha_setup.js +116 -0
- package/dest/fixtures/index.d.ts +2 -1
- package/dest/fixtures/index.d.ts.map +1 -1
- package/dest/fixtures/index.js +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +37 -0
- package/dest/fixtures/setup.d.ts +86 -32
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +209 -169
- package/dest/fixtures/setup_p2p_test.d.ts +22 -10
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +23 -17
- package/dest/fixtures/token_utils.d.ts +2 -2
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +5 -7
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/shared/cross_chain_test_harness.d.ts +4 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +22 -18
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +19 -10
- package/dest/shared/index.d.ts +2 -1
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/index.js +1 -0
- package/dest/shared/jest_setup.js +41 -1
- package/dest/shared/mock_state_view.d.ts +86 -0
- package/dest/shared/mock_state_view.d.ts.map +1 -0
- package/dest/shared/mock_state_view.js +186 -0
- package/dest/shared/submit-transactions.d.ts +2 -2
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +57 -40
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +26 -14
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +3 -24
- package/dest/spartan/setup_test_wallets.d.ts +12 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +108 -41
- package/dest/spartan/tx_metrics.d.ts +18 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +74 -21
- package/dest/spartan/utils/bot.d.ts +3 -2
- package/dest/spartan/utils/bot.d.ts.map +1 -1
- package/dest/spartan/utils/bot.js +2 -1
- package/dest/spartan/utils/config.d.ts +11 -28
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/config.js +4 -1
- package/dest/spartan/utils/index.d.ts +5 -3
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +5 -1
- package/dest/spartan/utils/k8s.d.ts +3 -1
- package/dest/spartan/utils/k8s.d.ts.map +1 -1
- package/dest/spartan/utils/k8s.js +6 -0
- package/dest/spartan/utils/nodes.d.ts +4 -5
- package/dest/spartan/utils/nodes.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +11 -11
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/spartan/utils/scripts.d.ts +18 -4
- package/dest/spartan/utils/scripts.d.ts.map +1 -1
- package/dest/spartan/utils/scripts.js +19 -4
- package/dest/test-wallet/test_wallet.d.ts +85 -0
- package/dest/test-wallet/test_wallet.d.ts.map +1 -0
- package/dest/test-wallet/test_wallet.js +273 -0
- package/dest/test-wallet/utils.d.ts +41 -0
- package/dest/test-wallet/utils.d.ts.map +1 -0
- package/dest/test-wallet/utils.js +66 -0
- package/dest/test-wallet/wallet_worker_script.d.ts +2 -0
- package/dest/test-wallet/wallet_worker_script.d.ts.map +1 -0
- package/dest/test-wallet/wallet_worker_script.js +53 -0
- package/dest/test-wallet/worker_wallet.d.ts +53 -0
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet.js +155 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts +160 -0
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -0
- package/dest/test-wallet/worker_wallet_schema.js +22 -0
- package/package.json +52 -45
- package/src/bench/client_flows/benchmark.ts +19 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +64 -49
- package/src/bench/client_flows/config.ts +9 -1
- package/src/bench/utils.ts +10 -4
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +52 -25
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +56 -19
- package/src/e2e_deploy_contract/deploy_test.ts +6 -5
- package/src/e2e_epochs/epochs_test.ts +166 -68
- package/src/e2e_fees/bridging_race.notest.ts +1 -1
- package/src/e2e_fees/fees_test.ts +57 -32
- package/src/e2e_nested_contract/nested_contract_test.ts +10 -6
- package/src/e2e_p2p/inactivity_slash_test.ts +8 -7
- package/src/e2e_p2p/p2p_network.ts +93 -49
- package/src/e2e_p2p/reqresp/utils.ts +84 -17
- package/src/e2e_p2p/shared.ts +109 -65
- package/src/e2e_storage_proof/fixtures/storage_proof.json +915 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fetcher.ts +190 -0
- package/src/e2e_storage_proof/fixtures/storage_proof_fixture.ts +173 -0
- package/src/e2e_token_contract/token_contract_test.ts +38 -11
- package/src/fixtures/authwit_proxy.ts +54 -0
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +49 -56
- package/src/fixtures/elu_monitor.ts +126 -0
- package/src/fixtures/fixtures.ts +93 -0
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +188 -0
- package/src/fixtures/index.ts +1 -0
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +272 -233
- package/src/fixtures/setup_p2p_test.ts +37 -32
- package/src/fixtures/token_utils.ts +3 -3
- package/src/fixtures/utils.ts +2 -0
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +104 -0
- package/src/guides/up_quick_start.sh +3 -5
- package/src/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/shared/cross_chain_test_harness.ts +27 -13
- package/src/shared/gas_portal_test_harness.ts +21 -11
- package/src/shared/index.ts +1 -0
- package/src/shared/jest_setup.ts +51 -1
- package/src/shared/mock_state_view.ts +188 -0
- package/src/shared/submit-transactions.ts +3 -2
- package/src/shared/uniswap_l1_l2.ts +103 -54
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +32 -14
- package/src/simulators/token_simulator.ts +6 -30
- package/src/spartan/setup_test_wallets.ts +146 -35
- package/src/spartan/tx_metrics.ts +82 -24
- package/src/spartan/utils/bot.ts +4 -1
- package/src/spartan/utils/config.ts +3 -0
- package/src/spartan/utils/index.ts +8 -1
- package/src/spartan/utils/k8s.ts +8 -0
- package/src/spartan/utils/nodes.ts +17 -12
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/spartan/utils/scripts.ts +43 -7
- package/src/test-wallet/test_wallet.ts +376 -0
- package/src/test-wallet/utils.ts +108 -0
- package/src/test-wallet/wallet_worker_script.ts +63 -0
- package/src/test-wallet/worker_wallet.ts +218 -0
- package/src/test-wallet/worker_wallet_schema.ts +13 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
4
|
+
import { getSchemaReturnType } from '@aztec/foundation/schemas';
|
|
5
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
6
|
+
import { NodeConnector, TransportClient } from '@aztec/foundation/transport';
|
|
7
|
+
import { Worker } from 'worker_threads';
|
|
8
|
+
import { WorkerWalletSchema } from './worker_wallet_schema.js';
|
|
9
|
+
const log = createLogger('e2e:test-wallet:worker-wallet');
|
|
10
|
+
const WORKER_READY_TIMEOUT_MS = 120_000;
|
|
11
|
+
/**
|
|
12
|
+
* Wallet implementation that offloads all work to a worker thread.
|
|
13
|
+
* Implements the Wallet interface by proxying calls over a transport layer
|
|
14
|
+
* using JSON serialization with Zod schema parsing on both ends.
|
|
15
|
+
*/ export class WorkerWallet {
|
|
16
|
+
worker;
|
|
17
|
+
client;
|
|
18
|
+
constructor(worker, client){
|
|
19
|
+
this.worker = worker;
|
|
20
|
+
this.client = client;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a WorkerWallet by spawning a worker thread that creates a TestWallet internally.
|
|
24
|
+
* @param nodeUrl - URL of the Aztec node to connect to.
|
|
25
|
+
* @param pxeConfig - Optional PXE configuration overrides.
|
|
26
|
+
* @returns A WorkerWallet ready to use.
|
|
27
|
+
*/ static async create(nodeUrl, pxeConfig) {
|
|
28
|
+
// replace stc/ with dest/ so the wallet works in Jest tests
|
|
29
|
+
const workerUrl = new URL('./wallet_worker_script.js', import.meta.url);
|
|
30
|
+
workerUrl.pathname = workerUrl.pathname.replace('/src/', '/dest/');
|
|
31
|
+
// remove JEST_WORKER_ID so the worker uses pino-pretty transport instead of Jest's raw output.
|
|
32
|
+
const { JEST_WORKER_ID: _, ...parentEnv } = process.env;
|
|
33
|
+
const worker = new Worker(workerUrl, {
|
|
34
|
+
workerData: {
|
|
35
|
+
nodeUrl,
|
|
36
|
+
pxeConfig
|
|
37
|
+
},
|
|
38
|
+
env: {
|
|
39
|
+
...parentEnv,
|
|
40
|
+
...process.stderr.isTTY || process.env.FORCE_COLOR ? {
|
|
41
|
+
FORCE_COLOR: '1'
|
|
42
|
+
} : {},
|
|
43
|
+
LOG_LEVEL: process.env.WORKER_LOG_LEVEL ?? 'info'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const connector = new NodeConnector(worker);
|
|
47
|
+
const client = new TransportClient(connector);
|
|
48
|
+
await client.open();
|
|
49
|
+
const wallet = new WorkerWallet(worker, client);
|
|
50
|
+
const { promise: workerDied, reject: rejectWorkerDied } = promiseWithResolvers();
|
|
51
|
+
// reject if the worker exits or errors before the warmup completes.
|
|
52
|
+
const onError = (err)=>{
|
|
53
|
+
worker.off('exit', onExit);
|
|
54
|
+
rejectWorkerDied(new Error(`Worker wallet thread error: ${err.message}`));
|
|
55
|
+
};
|
|
56
|
+
const onExit = (code)=>{
|
|
57
|
+
worker.off('error', onError);
|
|
58
|
+
rejectWorkerDied(new Error(`Worker wallet thread exited with code ${code} before becoming ready`));
|
|
59
|
+
};
|
|
60
|
+
worker.once('error', onError);
|
|
61
|
+
worker.once('exit', onExit);
|
|
62
|
+
const timeout = sleep(WORKER_READY_TIMEOUT_MS).then(()=>{
|
|
63
|
+
throw new Error(`Worker wallet creation timed out after ${WORKER_READY_TIMEOUT_MS / 1000}s`);
|
|
64
|
+
});
|
|
65
|
+
try {
|
|
66
|
+
// wait for worker wallet to start
|
|
67
|
+
await Promise.race([
|
|
68
|
+
wallet.getChainInfo(),
|
|
69
|
+
workerDied,
|
|
70
|
+
timeout
|
|
71
|
+
]);
|
|
72
|
+
} catch (err) {
|
|
73
|
+
log.error('Worker wallet creation failed, cleaning up', {
|
|
74
|
+
error: String(err)
|
|
75
|
+
});
|
|
76
|
+
client.close();
|
|
77
|
+
await worker.terminate();
|
|
78
|
+
throw err;
|
|
79
|
+
} finally{
|
|
80
|
+
worker.off('error', onError);
|
|
81
|
+
worker.off('exit', onExit);
|
|
82
|
+
}
|
|
83
|
+
return wallet;
|
|
84
|
+
}
|
|
85
|
+
async callRaw(fn, ...args) {
|
|
86
|
+
const argsJson = jsonStringify(args);
|
|
87
|
+
return await this.client.request({
|
|
88
|
+
fn,
|
|
89
|
+
args: argsJson
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
async call(fn, ...args) {
|
|
93
|
+
const resultJson = await this.callRaw(fn, ...args);
|
|
94
|
+
const methodSchema = WorkerWalletSchema[fn];
|
|
95
|
+
return getSchemaReturnType(methodSchema).parseAsync(JSON.parse(resultJson));
|
|
96
|
+
}
|
|
97
|
+
getChainInfo() {
|
|
98
|
+
return this.call('getChainInfo');
|
|
99
|
+
}
|
|
100
|
+
getContractMetadata(address) {
|
|
101
|
+
return this.call('getContractMetadata', address);
|
|
102
|
+
}
|
|
103
|
+
getContractClassMetadata(id) {
|
|
104
|
+
return this.call('getContractClassMetadata', id);
|
|
105
|
+
}
|
|
106
|
+
getPrivateEvents(eventMetadata, eventFilter) {
|
|
107
|
+
return this.call('getPrivateEvents', eventMetadata, eventFilter);
|
|
108
|
+
}
|
|
109
|
+
registerSender(address, alias) {
|
|
110
|
+
return this.call('registerSender', address, alias);
|
|
111
|
+
}
|
|
112
|
+
getAddressBook() {
|
|
113
|
+
return this.call('getAddressBook');
|
|
114
|
+
}
|
|
115
|
+
getAccounts() {
|
|
116
|
+
return this.call('getAccounts');
|
|
117
|
+
}
|
|
118
|
+
registerContract(instance, artifact, secretKey) {
|
|
119
|
+
return this.call('registerContract', instance, artifact, secretKey);
|
|
120
|
+
}
|
|
121
|
+
registerContractClass(artifact) {
|
|
122
|
+
return this.call('registerContractClass', artifact);
|
|
123
|
+
}
|
|
124
|
+
simulateTx(exec, opts) {
|
|
125
|
+
return this.call('simulateTx', exec, opts);
|
|
126
|
+
}
|
|
127
|
+
executeUtility(call, opts) {
|
|
128
|
+
return this.call('executeUtility', call, opts);
|
|
129
|
+
}
|
|
130
|
+
profileTx(exec, opts) {
|
|
131
|
+
return this.call('profileTx', exec, opts);
|
|
132
|
+
}
|
|
133
|
+
sendTx(exec, opts) {
|
|
134
|
+
return this.call('sendTx', exec, opts);
|
|
135
|
+
}
|
|
136
|
+
proveTx(exec, opts) {
|
|
137
|
+
return this.call('proveTx', exec, opts);
|
|
138
|
+
}
|
|
139
|
+
/** Registers an account inside the worker's TestWallet, populating its accounts map. */ registerAccount(secret, salt) {
|
|
140
|
+
return this.call('registerAccount', secret, salt);
|
|
141
|
+
}
|
|
142
|
+
createAuthWit(from, messageHashOrIntent) {
|
|
143
|
+
return this.call('createAuthWit', from, messageHashOrIntent);
|
|
144
|
+
}
|
|
145
|
+
requestCapabilities(manifest) {
|
|
146
|
+
return this.call('requestCapabilities', manifest);
|
|
147
|
+
}
|
|
148
|
+
batch(methods) {
|
|
149
|
+
return this.call('batch', methods);
|
|
150
|
+
}
|
|
151
|
+
/** Shuts down the worker thread and closes the transport. */ async stop() {
|
|
152
|
+
this.client.close();
|
|
153
|
+
await this.worker.terminate();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
/** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */
|
|
5
|
+
export declare const WorkerWalletSchema: {
|
|
6
|
+
getPrivateEvents: z.ZodFunction<z.ZodTuple<[eventMetadata: z.ZodType<import("@aztec/stdlib/abi").EventMetadataDefinition, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").EventMetadataDefinition, any>>, eventFilter: z.ZodType<import("@aztec/aztec.js/wallet").PrivateEventFilter, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").PrivateEventFilter, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").PrivateEvent<unknown>[], any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").PrivateEvent<unknown>[], any>>>;
|
|
7
|
+
getChainInfo: z.ZodFunction<z.ZodTuple<[], null>, z.ZodType<import("@aztec/entrypoints/interfaces").ChainInfo, any, z.core.$ZodTypeInternals<import("@aztec/entrypoints/interfaces").ChainInfo, any>>>;
|
|
8
|
+
getContractMetadata: z.ZodFunction<z.ZodTuple<[address: z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").ContractMetadata, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ContractMetadata, any>>>;
|
|
9
|
+
getContractClassMetadata: z.ZodFunction<z.ZodTuple<[id: z.ZodType<import("@aztec/foundation/schemas").Fr, any, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").ContractClassMetadata, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ContractClassMetadata, any>>>;
|
|
10
|
+
registerSender: z.ZodFunction<z.ZodTuple<[address: z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>, alias: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<string | undefined, any, z.core.$ZodTypeInternals<string | undefined, any>>>], null>, z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>>;
|
|
11
|
+
getAddressBook: z.ZodFunction<z.ZodTuple<[], null>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any>>>;
|
|
12
|
+
getAccounts: z.ZodFunction<z.ZodTuple<[], null>, z.ZodType<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").Aliased<AztecAddress>[], any>>>;
|
|
13
|
+
registerContract: z.ZodFunction<z.ZodTuple<[instance: z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any>>, artifact: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/stdlib/abi").ContractArtifact | undefined, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").ContractArtifact | undefined, any>>>, secretKey: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodType<import("@aztec/foundation/schemas").Fr | undefined, any, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr | undefined, any>>>], null>, z.ZodType<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/contract").ContractInstanceWithAddress, any>>>;
|
|
14
|
+
registerContractClass: z.ZodFunction<z.ZodTuple<[artifact: z.ZodType<import("@aztec/stdlib/abi").ContractArtifact, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").ContractArtifact, any>>], null>, z.ZodType<void, any, z.core.$ZodTypeInternals<void, any>>>;
|
|
15
|
+
simulateTx: z.ZodFunction<z.ZodTuple<[exec: z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").ExecutionPayload, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SimulateOptions, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").SimulateOptions, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").TxSimulationResultWithAppOffset, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").TxSimulationResultWithAppOffset, any>>>;
|
|
16
|
+
executeUtility: z.ZodFunction<z.ZodTuple<[call: z.ZodType<import("@aztec/stdlib/abi").FunctionCall, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").FunctionCall, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ExecuteUtilityOptions, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ExecuteUtilityOptions, any>>], null>, z.ZodType<import("@aztec/stdlib/tx").UtilityExecutionResult, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").UtilityExecutionResult, any>>>;
|
|
17
|
+
profileTx: z.ZodFunction<z.ZodTuple<[exec: z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").ExecutionPayload, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").ProfileOptions, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").ProfileOptions, any>>], null>, z.ZodType<import("@aztec/stdlib/tx").TxProfileResult, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").TxProfileResult, any>>>;
|
|
18
|
+
sendTx: z.ZodFunction<z.ZodTuple<[exec: z.ZodType<import("@aztec/stdlib/tx").ExecutionPayload, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").ExecutionPayload, any>>, opts: z.ZodType<import("@aztec/aztec.js/wallet").SendOptions<import("@aztec/aztec.js/contracts").InteractionWaitOptions>, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").SendOptions<import("@aztec/aztec.js/contracts").InteractionWaitOptions>, any>>], null>, z.ZodType<import("@aztec/aztec.js/contracts").TxSendResultImmediate | import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/contracts").TxSendResultImmediate | import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>, any>>>;
|
|
19
|
+
createAuthWit: z.ZodFunction<z.ZodTuple<[from: z.ZodType<AztecAddress, any, z.core.$ZodTypeInternals<AztecAddress, any>>, messageHashOrIntent: z.ZodType<import("@aztec/aztec.js/authorization").CallIntent | import("@aztec/aztec.js/authorization").IntentInnerHash, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/authorization").CallIntent | import("@aztec/aztec.js/authorization").IntentInnerHash, any>>], null>, z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, any, z.core.$ZodTypeInternals<import("@aztec/stdlib/auth-witness").AuthWitness, any>>>;
|
|
20
|
+
requestCapabilities: z.ZodFunction<z.ZodTuple<[manifest: z.ZodType<import("@aztec/aztec.js/wallet").AppCapabilities, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").AppCapabilities, any>>], null>, z.ZodType<import("@aztec/aztec.js/wallet").WalletCapabilities, any, z.core.$ZodTypeInternals<import("@aztec/aztec.js/wallet").WalletCapabilities, any>>>;
|
|
21
|
+
batch: z.ZodFunction<z.ZodTuple<[methods: z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethod[], any, z.core.$ZodTypeInternals<readonly import("@aztec/aztec.js/wallet").BatchedMethod[], any>>], null>, z.ZodType<readonly import("@aztec/aztec.js/wallet").BatchedMethodResultWrapper<import("@aztec/aztec.js/wallet").BatchedMethod>[], any, z.core.$ZodTypeInternals<readonly import("@aztec/aztec.js/wallet").BatchedMethodResultWrapper<import("@aztec/aztec.js/wallet").BatchedMethod>[], any>>>;
|
|
22
|
+
proveTx: z.ZodFunction<z.ZodTuple<[z.ZodObject<{
|
|
23
|
+
calls: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
to: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
26
|
+
selector: import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/abi").FunctionSelector>;
|
|
27
|
+
type: z.ZodEnum<typeof import("@aztec/stdlib/abi").FunctionType>;
|
|
28
|
+
isStatic: z.ZodBoolean;
|
|
29
|
+
hideMsgSender: z.ZodBoolean;
|
|
30
|
+
args: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/foundation/schemas").Fr>>;
|
|
31
|
+
returnTypes: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
|
|
32
|
+
}, z.core.$strip>, z.ZodTransform<import("@aztec/stdlib/abi").FunctionCall, {
|
|
33
|
+
name: string;
|
|
34
|
+
to: AztecAddress;
|
|
35
|
+
selector: import("@aztec/stdlib/abi").FunctionSelector;
|
|
36
|
+
type: import("@aztec/stdlib/abi").FunctionType;
|
|
37
|
+
isStatic: boolean;
|
|
38
|
+
hideMsgSender: boolean;
|
|
39
|
+
args: import("@aztec/foundation/schemas").Fr[];
|
|
40
|
+
returnTypes: import("@aztec/stdlib/abi").AbiType[];
|
|
41
|
+
}>>>;
|
|
42
|
+
authWitnesses: z.ZodArray<z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/auth-witness").AuthWitness, string>>>;
|
|
43
|
+
capsules: z.ZodArray<z.ZodType<import("@aztec/stdlib/tx").Capsule, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").Capsule, string>>>;
|
|
44
|
+
extraHashedArgs: z.ZodArray<import("@aztec/foundation/schemas").ZodFor<import("@aztec/stdlib/tx").HashedValues>>;
|
|
45
|
+
feePayer: z.ZodPipe<z.ZodOptional<z.ZodNullable<import("@aztec/foundation/schemas").ZodFor<AztecAddress>>>, z.ZodTransform<AztecAddress | undefined, AztecAddress | null | undefined>>;
|
|
46
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
47
|
+
from: z.ZodUnion<readonly [import("@aztec/foundation/schemas").ZodFor<AztecAddress>, z.ZodLiteral<"NO_FROM">]>;
|
|
48
|
+
authWitnesses: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@aztec/stdlib/auth-witness").AuthWitness, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/auth-witness").AuthWitness, string>>>>>, z.ZodTransform<import("@aztec/stdlib/auth-witness").AuthWitness[] | undefined, import("@aztec/stdlib/auth-witness").AuthWitness[] | null | undefined>>;
|
|
49
|
+
capsules: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodType<import("@aztec/stdlib/tx").Capsule, string, z.core.$ZodTypeInternals<import("@aztec/stdlib/tx").Capsule, string>>>>>, z.ZodTransform<import("@aztec/stdlib/tx").Capsule[] | undefined, import("@aztec/stdlib/tx").Capsule[] | null | undefined>>;
|
|
50
|
+
fee: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
51
|
+
gasSettings: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
52
|
+
gasLimits: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
53
|
+
daGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
|
|
54
|
+
l2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
|
|
55
|
+
}, z.core.$strip>, z.ZodTransform<import("@aztec/stdlib/gas").Gas, {
|
|
56
|
+
daGas: number;
|
|
57
|
+
l2Gas: number;
|
|
58
|
+
}>>>>, z.ZodTransform<import("@aztec/stdlib/gas").Gas | undefined, import("@aztec/stdlib/gas").Gas | null | undefined>>;
|
|
59
|
+
teardownGasLimits: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
60
|
+
daGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
|
|
61
|
+
l2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedNumber<string | number | bigint>>;
|
|
62
|
+
}, z.core.$strip>, z.ZodTransform<import("@aztec/stdlib/gas").Gas, {
|
|
63
|
+
daGas: number;
|
|
64
|
+
l2Gas: number;
|
|
65
|
+
}>>>>, z.ZodTransform<import("@aztec/stdlib/gas").Gas | undefined, import("@aztec/stdlib/gas").Gas | null | undefined>>;
|
|
66
|
+
maxFeePerGas: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
67
|
+
feePerDaGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
68
|
+
feePerL2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
69
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
70
|
+
feePerDaGas: bigint;
|
|
71
|
+
feePerL2Gas: bigint;
|
|
72
|
+
} | undefined, {
|
|
73
|
+
feePerDaGas: bigint;
|
|
74
|
+
feePerL2Gas: bigint;
|
|
75
|
+
} | null | undefined>>;
|
|
76
|
+
maxPriorityFeePerGas: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
77
|
+
feePerDaGas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
78
|
+
feePerL2Gas: z.ZodPipe<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodCoercedBigInt<string | number | bigint>>;
|
|
79
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
80
|
+
feePerDaGas: bigint;
|
|
81
|
+
feePerL2Gas: bigint;
|
|
82
|
+
} | undefined, {
|
|
83
|
+
feePerDaGas: bigint;
|
|
84
|
+
feePerL2Gas: bigint;
|
|
85
|
+
} | null | undefined>>;
|
|
86
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
87
|
+
gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
88
|
+
teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
89
|
+
maxFeePerGas: {
|
|
90
|
+
feePerDaGas: bigint;
|
|
91
|
+
feePerL2Gas: bigint;
|
|
92
|
+
} | undefined;
|
|
93
|
+
maxPriorityFeePerGas: {
|
|
94
|
+
feePerDaGas: bigint;
|
|
95
|
+
feePerL2Gas: bigint;
|
|
96
|
+
} | undefined;
|
|
97
|
+
} | undefined, {
|
|
98
|
+
gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
99
|
+
teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
100
|
+
maxFeePerGas: {
|
|
101
|
+
feePerDaGas: bigint;
|
|
102
|
+
feePerL2Gas: bigint;
|
|
103
|
+
} | undefined;
|
|
104
|
+
maxPriorityFeePerGas: {
|
|
105
|
+
feePerDaGas: bigint;
|
|
106
|
+
feePerL2Gas: bigint;
|
|
107
|
+
} | undefined;
|
|
108
|
+
} | null | undefined>>;
|
|
109
|
+
congestionEstimate: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof import("@aztec/stdlib/gas").ManaUsageEstimate>>>, z.ZodTransform<import("@aztec/stdlib/gas").ManaUsageEstimate | undefined, import("@aztec/stdlib/gas").ManaUsageEstimate | null | undefined>>;
|
|
110
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
111
|
+
gasSettings: {
|
|
112
|
+
gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
113
|
+
teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
114
|
+
maxFeePerGas: {
|
|
115
|
+
feePerDaGas: bigint;
|
|
116
|
+
feePerL2Gas: bigint;
|
|
117
|
+
} | undefined;
|
|
118
|
+
maxPriorityFeePerGas: {
|
|
119
|
+
feePerDaGas: bigint;
|
|
120
|
+
feePerL2Gas: bigint;
|
|
121
|
+
} | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
congestionEstimate: import("@aztec/stdlib/gas").ManaUsageEstimate | undefined;
|
|
124
|
+
} | undefined, {
|
|
125
|
+
gasSettings: {
|
|
126
|
+
gasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
127
|
+
teardownGasLimits: import("@aztec/stdlib/gas").Gas | undefined;
|
|
128
|
+
maxFeePerGas: {
|
|
129
|
+
feePerDaGas: bigint;
|
|
130
|
+
feePerL2Gas: bigint;
|
|
131
|
+
} | undefined;
|
|
132
|
+
maxPriorityFeePerGas: {
|
|
133
|
+
feePerDaGas: bigint;
|
|
134
|
+
feePerL2Gas: bigint;
|
|
135
|
+
} | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
congestionEstimate: import("@aztec/stdlib/gas").ManaUsageEstimate | undefined;
|
|
138
|
+
} | null | undefined>>;
|
|
139
|
+
wait: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"NO_WAIT">, z.ZodObject<{
|
|
140
|
+
ignoreDroppedReceiptsFor: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
141
|
+
timeout: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
142
|
+
interval: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodNumber>>, z.ZodTransform<number | undefined, number | null | undefined>>;
|
|
143
|
+
dontThrowOnRevert: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>;
|
|
144
|
+
}, z.core.$strip>]>>>, z.ZodTransform<NonNullable<"NO_WAIT" | {
|
|
145
|
+
ignoreDroppedReceiptsFor: number | undefined;
|
|
146
|
+
timeout: number | undefined;
|
|
147
|
+
interval: number | undefined;
|
|
148
|
+
dontThrowOnRevert: boolean | undefined;
|
|
149
|
+
}> | undefined, "NO_WAIT" | {
|
|
150
|
+
ignoreDroppedReceiptsFor: number | undefined;
|
|
151
|
+
timeout: number | undefined;
|
|
152
|
+
interval: number | undefined;
|
|
153
|
+
dontThrowOnRevert: boolean | undefined;
|
|
154
|
+
} | null | undefined>>;
|
|
155
|
+
additionalScopes: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodArray<import("@aztec/foundation/schemas").ZodFor<AztecAddress>>>>, z.ZodTransform<AztecAddress[] | undefined, AztecAddress[] | null | undefined>>;
|
|
156
|
+
sendMessagesAs: z.ZodPipe<z.ZodOptional<z.ZodNullable<import("@aztec/foundation/schemas").ZodFor<AztecAddress>>>, z.ZodTransform<AztecAddress | undefined, AztecAddress | null | undefined>>;
|
|
157
|
+
}, z.core.$strip>], null>, import("@aztec/foundation/schemas").ZodFor<Tx>>;
|
|
158
|
+
registerAccount: z.ZodFunction<z.ZodTuple<[z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>, z.ZodType<import("@aztec/foundation/schemas").Fr, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Fr, string>>], null>, import("@aztec/foundation/schemas").ZodFor<AztecAddress>>;
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2VyX3dhbGxldF9zY2hlbWEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0LXdhbGxldC93b3JrZXJfd2FsbGV0X3NjaGVtYS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDM0QsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRXRDLE9BQU8sRUFBRSxDQUFDLEVBQUUsTUFBTSxLQUFLLENBQUM7QUFFeEIsaUdBQStGO0FBQy9GLGVBQU8sTUFBTSxrQkFBa0I7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FJOUIsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker_wallet_schema.d.ts","sourceRoot":"","sources":["../../src/test-wallet/worker_wallet_schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iGAA+F;AAC/F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI9B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExecutionPayloadSchema, SendOptionsSchema, WalletSchema } from '@aztec/aztec.js/wallet';
|
|
2
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
3
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/** Schema for the WorkerWallet API — extends WalletSchema with proveTx and registerAccount. */ export const WorkerWalletSchema = {
|
|
7
|
+
...WalletSchema,
|
|
8
|
+
proveTx: z.function({
|
|
9
|
+
input: z.tuple([
|
|
10
|
+
ExecutionPayloadSchema,
|
|
11
|
+
SendOptionsSchema
|
|
12
|
+
]),
|
|
13
|
+
output: Tx.schema
|
|
14
|
+
}),
|
|
15
|
+
registerAccount: z.function({
|
|
16
|
+
input: z.tuple([
|
|
17
|
+
schemas.Fr,
|
|
18
|
+
schemas.Fr
|
|
19
|
+
]),
|
|
20
|
+
output: AztecAddress.schema
|
|
21
|
+
})
|
|
22
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.e57c76e",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"exports":
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./dest/index.js",
|
|
7
|
+
"./*": "./dest/*"
|
|
8
|
+
},
|
|
6
9
|
"inherits": [
|
|
7
10
|
"../package.common.json",
|
|
8
11
|
"./package.local.json"
|
|
@@ -12,57 +15,59 @@
|
|
|
12
15
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
13
16
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
14
17
|
"test:with-alerts": "./scripts/test-with-alerts.sh",
|
|
15
|
-
"test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000
|
|
18
|
+
"test:e2e": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
|
|
16
19
|
"test:e2e-docker": "./scripts/run_test.sh simple",
|
|
17
20
|
"test:e2e-no-docker": "echo 'The command test:e2e-no-docker is now the same as test:e2e. You can now run this dropping the no-docker suffix.'; yarn test:e2e",
|
|
18
|
-
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000
|
|
21
|
+
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000",
|
|
19
22
|
"serve:flames": "python3 -m http.server --directory \"flame_graph\" 8000",
|
|
20
|
-
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000
|
|
23
|
+
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000",
|
|
21
24
|
"test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"",
|
|
22
25
|
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json",
|
|
23
26
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests src/fixtures",
|
|
24
27
|
"test:compose": "./scripts/run_test.sh compose",
|
|
28
|
+
"test:ha": "./scripts/run_test.sh ha",
|
|
25
29
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
30
|
},
|
|
27
31
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
29
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
30
|
-
"@aztec/aztec": "0.0.1-commit.
|
|
31
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
32
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
33
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
34
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
35
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
36
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
37
|
-
"@aztec/bot": "0.0.1-commit.
|
|
38
|
-
"@aztec/cli": "0.0.1-commit.
|
|
39
|
-
"@aztec/constants": "0.0.1-commit.
|
|
40
|
-
"@aztec/entrypoints": "0.0.1-commit.
|
|
41
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
42
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
43
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
44
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
45
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/noir-
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/noir-
|
|
51
|
-
"@aztec/
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/prover-
|
|
55
|
-
"@aztec/
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
60
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
61
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
62
|
-
"@aztec/
|
|
63
|
-
"@aztec/validator-
|
|
64
|
-
"@aztec/
|
|
65
|
-
"@aztec/
|
|
32
|
+
"@aztec/accounts": "0.0.1-commit.e57c76e",
|
|
33
|
+
"@aztec/archiver": "0.0.1-commit.e57c76e",
|
|
34
|
+
"@aztec/aztec": "0.0.1-commit.e57c76e",
|
|
35
|
+
"@aztec/aztec-node": "0.0.1-commit.e57c76e",
|
|
36
|
+
"@aztec/aztec.js": "0.0.1-commit.e57c76e",
|
|
37
|
+
"@aztec/bb-prover": "0.0.1-commit.e57c76e",
|
|
38
|
+
"@aztec/bb.js": "0.0.1-commit.e57c76e",
|
|
39
|
+
"@aztec/blob-client": "0.0.1-commit.e57c76e",
|
|
40
|
+
"@aztec/blob-lib": "0.0.1-commit.e57c76e",
|
|
41
|
+
"@aztec/bot": "0.0.1-commit.e57c76e",
|
|
42
|
+
"@aztec/cli": "0.0.1-commit.e57c76e",
|
|
43
|
+
"@aztec/constants": "0.0.1-commit.e57c76e",
|
|
44
|
+
"@aztec/entrypoints": "0.0.1-commit.e57c76e",
|
|
45
|
+
"@aztec/epoch-cache": "0.0.1-commit.e57c76e",
|
|
46
|
+
"@aztec/ethereum": "0.0.1-commit.e57c76e",
|
|
47
|
+
"@aztec/foundation": "0.0.1-commit.e57c76e",
|
|
48
|
+
"@aztec/kv-store": "0.0.1-commit.e57c76e",
|
|
49
|
+
"@aztec/l1-artifacts": "0.0.1-commit.e57c76e",
|
|
50
|
+
"@aztec/node-keystore": "0.0.1-commit.e57c76e",
|
|
51
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.e57c76e",
|
|
52
|
+
"@aztec/noir-noirc_abi": "0.0.1-commit.e57c76e",
|
|
53
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.e57c76e",
|
|
54
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.e57c76e",
|
|
55
|
+
"@aztec/p2p": "0.0.1-commit.e57c76e",
|
|
56
|
+
"@aztec/protocol-contracts": "0.0.1-commit.e57c76e",
|
|
57
|
+
"@aztec/prover-client": "0.0.1-commit.e57c76e",
|
|
58
|
+
"@aztec/prover-node": "0.0.1-commit.e57c76e",
|
|
59
|
+
"@aztec/pxe": "0.0.1-commit.e57c76e",
|
|
60
|
+
"@aztec/sequencer-client": "0.0.1-commit.e57c76e",
|
|
61
|
+
"@aztec/simulator": "0.0.1-commit.e57c76e",
|
|
62
|
+
"@aztec/slasher": "0.0.1-commit.e57c76e",
|
|
63
|
+
"@aztec/standard-contracts": "0.0.1-commit.e57c76e",
|
|
64
|
+
"@aztec/stdlib": "0.0.1-commit.e57c76e",
|
|
65
|
+
"@aztec/telemetry-client": "0.0.1-commit.e57c76e",
|
|
66
|
+
"@aztec/validator-client": "0.0.1-commit.e57c76e",
|
|
67
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.e57c76e",
|
|
68
|
+
"@aztec/wallet-sdk": "0.0.1-commit.e57c76e",
|
|
69
|
+
"@aztec/wallets": "0.0.1-commit.e57c76e",
|
|
70
|
+
"@aztec/world-state": "0.0.1-commit.e57c76e",
|
|
66
71
|
"@iarna/toml": "^2.2.5",
|
|
67
72
|
"@jest/globals": "^30.0.0",
|
|
68
73
|
"@noble/curves": "=1.0.0",
|
|
@@ -74,7 +79,6 @@
|
|
|
74
79
|
"@types/koa-static": "^4.0.2",
|
|
75
80
|
"@types/lodash.every": "^4.6.7",
|
|
76
81
|
"@types/node": "^22.15.17",
|
|
77
|
-
"@viem/anvil": "^0.0.9",
|
|
78
82
|
"buffer": "^6.0.3",
|
|
79
83
|
"crypto-browserify": "^3.12.1",
|
|
80
84
|
"fs-extra": "^11.2.0",
|
|
@@ -90,6 +94,7 @@
|
|
|
90
94
|
"lodash.every": "^4.6.0",
|
|
91
95
|
"lodash.omit": "^4.5.0",
|
|
92
96
|
"msgpackr": "^1.11.2",
|
|
97
|
+
"pg": "^8.17.1",
|
|
93
98
|
"process": "^0.11.10",
|
|
94
99
|
"snappy": "^7.2.2",
|
|
95
100
|
"stream-browserify": "^3.0.0",
|
|
@@ -100,7 +105,7 @@
|
|
|
100
105
|
"typescript": "^5.3.3",
|
|
101
106
|
"util": "^0.12.5",
|
|
102
107
|
"viem": "npm:@aztec/viem@2.38.2",
|
|
103
|
-
"zod": "^
|
|
108
|
+
"zod": "^4"
|
|
104
109
|
},
|
|
105
110
|
"devDependencies": {
|
|
106
111
|
"0x": "^5.7.0",
|
|
@@ -108,6 +113,7 @@
|
|
|
108
113
|
"@types/jest": "^30.0.0",
|
|
109
114
|
"@types/js-yaml": "^4.0.9",
|
|
110
115
|
"@types/lodash.chunk": "^4.2.9",
|
|
116
|
+
"@types/pg": "^8",
|
|
111
117
|
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
112
118
|
"concurrently": "^7.6.0",
|
|
113
119
|
"jest": "^30.0.0",
|
|
@@ -157,6 +163,7 @@
|
|
|
157
163
|
"moduleNameMapper": {
|
|
158
164
|
"^(\\.{1,2}/.*)\\.[cm]?js$": "$1"
|
|
159
165
|
},
|
|
166
|
+
"resolver": "<rootDir>/legacy-jest-resolver.cjs",
|
|
160
167
|
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
|
|
161
168
|
"rootDir": "./src",
|
|
162
169
|
"testTimeout": 120000,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
type ProfileInteractionOptions,
|
|
6
6
|
} from '@aztec/aztec.js/contracts';
|
|
7
7
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
8
|
+
import { MAX_APPS_PER_KERNEL } from '@aztec/constants';
|
|
8
9
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
10
|
import { type PrivateExecutionStep, serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
|
|
10
11
|
import type {
|
|
@@ -320,6 +321,24 @@ export function convertProfileToGHBenchmark(benchmark: ClientFlowBenchmark): Git
|
|
|
320
321
|
return benches;
|
|
321
322
|
}
|
|
322
323
|
|
|
324
|
+
/**
|
|
325
|
+
* Computes the expected number of `PrivateExecutionStep` entries the orchestrator will produce
|
|
326
|
+
* for a tx with `apps` private function calls.
|
|
327
|
+
*
|
|
328
|
+
* Step layout: `apps` app circuits + kernel iterations + 1 final reset + 1 tail + 1 hiding kernel.
|
|
329
|
+
* Each kernel iteration absorbs up to `MAX_APPS_PER_KERNEL` apps via the `init_K` / `inner_K`
|
|
330
|
+
* variants, so the kernel count is `ceil(apps / MAX_APPS_PER_KERNEL)`.
|
|
331
|
+
*
|
|
332
|
+
* Caveat: this assumes no mid-flow reset is triggered, which would split a batch into two kernels
|
|
333
|
+
* separated by a reset. For the flows currently exercised in this benchmark suite that holds, but
|
|
334
|
+
* a future flow that grows large enough to overflow per-tx limits before consuming all apps will
|
|
335
|
+
* not match this formula.
|
|
336
|
+
*/
|
|
337
|
+
export function expectedExecutionSteps(apps: number): number {
|
|
338
|
+
const kernels = Math.ceil(apps / MAX_APPS_PER_KERNEL);
|
|
339
|
+
return apps + kernels + 1 /* final reset */ + 1 /* tail */ + 1 /* hiding */;
|
|
340
|
+
}
|
|
341
|
+
|
|
323
342
|
export async function captureProfile(
|
|
324
343
|
label: string,
|
|
325
344
|
interaction: ContractFunctionInteraction | DeployMethod,
|