@aztec/end-to-end 0.87.4 → 0.87.5
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/bench/client_flows/client_flows_benchmark.d.ts +3 -5
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +14 -24
- package/dest/bench/client_flows/data_extractor.d.ts +21 -0
- package/dest/bench/client_flows/data_extractor.d.ts.map +1 -1
- package/dest/bench/client_flows/data_extractor.js +122 -5
- package/dest/bench/utils.d.ts +0 -7
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +2 -6
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -7
- package/dest/shared/capture_private_execution_steps.d.ts +7 -0
- package/dest/shared/capture_private_execution_steps.d.ts.map +1 -0
- package/dest/shared/capture_private_execution_steps.js +49 -0
- package/package.json +34 -34
- package/src/bench/client_flows/client_flows_benchmark.ts +10 -28
- package/src/bench/client_flows/data_extractor.ts +142 -8
- package/src/bench/utils.ts +1 -1
- package/src/e2e_p2p/shared.ts +2 -2
- package/src/fixtures/utils.ts +4 -7
- package/src/shared/capture_private_execution_steps.ts +68 -0
- package/dest/bench/client_flows/benchmark.d.ts +0 -59
- package/dest/bench/client_flows/benchmark.d.ts.map +0 -1
- package/dest/bench/client_flows/benchmark.js +0 -240
- package/src/bench/client_flows/benchmark.ts +0 -308
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AccountWallet,
|
|
1
|
+
import { type AccountWallet, AztecAddress, type AztecNode, FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, type FeePaymentMethod, type Logger, type PXE, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, type Wallet } from '@aztec/aztec.js';
|
|
2
2
|
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
3
3
|
import { type DeployL1ContractsArgs } from '@aztec/ethereum';
|
|
4
4
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -37,20 +37,18 @@ export declare class ClientFlowsBenchmark {
|
|
|
37
37
|
liquidityToken: TokenContract;
|
|
38
38
|
sponsoredFPC: SponsoredFPCContract;
|
|
39
39
|
userPXE: PXE;
|
|
40
|
-
realProofs: boolean;
|
|
41
40
|
paymentMethods: Record<BenchmarkingFeePaymentMethod, {
|
|
42
41
|
forWallet: FeePaymentMethodGetter;
|
|
43
42
|
circuits: number;
|
|
44
43
|
}>;
|
|
45
44
|
config: ClientFlowsConfig;
|
|
46
|
-
private proxyLogger;
|
|
47
45
|
constructor(testName?: string, setupOptions?: Partial<SetupOptions & DeployL1ContractsArgs>);
|
|
48
46
|
setup(): Promise<this>;
|
|
49
47
|
teardown(): Promise<void>;
|
|
50
48
|
mintAndBridgeFeeJuice(address: AztecAddress, amount: bigint): Promise<void>;
|
|
51
49
|
/** Admin mints bananaCoin tokens privately to the target address and redeems them. */
|
|
52
50
|
mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
|
|
53
|
-
createBenchmarkingAccountManager(
|
|
51
|
+
createBenchmarkingAccountManager(type: 'ecdsar1' | 'schnorr'): Promise<import("@aztec/aztec.js").AccountManager>;
|
|
54
52
|
applyBaseSnapshots(): Promise<void>;
|
|
55
53
|
applyInitialAccountsSnapshot(): Promise<void>;
|
|
56
54
|
applySetupFeeJuiceSnapshot(): Promise<void>;
|
|
@@ -59,7 +57,7 @@ export declare class ClientFlowsBenchmark {
|
|
|
59
57
|
applyFPCSetupSnapshot(): Promise<void>;
|
|
60
58
|
applyDeploySponsoredFPCSnapshot(): Promise<void>;
|
|
61
59
|
createCrossChainTestHarness(owner: AccountWallet): Promise<CrossChainTestHarness>;
|
|
62
|
-
createAndFundBenchmarkingWallet(accountType: AccountType): Promise<AccountWalletWithSecretKey>;
|
|
60
|
+
createAndFundBenchmarkingWallet(accountType: AccountType): Promise<import("@aztec/aztec.js").AccountWalletWithSecretKey>;
|
|
63
61
|
applyDeployAmmSnapshot(): Promise<void>;
|
|
64
62
|
getBridgedFeeJuicePaymentMethodForWallet(wallet: Wallet): Promise<FeeJuicePaymentMethodWithClaim>;
|
|
65
63
|
getPrivateFPCPaymentMethodForWallet(wallet: Wallet): Promise<PrivateFeePaymentMethod>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,
|
|
1
|
+
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,qBAAqB,EAA4D,MAAM,iBAAiB,CAAC;AACvH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAO5F,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,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hH;IAEG,MAAM,EAAE,iBAAiB,CAAC;gBAErB,QAAQ,CAAC,EAAE,MAAM,EAAE,YAAY,GAAE,OAAO,CAAC,YAAY,GAAG,qBAAqB,CAAM;IAWzF,KAAK;IAUL,QAAQ;IAKR,qBAAqB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM;IAMjE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IASxD,gCAAgC,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAmBrD,kBAAkB;IAKzB,4BAA4B;IAkC5B,0BAA0B;IAqB1B,8BAA8B;IAgB9B,gCAAgC;IAgBzB,qBAAqB;IAwB5B,+BAA+B;IAcxB,2BAA2B,CAAC,KAAK,EAAE,aAAa;IAwBhD,+BAA+B,CAAC,WAAW,EAAE,WAAW;IAmBxD,sBAAsB;IA0BtB,wCAAwC,CAAC,MAAM,EAAE,MAAM;IAQ7D,mCAAmC,CAAC,MAAM,EAAE,MAAM;IAIlD,qCAAqC,CAAC,OAAO,EAAE,MAAM;IAIrD,iCAAiC,CAAC,MAAM,EAAE,MAAM;CAGxD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EcdsaRAccountContractArtifact, getEcdsaRAccount } from '@aztec/accounts/ecdsa';
|
|
2
2
|
import { SchnorrAccountContractArtifact, getSchnorrAccount, getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
3
|
-
import {
|
|
3
|
+
import { FeeJuicePaymentMethod, FeeJuicePaymentMethodWithClaim, PrivateFeePaymentMethod, SponsoredFeePaymentMethod, createLogger } from '@aztec/aztec.js';
|
|
4
4
|
import { CheatCodes } from '@aztec/aztec.js/testing';
|
|
5
5
|
import { FEE_FUNDING_FOR_TESTER_ACCOUNT } from '@aztec/constants';
|
|
6
6
|
import { RollupContract, createExtendedL1Client, deployL1Contract } from '@aztec/ethereum';
|
|
@@ -25,7 +25,6 @@ import { mintTokensToPrivate } from '../../fixtures/token_utils.js';
|
|
|
25
25
|
import { setupSponsoredFPC } from '../../fixtures/utils.js';
|
|
26
26
|
import { CrossChainTestHarness } from '../../shared/cross_chain_test_harness.js';
|
|
27
27
|
import { FeeJuicePortalTestingHarnessFactory } from '../../shared/gas_portal_test_harness.js';
|
|
28
|
-
import { ProxyLogger } from './benchmark.js';
|
|
29
28
|
import { FULL_FLOWS_CONFIG, KEY_FLOWS_CONFIG } from './config.js';
|
|
30
29
|
const { E2E_DATA_PATH: dataPath, BENCHMARK_CONFIG } = process.env;
|
|
31
30
|
export class ClientFlowsBenchmark {
|
|
@@ -58,10 +57,6 @@ export class ClientFlowsBenchmark {
|
|
|
58
57
|
sponsoredFPC;
|
|
59
58
|
// PXE used by the benchmarking user. It can be set up with client-side proving enabled
|
|
60
59
|
userPXE;
|
|
61
|
-
realProofs = [
|
|
62
|
-
'true',
|
|
63
|
-
'1'
|
|
64
|
-
].includes(process.env.REAL_PROOFS ?? '');
|
|
65
60
|
paymentMethods = {
|
|
66
61
|
// eslint-disable-next-line camelcase
|
|
67
62
|
bridged_fee_juice: {
|
|
@@ -88,7 +83,6 @@ export class ClientFlowsBenchmark {
|
|
|
88
83
|
}
|
|
89
84
|
};
|
|
90
85
|
config;
|
|
91
|
-
proxyLogger;
|
|
92
86
|
constructor(testName, setupOptions = {}){
|
|
93
87
|
this.logger = createLogger(`bench:client_flows${testName ? `:${testName}` : ''}`);
|
|
94
88
|
this.snapshotManager = createSnapshotManager(`bench_client_flows${testName ? `/${testName}` : ''}`, dataPath, {
|
|
@@ -98,8 +92,6 @@ export class ClientFlowsBenchmark {
|
|
|
98
92
|
...setupOptions
|
|
99
93
|
});
|
|
100
94
|
this.config = BENCHMARK_CONFIG === 'key_flows' ? KEY_FLOWS_CONFIG : FULL_FLOWS_CONFIG;
|
|
101
|
-
ProxyLogger.create();
|
|
102
|
-
this.proxyLogger = ProxyLogger.getInstance();
|
|
103
95
|
}
|
|
104
96
|
async setup() {
|
|
105
97
|
const context = await this.snapshotManager.setup();
|
|
@@ -126,17 +118,17 @@ export class ClientFlowsBenchmark {
|
|
|
126
118
|
const balanceAfter = await this.bananaCoin.methods.balance_of_private(address).simulate();
|
|
127
119
|
expect(balanceAfter).toEqual(balanceBefore + amount);
|
|
128
120
|
}
|
|
129
|
-
async createBenchmarkingAccountManager(
|
|
121
|
+
async createBenchmarkingAccountManager(type) {
|
|
130
122
|
const benchysSecretKey = Fr.random();
|
|
131
123
|
const salt = Fr.random();
|
|
132
124
|
let benchysPrivateSigningKey;
|
|
133
125
|
let benchysAccountManager;
|
|
134
126
|
if (type === 'schnorr') {
|
|
135
127
|
benchysPrivateSigningKey = deriveSigningKey(benchysSecretKey);
|
|
136
|
-
benchysAccountManager = await getSchnorrAccount(
|
|
128
|
+
benchysAccountManager = await getSchnorrAccount(this.userPXE, benchysSecretKey, benchysPrivateSigningKey, salt);
|
|
137
129
|
} else if (type === 'ecdsar1') {
|
|
138
130
|
benchysPrivateSigningKey = randomBytes(32);
|
|
139
|
-
benchysAccountManager = await getEcdsaRAccount(
|
|
131
|
+
benchysAccountManager = await getEcdsaRAccount(this.userPXE, benchysSecretKey, benchysPrivateSigningKey, salt);
|
|
140
132
|
} else {
|
|
141
133
|
throw new Error(`Unknown account type: ${type}`);
|
|
142
134
|
}
|
|
@@ -163,14 +155,13 @@ export class ClientFlowsBenchmark {
|
|
|
163
155
|
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
164
156
|
const userPXEConfigWithContracts = {
|
|
165
157
|
...userPXEConfig,
|
|
166
|
-
proverEnabled:
|
|
158
|
+
proverEnabled: [
|
|
159
|
+
'true',
|
|
160
|
+
'1'
|
|
161
|
+
].includes(process.env.REAL_PROOFS ?? ''),
|
|
167
162
|
l1Contracts
|
|
168
163
|
};
|
|
169
|
-
this.userPXE = await createPXEService(this.aztecNode, userPXEConfigWithContracts,
|
|
170
|
-
loggers: {
|
|
171
|
-
prover: this.proxyLogger.createLogger('pxe:bb:wasm:bundle:proxied')
|
|
172
|
-
}
|
|
173
|
-
});
|
|
164
|
+
this.userPXE = await createPXEService(this.aztecNode, userPXEConfigWithContracts, 'pxe-user');
|
|
174
165
|
});
|
|
175
166
|
}
|
|
176
167
|
async applySetupFeeJuiceSnapshot() {
|
|
@@ -248,7 +239,7 @@ export class ClientFlowsBenchmark {
|
|
|
248
239
|
return crossChainTestHarness;
|
|
249
240
|
}
|
|
250
241
|
async createAndFundBenchmarkingWallet(accountType) {
|
|
251
|
-
const benchysAccountManager = await this.createBenchmarkingAccountManager(
|
|
242
|
+
const benchysAccountManager = await this.createBenchmarkingAccountManager(accountType);
|
|
252
243
|
const benchysWallet = await benchysAccountManager.getWallet();
|
|
253
244
|
const benchysAddress = benchysAccountManager.getAddress();
|
|
254
245
|
const claim = await this.feeJuiceBridgeTestHarness.prepareTokensOnL1(FEE_FUNDING_FOR_TESTER_ACCOUNT, benchysAddress);
|
|
@@ -258,14 +249,13 @@ export class ClientFlowsBenchmark {
|
|
|
258
249
|
paymentMethod
|
|
259
250
|
}
|
|
260
251
|
}).wait();
|
|
261
|
-
// Register benchy on
|
|
262
|
-
await this.
|
|
252
|
+
// Register benchy on admin's PXE so we can check its balances
|
|
253
|
+
await this.pxe.registerContract({
|
|
263
254
|
instance: benchysAccountManager.getInstance(),
|
|
264
255
|
artifact: accountType === 'ecdsar1' ? EcdsaRAccountContractArtifact : SchnorrAccountContractArtifact
|
|
265
256
|
});
|
|
266
|
-
await this.
|
|
267
|
-
|
|
268
|
-
return new AccountWalletWithSecretKey(this.userPXE, entrypoint, benchysWallet.getSecretKey(), benchysAccountManager.salt);
|
|
257
|
+
await this.pxe.registerAccount(benchysWallet.getSecretKey(), benchysWallet.getCompleteAddress().partialAddress);
|
|
258
|
+
return benchysWallet;
|
|
269
259
|
}
|
|
270
260
|
async applyDeployAmmSnapshot() {
|
|
271
261
|
await this.snapshotManager.snapshot('deploy_amm', async ()=>{
|
|
@@ -1,2 +1,23 @@
|
|
|
1
|
+
import type { Logger } from '@aztec/aztec.js';
|
|
2
|
+
declare const logLevel: readonly ["silent", "fatal", "error", "warn", "info", "verbose", "debug", "trace"];
|
|
3
|
+
type LogLevel = (typeof logLevel)[number];
|
|
4
|
+
type Log = {
|
|
5
|
+
type: LogLevel;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
prefix: string;
|
|
8
|
+
message: string;
|
|
9
|
+
data: any;
|
|
10
|
+
};
|
|
11
|
+
export declare class ProxyLogger {
|
|
12
|
+
private static instance;
|
|
13
|
+
private logs;
|
|
14
|
+
private constructor();
|
|
15
|
+
static create(): void;
|
|
16
|
+
static getInstance(): ProxyLogger;
|
|
17
|
+
createLogger(prefix: string): Logger;
|
|
18
|
+
private handleLog;
|
|
19
|
+
flushLogs(): void;
|
|
20
|
+
getLogs(): Log[];
|
|
21
|
+
}
|
|
1
22
|
export {};
|
|
2
23
|
//# sourceMappingURL=data_extractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_extractor.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/data_extractor.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"data_extractor.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/data_extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAa9C,QAAA,MAAM,QAAQ,oFAAqF,CAAC;AACpG,KAAK,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1C,KAAK,GAAG,GAAG;IACT,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,GAAG,CAAC;CACX,CAAC;AAsBF,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAc;IACrC,OAAO,CAAC,IAAI,CAAa;IAEzB,OAAO;IAEP,MAAM,CAAC,MAAM;IAIb,MAAM,CAAC,WAAW;IAIlB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAiBpC,OAAO,CAAC,SAAS;IAIV,SAAS;IAIT,OAAO;CAGf"}
|
|
@@ -4,9 +4,81 @@ import { createLogger, logger } from '@aztec/foundation/log';
|
|
|
4
4
|
import { Timer } from '@aztec/foundation/timer';
|
|
5
5
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
6
6
|
import { Decoder } from 'msgpackr';
|
|
7
|
+
import assert from 'node:assert';
|
|
7
8
|
import { readFile, readdir, writeFile } from 'node:fs/promises';
|
|
8
9
|
import { join } from 'node:path';
|
|
9
|
-
|
|
10
|
+
const logLevel = [
|
|
11
|
+
'silent',
|
|
12
|
+
'fatal',
|
|
13
|
+
'error',
|
|
14
|
+
'warn',
|
|
15
|
+
'info',
|
|
16
|
+
'verbose',
|
|
17
|
+
'debug',
|
|
18
|
+
'trace'
|
|
19
|
+
];
|
|
20
|
+
const GATE_TYPES = [
|
|
21
|
+
'ecc_op',
|
|
22
|
+
'busread',
|
|
23
|
+
'lookup',
|
|
24
|
+
'pub_inputs',
|
|
25
|
+
'arithmetic',
|
|
26
|
+
'delta_range',
|
|
27
|
+
'elliptic',
|
|
28
|
+
'aux',
|
|
29
|
+
'poseidon2_external',
|
|
30
|
+
'poseidon2_internal',
|
|
31
|
+
'overflow'
|
|
32
|
+
];
|
|
33
|
+
export class ProxyLogger {
|
|
34
|
+
static instance;
|
|
35
|
+
logs = [];
|
|
36
|
+
constructor(){}
|
|
37
|
+
static create() {
|
|
38
|
+
ProxyLogger.instance = new ProxyLogger();
|
|
39
|
+
}
|
|
40
|
+
static getInstance() {
|
|
41
|
+
return ProxyLogger.instance;
|
|
42
|
+
}
|
|
43
|
+
createLogger(prefix) {
|
|
44
|
+
return new Proxy(createLogger(prefix), {
|
|
45
|
+
get: (target, prop)=>{
|
|
46
|
+
if (logLevel.includes(prop)) {
|
|
47
|
+
return function(...data) {
|
|
48
|
+
const loggingFn = prop;
|
|
49
|
+
const args = [
|
|
50
|
+
loggingFn,
|
|
51
|
+
prefix,
|
|
52
|
+
...data
|
|
53
|
+
];
|
|
54
|
+
ProxyLogger.getInstance().handleLog(...args);
|
|
55
|
+
target[loggingFn].call(this, ...[
|
|
56
|
+
data[0],
|
|
57
|
+
data[1]
|
|
58
|
+
]);
|
|
59
|
+
};
|
|
60
|
+
} else {
|
|
61
|
+
return target[prop];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
handleLog(type, prefix, message, data) {
|
|
67
|
+
this.logs.unshift({
|
|
68
|
+
type,
|
|
69
|
+
prefix,
|
|
70
|
+
message,
|
|
71
|
+
data,
|
|
72
|
+
timestamp: Date.now()
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
flushLogs() {
|
|
76
|
+
this.logs = [];
|
|
77
|
+
}
|
|
78
|
+
getLogs() {
|
|
79
|
+
return this.logs;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
10
82
|
async function createProver(config = {}, log) {
|
|
11
83
|
const simulationProvider = new WASMSimulator();
|
|
12
84
|
if (!config.bbBinaryPath || !config.bbWorkingDirectory) {
|
|
@@ -25,6 +97,25 @@ async function createProver(config = {}, log) {
|
|
|
25
97
|
};
|
|
26
98
|
}
|
|
27
99
|
}
|
|
100
|
+
function getMinimumTrace(logs) {
|
|
101
|
+
const minimumMessage = 'Trace details:';
|
|
102
|
+
const minimumMessageIndex = logs.findIndex((log)=>log.message.includes(minimumMessage));
|
|
103
|
+
const candidateLogs = logs.slice(minimumMessageIndex - GATE_TYPES.length, minimumMessageIndex);
|
|
104
|
+
const traceLogs = candidateLogs.filter((log)=>GATE_TYPES.some((type)=>log.message.includes(type))).map((log)=>log.message.split(/\t|\n/)).flat().map((log)=>log.replace(/\(mem: .*\)/, '').trim()).filter(Boolean);
|
|
105
|
+
const traceSizes = traceLogs.map((log)=>{
|
|
106
|
+
const [gateType, gateSizeStr] = log.replace(/\n.*\)$/, '').replace(/bb - /, '').split(':').map((s)=>s.trim());
|
|
107
|
+
const gateSize = parseInt(gateSizeStr);
|
|
108
|
+
assert(GATE_TYPES.includes(gateType), `Gate type ${gateType} is not recognized`);
|
|
109
|
+
return {
|
|
110
|
+
[gateType]: gateSize
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
assert(traceSizes.length === GATE_TYPES.length, 'Decoded trace sizes do not match expected amount of gate types');
|
|
114
|
+
return traceSizes.reduce((acc, curr)=>({
|
|
115
|
+
...acc,
|
|
116
|
+
...curr
|
|
117
|
+
}), {});
|
|
118
|
+
}
|
|
28
119
|
async function main() {
|
|
29
120
|
ProxyLogger.create();
|
|
30
121
|
const proxyLogger = ProxyLogger.getInstance();
|
|
@@ -55,7 +146,7 @@ async function main() {
|
|
|
55
146
|
const profileFile = await readFile(join(ivcFolder, flow, 'profile.json'));
|
|
56
147
|
const profile = JSON.parse(profileFile.toString());
|
|
57
148
|
const privateExecutionSteps = profile.steps.map((step, i)=>({
|
|
58
|
-
functionName: step.
|
|
149
|
+
functionName: step.fnName,
|
|
59
150
|
gateCount: step.gateCount,
|
|
60
151
|
bytecode: stepsFromFile[i].bytecode,
|
|
61
152
|
// TODO(AD) do we still want to take this from witness.json?
|
|
@@ -66,6 +157,7 @@ async function main() {
|
|
|
66
157
|
gateCount: step.timings.witgen
|
|
67
158
|
}
|
|
68
159
|
}));
|
|
160
|
+
let stats;
|
|
69
161
|
let error;
|
|
70
162
|
let currentLogs = [];
|
|
71
163
|
let provingTime;
|
|
@@ -80,10 +172,35 @@ async function main() {
|
|
|
80
172
|
// Extract logs from this run from the proxy and write them to disk unconditionally
|
|
81
173
|
currentLogs = proxyLogger.getLogs();
|
|
82
174
|
await writeFile(join(ivcFolder, flow, 'logs.json'), JSON.stringify(currentLogs, null, 2));
|
|
83
|
-
if (!
|
|
84
|
-
|
|
175
|
+
if (!error) {
|
|
176
|
+
stats = currentLogs[0].data;
|
|
85
177
|
}
|
|
86
|
-
const
|
|
178
|
+
const minimumTrace = getMinimumTrace(currentLogs);
|
|
179
|
+
const steps = profile.steps.reduce((acc, step, i)=>{
|
|
180
|
+
const previousAccGateCount = i === 0 ? 0 : acc[i - 1].accGateCount;
|
|
181
|
+
return [
|
|
182
|
+
...acc,
|
|
183
|
+
{
|
|
184
|
+
fnName: step.fnName,
|
|
185
|
+
gateCount: step.gateCount,
|
|
186
|
+
accGateCount: previousAccGateCount + step.gateCount,
|
|
187
|
+
timings: {
|
|
188
|
+
witgen: step.timings.witgen
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
];
|
|
192
|
+
}, []);
|
|
193
|
+
const totalGateCount = steps[steps.length - 1].accGateCount;
|
|
194
|
+
const benchmark = {
|
|
195
|
+
syncTime: profile.syncTime,
|
|
196
|
+
provingTime,
|
|
197
|
+
proverType,
|
|
198
|
+
minimumTrace: minimumTrace,
|
|
199
|
+
totalGateCount,
|
|
200
|
+
stats,
|
|
201
|
+
steps,
|
|
202
|
+
error
|
|
203
|
+
};
|
|
87
204
|
await writeFile(join(ivcFolder, flow, 'benchmark.json'), JSON.stringify(benchmark, null, 2));
|
|
88
205
|
proxyLogger.flushLogs();
|
|
89
206
|
}
|
package/dest/bench/utils.d.ts
CHANGED
|
@@ -23,13 +23,6 @@ type MetricFilter = {
|
|
|
23
23
|
name: string;
|
|
24
24
|
unit?: string;
|
|
25
25
|
};
|
|
26
|
-
export type GithubActionBenchmarkResult = {
|
|
27
|
-
name: string;
|
|
28
|
-
value: number;
|
|
29
|
-
range?: string;
|
|
30
|
-
unit: string;
|
|
31
|
-
extra?: string;
|
|
32
|
-
};
|
|
33
26
|
/**
|
|
34
27
|
* Assembles and sends multiple transactions simultaneously to the node in context.
|
|
35
28
|
* Each tx is the result of calling makeCall.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":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AAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAS,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG;IAC5B,6BAA6B,CAAC,OAAO,EAAE,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IACtE,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;GAwBF;AAED,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAuEF;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,oBAAoB,EAC9B,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,QAAQ,iBAI3F;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiBvG"}
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -27,9 +27,7 @@ export const submitComplexTxsTo = async (logger, spamContract, numTxs, opts = {}
|
|
|
27
27
|
export const createPXEServiceAndSubmitTransactions = async (logger, node, numTxs, fundedAccount)=>{
|
|
28
28
|
const rpcConfig = getRpcConfig();
|
|
29
29
|
rpcConfig.proverEnabled = false;
|
|
30
|
-
const pxeService = await createPXEService(node, rpcConfig,
|
|
31
|
-
useLogSuffix: true
|
|
32
|
-
});
|
|
30
|
+
const pxeService = await createPXEService(node, rpcConfig, true);
|
|
33
31
|
const account = await getSchnorrAccount(pxeService, fundedAccount.secret, fundedAccount.signingKey, fundedAccount.salt);
|
|
34
32
|
await account.register();
|
|
35
33
|
const wallet = await account.getWallet();
|
|
@@ -43,9 +41,7 @@ export const createPXEServiceAndSubmitTransactions = async (logger, node, numTxs
|
|
|
43
41
|
export async function createPXEServiceAndPrepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
44
42
|
const rpcConfig = getRpcConfig();
|
|
45
43
|
rpcConfig.proverEnabled = false;
|
|
46
|
-
const pxe = await createPXEService(node, rpcConfig,
|
|
47
|
-
useLogSuffix: true
|
|
48
|
-
});
|
|
44
|
+
const pxe = await createPXEService(node, rpcConfig, true);
|
|
49
45
|
const account = await getSchnorrAccount(pxe, fundedAccount.secret, fundedAccount.signingKey, fundedAccount.salt);
|
|
50
46
|
await account.register();
|
|
51
47
|
const wallet = await account.getWallet();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,iBAAiB,EAOlB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAA0C,UAAU,EAAE,MAAM,sBAAsB,CAAC;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';
|
|
|
21
21
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
22
22
|
import { createProverNode } from '@aztec/prover-node';
|
|
23
23
|
import { createPXEServiceWithSimulationProvider, getPXEServiceConfig } from '@aztec/pxe/server';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { WASMSimulator } from '@aztec/simulator/client';
|
|
25
|
+
import { SimulationProviderRecorderWrapper } from '@aztec/simulator/testing';
|
|
26
26
|
import { getContractClassFromArtifact, getContractInstanceFromDeployParams } from '@aztec/stdlib/contract';
|
|
27
27
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
28
28
|
import { BenchmarkTelemetryClient } from '@aztec/telemetry-client/bench';
|
|
@@ -97,11 +97,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
97
97
|
pxeServiceConfig.dataDirectory = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
98
98
|
}
|
|
99
99
|
const simulationProvider = new WASMSimulator();
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
const pxe = await createPXEServiceWithSimulationProvider(aztecNode, simulationProviderWithRecorder, pxeServiceConfig, {
|
|
103
|
-
useLogSuffix
|
|
104
|
-
});
|
|
100
|
+
const simulationProviderWithRecorder = new SimulationProviderRecorderWrapper(simulationProvider);
|
|
101
|
+
const pxe = await createPXEServiceWithSimulationProvider(aztecNode, simulationProviderWithRecorder, pxeServiceConfig, useLogSuffix);
|
|
105
102
|
const teardown = async ()=>{
|
|
106
103
|
if (!configuredDataDirectory) {
|
|
107
104
|
try {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module exposes the ability to capture the private exection steps that go into our "Client IVC" prover.
|
|
3
|
+
* These are used for debugging and benchmarking barretenberg (the prover component).
|
|
4
|
+
*/
|
|
5
|
+
import type { ContractFunctionInteraction, DeployMethod, DeployOptions, ProfileMethodOptions } from '@aztec/aztec.js/contracts';
|
|
6
|
+
export declare function capturePrivateExecutionStepsIfEnvSet(label: string, interaction: ContractFunctionInteraction | DeployMethod, opts?: Omit<ProfileMethodOptions & DeployOptions, 'profileMode'>, expectedSteps?: number): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=capture_private_execution_steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture_private_execution_steps.d.ts","sourceRoot":"","sources":["../../src/shared/capture_private_execution_steps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,2BAA2B,EAC3B,YAAY,EACZ,aAAa,EACb,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AASnC,wBAAsB,oCAAoC,CACxD,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,2BAA2B,GAAG,YAAY,EACvD,IAAI,CAAC,EAAE,IAAI,CAAC,oBAAoB,GAAG,aAAa,EAAE,aAAa,CAAC,EAChE,aAAa,CAAC,EAAE,MAAM,iBA6CvB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This module exposes the ability to capture the private exection steps that go into our "Client IVC" prover.
|
|
3
|
+
* These are used for debugging and benchmarking barretenberg (the prover component).
|
|
4
|
+
*/ import { createLogger } from '@aztec/foundation/log';
|
|
5
|
+
import { serializePrivateExecutionSteps } from '@aztec/stdlib/kernel';
|
|
6
|
+
import { promises as fs } from 'fs';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
const logger = createLogger('e2e:capture-private-execution-steps');
|
|
9
|
+
export async function capturePrivateExecutionStepsIfEnvSet(label, interaction, opts, expectedSteps) {
|
|
10
|
+
// Not included in env_var.ts as internal to e2e tests.
|
|
11
|
+
const ivcFolder = process.env.CAPTURE_IVC_FOLDER;
|
|
12
|
+
if (!ivcFolder) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const profileMode = [
|
|
16
|
+
'execution-steps',
|
|
17
|
+
'full'
|
|
18
|
+
].includes(process.env.PROFILE_MODE ?? '') ? process.env.PROFILE_MODE : 'execution-steps';
|
|
19
|
+
logger.info(`Capturing client ivc execution profile for ${label} in mode ${profileMode}`);
|
|
20
|
+
const result = await interaction.profile({
|
|
21
|
+
...opts,
|
|
22
|
+
profileMode
|
|
23
|
+
});
|
|
24
|
+
if (expectedSteps !== undefined && result.executionSteps.length !== expectedSteps) {
|
|
25
|
+
throw new Error(`Expected ${expectedSteps} execution steps, got ${result.executionSteps.length}`);
|
|
26
|
+
}
|
|
27
|
+
const resultsDirectory = path.join(ivcFolder, label);
|
|
28
|
+
logger.info(`Writing private execution steps to ${resultsDirectory}`);
|
|
29
|
+
await fs.mkdir(resultsDirectory, {
|
|
30
|
+
recursive: true
|
|
31
|
+
});
|
|
32
|
+
// Write the client IVC files read by the prover.
|
|
33
|
+
const ivcInputsPath = path.join(resultsDirectory, 'ivc-inputs.msgpack');
|
|
34
|
+
await fs.writeFile(ivcInputsPath, serializePrivateExecutionSteps(result.executionSteps));
|
|
35
|
+
if (profileMode === 'full') {
|
|
36
|
+
// If we have gate counts, write the steps in human-readable format.
|
|
37
|
+
await fs.writeFile(path.join(resultsDirectory, 'profile.json'), JSON.stringify({
|
|
38
|
+
timings: result.timings,
|
|
39
|
+
steps: result.executionSteps.map((step)=>({
|
|
40
|
+
fnName: step.functionName,
|
|
41
|
+
gateCount: step.gateCount,
|
|
42
|
+
timings: step.timings
|
|
43
|
+
}))
|
|
44
|
+
}, null, 2));
|
|
45
|
+
// In full mode, we also write the raw witnesses in a more human-readable format.
|
|
46
|
+
await fs.writeFile(path.join(resultsDirectory, 'witnesses.json'), JSON.stringify(result.executionSteps.map((step)=>Object.fromEntries(step.witness))));
|
|
47
|
+
}
|
|
48
|
+
logger.info(`Wrote private execution steps to ${resultsDirectory}`);
|
|
49
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,39 +25,39 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "0.87.
|
|
29
|
-
"@aztec/archiver": "0.87.
|
|
30
|
-
"@aztec/aztec": "0.87.
|
|
31
|
-
"@aztec/aztec-node": "0.87.
|
|
32
|
-
"@aztec/aztec.js": "0.87.
|
|
33
|
-
"@aztec/bb-prover": "0.87.
|
|
34
|
-
"@aztec/blob-lib": "0.87.
|
|
35
|
-
"@aztec/blob-sink": "0.87.
|
|
36
|
-
"@aztec/bot": "0.87.
|
|
37
|
-
"@aztec/cli": "0.87.
|
|
38
|
-
"@aztec/constants": "0.87.
|
|
39
|
-
"@aztec/entrypoints": "0.87.
|
|
40
|
-
"@aztec/epoch-cache": "0.87.
|
|
41
|
-
"@aztec/ethereum": "0.87.
|
|
42
|
-
"@aztec/foundation": "0.87.
|
|
43
|
-
"@aztec/kv-store": "0.87.
|
|
44
|
-
"@aztec/l1-artifacts": "0.87.
|
|
45
|
-
"@aztec/merkle-tree": "0.87.
|
|
46
|
-
"@aztec/noir-contracts.js": "0.87.
|
|
47
|
-
"@aztec/noir-noirc_abi": "0.87.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "0.87.
|
|
49
|
-
"@aztec/noir-test-contracts.js": "0.87.
|
|
50
|
-
"@aztec/p2p": "0.87.
|
|
51
|
-
"@aztec/protocol-contracts": "0.87.
|
|
52
|
-
"@aztec/prover-client": "0.87.
|
|
53
|
-
"@aztec/prover-node": "0.87.
|
|
54
|
-
"@aztec/pxe": "0.87.
|
|
55
|
-
"@aztec/sequencer-client": "0.87.
|
|
56
|
-
"@aztec/simulator": "0.87.
|
|
57
|
-
"@aztec/stdlib": "0.87.
|
|
58
|
-
"@aztec/telemetry-client": "0.87.
|
|
59
|
-
"@aztec/validator-client": "0.87.
|
|
60
|
-
"@aztec/world-state": "0.87.
|
|
28
|
+
"@aztec/accounts": "0.87.5",
|
|
29
|
+
"@aztec/archiver": "0.87.5",
|
|
30
|
+
"@aztec/aztec": "0.87.5",
|
|
31
|
+
"@aztec/aztec-node": "0.87.5",
|
|
32
|
+
"@aztec/aztec.js": "0.87.5",
|
|
33
|
+
"@aztec/bb-prover": "0.87.5",
|
|
34
|
+
"@aztec/blob-lib": "0.87.5",
|
|
35
|
+
"@aztec/blob-sink": "0.87.5",
|
|
36
|
+
"@aztec/bot": "0.87.5",
|
|
37
|
+
"@aztec/cli": "0.87.5",
|
|
38
|
+
"@aztec/constants": "0.87.5",
|
|
39
|
+
"@aztec/entrypoints": "0.87.5",
|
|
40
|
+
"@aztec/epoch-cache": "0.87.5",
|
|
41
|
+
"@aztec/ethereum": "0.87.5",
|
|
42
|
+
"@aztec/foundation": "0.87.5",
|
|
43
|
+
"@aztec/kv-store": "0.87.5",
|
|
44
|
+
"@aztec/l1-artifacts": "0.87.5",
|
|
45
|
+
"@aztec/merkle-tree": "0.87.5",
|
|
46
|
+
"@aztec/noir-contracts.js": "0.87.5",
|
|
47
|
+
"@aztec/noir-noirc_abi": "0.87.5",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "0.87.5",
|
|
49
|
+
"@aztec/noir-test-contracts.js": "0.87.5",
|
|
50
|
+
"@aztec/p2p": "0.87.5",
|
|
51
|
+
"@aztec/protocol-contracts": "0.87.5",
|
|
52
|
+
"@aztec/prover-client": "0.87.5",
|
|
53
|
+
"@aztec/prover-node": "0.87.5",
|
|
54
|
+
"@aztec/pxe": "0.87.5",
|
|
55
|
+
"@aztec/sequencer-client": "0.87.5",
|
|
56
|
+
"@aztec/simulator": "0.87.5",
|
|
57
|
+
"@aztec/stdlib": "0.87.5",
|
|
58
|
+
"@aztec/telemetry-client": "0.87.5",
|
|
59
|
+
"@aztec/validator-client": "0.87.5",
|
|
60
|
+
"@aztec/world-state": "0.87.5",
|
|
61
61
|
"@iarna/toml": "^2.2.5",
|
|
62
62
|
"@jest/globals": "^29.5.0",
|
|
63
63
|
"@noble/curves": "^1.0.0",
|