@aztec/cli-wallet 0.86.0 → 0.87.0
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/dest/bin/index.js +7 -9
- package/dest/cmds/create_account.d.ts +1 -1
- package/dest/cmds/create_account.d.ts.map +1 -1
- package/dest/cmds/create_account.js +25 -15
- package/dest/cmds/deploy.d.ts +1 -1
- package/dest/cmds/deploy.d.ts.map +1 -1
- package/dest/cmds/deploy.js +7 -2
- package/dest/cmds/deploy_account.d.ts +1 -1
- package/dest/cmds/deploy_account.d.ts.map +1 -1
- package/dest/cmds/deploy_account.js +26 -17
- package/dest/cmds/index.d.ts.map +1 -1
- package/dest/cmds/index.js +34 -32
- package/dest/cmds/profile.d.ts +2 -1
- package/dest/cmds/profile.d.ts.map +1 -1
- package/dest/cmds/profile.js +7 -17
- package/dest/cmds/register_contract.d.ts +1 -1
- package/dest/cmds/register_contract.d.ts.map +1 -1
- package/dest/cmds/send.d.ts +1 -1
- package/dest/cmds/send.d.ts.map +1 -1
- package/dest/cmds/send.js +7 -2
- package/dest/cmds/simulate.d.ts +2 -1
- package/dest/cmds/simulate.d.ts.map +1 -1
- package/dest/cmds/simulate.js +10 -4
- package/dest/storage/wallet_db.d.ts +1 -3
- package/dest/storage/wallet_db.d.ts.map +1 -1
- package/dest/storage/wallet_db.js +1 -1
- package/dest/utils/accounts.d.ts +1 -1
- package/dest/utils/accounts.d.ts.map +1 -1
- package/dest/utils/ecdsa.d.ts +0 -2
- package/dest/utils/ecdsa.d.ts.map +1 -1
- package/dest/utils/options/fees.d.ts.map +1 -1
- package/dest/utils/options/fees.js +1 -1
- package/dest/utils/options/options.d.ts +1 -0
- package/dest/utils/options/options.d.ts.map +1 -1
- package/dest/utils/options/options.js +6 -3
- package/dest/utils/profiling.d.ts +5 -0
- package/dest/utils/profiling.d.ts.map +1 -0
- package/dest/utils/profiling.js +32 -0
- package/dest/utils/pxe_wrapper.d.ts +3 -2
- package/dest/utils/pxe_wrapper.d.ts.map +1 -1
- package/dest/utils/pxe_wrapper.js +7 -3
- package/package.json +15 -15
- package/src/bin/index.ts +7 -9
- package/src/cmds/create_account.ts +24 -14
- package/src/cmds/deploy.ts +8 -1
- package/src/cmds/deploy_account.ts +26 -16
- package/src/cmds/index.ts +98 -69
- package/src/cmds/profile.ts +10 -25
- package/src/cmds/register_contract.ts +1 -1
- package/src/cmds/send.ts +8 -1
- package/src/cmds/simulate.ts +14 -2
- package/src/storage/wallet_db.ts +1 -1
- package/src/utils/accounts.ts +1 -1
- package/src/utils/options/fees.ts +25 -16
- package/src/utils/options/options.ts +10 -3
- package/src/utils/profiling.ts +87 -0
- package/src/utils/pxe_wrapper.ts +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulate.d.ts","sourceRoot":"","sources":["../../src/cmds/simulate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,WAAW,EAAE,KAAK,YAAY,EAAY,MAAM,iBAAiB,CAAC;AAE5G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,aAAa,EAAE,WAAW,EAAE,EAC5B,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"simulate.d.ts","sourceRoot":"","sources":["../../src/cmds/simulate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAE,WAAW,EAAE,KAAK,YAAY,EAAY,MAAM,iBAAiB,CAAC;AAE5G,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,0BAA0B,EAClC,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,GAAG,EAAE,EACrB,oBAAoB,EAAE,MAAM,EAC5B,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,QAAQ,EACjB,aAAa,EAAE,WAAW,EAAE,EAC5B,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,KAAK,iBAeX"}
|
package/dest/cmds/simulate.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { Contract } from '@aztec/aztec.js';
|
|
2
2
|
import { prepTx } from '@aztec/cli/utils';
|
|
3
3
|
import { format } from 'util';
|
|
4
|
-
|
|
4
|
+
import { printProfileResult } from '../utils/profiling.js';
|
|
5
|
+
export async function simulate(wallet, functionName, functionArgsIn, contractArtifactPath, contractAddress, feeOpts, authWitnesses, verbose, log) {
|
|
5
6
|
const { functionArgs, contractArtifact } = await prepTx(contractArtifactPath, functionName, functionArgsIn, log);
|
|
6
7
|
const contract = await Contract.at(contractAddress, contractArtifact, wallet);
|
|
7
8
|
const call = contract.methods[functionName](...functionArgs);
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const simulationResult = await call.simulate({
|
|
10
|
+
...await feeOpts.toSendOpts(wallet),
|
|
11
|
+
authWitnesses,
|
|
12
|
+
includeMetadata: true
|
|
10
13
|
});
|
|
11
|
-
|
|
14
|
+
if (verbose) {
|
|
15
|
+
printProfileResult(simulationResult.meta.timings, log);
|
|
16
|
+
}
|
|
17
|
+
log(format('\nSimulation result: ', simulationResult.result, '\n'));
|
|
12
18
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
5
3
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
@@ -53,7 +51,7 @@ export declare class WalletDB {
|
|
|
53
51
|
value: string;
|
|
54
52
|
}[]>;
|
|
55
53
|
storeAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string, metadata: Buffer): Promise<void>;
|
|
56
|
-
retrieveAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string): Promise<Buffer
|
|
54
|
+
retrieveAccountMetadata(aliasOrAddress: AztecAddress | string, metadataKey: string): Promise<Buffer<ArrayBufferLike>>;
|
|
57
55
|
retrieveAccount(address: AztecAddress | string): Promise<{
|
|
58
56
|
address: string | AztecAddress;
|
|
59
57
|
secretKey: Fr;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet_db.d.ts","sourceRoot":"","sources":["../../src/storage/wallet_db.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wallet_db.d.ts","sourceRoot":"","sources":["../../src/storage/wallet_db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,eAAO,MAAM,OAAO,wFAAyF,CAAC;AAC9G,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,qBAAa,QAAQ;;IAMnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAW;IAElC,OAAO,CAAC,UAAU,CAA6B;IAE/C,MAAM,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,GAAG,EAAE,MAAM;IAcnC,aAAa,CAAC,GAAG,EAAE,MAAM;IAazB,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS;;;;IAa5B,oBAAoB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAKjG,uBAAuB,CAAC,cAAc,EAAE,YAAY,GAAG,MAAM,EAAE,WAAW,EAAE,MAAM;IASlF,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM;;;;;;IAW9C,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK;CAOzE"}
|
package/dest/utils/accounts.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
|
5
5
|
import type { WalletDB } from '../storage/wallet_db.js';
|
|
6
6
|
export declare const AccountTypes: readonly ["schnorr", "ecdsasecp256r1", "ecdsasecp256r1ssh", "ecdsasecp256k1"];
|
|
7
7
|
export type AccountType = (typeof AccountTypes)[number];
|
|
8
|
-
export declare function createOrRetrieveAccount(pxe: PXE, address?: AztecAddress, db?: WalletDB, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string
|
|
8
|
+
export declare function createOrRetrieveAccount(pxe: PXE, address?: AztecAddress, db?: WalletDB, secretKey?: Fr, type?: AccountType, salt?: Fr, publicKey?: string): Promise<AccountManager>;
|
|
9
9
|
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/utils/accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC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1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../src/utils/ecdsa.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ecdsa.d.ts","sourceRoot":"","sources":["../../src/utils/ecdsa.ts"],"names":[],"mappings":"AAAA,wBAAgB,qCAAqC,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAcrF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../../../src/utils/options/fees.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EACrB,KAAK,GAAG,EACR,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAO,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAI3D,MAAM,MAAM,UAAU,GAAG;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,WAAW,QAAQ;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9D,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC3E;AAED,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
93
93
|
new Option('--max-fees-per-gas <da=100,l2=100>', 'Maximum fees per gas unit for DA and L2 computation.'),
|
|
94
94
|
new Option('--max-priority-fees-per-gas <da=0,l2=0>', 'Maximum priority fees per gas unit for DA and L2 computation.'),
|
|
95
|
-
new Option('--
|
|
95
|
+
new Option('--estimate-gas', 'Whether to automatically estimate gas limits for the tx.'),
|
|
96
96
|
new Option('--estimate-gas-only', 'Only report gas estimation for the tx, do not send it.')
|
|
97
97
|
];
|
|
98
98
|
}
|
|
@@ -15,6 +15,7 @@ export declare function createTypeOption(mandatory: boolean): Option;
|
|
|
15
15
|
export declare function createArgsOption(isConstructor: boolean, db?: WalletDB): Option;
|
|
16
16
|
export declare function createContractAddressOption(db?: WalletDB): Option;
|
|
17
17
|
export declare function createDebugExecutionStepsDirOption(): Option;
|
|
18
|
+
export declare function createVerboseOption(): Option;
|
|
18
19
|
export declare function artifactPathParser(filePath: string, db?: WalletDB): Promise<string>;
|
|
19
20
|
export declare function artifactPathFromPromiseOrAlias(artifactPathPromise: Promise<string>, contractAddress: AztecAddress, db?: WalletDB): Promise<string>;
|
|
20
21
|
export declare function createArtifactOption(db?: WalletDB): Option;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/utils/options/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAKtE,eAAO,MAAM,oBAAoB,wKACsI,CAAC;AAExK,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,GAAG,SAA0B,EAC7B,GAAG,SAA0B,UAU9B;AAED,wBAAgB,mBAAmB,C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,EAAE,CAAC,EAAE,QAAQ,UAQrE;AAED,wBAAgB,2BAA2B,CAAC,EAAE,CAAC,EAAE,QAAQ,UAIxD;AAED,wBAAgB,kCAAkC,WAKjD;AAED,wBAAgB,mBAAmB,WAKlC;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,QAAQ,mBAajE;AAED,wBAAsB,8BAA8B,CAClD,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,EACpC,eAAe,EAAE,YAAY,EAC7B,EAAE,CAAC,EAAE,QAAQ,mBAWd;AAED,wBAAgB,oBAAoB,CAAC,EAAE,CAAC,EAAE,QAAQ,UAIjD;AA6BD,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,WAAW,EAAE,GAAG,SAAS,GAAG,WAAW,EAAE,CAE5F"}
|
|
@@ -18,7 +18,7 @@ export function integerArgParser(value, argName, min = Number.MIN_SAFE_INTEGER,
|
|
|
18
18
|
export function aliasedTxHashParser(txHash, db) {
|
|
19
19
|
try {
|
|
20
20
|
return parseTxHash(txHash);
|
|
21
|
-
} catch
|
|
21
|
+
} catch {
|
|
22
22
|
const prefixed = txHash.includes(':') ? txHash : `transactions:${txHash}`;
|
|
23
23
|
const rawTxHash = db ? db.tryRetrieveAlias(prefixed) : txHash;
|
|
24
24
|
return parseTxHash(rawTxHash);
|
|
@@ -28,7 +28,7 @@ export function aliasedAuthWitParser(witnesses, db) {
|
|
|
28
28
|
const parsedWitnesses = witnesses.split(',').map((witness)=>{
|
|
29
29
|
try {
|
|
30
30
|
return AuthWitness.fromString(witness);
|
|
31
|
-
} catch
|
|
31
|
+
} catch {
|
|
32
32
|
const prefixed = witness.includes(':') ? witness : `authwits:${witness}`;
|
|
33
33
|
const rawAuthWitness = db ? db.tryRetrieveAlias(prefixed) : witness;
|
|
34
34
|
return AuthWitness.fromString(rawAuthWitness);
|
|
@@ -79,6 +79,9 @@ export function createContractAddressOption(db) {
|
|
|
79
79
|
export function createDebugExecutionStepsDirOption() {
|
|
80
80
|
return new Option('--debug-execution-steps-dir <address>', 'Directory to write execution step artifacts for bb profiling/debugging.').makeOptionMandatory(false);
|
|
81
81
|
}
|
|
82
|
+
export function createVerboseOption() {
|
|
83
|
+
return new Option('-v, --verbose', 'Provide timings on all executed operations (synching, simulating, proving)').default(false);
|
|
84
|
+
}
|
|
82
85
|
export function artifactPathParser(filePath, db) {
|
|
83
86
|
if (filePath.includes('@')) {
|
|
84
87
|
const [pkg, contractName] = filePath.split('@');
|
|
@@ -108,7 +111,7 @@ async function contractArtifactFromWorkspace(pkg, contractName) {
|
|
|
108
111
|
const cwd = process.cwd();
|
|
109
112
|
try {
|
|
110
113
|
await stat(`${cwd}/Nargo.toml`);
|
|
111
|
-
} catch
|
|
114
|
+
} catch {
|
|
112
115
|
throw new Error('Invalid contract artifact argument provided. To use this option, command should be called from a nargo workspace');
|
|
113
116
|
}
|
|
114
117
|
const filesInTarget = await readdir(`${cwd}/${TARGET_DIR}`);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
import type { PrivateExecutionStep } from '@aztec/stdlib/kernel';
|
|
3
|
+
import type { ProvingTimings, SimulationTimings } from '@aztec/stdlib/tx';
|
|
4
|
+
export declare function printProfileResult(timings: ProvingTimings | SimulationTimings, log: LogFn, executionSteps?: PrivateExecutionStep[]): void;
|
|
5
|
+
//# sourceMappingURL=profiling.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiling.d.ts","sourceRoot":"","sources":["../../src/utils/profiling.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1E,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,cAAc,GAAG,iBAAiB,EAC3C,GAAG,EAAE,KAAK,EACV,cAAc,CAAC,EAAE,oBAAoB,EAAE,QA6ExC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { format } from 'util';
|
|
2
|
+
export function printProfileResult(timings, log, executionSteps) {
|
|
3
|
+
log(format('\nPer circuit breakdown:\n'));
|
|
4
|
+
log(format(' ', 'Function name'.padEnd(50), 'Time'.padStart(13).padEnd(15), executionSteps ? 'Gates'.padStart(13).padEnd(15) : '', executionSteps ? 'Subtotal'.padStart(13).padEnd(15) : ''));
|
|
5
|
+
log(format(''.padEnd(50 + 15 + 15 + (executionSteps ? 15 + 15 : 0), '-')));
|
|
6
|
+
let acc = 0;
|
|
7
|
+
let biggest = executionSteps?.[0];
|
|
8
|
+
timings.perFunction.forEach((fn, i)=>{
|
|
9
|
+
const currentExecutionStep = executionSteps?.[i];
|
|
10
|
+
if (currentExecutionStep && biggest && currentExecutionStep.gateCount > biggest.gateCount) {
|
|
11
|
+
biggest = currentExecutionStep;
|
|
12
|
+
}
|
|
13
|
+
acc += currentExecutionStep ? currentExecutionStep.gateCount : 0;
|
|
14
|
+
log(format(' ', fn.functionName.padEnd(50), `${fn.time.toFixed(2)}ms`.padStart(13).padEnd(15), currentExecutionStep ? currentExecutionStep.gateCount.toLocaleString().padStart(13).padEnd(15) : '', currentExecutionStep ? acc.toLocaleString().padStart(15) : ''));
|
|
15
|
+
});
|
|
16
|
+
if (biggest) {
|
|
17
|
+
log(format('\nTotal gates:', acc.toLocaleString(), `(Biggest circuit: ${biggest.functionName} -> ${biggest.gateCount.toLocaleString()})`));
|
|
18
|
+
}
|
|
19
|
+
log(format('\nSync time:'.padEnd(25), `${timings.sync?.toFixed(2)}ms`.padStart(16)));
|
|
20
|
+
log(format('Private simulation time:'.padEnd(25), `${timings.perFunction.reduce((acc, { time })=>acc + time, 0).toFixed(2)}ms`.padStart(15)));
|
|
21
|
+
if (timings.proving) {
|
|
22
|
+
log(format('Proving time:'.padEnd(25), `${timings.proving?.toFixed(2)}ms`.padStart(15)));
|
|
23
|
+
}
|
|
24
|
+
if (timings.publicSimulation) {
|
|
25
|
+
log(format('Public simulation time:'.padEnd(25), `${timings.publicSimulation?.toFixed(2)}ms`.padStart(15)));
|
|
26
|
+
}
|
|
27
|
+
if (timings.validation) {
|
|
28
|
+
log(format('Validation time:'.padEnd(25), `${timings.validation?.toFixed(2)}ms`.padStart(15)));
|
|
29
|
+
}
|
|
30
|
+
log(format('Total time:'.padEnd(25), `${timings.total.toFixed(2)}ms`.padStart(15), `(${timings.unaccounted.toFixed(2)}ms unaccounted)`));
|
|
31
|
+
log('\n');
|
|
32
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type PXEServiceConfig } from '@aztec/pxe/server';
|
|
2
2
|
import { type AztecNode, type PXE } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
export declare class PXEWrapper {
|
|
4
|
+
private static pxeConfig;
|
|
4
5
|
private static pxe;
|
|
5
6
|
private static node;
|
|
6
|
-
getPXE(): PXE
|
|
7
|
+
getPXE(): Promise<PXE>;
|
|
7
8
|
getNode(): AztecNode | undefined;
|
|
8
|
-
|
|
9
|
+
prepare(nodeUrl: string, dataDir: string, overridePXEServiceConfig?: Partial<PXEServiceConfig>): void;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=pxe_wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/pxe_wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAyC,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAyB,MAAM,iCAAiC,CAAC;AAMlG,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAkB;IACpC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAwB;
|
|
1
|
+
{"version":3,"file":"pxe_wrapper.d.ts","sourceRoot":"","sources":["../../src/utils/pxe_wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAyC,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAyB,MAAM,iCAAiC,CAAC;AAMlG,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAC,SAAS,CAA+B;IACvD,OAAO,CAAC,MAAM,CAAC,GAAG,CAAkB;IACpC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAwB;IAErC,MAAM;IAOZ,OAAO,IAAI,SAAS,GAAG,SAAS;IAIhC,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,wBAAwB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC;CAM/F"}
|
|
@@ -4,18 +4,22 @@ import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
|
4
4
|
* Wrapper class for PXE service, avoids initialization issues due to
|
|
5
5
|
* closures when providing PXE service to injected commander.js commands
|
|
6
6
|
*/ export class PXEWrapper {
|
|
7
|
+
static pxeConfig;
|
|
7
8
|
static pxe;
|
|
8
9
|
static node;
|
|
9
|
-
getPXE() {
|
|
10
|
+
async getPXE() {
|
|
11
|
+
if (!PXEWrapper.pxe) {
|
|
12
|
+
PXEWrapper.pxe = await createPXEService(PXEWrapper.node, PXEWrapper.pxeConfig);
|
|
13
|
+
}
|
|
10
14
|
return PXEWrapper.pxe;
|
|
11
15
|
}
|
|
12
16
|
getNode() {
|
|
13
17
|
return PXEWrapper.node;
|
|
14
18
|
}
|
|
15
|
-
|
|
19
|
+
prepare(nodeUrl, dataDir, overridePXEServiceConfig) {
|
|
16
20
|
PXEWrapper.node = createAztecNodeClient(nodeUrl);
|
|
17
21
|
const pxeConfig = Object.assign(getPXEServiceConfig(), overridePXEServiceConfig);
|
|
18
22
|
pxeConfig.dataDirectory = dataDir;
|
|
19
|
-
PXEWrapper.
|
|
23
|
+
PXEWrapper.pxeConfig = pxeConfig;
|
|
20
24
|
}
|
|
21
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/cli-wallet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/cmds/index.js",
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@aztec/accounts": "0.
|
|
67
|
-
"@aztec/aztec.js": "0.
|
|
68
|
-
"@aztec/cli": "0.
|
|
69
|
-
"@aztec/entrypoints": "0.
|
|
70
|
-
"@aztec/ethereum": "0.
|
|
71
|
-
"@aztec/foundation": "0.
|
|
72
|
-
"@aztec/kv-store": "0.
|
|
73
|
-
"@aztec/noir-contracts.js": "0.
|
|
74
|
-
"@aztec/noir-noirc_abi": "0.
|
|
75
|
-
"@aztec/pxe": "0.
|
|
76
|
-
"@aztec/stdlib": "0.
|
|
66
|
+
"@aztec/accounts": "0.87.0",
|
|
67
|
+
"@aztec/aztec.js": "0.87.0",
|
|
68
|
+
"@aztec/cli": "0.87.0",
|
|
69
|
+
"@aztec/entrypoints": "0.87.0",
|
|
70
|
+
"@aztec/ethereum": "0.87.0",
|
|
71
|
+
"@aztec/foundation": "0.87.0",
|
|
72
|
+
"@aztec/kv-store": "0.87.0",
|
|
73
|
+
"@aztec/noir-contracts.js": "0.87.0",
|
|
74
|
+
"@aztec/noir-noirc_abi": "0.87.0",
|
|
75
|
+
"@aztec/pxe": "0.87.0",
|
|
76
|
+
"@aztec/stdlib": "0.87.0",
|
|
77
77
|
"commander": "^12.1.0",
|
|
78
78
|
"inquirer": "^10.1.8",
|
|
79
79
|
"source-map-support": "^0.5.21",
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@jest/globals": "^29.5.0",
|
|
84
84
|
"@types/jest": "^29.5.0",
|
|
85
|
-
"@types/node": "^
|
|
85
|
+
"@types/node": "^22.15.17",
|
|
86
86
|
"@types/source-map-support": "^0.5.10",
|
|
87
87
|
"jest": "^29.5.0",
|
|
88
88
|
"jest-mock-extended": "^3.0.5",
|
|
89
89
|
"ts-jest": "^29.1.0",
|
|
90
90
|
"ts-node": "^10.9.1",
|
|
91
|
-
"typescript": "^5.
|
|
91
|
+
"typescript": "^5.3.3"
|
|
92
92
|
},
|
|
93
93
|
"files": [
|
|
94
94
|
"dest",
|
|
@@ -97,6 +97,6 @@
|
|
|
97
97
|
],
|
|
98
98
|
"types": "./dest/index.d.ts",
|
|
99
99
|
"engines": {
|
|
100
|
-
"node": ">=
|
|
100
|
+
"node": ">=20.10"
|
|
101
101
|
}
|
|
102
102
|
}
|
package/src/bin/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fr,
|
|
1
|
+
import { Fr, ProtocolContractAddress, computeSecretHash, fileURLToPath } from '@aztec/aztec.js';
|
|
2
2
|
import { LOCALHOST } from '@aztec/cli/cli-utils';
|
|
3
3
|
import { type LogFn, createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { openStoreAt } from '@aztec/kv-store/lmdb-v2';
|
|
@@ -55,7 +55,7 @@ function injectInternalCommands(program: Command, log: LogFn, db: WalletDB) {
|
|
|
55
55
|
const options = command.optsWithGlobals();
|
|
56
56
|
const { alias } = options;
|
|
57
57
|
const value = Fr.random();
|
|
58
|
-
const hash = computeSecretHash(value);
|
|
58
|
+
const hash = await computeSecretHash(value);
|
|
59
59
|
|
|
60
60
|
await db.storeAlias('secrets', alias, Buffer.from(value.toString()), log);
|
|
61
61
|
await db.storeAlias('secrets', `${alias}:hash`, Buffer.from(hash.toString()), log);
|
|
@@ -84,7 +84,7 @@ async function main() {
|
|
|
84
84
|
.default('native'),
|
|
85
85
|
)
|
|
86
86
|
.addOption(
|
|
87
|
-
new Option('--remote-pxe', 'Connect to an external PXE RPC server
|
|
87
|
+
new Option('--remote-pxe', 'Connect to an external PXE RPC server instead of the local one')
|
|
88
88
|
.env('REMOTE_PXE')
|
|
89
89
|
.default(false)
|
|
90
90
|
.conflicts('rpc-url'),
|
|
@@ -95,7 +95,7 @@ async function main() {
|
|
|
95
95
|
.default(`http://${LOCALHOST}:8080`),
|
|
96
96
|
)
|
|
97
97
|
.hook('preSubcommand', async command => {
|
|
98
|
-
const { dataDir, remotePxe, nodeUrl, prover
|
|
98
|
+
const { dataDir, remotePxe, nodeUrl, prover } = command.optsWithGlobals();
|
|
99
99
|
|
|
100
100
|
if (!remotePxe) {
|
|
101
101
|
debugLogger.info('Using local PXE service');
|
|
@@ -115,19 +115,17 @@ async function main() {
|
|
|
115
115
|
bbWorkingDirectory: prover === 'native' ? bbWorkingDirectory : undefined,
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
pxeWrapper.prepare(nodeUrl, join(dataDir, 'pxe'), overridePXEConfig);
|
|
119
119
|
}
|
|
120
120
|
await db.init(await openStoreAt(dataDir));
|
|
121
121
|
let protocolContractsRegistered;
|
|
122
122
|
try {
|
|
123
|
-
protocolContractsRegistered = !!(await db.retrieveAlias('contracts:
|
|
123
|
+
protocolContractsRegistered = !!(await db.retrieveAlias('contracts:ContractClassRegisterer'));
|
|
124
124
|
// eslint-disable-next-line no-empty
|
|
125
125
|
} catch {}
|
|
126
126
|
if (!protocolContractsRegistered) {
|
|
127
127
|
userLog('Registering protocol contract aliases...');
|
|
128
|
-
const
|
|
129
|
-
const { protocolContractAddresses } = await client.getPXEInfo();
|
|
130
|
-
for (const [name, address] of Object.entries(protocolContractAddresses)) {
|
|
128
|
+
for (const [name, address] of Object.entries(ProtocolContractAddress)) {
|
|
131
129
|
await db.storeAlias('contracts', name, Buffer.from(address.toString()), userLog);
|
|
132
130
|
await db.storeAlias(
|
|
133
131
|
'artifacts',
|
|
@@ -5,6 +5,7 @@ import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
|
5
5
|
|
|
6
6
|
import { type AccountType, createOrRetrieveAccount } from '../utils/accounts.js';
|
|
7
7
|
import { type IFeeOpts, printGasEstimates } from '../utils/options/fees.js';
|
|
8
|
+
import { printProfileResult } from '../utils/profiling.js';
|
|
8
9
|
|
|
9
10
|
export async function createAccount(
|
|
10
11
|
client: PXE,
|
|
@@ -18,6 +19,7 @@ export async function createAccount(
|
|
|
18
19
|
wait: boolean,
|
|
19
20
|
feeOpts: IFeeOpts,
|
|
20
21
|
json: boolean,
|
|
22
|
+
verbose: boolean,
|
|
21
23
|
debugLogger: Logger,
|
|
22
24
|
log: LogFn,
|
|
23
25
|
) {
|
|
@@ -71,20 +73,23 @@ export async function createAccount(
|
|
|
71
73
|
skipInitialization: skipInitialization,
|
|
72
74
|
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
73
75
|
};
|
|
76
|
+
/*
|
|
77
|
+
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
78
|
+
* level method to get gas and timings. That means we have to replicate some of the logic here.
|
|
79
|
+
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
80
|
+
* wrapping it in the one that will make use of the freshly deployed account's
|
|
81
|
+
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
82
|
+
* Also, salt and universalDeploy have to be explicitly provided
|
|
83
|
+
*/
|
|
84
|
+
deployOpts.fee =
|
|
85
|
+
!deployOpts?.deployWallet && deployOpts?.fee
|
|
86
|
+
? { ...deployOpts.fee, paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod) }
|
|
87
|
+
: deployOpts?.fee;
|
|
88
|
+
|
|
89
|
+
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
90
|
+
|
|
74
91
|
if (feeOpts.estimateOnly) {
|
|
75
|
-
|
|
76
|
-
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
77
|
-
* level method to get the gas estimates. That means we have to replicate some of the logic here.
|
|
78
|
-
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
79
|
-
* wrapping it in the one that will make use of the freshly deployed account's
|
|
80
|
-
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
81
|
-
*/
|
|
82
|
-
const fee =
|
|
83
|
-
!deployOpts?.deployWallet && deployOpts?.fee
|
|
84
|
-
? { ...deployOpts.fee, paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod) }
|
|
85
|
-
: deployOpts?.fee;
|
|
86
|
-
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
87
|
-
const gas = await deployMethod.estimateGas({ ...deployOpts, fee, universalDeploy: true });
|
|
92
|
+
const gas = await deployMethod.estimateGas({ ...deployOpts, universalDeploy: true, contractAddressSalt: salt });
|
|
88
93
|
if (json) {
|
|
89
94
|
out.fee = {
|
|
90
95
|
gasLimits: {
|
|
@@ -100,7 +105,12 @@ export async function createAccount(
|
|
|
100
105
|
printGasEstimates(feeOpts, gas, log);
|
|
101
106
|
}
|
|
102
107
|
} else {
|
|
103
|
-
|
|
108
|
+
const provenTx = await deployMethod.prove({ ...deployOpts, universalDeploy: true, contractAddressSalt: salt });
|
|
109
|
+
if (verbose) {
|
|
110
|
+
printProfileResult(provenTx.timings!, log);
|
|
111
|
+
}
|
|
112
|
+
tx = provenTx.send();
|
|
113
|
+
|
|
104
114
|
const txHash = await tx.getTxHash();
|
|
105
115
|
debugLogger.debug(`Account contract tx sent with hash ${txHash}`);
|
|
106
116
|
out.txHash = txHash;
|
package/src/cmds/deploy.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { getAllFunctionAbis, getInitializer } from '@aztec/stdlib/abi';
|
|
|
5
5
|
import { PublicKeys } from '@aztec/stdlib/keys';
|
|
6
6
|
|
|
7
7
|
import { type IFeeOpts, printGasEstimates } from '../utils/options/fees.js';
|
|
8
|
+
import { printProfileResult } from '../utils/profiling.js';
|
|
8
9
|
|
|
9
10
|
export async function deploy(
|
|
10
11
|
wallet: AccountWalletWithSecretKey,
|
|
@@ -20,6 +21,7 @@ export async function deploy(
|
|
|
20
21
|
universalDeploy: boolean | undefined,
|
|
21
22
|
wait: boolean,
|
|
22
23
|
feeOpts: IFeeOpts,
|
|
24
|
+
verbose: boolean,
|
|
23
25
|
debugLogger: Logger,
|
|
24
26
|
log: LogFn,
|
|
25
27
|
logJson: (output: any) => void,
|
|
@@ -59,7 +61,12 @@ export async function deploy(
|
|
|
59
61
|
return;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
const
|
|
64
|
+
const provenTx = await deploy.prove(deployOpts);
|
|
65
|
+
if (verbose) {
|
|
66
|
+
printProfileResult(provenTx.timings!, log);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const tx = provenTx.send();
|
|
63
70
|
|
|
64
71
|
const txHash = await tx.getTxHash();
|
|
65
72
|
debugLogger.debug(`Deploy tx sent with hash ${txHash}`);
|
|
@@ -3,13 +3,16 @@ import { prettyPrintJSON } from '@aztec/cli/cli-utils';
|
|
|
3
3
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
4
4
|
|
|
5
5
|
import { type IFeeOpts, printGasEstimates } from '../utils/options/fees.js';
|
|
6
|
+
import { printProfileResult } from '../utils/profiling.js';
|
|
6
7
|
|
|
7
8
|
export async function deployAccount(
|
|
8
9
|
account: AccountManager,
|
|
9
10
|
wait: boolean,
|
|
10
11
|
registerClass: boolean,
|
|
12
|
+
publicDeploy: boolean,
|
|
11
13
|
feeOpts: IFeeOpts,
|
|
12
14
|
json: boolean,
|
|
15
|
+
verbose: boolean,
|
|
13
16
|
debugLogger: Logger,
|
|
14
17
|
log: LogFn,
|
|
15
18
|
) {
|
|
@@ -42,26 +45,28 @@ export async function deployAccount(
|
|
|
42
45
|
let txReceipt;
|
|
43
46
|
|
|
44
47
|
const deployOpts: DeployAccountOptions = {
|
|
45
|
-
|
|
46
|
-
skipPublicDeployment: false,
|
|
48
|
+
skipPublicDeployment: !publicDeploy,
|
|
47
49
|
skipClassRegistration: !registerClass,
|
|
48
50
|
...(await feeOpts.toDeployAccountOpts(wallet)),
|
|
49
51
|
};
|
|
50
52
|
|
|
53
|
+
/*
|
|
54
|
+
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
55
|
+
* level method to get gas and timings. That means we have to replicate some of the logic here.
|
|
56
|
+
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
57
|
+
* wrapping it in the one that will make use of the freshly deployed account's
|
|
58
|
+
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
59
|
+
* Also, salt and universalDeploy have to be explicitly provided
|
|
60
|
+
*/
|
|
61
|
+
deployOpts.fee =
|
|
62
|
+
!deployOpts?.deployWallet && deployOpts?.fee
|
|
63
|
+
? { ...deployOpts.fee, paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod) }
|
|
64
|
+
: deployOpts?.fee;
|
|
65
|
+
|
|
66
|
+
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
67
|
+
|
|
51
68
|
if (feeOpts.estimateOnly) {
|
|
52
|
-
|
|
53
|
-
* This is usually handled by accountManager.deploy(), but we're accessing the lower
|
|
54
|
-
* level method to get the gas estimates. That means we have to replicate some of the logic here.
|
|
55
|
-
* In case we're deploying our own account, we need to hijack the payment method for the fee,
|
|
56
|
-
* wrapping it in the one that will make use of the freshly deployed account's
|
|
57
|
-
* entrypoint. For reference, see aztec.js/src/account_manager.ts:deploy()
|
|
58
|
-
*/
|
|
59
|
-
const fee =
|
|
60
|
-
!deployOpts?.deployWallet && deployOpts?.fee
|
|
61
|
-
? { ...deployOpts.fee, paymentMethod: await account.getSelfPaymentMethod(deployOpts.fee.paymentMethod) }
|
|
62
|
-
: deployOpts?.fee;
|
|
63
|
-
const deployMethod = await account.getDeployMethod(deployOpts.deployWallet);
|
|
64
|
-
const gas = await deployMethod.estimateGas({ ...deployOpts, fee, universalDeploy: true });
|
|
69
|
+
const gas = await deployMethod.estimateGas({ ...deployOpts, universalDeploy: true, contractAddressSalt: salt });
|
|
65
70
|
if (json) {
|
|
66
71
|
out.fee = {
|
|
67
72
|
gasLimits: {
|
|
@@ -77,7 +82,12 @@ export async function deployAccount(
|
|
|
77
82
|
printGasEstimates(feeOpts, gas, log);
|
|
78
83
|
}
|
|
79
84
|
} else {
|
|
80
|
-
|
|
85
|
+
const provenTx = await deployMethod.prove({ ...deployOpts, universalDeploy: true, contractAddressSalt: salt });
|
|
86
|
+
if (verbose) {
|
|
87
|
+
printProfileResult(provenTx.timings!, log);
|
|
88
|
+
}
|
|
89
|
+
tx = provenTx.send();
|
|
90
|
+
|
|
81
91
|
const txHash = await tx.getTxHash();
|
|
82
92
|
debugLogger.debug(`Account contract tx sent with hash ${txHash}`);
|
|
83
93
|
out.txHash = txHash;
|