@aztec/end-to-end 3.0.0-nightly.20251221 → 3.0.0-nightly.20251223

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.
@@ -10,8 +10,7 @@ import { type Logger, createLogger } from '@aztec/aztec.js/log';
10
10
  import { type AztecNode, createAztecNodeClient, waitForNode } from '@aztec/aztec.js/node';
11
11
  import type { Wallet } from '@aztec/aztec.js/wallet';
12
12
  import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
13
- import { createBlobSinkClient } from '@aztec/blob-sink/client';
14
- import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server';
13
+ import { type BlobClientInterface, createBlobClientWithFileStores } from '@aztec/blob-client/client';
15
14
  import { SPONSORED_FPC_SALT } from '@aztec/constants';
16
15
  import { isAnvilTestChain } from '@aztec/ethereum/chain';
17
16
  import { createExtendedL1Client } from '@aztec/ethereum/client';
@@ -70,7 +69,6 @@ import { getGenesisValues } from '@aztec/world-state/testing';
70
69
  import type { Anvil } from '@viem/anvil';
71
70
  import { randomBytes } from 'crypto';
72
71
  import fs from 'fs/promises';
73
- import getPort from 'get-port';
74
72
  import { tmpdir } from 'os';
75
73
  import * as path from 'path';
76
74
  import type { Hex } from 'viem';
@@ -91,6 +89,16 @@ import { isMetricsLoggingRequested, setupMetricsLogger } from './logging.js';
91
89
  export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
92
90
  export { startAnvil };
93
91
 
92
+ /**
93
+ * Sets up shared blob storage using FileStore in the data directory.
94
+ */
95
+ export async function setupSharedBlobStorage(config: { dataDirectory?: string } & Record<string, any>): Promise<void> {
96
+ const sharedBlobPath = path.join(config.dataDirectory!, 'shared-blobs');
97
+ await fs.mkdir(sharedBlobPath, { recursive: true });
98
+ config.blobFileStoreUrls = [`file://${sharedBlobPath}`];
99
+ config.blobFileStoreUploadUrl = `file://${sharedBlobPath}`;
100
+ }
101
+
94
102
  const { AZTEC_NODE_URL = '' } = process.env;
95
103
  const getAztecUrl = () => AZTEC_NODE_URL;
96
104
 
@@ -232,8 +240,8 @@ async function setupWithRemoteEnvironment(
232
240
  mockGossipSubNetwork: undefined,
233
241
  watcher: undefined,
234
242
  dateProvider: undefined,
235
- blobSink: undefined,
236
243
  telemetryClient: undefined,
244
+ blobClient: undefined,
237
245
  teardown,
238
246
  };
239
247
  }
@@ -312,14 +320,14 @@ export type EndToEndContext = {
312
320
  watcher: AnvilTestWatcher | undefined;
313
321
  /** Allows tweaking current system time, used by the epoch cache only (undefined if connected to remote environment) */
314
322
  dateProvider: TestDateProvider | undefined;
315
- /** The blob sink (undefined if connected to remote environment) */
316
- blobSink: BlobSinkServer | undefined;
317
323
  /** Telemetry client */
318
324
  telemetryClient: TelemetryClient | undefined;
319
325
  /** Mock gossip sub network used for gossipping messages (only if mockGossipSubNetwork was set to true in opts) */
320
326
  mockGossipSubNetwork: MockGossipSubNetwork | undefined;
321
327
  /** Prefilled public data used for setting up nodes. */
322
328
  prefilledPublicData: PublicDataTreeLeaf[] | undefined;
329
+ /** The blob client client used for blob storage (undefined if connected to remote environment) */
330
+ blobClient: BlobClientInterface | undefined;
323
331
  /** Function to stop the started services. */
324
332
  teardown: () => Promise<void>;
325
333
  };
