@aztec/end-to-end 0.0.1-commit.bf2612ae → 0.0.1-commit.c80b6263

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.
@@ -1 +1 @@
1
- {"version":3,"file":"tx_metrics.d.ts","sourceRoot":"","sources":["../../src/spartan/tx_metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAItD,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qBAAa,kBAAkB;IAgB3B,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM,CAAC;IAhBjB,OAAO,CAAC,IAAI,CAAsC;IAClD,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,MAAM,CAAmD;IAEjE,OAAO,CAAC,uBAAuB,CAAgE;IAE/F,OAAO,CAAC,kBAAkB,CAA2C;IACrE,OAAO,CAAC,iBAAiB,CAAyE;IAClG,OAAO,CAAC,YAAY,CAAuE;IAC3F,OAAO,CAAC,SAAS,CAAiG;IAClH,OAAO,CAAC,iBAAiB,CAEX;IAEd,YACU,SAAS,EAAE,SAAS,EACpB,MAAM,CAAC,oBAAQ,EACrB;IAEJ,YAAY,C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@ -1,4 +1,154 @@
1
1
  import { createHistogram } from 'perf_hooks';
2
+ /** Metrics class for proving-related benchmarks. */ export class ProvingMetrics {
3
+ prefix;
4
+ successfulTxs;
5
+ proofDuration;
6
+ activeAgents;
7
+ avgQueueTime;
8
+ jobRetries;
9
+ jobDuration;
10
+ timedOutJobs;
11
+ resolvedJobs;
12
+ rejectedJobs;
13
+ epochProvingDuration;
14
+ provenTransactions;
15
+ provenBlocks;
16
+ constructor(prefix){
17
+ this.prefix = prefix;
18
+ }
19
+ recordSuccessfulTxs(count) {
20
+ this.successfulTxs = count;
21
+ }
22
+ recordProofDuration(seconds) {
23
+ this.proofDuration = seconds;
24
+ }
25
+ recordActiveAgents(count) {
26
+ this.activeAgents = count;
27
+ }
28
+ recordAvgQueueTime(ms) {
29
+ this.avgQueueTime = ms;
30
+ }
31
+ recordJobRetries(count) {
32
+ this.jobRetries = count;
33
+ }
34
+ recordJobDuration(ms) {
35
+ this.jobDuration = ms;
36
+ }
37
+ recordTimedOutJobs(count) {
38
+ this.timedOutJobs = count;
39
+ }
40
+ recordResolvedJobs(count) {
41
+ this.resolvedJobs = count;
42
+ }
43
+ recordRejectedJobs(count) {
44
+ this.rejectedJobs = count;
45
+ }
46
+ recordEpochProvingDuration(seconds) {
47
+ this.epochProvingDuration = seconds;
48
+ }
49
+ recordProvenTransactions(count) {
50
+ this.provenTransactions = count;
51
+ }
52
+ recordProvenBlocks(count) {
53
+ this.provenBlocks = count;
54
+ }
55
+ toGithubActionBenchmarkJSON() {
56
+ const data = [];
57
+ if (this.successfulTxs !== undefined) {
58
+ data.push({
59
+ name: `${this.prefix}/successful_txs`,
60
+ unit: 'count',
61
+ value: this.successfulTxs
62
+ });
63
+ }
64
+ if (this.proofDuration !== undefined) {
65
+ data.push({
66
+ name: `${this.prefix}/proof_duration`,
67
+ unit: 's',
68
+ value: this.proofDuration
69
+ });
70
+ }
71
+ if (this.activeAgents !== undefined) {
72
+ data.push({
73
+ name: `${this.prefix}/active_agents`,
74
+ unit: 'count',
75
+ value: this.activeAgents
76
+ });
77
+ }
78
+ if (this.avgQueueTime !== undefined) {
79
+ data.push({
80
+ name: `${this.prefix}/avg_queue_time`,
81
+ unit: 'ms',
82
+ value: this.avgQueueTime
83
+ });
84
+ }
85
+ if (this.jobRetries !== undefined) {
86
+ data.push({
87
+ name: `${this.prefix}/job_retries`,
88
+ unit: 'count',
89
+ value: this.jobRetries
90
+ });
91
+ }
92
+ if (this.jobDuration !== undefined) {
93
+ data.push({
94
+ name: `${this.prefix}/job_duration`,
95
+ unit: 'ms',
96
+ value: this.jobDuration
97
+ });
98
+ }
99
+ if (this.timedOutJobs !== undefined) {
100
+ data.push({
101
+ name: `${this.prefix}/timed_out_jobs`,
102
+ unit: 'count',
103
+ value: this.timedOutJobs
104
+ });
105
+ }
106
+ if (this.resolvedJobs !== undefined) {
107
+ data.push({
108
+ name: `${this.prefix}/resolved_jobs`,
109
+ unit: 'count',
110
+ value: this.resolvedJobs
111
+ });
112
+ }
113
+ if (this.rejectedJobs !== undefined) {
114
+ data.push({
115
+ name: `${this.prefix}/rejected_jobs`,
116
+ unit: 'count',
117
+ value: this.rejectedJobs
118
+ });
119
+ }
120
+ if (this.epochProvingDuration !== undefined) {
121
+ data.push({
122
+ name: `${this.prefix}/epoch_proving_duration`,
123
+ unit: 's',
124
+ value: this.epochProvingDuration
125
+ });
126
+ }
127
+ if (this.provenTransactions !== undefined) {
128
+ data.push({
129
+ name: `${this.prefix}/proven_transactions`,
130
+ unit: 'count',
131
+ value: this.provenTransactions
132
+ });
133
+ }
134
+ if (this.provenBlocks !== undefined) {
135
+ data.push({
136
+ name: `${this.prefix}/proven_blocks`,
137
+ unit: 'count',
138
+ value: this.provenBlocks
139
+ });
140
+ }
141
+ const scenario = process.env.BENCH_SCENARIO?.trim();
142
+ if (!scenario) {
143
+ return data;
144
+ }
145
+ const scenarioPrefix = `scenario/${scenario}/`;
146
+ return data.map((entry)=>({
147
+ ...entry,
148
+ name: `${scenarioPrefix}${entry.name}`
149
+ }));
150
+ }
151
+ }
2
152
  export class TxInclusionMetrics {
3
153
  aztecNode;
4
154
  logger;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/end-to-end",
3
- "version": "0.0.1-commit.bf2612ae",
3
+ "version": "0.0.1-commit.c80b6263",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "inherits": [
@@ -25,44 +25,44 @@
25
25
  "formatting": "run -T prettier --check ./src && run -T eslint ./src"
26
26
  },
27
27
  "dependencies": {
28
- "@aztec/accounts": "0.0.1-commit.bf2612ae",
29
- "@aztec/archiver": "0.0.1-commit.bf2612ae",
30
- "@aztec/aztec": "0.0.1-commit.bf2612ae",
31
- "@aztec/aztec-node": "0.0.1-commit.bf2612ae",
32
- "@aztec/aztec.js": "0.0.1-commit.bf2612ae",
33
- "@aztec/bb-prover": "0.0.1-commit.bf2612ae",
34
- "@aztec/bb.js": "0.0.1-commit.bf2612ae",
35
- "@aztec/blob-client": "0.0.1-commit.bf2612ae",
36
- "@aztec/blob-lib": "0.0.1-commit.bf2612ae",
37
- "@aztec/bot": "0.0.1-commit.bf2612ae",
38
- "@aztec/cli": "0.0.1-commit.bf2612ae",
39
- "@aztec/constants": "0.0.1-commit.bf2612ae",
40
- "@aztec/entrypoints": "0.0.1-commit.bf2612ae",
41
- "@aztec/epoch-cache": "0.0.1-commit.bf2612ae",
42
- "@aztec/ethereum": "0.0.1-commit.bf2612ae",
43
- "@aztec/foundation": "0.0.1-commit.bf2612ae",
44
- "@aztec/kv-store": "0.0.1-commit.bf2612ae",
45
- "@aztec/l1-artifacts": "0.0.1-commit.bf2612ae",
46
- "@aztec/merkle-tree": "0.0.1-commit.bf2612ae",
47
- "@aztec/node-keystore": "0.0.1-commit.bf2612ae",
48
- "@aztec/noir-contracts.js": "0.0.1-commit.bf2612ae",
49
- "@aztec/noir-noirc_abi": "0.0.1-commit.bf2612ae",
50
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.bf2612ae",
51
- "@aztec/noir-test-contracts.js": "0.0.1-commit.bf2612ae",
52
- "@aztec/p2p": "0.0.1-commit.bf2612ae",
53
- "@aztec/protocol-contracts": "0.0.1-commit.bf2612ae",
54
- "@aztec/prover-client": "0.0.1-commit.bf2612ae",
55
- "@aztec/prover-node": "0.0.1-commit.bf2612ae",
56
- "@aztec/pxe": "0.0.1-commit.bf2612ae",
57
- "@aztec/sequencer-client": "0.0.1-commit.bf2612ae",
58
- "@aztec/simulator": "0.0.1-commit.bf2612ae",
59
- "@aztec/slasher": "0.0.1-commit.bf2612ae",
60
- "@aztec/stdlib": "0.0.1-commit.bf2612ae",
61
- "@aztec/telemetry-client": "0.0.1-commit.bf2612ae",
62
- "@aztec/test-wallet": "0.0.1-commit.bf2612ae",
63
- "@aztec/validator-client": "0.0.1-commit.bf2612ae",
64
- "@aztec/validator-ha-signer": "0.0.1-commit.bf2612ae",
65
- "@aztec/world-state": "0.0.1-commit.bf2612ae",
28
+ "@aztec/accounts": "0.0.1-commit.c80b6263",
29
+ "@aztec/archiver": "0.0.1-commit.c80b6263",
30
+ "@aztec/aztec": "0.0.1-commit.c80b6263",
31
+ "@aztec/aztec-node": "0.0.1-commit.c80b6263",
32
+ "@aztec/aztec.js": "0.0.1-commit.c80b6263",
33
+ "@aztec/bb-prover": "0.0.1-commit.c80b6263",
34
+ "@aztec/bb.js": "0.0.1-commit.c80b6263",
35
+ "@aztec/blob-client": "0.0.1-commit.c80b6263",
36
+ "@aztec/blob-lib": "0.0.1-commit.c80b6263",
37
+ "@aztec/bot": "0.0.1-commit.c80b6263",
38
+ "@aztec/cli": "0.0.1-commit.c80b6263",
39
+ "@aztec/constants": "0.0.1-commit.c80b6263",
40
+ "@aztec/entrypoints": "0.0.1-commit.c80b6263",
41
+ "@aztec/epoch-cache": "0.0.1-commit.c80b6263",
42
+ "@aztec/ethereum": "0.0.1-commit.c80b6263",
43
+ "@aztec/foundation": "0.0.1-commit.c80b6263",
44
+ "@aztec/kv-store": "0.0.1-commit.c80b6263",
45
+ "@aztec/l1-artifacts": "0.0.1-commit.c80b6263",
46
+ "@aztec/merkle-tree": "0.0.1-commit.c80b6263",
47
+ "@aztec/node-keystore": "0.0.1-commit.c80b6263",
48
+ "@aztec/noir-contracts.js": "0.0.1-commit.c80b6263",
49
+ "@aztec/noir-noirc_abi": "0.0.1-commit.c80b6263",
50
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.c80b6263",
51
+ "@aztec/noir-test-contracts.js": "0.0.1-commit.c80b6263",
52
+ "@aztec/p2p": "0.0.1-commit.c80b6263",
53
+ "@aztec/protocol-contracts": "0.0.1-commit.c80b6263",
54
+ "@aztec/prover-client": "0.0.1-commit.c80b6263",
55
+ "@aztec/prover-node": "0.0.1-commit.c80b6263",
56
+ "@aztec/pxe": "0.0.1-commit.c80b6263",
57
+ "@aztec/sequencer-client": "0.0.1-commit.c80b6263",
58
+ "@aztec/simulator": "0.0.1-commit.c80b6263",
59
+ "@aztec/slasher": "0.0.1-commit.c80b6263",
60
+ "@aztec/stdlib": "0.0.1-commit.c80b6263",
61
+ "@aztec/telemetry-client": "0.0.1-commit.c80b6263",
62
+ "@aztec/test-wallet": "0.0.1-commit.c80b6263",
63
+ "@aztec/validator-client": "0.0.1-commit.c80b6263",
64
+ "@aztec/validator-ha-signer": "0.0.1-commit.c80b6263",
65
+ "@aztec/world-state": "0.0.1-commit.c80b6263",
66
66
  "@iarna/toml": "^2.2.5",
67
67
  "@jest/globals": "^30.0.0",
68
68
  "@noble/curves": "=1.0.0",
@@ -14,13 +14,15 @@ import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
14
14
  import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
15
15
  import { SecretValue } from '@aztec/foundation/config';
16
16
  import { randomBytes } from '@aztec/foundation/crypto/random';
17
- import { withLogNameSuffix } from '@aztec/foundation/log';
17
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
18
18
  import { retryUntil } from '@aztec/foundation/retry';
19
19
  import { sleep } from '@aztec/foundation/sleep';
20
20
  import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
21
+ import { TestContract } from '@aztec/noir-test-contracts.js/Test';
21
22
  import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
22
23
  import { ProverNode, type ProverNodeConfig, ProverNodePublisher } from '@aztec/prover-node';
23
24
  import type { TestProverNode } from '@aztec/prover-node/test';
25
+ import type { PXEConfig } from '@aztec/pxe/config';
24
26
  import {
25
27
  type SequencerClient,
26
28
  type SequencerEvents,
@@ -49,7 +51,11 @@ export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
49
51
  export const ARCHIVER_POLL_INTERVAL = 50;
50
52
  export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
51
53
 
52
- export type EpochsTestOpts = Partial<SetupOptions> & { numberOfAccounts?: number };
54
+ export type EpochsTestOpts = Partial<SetupOptions> & {
55
+ numberOfAccounts?: number;
56
+ pxeOpts?: Partial<PXEConfig>;
57
+ aztecSlotDurationInL1Slots?: number;
58
+ };
53
59
 
54
60
  export type TrackedSequencerEvent = {
55
61
  [K in keyof SequencerEvents]: Parameters<SequencerEvents[K]>[0] & {
@@ -94,7 +100,7 @@ export class EpochsTestContext {
94
100
  ? parseInt(process.env.L1_BLOCK_TIME)
95
101
  : DEFAULT_L1_BLOCK_TIME;
96
102
  const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
97
- const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
103
+ const aztecSlotDuration = opts.aztecSlotDuration ?? (opts.aztecSlotDurationInL1Slots ?? 2) * ethereumSlotDuration;
98
104
  const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
99
105
  const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
100
106
  const l1PublishingTime = opts.l1PublishingTime ?? 1;
@@ -147,8 +153,9 @@ export class EpochsTestContext {
147
153
  l1PublishingTime,
148
154
  ...opts,
149
155
  },
150
- // Use checkpointed chain tip for PXE to avoid issues with blocks being dropped due to pruned anchor blocks.
151
- { syncChainTip: 'checkpointed' },
156
+ // Use checkpointed chain tip for PXE by default to avoid issues with blocks being dropped due to pruned anchor blocks.
157
+ // Can be overridden via opts.pxeOpts.
158
+ { syncChainTip: 'checkpointed', ...opts.pxeOpts },
152
159
  );
153
160
 
154
161
  this.context = context;
@@ -204,14 +211,14 @@ export class EpochsTestContext {
204
211
  public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
205
212
  this.logger.warn('Creating and syncing a simulated prover node...');
206
213
  const proverNodePrivateKey = this.getNextPrivateKey();
207
- const suffix = (this.proverNodes.length + 1).toString();
208
- const proverNode = await withLogNameSuffix(suffix, () =>
214
+ const proverIndex = this.proverNodes.length + 1;
215
+ const proverNode = await withLoggerBindings({ actor: `prover-${proverIndex}` }, () =>
209
216
  createAndSyncProverNode(
210
217
  proverNodePrivateKey,
211
218
  { ...this.context.config },
212
219
  {
213
220
  dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
214
- proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
221
+ proverId: EthAddress.fromNumber(proverIndex),
215
222
  dontStart: opts.dontStart,
216
223
  ...opts,
217
224
  },
@@ -240,12 +247,13 @@ export class EpochsTestContext {
240
247
  private async createNode(
241
248
  opts: Partial<AztecNodeConfig> & { txDelayerMaxInclusionTimeIntoSlot?: number; dontStartSequencer?: boolean } = {},
242
249
  ) {
243
- const suffix = (this.nodes.length + 1).toString();
250
+ const nodeIndex = this.nodes.length + 1;
251
+ const actorPrefix = opts.disableValidator ? 'node' : 'validator';
244
252
  const { mockGossipSubNetwork } = this.context;
245
253
  const resolvedConfig = { ...this.context.config, ...opts };
246
254
  const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
247
255
  const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
248
- const node = await withLogNameSuffix(suffix, () =>
256
+ const node = await withLoggerBindings({ actor: `${actorPrefix}-${nodeIndex}` }, () =>
249
257
  AztecNodeService.createAndSync(
250
258
  {
251
259
  ...resolvedConfig,
@@ -375,6 +383,19 @@ export class EpochsTestContext {
375
383
  return SpamContract.at(instance.address, wallet);
376
384
  }
377
385
 
386
+ /** Registers the TestContract on the given wallet. */
387
+ public async registerTestContract(wallet: Wallet, salt = Fr.ZERO) {
388
+ const instance = await getContractInstanceFromInstantiationParams(TestContract.artifact, {
389
+ constructorArgs: [],
390
+ constructorArtifact: undefined,
391
+ salt,
392
+ publicKeys: undefined,
393
+ deployer: undefined,
394
+ });
395
+ await wallet.registerContract(instance, TestContract.artifact);
396
+ return TestContract.at(instance.address, wallet);
397
+ }
398
+
378
399
  /** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
379
400
  public async createL1Client() {
380
401
  const { client, delayer } = withDelayer(
@@ -56,7 +56,11 @@ export const submitTransactions = async (
56
56
  ): Promise<TxHash[]> => {
57
57
  const rpcConfig = getRpcConfig();
58
58
  rpcConfig.proverEnabled = false;
59
- const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
59
+ const wallet = await TestWallet.create(
60
+ node,
61
+ { ...getPXEConfig(), proverEnabled: false },
62
+ { loggerActorLabel: 'pxe-tx' },
63
+ );
60
64
  const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
61
65
  return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
62
66
  };
@@ -70,7 +74,11 @@ export async function prepareTransactions(
70
74
  const rpcConfig = getRpcConfig();
71
75
  rpcConfig.proverEnabled = false;
72
76
 
73
- const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
77
+ const wallet = await TestWallet.create(
78
+ node,
79
+ { ...getPXEConfig(), proverEnabled: false },
80
+ { loggerActorLabel: 'pxe-tx' },
81
+ );
74
82
  const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
75
83
 
76
84
  const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
@@ -198,7 +198,7 @@ export class FullProverTest {
198
198
  this.aztecNode,
199
199
  { proverEnabled: this.realProofs },
200
200
  undefined,
201
- true,
201
+ 'pxe-proven',
202
202
  );
203
203
  this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
204
204
  await provenWallet.registerContract(this.fakeProofsAssetInstance, TokenContract.artifact);
@@ -41,7 +41,7 @@ import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
41
41
  import { SecretValue } from '@aztec/foundation/config';
42
42
  import { randomBytes } from '@aztec/foundation/crypto/random';
43
43
  import { tryRmDir } from '@aztec/foundation/fs';
44
- import { withLogNameSuffix } from '@aztec/foundation/log';
44
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
45
45
  import { retryUntil } from '@aztec/foundation/retry';
46
46
  import { sleep } from '@aztec/foundation/sleep';
47
47
  import { DateProvider, TestDateProvider } from '@aztec/foundation/timer';
@@ -125,14 +125,14 @@ export async function setupSharedBlobStorage(config: { dataDirectory?: string }
125
125
  * @param aztecNode - An instance of Aztec Node.
126
126
  * @param opts - Partial configuration for the PXE.
127
127
  * @param logger - The logger to be used.
128
- * @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
128
+ * @param actor - Actor label to include in log output (e.g., 'pxe-test').
129
129
  * @returns A test wallet, logger and teardown function.
130
130
  */
131
131
  export async function setupPXEAndGetWallet(
132
132
  aztecNode: AztecNode,
133
133
  opts: Partial<PXEConfig> = {},
134
134
  logger = getLogger(),
135
- useLogSuffix = false,
135
+ actor?: string,
136
136
  ): Promise<{
137
137
  wallet: TestWallet;
138
138
  logger: Logger;
@@ -150,9 +150,7 @@ export async function setupPXEAndGetWallet(
150
150
 
151
151
  const teardown = configuredDataDirectory ? () => Promise.resolve() : () => tryRmDir(PXEConfig.dataDirectory!);
152
152
 
153
- const wallet = await TestWallet.create(aztecNode, PXEConfig, {
154
- useLogSuffix,
155
- });
153
+ const wallet = await TestWallet.create(aztecNode, PXEConfig, { loggerActorLabel: actor });
156
154
 
157
155
  return {
158
156
  wallet,
@@ -392,7 +390,7 @@ export async function setup(
392
390
  const res = await startAnvil({
393
391
  l1BlockTime: opts.ethereumSlotDuration,
394
392
  accounts: opts.anvilAccounts,
395
- port: opts.anvilPort,
393
+ port: opts.anvilPort ?? (process.env.ANVIL_PORT ? parseInt(process.env.ANVIL_PORT) : undefined),
396
394
  });
397
395
  anvil = res.anvil;
398
396
  config.l1RpcUrls = [res.rpcUrl];
@@ -574,10 +572,12 @@ export async function setup(
574
572
  }
575
573
  }
576
574
 
577
- const aztecNodeService = await AztecNodeService.createAndSync(
578
- config,
579
- { dateProvider, telemetry: telemetryClient, p2pClientDeps, logger: createLogger('node:MAIN-aztec-node') },
580
- { prefilledPublicData },
575
+ const aztecNodeService = await withLoggerBindings({ actor: 'node-0' }, () =>
576
+ AztecNodeService.createAndSync(
577
+ config,
578
+ { dateProvider, telemetry: telemetryClient, p2pClientDeps },
579
+ { prefilledPublicData },
580
+ ),
581
581
  );
582
582
  const sequencerClient = aztecNodeService.getSequencer();
583
583
 
@@ -611,7 +611,7 @@ export async function setup(
611
611
  pxeConfig.dataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
612
612
  // For tests we only want proving enabled if specifically requested
613
613
  pxeConfig.proverEnabled = !!pxeOpts.proverEnabled;
614
- const wallet = await TestWallet.create(aztecNodeService, pxeConfig);
614
+ const wallet = await TestWallet.create(aztecNodeService, pxeConfig, { loggerActorLabel: 'pxe-0' });
615
615
 
616
616
  if (opts.walletMinFeePadding !== undefined) {
617
617
  wallet.setMinFeePadding(opts.walletMinFeePadding);
@@ -797,7 +797,7 @@ export function createAndSyncProverNode(
797
797
  prefilledPublicData: PublicDataTreeLeaf[] = [],
798
798
  proverNodeDeps: ProverNodeDeps = {},
799
799
  ) {
800
- return withLogNameSuffix('prover-node', async () => {
800
+ return withLoggerBindings({ actor: 'prover-0' }, async () => {
801
801
  const aztecNodeTxProvider = aztecNode && {
802
802
  getTxByHash: aztecNode.getTxByHash.bind(aztecNode),
803
803
  getTxsByHash: aztecNode.getTxsByHash.bind(aztecNode),
@@ -4,14 +4,13 @@
4
4
  import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
5
5
  import { range } from '@aztec/foundation/array';
6
6
  import { SecretValue } from '@aztec/foundation/config';
7
- import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
7
+ import { withLoggerBindings } from '@aztec/foundation/log/server';
8
8
  import { bufferToHex } from '@aztec/foundation/string';
9
9
  import type { DateProvider } from '@aztec/foundation/timer';
10
10
  import type { ProverNodeConfig, ProverNodeDeps } from '@aztec/prover-node';
11
11
  import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
12
12
 
13
13
  import getPort from 'get-port';
14
- import { AsyncLocalStorage } from 'node:async_hooks';
15
14
 
16
15
  import { TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
17
16
  import { createAndSyncProverNode, getPrivateKeyFromIndex } from './utils.js';
@@ -22,6 +21,11 @@ import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
22
21
  // to avoid running validators with the same key
23
22
  export const ATTESTER_PRIVATE_KEYS_START_INDEX = 3;
24
23
 
24
+ // Global counters for actor naming (start at 1)
25
+ let validatorCounter = 1;
26
+ let nodeCounter = 1;
27
+ let proverCounter = 1;
28
+
25
29
  export function generatePrivateKeys(startIndex: number, numberOfKeys: number): `0x${string}`[] {
26
30
  const privateKeys: `0x${string}`[] = [];
27
31
  // Do not start from 0 as it is used during setup
@@ -44,10 +48,6 @@ export async function createNodes(
44
48
  validatorsPerNode = 1,
45
49
  ): Promise<AztecNodeService[]> {
46
50
  const nodePromises: Promise<AztecNodeService>[] = [];
47
- const loggerIdStorage = new AsyncLocalStorage<string>();
48
- const logNameHandler = (module: string) =>
49
- loggerIdStorage.getStore() ? `${module}:${loggerIdStorage.getStore()}` : module;
50
- addLogNameHandler(logNameHandler);
51
51
 
52
52
  for (let i = 0; i < numNodes; i++) {
53
53
  const index = indexOffset + i;
@@ -69,7 +69,6 @@ export async function createNodes(
69
69
  prefilledPublicData,
70
70
  dataDir,
71
71
  metricsPort,
72
- loggerIdStorage,
73
72
  );
74
73
  nodePromises.push(nodePromise);
75
74
  }
@@ -81,7 +80,6 @@ export async function createNodes(
81
80
  throw new Error('Sequencer not found');
82
81
  }
83
82
 
84
- removeLogNameHandler(logNameHandler);
85
83
  return nodes;
86
84
  }
87
85
 
@@ -95,9 +93,9 @@ export async function createNode(
95
93
  prefilledPublicData?: PublicDataTreeLeaf[],
96
94
  dataDirectory?: string,
97
95
  metricsPort?: number,
98
- loggerIdStorage?: AsyncLocalStorage<string>,
99
96
  ) {
100
- const createNode = async () => {
97
+ const actorIndex = validatorCounter++;
98
+ return await withLoggerBindings({ actor: `validator-${actorIndex}` }, async () => {
101
99
  const validatorConfig = await createValidatorConfig(config, bootstrapNode, tcpPort, addressIndex, dataDirectory);
102
100
  const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
103
101
  return await AztecNodeService.createAndSync(
@@ -105,8 +103,7 @@ export async function createNode(
105
103
  { telemetry, dateProvider },
106
104
  { prefilledPublicData, dontStartSequencer: config.dontStartSequencer },
107
105
  );
108
- };
109
- return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
106
+ });
110
107
  }
111
108
 
112
109
  /** Creates a P2P enabled instance of Aztec Node Service without a validator */
@@ -118,9 +115,9 @@ export async function createNonValidatorNode(
118
115
  prefilledPublicData?: PublicDataTreeLeaf[],
119
116
  dataDirectory?: string,
120
117
  metricsPort?: number,
121
- loggerIdStorage?: AsyncLocalStorage<string>,
122
118
  ) {
123
- const createNode = async () => {
119
+ const actorIndex = nodeCounter++;
120
+ return await withLoggerBindings({ actor: `node-${actorIndex}` }, async () => {
124
121
  const p2pConfig = await createP2PConfig(baseConfig, bootstrapNode, tcpPort, dataDirectory);
125
122
  const config: AztecNodeConfig = {
126
123
  ...p2pConfig,
@@ -130,8 +127,7 @@ export async function createNonValidatorNode(
130
127
  };
131
128
  const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
132
129
  return await AztecNodeService.createAndSync(config, { telemetry, dateProvider }, { prefilledPublicData });
133
- };
134
- return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
130
+ });
135
131
  }
136
132
 
137
133
  export async function createProverNode(
@@ -143,9 +139,9 @@ export async function createProverNode(
143
139
  prefilledPublicData?: PublicDataTreeLeaf[],
144
140
  dataDirectory?: string,
145
141
  metricsPort?: number,
146
- loggerIdStorage?: AsyncLocalStorage<string>,
147
142
  ) {
148
- const createProverNode = async () => {
143
+ const actorIndex = proverCounter++;
144
+ return await withLoggerBindings({ actor: `prover-${actorIndex}` }, async () => {
149
145
  const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!;
150
146
  const telemetry = await getEndToEndTestTelemetryClient(metricsPort);
151
147
 
@@ -165,8 +161,7 @@ export async function createProverNode(
165
161
  prefilledPublicData,
166
162
  { ...proverNodeDeps, telemetry },
167
163
  );
168
- };
169
- return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
164
+ });
170
165
  }
171
166
 
172
167
  export async function createP2PConfig(