@aztec/end-to-end 0.0.1-commit.358457c → 0.0.1-commit.381b1a9
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 +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +15 -8
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +6 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
- 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 +14 -14
- package/dest/e2e_epochs/epochs_test.d.ts +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +2 -1
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +12 -5
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +4 -6
- package/dest/e2e_p2p/p2p_network.d.ts +1 -1
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +2 -3
- package/dest/e2e_p2p/shared.js +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +11 -11
- package/dest/fixtures/authwit_proxy.d.ts +3 -3
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +6 -6
- package/dest/fixtures/setup.d.ts +8 -5
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +5 -4
- 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 +4 -5
- package/dest/shared/cross_chain_test_harness.d.ts +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +13 -13
- package/dest/shared/gas_portal_test_harness.js +2 -2
- package/dest/shared/jest_setup.js +1 -10
- package/dest/shared/submit-transactions.d.ts +1 -1
- 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 +14 -17
- package/dest/simulators/lending_simulator.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +2 -2
- 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 +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +4 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +23 -10
- package/dest/spartan/utils/index.d.ts +2 -1
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +2 -0
- package/dest/spartan/utils/nodes.d.ts +5 -4
- package/dest/spartan/utils/nodes.d.ts.map +1 -1
- package/dest/spartan/utils/nodes.js +8 -8
- package/dest/test-wallet/test_wallet.js +1 -1
- package/dest/test-wallet/worker_wallet_schema.d.ts +1 -1
- package/package.json +40 -40
- package/src/bench/client_flows/client_flows_benchmark.ts +37 -30
- package/src/bench/utils.ts +7 -2
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +18 -14
- package/src/e2e_epochs/epochs_test.ts +1 -0
- package/src/e2e_fees/fees_test.ts +12 -5
- package/src/e2e_nested_contract/nested_contract_test.ts +6 -4
- package/src/e2e_p2p/p2p_network.ts +3 -2
- package/src/e2e_p2p/shared.ts +1 -1
- package/src/e2e_token_contract/token_contract_test.ts +16 -8
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +11 -5
- package/src/fixtures/setup.ts +14 -8
- package/src/fixtures/token_utils.ts +5 -4
- package/src/shared/cross_chain_test_harness.ts +13 -9
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/jest_setup.ts +1 -16
- package/src/shared/submit-transactions.ts +1 -4
- package/src/shared/uniswap_l1_l2.ts +35 -28
- package/src/simulators/lending_simulator.ts +4 -2
- package/src/simulators/token_simulator.ts +6 -2
- package/src/spartan/setup_test_wallets.ts +48 -25
- package/src/spartan/utils/index.ts +3 -0
- package/src/spartan/utils/nodes.ts +9 -14
- package/src/test-wallet/test_wallet.ts +1 -1
- package/dest/fixtures/elu_monitor.d.ts +0 -21
- package/dest/fixtures/elu_monitor.d.ts.map +0 -1
- package/dest/fixtures/elu_monitor.js +0 -102
- package/src/fixtures/elu_monitor.ts +0 -126
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** Samples event-loop utilization, delay histogram, and heap usage per test, writing columnar text to a file. */
|
|
2
|
-
export declare class EluMonitor {
|
|
3
|
-
private filePath;
|
|
4
|
-
private intervalMs;
|
|
5
|
-
private timer;
|
|
6
|
-
private lastELU;
|
|
7
|
-
private histogram;
|
|
8
|
-
private testName;
|
|
9
|
-
private testStart;
|
|
10
|
-
private eluSamples;
|
|
11
|
-
constructor(filePath: string, intervalMs?: number);
|
|
12
|
-
/** Begin sampling for a test. Writes a header line and starts the periodic sampler. */
|
|
13
|
-
startTest(testName: string): void;
|
|
14
|
-
/** Stop sampling and write a summary line. */
|
|
15
|
-
stopTest(): void;
|
|
16
|
-
/** Alias for stopTest — call on process exit to flush any remaining data. */
|
|
17
|
-
stop(): void;
|
|
18
|
-
private sample;
|
|
19
|
-
private writeSummary;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWx1X21vbml0b3IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9maXh0dXJlcy9lbHVfbW9uaXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSxpSEFBaUg7QUFDakgscUJBQWEsVUFBVTtJQUNyQixPQUFPLENBQUMsUUFBUSxDQUFTO0lBQ3pCLE9BQU8sQ0FBQyxVQUFVLENBQVM7SUFDM0IsT0FBTyxDQUFDLEtBQUssQ0FBNkM7SUFDMUQsT0FBTyxDQUFDLE9BQU8sQ0FBbUM7SUFDbEQsT0FBTyxDQUFDLFNBQVMsQ0FBb0I7SUFDckMsT0FBTyxDQUFDLFFBQVEsQ0FBcUI7SUFDckMsT0FBTyxDQUFDLFNBQVMsQ0FBcUI7SUFDdEMsT0FBTyxDQUFDLFVBQVUsQ0FBZ0I7SUFFbEMsWUFBWSxRQUFRLEVBQUUsTUFBTSxFQUFFLFVBQVUsQ0FBQyxFQUFFLE1BQU0sRUFJaEQ7SUFFRCx1RkFBdUY7SUFDdkYsU0FBUyxDQUFDLFFBQVEsRUFBRSxNQUFNLEdBQUcsSUFBSSxDQW1CaEM7SUFFRCw4Q0FBOEM7SUFDOUMsUUFBUSxJQUFJLElBQUksQ0FtQmY7SUFFRCwrRUFBNkU7SUFDN0UsSUFBSSxJQUFJLElBQUksQ0FFWDtJQUVELE9BQU8sQ0FBQyxNQUFNO0lBOEJkLE9BQU8sQ0FBQyxZQUFZO0NBbUJyQiJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"elu_monitor.d.ts","sourceRoot":"","sources":["../../src/fixtures/elu_monitor.ts"],"names":[],"mappings":"AAKA,iHAAiH;AACjH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,KAAK,CAA6C;IAC1D,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,SAAS,CAAqB;IACtC,OAAO,CAAC,UAAU,CAAgB;IAElC,YAAY,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAIhD;IAED,uFAAuF;IACvF,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAmBhC;IAED,8CAA8C;IAC9C,QAAQ,IAAI,IAAI,CAmBf;IAED,+EAA6E;IAC7E,IAAI,IAAI,IAAI,CAEX;IAED,OAAO,CAAC,MAAM;IA8Bd,OAAO,CAAC,YAAY;CAmBrB"}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { appendFileSync } from 'node:fs';
|
|
2
|
-
import { monitorEventLoopDelay, performance } from 'node:perf_hooks';
|
|
3
|
-
const NANOS_PER_MS = 1_000_000;
|
|
4
|
-
/** Samples event-loop utilization, delay histogram, and heap usage per test, writing columnar text to a file. */ export class EluMonitor {
|
|
5
|
-
filePath;
|
|
6
|
-
intervalMs;
|
|
7
|
-
timer;
|
|
8
|
-
lastELU;
|
|
9
|
-
histogram;
|
|
10
|
-
testName;
|
|
11
|
-
testStart;
|
|
12
|
-
eluSamples = [];
|
|
13
|
-
constructor(filePath, intervalMs){
|
|
14
|
-
this.filePath = filePath;
|
|
15
|
-
this.intervalMs = intervalMs ?? 2000;
|
|
16
|
-
this.histogram = monitorEventLoopDelay({
|
|
17
|
-
resolution: 20
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
/** Begin sampling for a test. Writes a header line and starts the periodic sampler. */ startTest(testName) {
|
|
21
|
-
this.stopTest();
|
|
22
|
-
this.testName = testName;
|
|
23
|
-
this.testStart = performance.now();
|
|
24
|
-
this.eluSamples = [];
|
|
25
|
-
appendFileSync(this.filePath, `\n=== Test: ${testName} ===\n`);
|
|
26
|
-
appendFileSync(this.filePath, padColumns('TIME', 'ELU', 'EL_DLY_P50', 'EL_DLY_P99', 'EL_DLY_MAX', 'HEAP_MB') + '\n');
|
|
27
|
-
this.lastELU = performance.eventLoopUtilization();
|
|
28
|
-
this.histogram.enable();
|
|
29
|
-
this.timer = setInterval(()=>this.sample(), this.intervalMs);
|
|
30
|
-
// Allow the process to exit even if the timer is still running.
|
|
31
|
-
this.timer.unref();
|
|
32
|
-
}
|
|
33
|
-
/** Stop sampling and write a summary line. */ stopTest() {
|
|
34
|
-
if (!this.timer) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
// Take a final sample before stopping.
|
|
38
|
-
this.sample();
|
|
39
|
-
clearInterval(this.timer);
|
|
40
|
-
this.timer = undefined;
|
|
41
|
-
this.histogram.disable();
|
|
42
|
-
this.histogram.reset();
|
|
43
|
-
this.writeSummary();
|
|
44
|
-
this.lastELU = undefined;
|
|
45
|
-
this.testName = undefined;
|
|
46
|
-
this.testStart = undefined;
|
|
47
|
-
this.eluSamples = [];
|
|
48
|
-
}
|
|
49
|
-
/** Alias for stopTest — call on process exit to flush any remaining data. */ stop() {
|
|
50
|
-
this.stopTest();
|
|
51
|
-
}
|
|
52
|
-
sample() {
|
|
53
|
-
const newELU = performance.eventLoopUtilization();
|
|
54
|
-
const delta = performance.eventLoopUtilization(newELU, this.lastELU);
|
|
55
|
-
this.lastELU = newELU;
|
|
56
|
-
const elu = delta.utilization;
|
|
57
|
-
this.eluSamples.push(elu);
|
|
58
|
-
const p50 = this.histogram.percentile(50) / NANOS_PER_MS;
|
|
59
|
-
const p99 = this.histogram.percentile(99) / NANOS_PER_MS;
|
|
60
|
-
const max = this.histogram.max / NANOS_PER_MS;
|
|
61
|
-
const heapMb = Math.round(process.memoryUsage().heapUsed / (1024 * 1024));
|
|
62
|
-
const now = new Date();
|
|
63
|
-
const time = [
|
|
64
|
-
now.getHours(),
|
|
65
|
-
now.getMinutes(),
|
|
66
|
-
now.getSeconds()
|
|
67
|
-
].map((n)=>String(n).padStart(2, '0')).join(':');
|
|
68
|
-
const line = padColumns(time, elu.toFixed(2), `${p50.toFixed(1)}ms`, `${p99.toFixed(1)}ms`, `${max.toFixed(1)}ms`, String(heapMb));
|
|
69
|
-
appendFileSync(this.filePath, line + '\n');
|
|
70
|
-
// Reset histogram so next sample only reflects the new interval.
|
|
71
|
-
this.histogram.reset();
|
|
72
|
-
}
|
|
73
|
-
writeSummary() {
|
|
74
|
-
if (this.eluSamples.length === 0 || this.testStart === undefined) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
const mean = this.eluSamples.reduce((a, b)=>a + b, 0) / this.eluSamples.length;
|
|
78
|
-
const maxElu = Math.max(...this.eluSamples);
|
|
79
|
-
const sorted = [
|
|
80
|
-
...this.eluSamples
|
|
81
|
-
].sort((a, b)=>a - b);
|
|
82
|
-
const p90Elu = sorted[Math.floor(sorted.length * 0.9)] ?? maxElu;
|
|
83
|
-
const durationS = ((performance.now() - this.testStart) / 1000).toFixed(1);
|
|
84
|
-
let summary = `--- Summary: mean_elu=${mean.toFixed(2)} max_elu=${maxElu.toFixed(2)} p90_elu=${p90Elu.toFixed(2)} duration=${durationS}s`;
|
|
85
|
-
if (maxElu > 0.85) {
|
|
86
|
-
summary += ' WARNING:ELU>0.85';
|
|
87
|
-
}
|
|
88
|
-
summary += ' ---\n';
|
|
89
|
-
appendFileSync(this.filePath, summary);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function padColumns(...cols) {
|
|
93
|
-
const widths = [
|
|
94
|
-
11,
|
|
95
|
-
7,
|
|
96
|
-
12,
|
|
97
|
-
12,
|
|
98
|
-
12,
|
|
99
|
-
8
|
|
100
|
-
];
|
|
101
|
-
return cols.map((col, i)=>col.padEnd(widths[i] ?? 10)).join('');
|
|
102
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { appendFileSync } from 'node:fs';
|
|
2
|
-
import { type EventLoopUtilization, type IntervalHistogram, monitorEventLoopDelay, performance } from 'node:perf_hooks';
|
|
3
|
-
|
|
4
|
-
const NANOS_PER_MS = 1_000_000;
|
|
5
|
-
|
|
6
|
-
/** Samples event-loop utilization, delay histogram, and heap usage per test, writing columnar text to a file. */
|
|
7
|
-
export class EluMonitor {
|
|
8
|
-
private filePath: string;
|
|
9
|
-
private intervalMs: number;
|
|
10
|
-
private timer: ReturnType<typeof setInterval> | undefined;
|
|
11
|
-
private lastELU: EventLoopUtilization | undefined;
|
|
12
|
-
private histogram: IntervalHistogram;
|
|
13
|
-
private testName: string | undefined;
|
|
14
|
-
private testStart: number | undefined;
|
|
15
|
-
private eluSamples: number[] = [];
|
|
16
|
-
|
|
17
|
-
constructor(filePath: string, intervalMs?: number) {
|
|
18
|
-
this.filePath = filePath;
|
|
19
|
-
this.intervalMs = intervalMs ?? 2000;
|
|
20
|
-
this.histogram = monitorEventLoopDelay({ resolution: 20 });
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** Begin sampling for a test. Writes a header line and starts the periodic sampler. */
|
|
24
|
-
startTest(testName: string): void {
|
|
25
|
-
this.stopTest();
|
|
26
|
-
|
|
27
|
-
this.testName = testName;
|
|
28
|
-
this.testStart = performance.now();
|
|
29
|
-
this.eluSamples = [];
|
|
30
|
-
|
|
31
|
-
appendFileSync(this.filePath, `\n=== Test: ${testName} ===\n`);
|
|
32
|
-
appendFileSync(
|
|
33
|
-
this.filePath,
|
|
34
|
-
padColumns('TIME', 'ELU', 'EL_DLY_P50', 'EL_DLY_P99', 'EL_DLY_MAX', 'HEAP_MB') + '\n',
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
this.lastELU = performance.eventLoopUtilization();
|
|
38
|
-
this.histogram.enable();
|
|
39
|
-
|
|
40
|
-
this.timer = setInterval(() => this.sample(), this.intervalMs);
|
|
41
|
-
// Allow the process to exit even if the timer is still running.
|
|
42
|
-
this.timer.unref();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/** Stop sampling and write a summary line. */
|
|
46
|
-
stopTest(): void {
|
|
47
|
-
if (!this.timer) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Take a final sample before stopping.
|
|
52
|
-
this.sample();
|
|
53
|
-
|
|
54
|
-
clearInterval(this.timer);
|
|
55
|
-
this.timer = undefined;
|
|
56
|
-
this.histogram.disable();
|
|
57
|
-
this.histogram.reset();
|
|
58
|
-
|
|
59
|
-
this.writeSummary();
|
|
60
|
-
|
|
61
|
-
this.lastELU = undefined;
|
|
62
|
-
this.testName = undefined;
|
|
63
|
-
this.testStart = undefined;
|
|
64
|
-
this.eluSamples = [];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Alias for stopTest — call on process exit to flush any remaining data. */
|
|
68
|
-
stop(): void {
|
|
69
|
-
this.stopTest();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private sample(): void {
|
|
73
|
-
const newELU = performance.eventLoopUtilization();
|
|
74
|
-
const delta = performance.eventLoopUtilization(newELU, this.lastELU);
|
|
75
|
-
this.lastELU = newELU;
|
|
76
|
-
|
|
77
|
-
const elu = delta.utilization;
|
|
78
|
-
this.eluSamples.push(elu);
|
|
79
|
-
|
|
80
|
-
const p50 = this.histogram.percentile(50) / NANOS_PER_MS;
|
|
81
|
-
const p99 = this.histogram.percentile(99) / NANOS_PER_MS;
|
|
82
|
-
const max = this.histogram.max / NANOS_PER_MS;
|
|
83
|
-
const heapMb = Math.round(process.memoryUsage().heapUsed / (1024 * 1024));
|
|
84
|
-
|
|
85
|
-
const now = new Date();
|
|
86
|
-
const time = [now.getHours(), now.getMinutes(), now.getSeconds()].map(n => String(n).padStart(2, '0')).join(':');
|
|
87
|
-
|
|
88
|
-
const line = padColumns(
|
|
89
|
-
time,
|
|
90
|
-
elu.toFixed(2),
|
|
91
|
-
`${p50.toFixed(1)}ms`,
|
|
92
|
-
`${p99.toFixed(1)}ms`,
|
|
93
|
-
`${max.toFixed(1)}ms`,
|
|
94
|
-
String(heapMb),
|
|
95
|
-
);
|
|
96
|
-
appendFileSync(this.filePath, line + '\n');
|
|
97
|
-
|
|
98
|
-
// Reset histogram so next sample only reflects the new interval.
|
|
99
|
-
this.histogram.reset();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
private writeSummary(): void {
|
|
103
|
-
if (this.eluSamples.length === 0 || this.testStart === undefined) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const mean = this.eluSamples.reduce((a, b) => a + b, 0) / this.eluSamples.length;
|
|
108
|
-
const maxElu = Math.max(...this.eluSamples);
|
|
109
|
-
const sorted = [...this.eluSamples].sort((a, b) => a - b);
|
|
110
|
-
const p90Elu = sorted[Math.floor(sorted.length * 0.9)] ?? maxElu;
|
|
111
|
-
const durationS = ((performance.now() - this.testStart) / 1000).toFixed(1);
|
|
112
|
-
|
|
113
|
-
let summary = `--- Summary: mean_elu=${mean.toFixed(2)} max_elu=${maxElu.toFixed(2)} p90_elu=${p90Elu.toFixed(2)} duration=${durationS}s`;
|
|
114
|
-
if (maxElu > 0.85) {
|
|
115
|
-
summary += ' WARNING:ELU>0.85';
|
|
116
|
-
}
|
|
117
|
-
summary += ' ---\n';
|
|
118
|
-
|
|
119
|
-
appendFileSync(this.filePath, summary);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function padColumns(...cols: string[]): string {
|
|
124
|
-
const widths = [11, 7, 12, 12, 12, 8];
|
|
125
|
-
return cols.map((col, i) => col.padEnd(widths[i] ?? 10)).join('');
|
|
126
|
-
}
|