@@ -489,21 +497,7 @@ export async function setup(
489
497
 
490
498
  const telemetry = await getTelemetryClient(opts.telemetryConfig);
491
499
 
492
- // Blob sink service - blobs get posted here and served from here
493
- const blobSinkPort = await getPort();
494
- const blobSink = await createBlobSinkServer(
495
- {
496
- l1ChainId: config.l1ChainId,
497
- l1RpcUrls: config.l1RpcUrls,
498
- l1Contracts: config.l1Contracts,
499
- port: blobSinkPort,
500
- dataDirectory: config.dataDirectory,
501
- dataStoreMapSizeKb: config.dataStoreMapSizeKb,
502
- },
503
- telemetry,
504
- );
505
- await blobSink.start();
506
- config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
500
+ await setupSharedBlobStorage(config);
507
501
 
508
502
  logger.verbose('Creating and synching an aztec node', config);
509
503
 
@@ -519,7 +513,7 @@ export async function setup(
519
513
  config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
520
514
  }
521
515
 
522
- const blobSinkClient = createBlobSinkClient(config, { logger: createLogger('node:blob-sink:client') });
516
+ const blobClient = await createBlobClientWithFileStores(config, createLogger('node:blob-client:client'));
523
517
 
524
518
  let mockGossipSubNetwork: MockGossipSubNetwork | undefined;
525
519
  let p2pClientDeps: P2PClientDeps<P2PClientType.Full> | undefined = undefined;
@@ -559,7 +553,7 @@ export async function setup(
559
553
 
560
554
  const aztecNode = await AztecNodeService.createAndSync(
561
555
  config, // REFACTOR: createAndSync mutates this config
562
- { dateProvider, blobSinkClient, telemetry, p2pClientDeps, logger: createLogger('node:MAIN-aztec-node') },
556
+ { dateProvider, blobClient, telemetry, p2pClientDeps, logger: createLogger('node:MAIN-aztec-node') },
563
557
  { prefilledPublicData },
564
558
  );
565
559
  const sequencerClient = aztecNode.getSequencer();
@@ -647,7 +641,6 @@ export async function setup(
647
641
  await tryStop(watcher, logger);
648
642
  await tryStop(anvil, logger);
649
643
 
650
- await tryStop(blobSink, logger);
651
644
  await tryRmDir(directoryToCleanup, logger);
652
645
  } catch (err) {
653
646
  logger.error(`Error during e2e test teardown`, err);
@@ -657,7 +650,6 @@ export async function setup(
657
650
  return {
658
651
  aztecNode,
659
652
  aztecNodeAdmin: aztecNode,
660
- blobSink,
661
653
  cheatCodes,
662
654
  ethCheatCodes,
663
655
  config,
@@ -674,6 +666,7 @@ export async function setup(
674
666
  wallet,
675
667
  accounts,
676
668
  watcher,
669
+ blobClient,
677
670
  };
678
671
  } catch (err) {
679
672
  // TODO: Just hoisted anvil for now to ensure cleanup. Prob need to hoist the rest.
@@ -852,13 +845,13 @@ export function createAndSyncProverNode(
852
845
  stop: () => Promise.resolve(),
853
846
  };
854
847
 
855
- const blobSinkClient = createBlobSinkClient(aztecNodeConfig);
848
+ const blobClient = await createBlobClientWithFileStores(aztecNodeConfig, createLogger('blob-client:prover-node'));
856
849
 
857
850
  // Creating temp store and archiver for simulated prover node
858
851
  const archiverConfig = { ...aztecNodeConfig, dataDirectory: proverNodeConfig.dataDirectory };
859
852
  const archiver = await createArchiver(
860
853
  archiverConfig,
861
- { blobSinkClient, dateProvider: proverNodeDeps.dateProvider },
854
+ { blobClient, dateProvider: proverNodeDeps.dateProvider },
862
855
  { blockUntilSync: true },
863
856
  );
864
857
 
@@ -963,7 +963,7 @@ export async function getPublicViemClient(
963
963
  containerPort: 8545,
964
964
  });
965
965
  const url = `http://127.0.0.1:${port}`;
966
- const client: ViemPublicClient = createPublicClient({ transport: fallback([http(url)]) });
966
+ const client: ViemPublicClient = createPublicClient({ transport: fallback([http(url, { batch: false })]) });
967
967
  if (processes) {
968
968
  processes.push(process);
969
969
  }
@@ -973,7 +973,9 @@ export async function getPublicViemClient(
973
973
  if (!L1_RPC_URLS_JSON) {
974
974
  throw new Error(`L1_RPC_URLS_JSON is not defined`);
975
975
  }
976
- const client: ViemPublicClient = createPublicClient({ transport: fallback([http(L1_RPC_URLS_JSON)]) });
976
+ const client: ViemPublicClient = createPublicClient({
977
+ transport: fallback([http(L1_RPC_URLS_JSON, { batch: false })]),
978
+ });
977
979
  return { url: L1_RPC_URLS_JSON, client };
978
980
  }
979
981
  }