@aztec/end-to-end 3.0.0-nightly.20251210 → 3.0.0-nightly.20251212
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 +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +3 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +3 -2
- 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 +2 -1
- package/dest/e2e_epochs/epochs_test.d.ts +2 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +3 -2
- package/dest/e2e_fees/fees_test.d.ts +3 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +2 -1
- package/dest/e2e_multi_validator/utils.js +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +2 -2
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +2 -2
- package/dest/e2e_p2p/p2p_network.d.ts +5 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +6 -2
- package/dest/e2e_p2p/shared.d.ts +2 -2
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.d.ts +2 -2
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +3 -2
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts +3 -3
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +1 -1
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/snapshot_manager.d.ts +2 -2
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +5 -3
- package/dest/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +13 -5
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/shared/cross_chain_test_harness.d.ts +3 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +1 -1
- package/dest/shared/gas_portal_test_harness.d.ts +2 -2
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +3 -2
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +3 -1
- package/dest/simulators/lending_simulator.d.ts +2 -2
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +2 -1
- package/dest/spartan/tx_metrics.d.ts +39 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +95 -0
- package/dest/spartan/utils.d.ts +4 -3
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +2 -2
- package/package.json +38 -38
- package/src/bench/client_flows/client_flows_benchmark.ts +3 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +3 -3
- package/src/e2e_epochs/epochs_test.ts +4 -2
- package/src/e2e_fees/fees_test.ts +3 -1
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +5 -3
- package/src/e2e_p2p/p2p_network.ts +8 -9
- package/src/e2e_p2p/shared.ts +5 -1
- package/src/fixtures/e2e_prover_test.ts +1 -1
- package/src/fixtures/l1_to_l2_messaging.ts +3 -1
- package/src/fixtures/setup_l1_contracts.ts +2 -1
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/snapshot_manager.ts +6 -9
- package/src/fixtures/utils.ts +13 -12
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/shared/cross_chain_test_harness.ts +3 -1
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +4 -7
- package/src/simulators/lending_simulator.ts +1 -1
- package/src/spartan/setup_test_wallets.ts +2 -1
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +4 -3
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
|
+
import type { L2Block } from '@aztec/stdlib/block';
|
|
3
|
+
import { Tx, type TxReceipt, TxStatus } from '@aztec/stdlib/tx';
|
|
4
|
+
|
|
5
|
+
import { createHistogram } from 'perf_hooks';
|
|
6
|
+
|
|
7
|
+
export type TxInclusionData = {
|
|
8
|
+
txHash: string;
|
|
9
|
+
sentAt: number;
|
|
10
|
+
minedAt: number;
|
|
11
|
+
attestedAt: number;
|
|
12
|
+
blocknumber: number;
|
|
13
|
+
priorityFee: number;
|
|
14
|
+
totalFee: number;
|
|
15
|
+
positionInBlock: number;
|
|
16
|
+
group: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export class TxInclusionMetrics {
|
|
20
|
+
private data = new Map<string, TxInclusionData>();
|
|
21
|
+
private groups = new Set<string>();
|
|
22
|
+
private blocks = new Map<number, Promise<L2Block>>();
|
|
23
|
+
|
|
24
|
+
constructor(private aztecNode: AztecNode) {}
|
|
25
|
+
|
|
26
|
+
recordSentTx(tx: Tx, group: string): void {
|
|
27
|
+
const txHash = tx.getTxHash().toString();
|
|
28
|
+
const priorityFees = tx.getGasSettings().maxPriorityFeesPerGas;
|
|
29
|
+
|
|
30
|
+
this.data.set(txHash, {
|
|
31
|
+
txHash,
|
|
32
|
+
sentAt: Math.trunc(Date.now() / 1000),
|
|
33
|
+
minedAt: -1,
|
|
34
|
+
attestedAt: -1,
|
|
35
|
+
blocknumber: -1,
|
|
36
|
+
priorityFee: Number(priorityFees.feePerDaGas + priorityFees.feePerL2Gas),
|
|
37
|
+
totalFee: -1,
|
|
38
|
+
positionInBlock: -1,
|
|
39
|
+
group,
|
|
40
|
+
});
|
|
41
|
+
this.groups.add(group);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async recordMinedTx(txReceipt: TxReceipt): Promise<void> {
|
|
45
|
+
const { status, txHash, blockNumber } = txReceipt;
|
|
46
|
+
if (status !== TxStatus.SUCCESS || !blockNumber) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (!this.blocks.has(blockNumber)) {
|
|
51
|
+
this.blocks.set(blockNumber, this.aztecNode.getBlock(blockNumber) as Promise<L2Block>);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const block = await this.blocks.get(blockNumber)!;
|
|
55
|
+
const data = this.data.get(txHash.toString())!;
|
|
56
|
+
data.blocknumber = blockNumber;
|
|
57
|
+
data.minedAt = Number(block.header.globalVariables.timestamp);
|
|
58
|
+
data.attestedAt = -1;
|
|
59
|
+
data.totalFee = Number(txReceipt.transactionFee ?? 0n);
|
|
60
|
+
data.positionInBlock = block.body.txEffects.findIndex(txEffect => txEffect.txHash.equals(txHash));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public inclusionTimeInSeconds(group: string): {
|
|
64
|
+
count: number;
|
|
65
|
+
group: string;
|
|
66
|
+
min: number;
|
|
67
|
+
mean: number;
|
|
68
|
+
max: number;
|
|
69
|
+
median: number;
|
|
70
|
+
p99: number;
|
|
71
|
+
} {
|
|
72
|
+
const histogram = createHistogram({});
|
|
73
|
+
for (const tx of this.data.values()) {
|
|
74
|
+
if (!tx.blocknumber || tx.group !== group) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
histogram.record(tx.minedAt - tx.sentAt);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (histogram.count === 0) {
|
|
82
|
+
return {
|
|
83
|
+
group,
|
|
84
|
+
count: 0,
|
|
85
|
+
mean: 0,
|
|
86
|
+
max: 0,
|
|
87
|
+
median: 0,
|
|
88
|
+
min: 0,
|
|
89
|
+
p99: 0,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
group,
|
|
95
|
+
count: histogram.count,
|
|
96
|
+
mean: histogram.mean,
|
|
97
|
+
max: histogram.max,
|
|
98
|
+
median: histogram.percentile(50),
|
|
99
|
+
min: histogram.min,
|
|
100
|
+
p99: histogram.percentile(99),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
toGithubActionBenchmarkJSON(): Array<{ name: string; unit: string; value: number; range?: number; extra?: string }> {
|
|
105
|
+
const data: Array<{ name: string; unit: string; value: number; range?: number; extra?: string }> = [];
|
|
106
|
+
for (const group of this.groups) {
|
|
107
|
+
const stats = this.inclusionTimeInSeconds(group);
|
|
108
|
+
|
|
109
|
+
data.push(
|
|
110
|
+
{
|
|
111
|
+
name: `${group}/avg_inclusion`,
|
|
112
|
+
unit: 's',
|
|
113
|
+
value: stats.mean,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: `${group}/median_inclusion`,
|
|
117
|
+
unit: 's',
|
|
118
|
+
value: stats.median,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: `${group}/p99_inclusion`,
|
|
122
|
+
unit: 's',
|
|
123
|
+
value: stats.p99,
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
}
|
package/src/spartan/utils.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
2
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
3
|
-
import type { L1ContractAddresses
|
|
3
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
4
|
+
import type { ViemPublicClient } from '@aztec/ethereum/types';
|
|
4
5
|
import type { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
5
6
|
import type { Logger } from '@aztec/foundation/log';
|
|
6
7
|
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
@@ -330,7 +331,7 @@ async function execHelmCommand(args: Parameters<typeof createHelmCommand>[0]) {
|
|
|
330
331
|
return stdout;
|
|
331
332
|
}
|
|
332
333
|
|
|
333
|
-
export async function
|
|
334
|
+
export async function uninstallChaosMesh(instanceName: string, namespace: string, logger: Logger) {
|
|
334
335
|
// uninstall the helm chart if it exists
|
|
335
336
|
logger.info(`Uninstalling helm chart ${instanceName}`);
|
|
336
337
|
await execAsync(`helm uninstall ${instanceName} --namespace ${namespace} --wait --ignore-not-found`);
|
|
@@ -394,7 +395,7 @@ export async function installChaosMeshChart({
|
|
|
394
395
|
logger: Logger;
|
|
395
396
|
}) {
|
|
396
397
|
if (clean) {
|
|
397
|
-
await
|
|
398
|
+
await uninstallChaosMesh(instanceName, targetNamespace, logger);
|
|
398
399
|
}
|
|
399
400
|
|
|
400
401
|
return execHelmCommand({
|