@aztec/stdlib 0.82.2 → 0.82.3

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.
Files changed (114) hide show
  1. package/dest/avm/avm.d.ts +919 -1252
  2. package/dest/avm/avm.d.ts.map +1 -1
  3. package/dest/avm/avm.js +138 -111
  4. package/dest/avm/avm_proving_request.d.ts +400 -575
  5. package/dest/avm/avm_proving_request.d.ts.map +1 -1
  6. package/dest/block/l2_block_downloader/l2_block_stream.d.ts +1 -0
  7. package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +1 -1
  8. package/dest/block/l2_block_downloader/l2_block_stream.js +6 -0
  9. package/dest/database-version/version_manager.d.ts +4 -2
  10. package/dest/database-version/version_manager.d.ts.map +1 -1
  11. package/dest/database-version/version_manager.js +13 -9
  12. package/dest/epoch-helpers/index.d.ts +2 -0
  13. package/dest/epoch-helpers/index.d.ts.map +1 -1
  14. package/dest/epoch-helpers/index.js +3 -0
  15. package/dest/file-store/factory.d.ts +7 -0
  16. package/dest/file-store/factory.d.ts.map +1 -0
  17. package/dest/file-store/factory.js +46 -0
  18. package/dest/file-store/gcs.d.ts +22 -0
  19. package/dest/file-store/gcs.d.ts.map +1 -0
  20. package/dest/file-store/gcs.js +115 -0
  21. package/dest/file-store/http.d.ts +15 -0
  22. package/dest/file-store/http.d.ts.map +1 -0
  23. package/dest/file-store/http.js +53 -0
  24. package/dest/file-store/index.d.ts +3 -0
  25. package/dest/file-store/index.d.ts.map +1 -0
  26. package/dest/file-store/index.js +2 -0
  27. package/dest/file-store/interface.d.ts +24 -0
  28. package/dest/file-store/interface.d.ts.map +1 -0
  29. package/dest/file-store/interface.js +1 -0
  30. package/dest/file-store/local.d.ts +16 -0
  31. package/dest/file-store/local.d.ts.map +1 -0
  32. package/dest/file-store/local.js +40 -0
  33. package/dest/interfaces/aztec-node-admin.d.ts +9 -1
  34. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  35. package/dest/interfaces/aztec-node-admin.js +2 -1
  36. package/dest/interfaces/aztec-node.d.ts +3 -0
  37. package/dest/interfaces/aztec-node.d.ts.map +1 -1
  38. package/dest/interfaces/aztec-node.js +2 -0
  39. package/dest/interfaces/p2p.d.ts +2 -0
  40. package/dest/interfaces/p2p.d.ts.map +1 -1
  41. package/dest/interfaces/p2p.js +2 -1
  42. package/dest/interfaces/prover-node.d.ts +4 -0
  43. package/dest/interfaces/prover-node.d.ts.map +1 -1
  44. package/dest/interfaces/prover-node.js +5 -1
  45. package/dest/interfaces/proving-job.d.ts +400 -575
  46. package/dest/interfaces/proving-job.d.ts.map +1 -1
  47. package/dest/interfaces/service.d.ts +3 -0
  48. package/dest/interfaces/service.d.ts.map +1 -1
  49. package/dest/interfaces/service.js +7 -0
  50. package/dest/interfaces/world_state.d.ts +13 -15
  51. package/dest/interfaces/world_state.d.ts.map +1 -1
  52. package/dest/snapshots/download.d.ts +9 -0
  53. package/dest/snapshots/download.d.ts.map +1 -0
  54. package/dest/snapshots/download.js +37 -0
  55. package/dest/snapshots/index.d.ts +4 -0
  56. package/dest/snapshots/index.d.ts.map +1 -0
  57. package/dest/snapshots/index.js +3 -0
  58. package/dest/snapshots/types.d.ts +97 -0
  59. package/dest/snapshots/types.d.ts.map +1 -0
  60. package/dest/snapshots/types.js +27 -0
  61. package/dest/snapshots/upload.d.ts +5 -0
  62. package/dest/snapshots/upload.d.ts.map +1 -0
  63. package/dest/snapshots/upload.js +37 -0
  64. package/dest/tests/factories.d.ts +13 -7
  65. package/dest/tests/factories.d.ts.map +1 -1
  66. package/dest/tests/factories.js +37 -25
  67. package/dest/trees/merkle_tree_id.d.ts +8 -0
  68. package/dest/trees/merkle_tree_id.d.ts.map +1 -1
  69. package/dest/trees/merkle_tree_id.js +10 -0
  70. package/dest/trees/nullifier_leaf.d.ts +11 -2
  71. package/dest/trees/nullifier_leaf.d.ts.map +1 -1
  72. package/dest/trees/nullifier_leaf.js +12 -7
  73. package/dest/trees/nullifier_membership_witness.d.ts +7 -7
  74. package/dest/trees/public_data_leaf.d.ts +13 -0
  75. package/dest/trees/public_data_leaf.d.ts.map +1 -1
  76. package/dest/trees/public_data_leaf.js +6 -0
  77. package/dest/trees/public_data_witness.d.ts +7 -7
  78. package/dest/validators/index.d.ts +3 -0
  79. package/dest/validators/index.d.ts.map +1 -0
  80. package/dest/validators/index.js +1 -0
  81. package/dest/validators/schemas.d.ts +342 -0
  82. package/dest/validators/schemas.d.ts.map +1 -0
  83. package/dest/validators/schemas.js +40 -0
  84. package/dest/validators/types.d.ts +39 -0
  85. package/dest/validators/types.d.ts.map +1 -0
  86. package/dest/validators/types.js +1 -0
  87. package/package.json +11 -7
  88. package/src/avm/avm.ts +131 -106
  89. package/src/block/l2_block_downloader/l2_block_stream.ts +6 -0
  90. package/src/database-version/version_manager.ts +12 -8
  91. package/src/epoch-helpers/index.ts +8 -0
  92. package/src/file-store/factory.ts +61 -0
  93. package/src/file-store/gcs.ts +121 -0
  94. package/src/file-store/http.ts +58 -0
  95. package/src/file-store/index.ts +2 -0
  96. package/src/file-store/interface.ts +19 -0
  97. package/src/file-store/local.ts +46 -0
  98. package/src/interfaces/aztec-node-admin.ts +11 -1
  99. package/src/interfaces/aztec-node.ts +7 -0
  100. package/src/interfaces/p2p.ts +4 -0
  101. package/src/interfaces/prover-node.ts +10 -0
  102. package/src/interfaces/service.ts +13 -0
  103. package/src/interfaces/world_state.ts +17 -15
  104. package/src/snapshots/download.ts +60 -0
  105. package/src/snapshots/index.ts +3 -0
  106. package/src/snapshots/types.ts +58 -0
  107. package/src/snapshots/upload.ts +53 -0
  108. package/src/tests/factories.ts +74 -54
  109. package/src/trees/merkle_tree_id.ts +12 -0
  110. package/src/trees/nullifier_leaf.ts +9 -5
  111. package/src/trees/public_data_leaf.ts +9 -0
  112. package/src/validators/index.ts +3 -0
  113. package/src/validators/schemas.ts +53 -0
  114. package/src/validators/types.ts +37 -0
@@ -1 +1 @@
1
- {"version":3,"file":"avm_proving_request.d.ts","s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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGlC,CAAC"}
@@ -9,6 +9,7 @@ export declare class L2BlockStream {
9
9
  private opts;
10
10
  private readonly runningPromise;
11
11
  private isSyncing;
12
+ private hasStarted;
12
13
  constructor(l2BlockSource: Pick<L2BlockSource, 'getPublishedBlocks' | 'getBlockHeader' | 'getL2Tips'>, localData: L2BlockStreamLocalDataProvider, handler: L2BlockStreamEventHandler, log?: import("@aztec/foundation/log").Logger, opts?: {
13
14
  proven?: boolean;
14
15
  pollIntervalMS?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"l2_block_stream.d.ts","sourceRoot":"","sources":["../../../src/block/l2_block_downloader/l2_block_stream.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,uHAAuH;AACvH,qBAAa,aAAa;IAKtB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,IAAI;IARd,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,SAAS,CAAS;gBAGhB,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,oBAAoB,GAAG,gBAAgB,GAAG,WAAW,CAAC,EACzF,SAAS,EAAE,8BAA8B,EACzC,OAAO,EAAE,yBAAyB,EACzB,GAAG,yCAAqC,EACjD,IAAI,GAAE;QACZ,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;KACnB;IAKD,KAAK;IAKC,IAAI;IAIV,SAAS;IAIH,IAAI;cAMD,IAAI;IA+DpB;;;;OAIG;YACW,qBAAqB;YAoBrB,SAAS;CASxB;AAED,8FAA8F;AAC9F,MAAM,WAAW,8BAA8B;IAC7C,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC5D,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9B;AAED,gDAAgD;AAChD,MAAM,WAAW,yBAAyB;IACxC,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClE;AAED,MAAM,MAAM,kBAAkB,GAC1B;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,qCAAqC;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B,GACD;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,iEAAiE;IACjE,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;CACrB,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
1
+ {"version":3,"file":"l2_block_stream.d.ts","sourceRoot":"","sources":["../../../src/block/l2_block_downloader/l2_block_stream.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,aAAa,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,uHAAuH;AACvH,qBAAa,aAAa;IAMtB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,QAAQ,CAAC,GAAG;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,MAAM,CAAC;CACrB,CAAC"}
@@ -9,6 +9,7 @@ import { RunningPromise } from '@aztec/foundation/running-promise';
9
9
  opts;
10
10
  runningPromise;
11
11
  isSyncing;
12
+ hasStarted;
12
13
  constructor(l2BlockSource, localData, handler, log = createLogger('types:block_stream'), opts = {}){
13
14
  this.l2BlockSource = l2BlockSource;
14
15
  this.localData = localData;
@@ -16,6 +17,7 @@ import { RunningPromise } from '@aztec/foundation/running-promise';
16
17
  this.log = log;
17
18
  this.opts = opts;
18
19
  this.isSyncing = false;
20
+ this.hasStarted = false;
19
21
  this.runningPromise = new RunningPromise(()=>this.work(), log, this.opts.pollIntervalMS ?? 1000);
20
22
  }
21
23
  start() {
@@ -70,7 +72,11 @@ import { RunningPromise } from '@aztec/foundation/running-promise';
70
72
  // If we are just starting, use the starting block number from the options.
71
73
  if (latestBlockNumber === 0 && this.opts.startingBlock !== undefined) {
72
74
  latestBlockNumber = Math.max(this.opts.startingBlock - 1, 0);
75
+ }
76
+ // Only log this entry once (for sanity)
77
+ if (!this.hasStarted) {
73
78
  this.log.verbose(`Starting sync from block number ${latestBlockNumber}`);
79
+ this.hasStarted = true;
74
80
  }
75
81
  // Request new blocks from the source.
76
82
  while(latestBlockNumber < sourceTips.latest.number){
@@ -48,6 +48,7 @@ export declare class DatabaseVersion {
48
48
  static empty(): DatabaseVersion;
49
49
  }
50
50
  export type DatabaseVersionManagerFs = Pick<typeof fs, 'readFile' | 'writeFile' | 'rm' | 'mkdir'>;
51
+ export declare const DATABASE_VERSION_FILE_NAME = "db_version";
51
52
  /**
52
53
  * A manager for handling database versioning and migrations.
53
54
  * This class will check the version of data in a directory and either
@@ -75,6 +76,7 @@ export declare class DatabaseVersionManager<T> {
75
76
  * @param options - Configuration options
76
77
  */
77
78
  constructor(schemaVersion: number, rollupAddress: EthAddress, dataDirectory: string, onOpen: (dataDir: string) => Promise<T>, onUpgrade?: ((dataDir: string, currentVersion: number, latestVersion: number) => Promise<void>) | undefined, fileSystem?: DatabaseVersionManagerFs, log?: import("@aztec/foundation/log").Logger);
79
+ static writeVersion(version: DatabaseVersion, dataDir: string, fileSystem?: DatabaseVersionManagerFs): Promise<void>;
78
80
  /**
79
81
  * Checks the stored version against the current version and handles the outcome
80
82
  * by either resetting the data directory or calling an upgrade function
@@ -87,11 +89,11 @@ export declare class DatabaseVersionManager<T> {
87
89
  /**
88
90
  * Writes the current version to the version file
89
91
  */
90
- private writeVersion;
92
+ writeVersion(dir?: string): Promise<void>;
91
93
  /**
92
94
  * Resets the data directory by deleting it and recreating it
93
95
  */
94
- private resetDataDirectory;
96
+ resetDataDirectory(): Promise<void>;
95
97
  /**
96
98
  * Get the data directory path
97
99
  */
@@ -1 +1 @@
1
- {"version":3,"file":"version_manager.d.ts","sourceRoot":"","sources":["../../src/database-version/version_manager.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,qBAAa,eAAe;aACE,aAAa,EAAE,MAAM;aAAkB,aAAa,EAAE,UAAU;gBAAhE,aAAa,EAAE,MAAM,EAAkB,aAAa,EAAE,UAAU;IAErF,QAAQ,IAAI,MAAM;WAIX,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe;IAQtD;;OAEG;IACI,GAAG,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAa1D;;OAEG;IACI,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAI9C;;OAEG;IACH,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAED,uCAAuC;IAChC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM;IAI1B,QAAQ,IAAI,MAAM;IAIzB;;OA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MAAM,iBAAiB,MAAM,KAAK,QAAQ,IAAI,CAAC,aAAA,EAC7F,UAAU,GAAE,wBAA6B,EACzC,GAAG,yCAA6C;WAU7C,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,GAAE,wBAA6B;IAK9G;;;;;;;OAOG;IACU,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAmD1C;;OAEG;IACI,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD;;OAEG;IACU,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUhD;;OAEG;IACI,gBAAgB,IAAI,MAAM;IAIjC;;OAEG;IACI,gBAAgB,IAAI,MAAM;CAGlC"}
@@ -65,6 +65,7 @@ import { z } from 'zod';
65
65
  return new DatabaseVersion(0, EthAddress.ZERO);
66
66
  }
67
67
  }
68
+ export const DATABASE_VERSION_FILE_NAME = 'db_version';
68
69
  /**
69
70
  * A manager for handling database versioning and migrations.
70
71
  * This class will check the version of data in a directory and either
@@ -75,7 +76,7 @@ import { z } from 'zod';
75
76
  onUpgrade;
76
77
  fileSystem;
77
78
  log;
78
- static VERSION_FILE = 'db_version';
79
+ static VERSION_FILE = DATABASE_VERSION_FILE_NAME;
79
80
  versionFile;
80
81
  currentVersion;
81
82
  /**
@@ -101,6 +102,12 @@ import { z } from 'zod';
101
102
  this.versionFile = join(this.dataDirectory, DatabaseVersionManager.VERSION_FILE);
102
103
  this.currentVersion = new DatabaseVersion(schemaVersion, rollupAddress);
103
104
  }
105
+ static async writeVersion(version, dataDir, fileSystem = fs) {
106
+ await fileSystem.mkdir(dataDir, {
107
+ recursive: true
108
+ });
109
+ return fileSystem.writeFile(join(dataDir, DatabaseVersionManager.VERSION_FILE), version.toBuffer());
110
+ }
104
111
  /**
105
112
  * Checks the stored version against the current version and handles the outcome
106
113
  * by either resetting the data directory or calling an upgrade function
@@ -139,7 +146,9 @@ import { z } from 'zod';
139
146
  needsReset = true;
140
147
  }
141
148
  } else {
142
- this.log.warn('Rollup address changed, resetting data directory');
149
+ this.log.warn('Rollup address changed, resetting data directory', {
150
+ versionFile: this.versionFile
151
+ });
143
152
  needsReset = true;
144
153
  }
145
154
  // Handle reset if needed
@@ -155,13 +164,8 @@ import { z } from 'zod';
155
164
  }
156
165
  /**
157
166
  * Writes the current version to the version file
158
- */ async writeVersion() {
159
- // Ensure the directory exists
160
- await this.fileSystem.mkdir(this.dataDirectory, {
161
- recursive: true
162
- });
163
- // Write the version file
164
- await this.fileSystem.writeFile(this.versionFile, this.currentVersion.toBuffer());
167
+ */ writeVersion(dir) {
168
+ return DatabaseVersionManager.writeVersion(this.currentVersion, dir ?? this.dataDirectory, this.fileSystem);
165
169
  }
166
170
  /**
167
171
  * Resets the data directory by deleting it and recreating it
@@ -26,6 +26,8 @@ export declare const L1RollupConstantsSchema: z.ZodObject<{
26
26
  epochDuration: number;
27
27
  ethereumSlotDuration: number;
28
28
  }>;
29
+ /** Returns the timestamp for a given L2 slot. */
30
+ export declare function getTimestampForSlot(slot: bigint, constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'>): bigint;
29
31
  /** Returns the slot number for a given timestamp. */
30
32
  export declare function getSlotAtTimestamp(ts: bigint, constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'>): bigint;
31
33
  /** Returns the epoch number for a given timestamp. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/epoch-helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;CAC9B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AC;AAEvC,iDAAiD;AACjD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,cAAc,CAAC,UAGrE;AAED,qDAAqD;AACrD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,cAAc,CAAC,UAElH;AAED,sDAAsD;AACtD,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,cAAc,GAAG,eAAe,CAAC,UAGvF;AAED,iDAAiD;AACjD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,CAAC,UAE/F;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,CAAC,YAG5G;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,cAAc,GAAG,eAAe,GAAG,sBAAsB,CAAC,YAUhH"}
@@ -14,6 +14,9 @@ export const L1RollupConstantsSchema = z.object({
14
14
  epochDuration: z.number(),
15
15
  ethereumSlotDuration: z.number()
16
16
  });
17
+ /** Returns the timestamp for a given L2 slot. */ export function getTimestampForSlot(slot, constants) {
18
+ return constants.l1GenesisTime + slot * BigInt(constants.slotDuration);
19
+ }
17
20
  /** Returns the slot number for a given timestamp. */ export function getSlotAtTimestamp(ts, constants) {
18
21
  return ts < constants.l1GenesisTime ? 0n : (ts - constants.l1GenesisTime) / BigInt(constants.slotDuration);
19
22
  }
@@ -0,0 +1,7 @@
1
+ import { type Logger } from '@aztec/foundation/log';
2
+ import type { FileStore, ReadOnlyFileStore } from './interface.js';
3
+ export declare function createFileStore(config: string, logger?: Logger): Promise<FileStore>;
4
+ export declare function createFileStore(config: undefined, logger?: Logger): Promise<undefined>;
5
+ export declare function createReadOnlyFileStore(config: string, logger?: Logger): Promise<ReadOnlyFileStore>;
6
+ export declare function createReadOnlyFileStore(config: undefined, logger?: Logger): Promise<undefined>;
7
+ //# sourceMappingURL=factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/file-store/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AASnE,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAC3F,wBAAsB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAgC9F,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC3G,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { GoogleCloudFileStore } from './gcs.js';
3
+ import { HttpFileStore } from './http.js';
4
+ import { LocalFileStore } from './local.js';
5
+ const supportedExamples = [
6
+ `gs://bucket-name/path/to/store`,
7
+ `file:///absolute/local/path/to/store`,
8
+ `https://host/path`
9
+ ];
10
+ export async function createFileStore(config, logger = createLogger('stdlib:file-store')) {
11
+ if (config === undefined) {
12
+ return undefined;
13
+ } else if (config.startsWith('file://')) {
14
+ const url = new URL(config);
15
+ if (url.host) {
16
+ throw new Error(`File store URL only supports local paths (got host ${url.host} from ${config})`);
17
+ }
18
+ const path = url.pathname;
19
+ logger.info(`Creating local file file store at ${path}`);
20
+ return new LocalFileStore(path);
21
+ } else if (config.startsWith('gs://')) {
22
+ try {
23
+ const url = new URL(config);
24
+ const bucket = url.host;
25
+ const path = url.pathname.replace(/^\/+/, '');
26
+ logger.info(`Creating google cloud file store at ${bucket} ${path}`);
27
+ const store = new GoogleCloudFileStore(bucket, path);
28
+ await store.checkCredentials();
29
+ return store;
30
+ } catch (err) {
31
+ throw new Error(`Invalid google cloud store definition: '${config}'.`);
32
+ }
33
+ } else {
34
+ throw new Error(`Unknown file store config: '${config}'. Supported values are ${supportedExamples.join(', ')}.`);
35
+ }
36
+ }
37
+ export async function createReadOnlyFileStore(config, logger = createLogger('stdlib:file-store')) {
38
+ if (config === undefined) {
39
+ return undefined;
40
+ } else if (config.startsWith('http://') || config.startsWith('https://')) {
41
+ logger.info(`Creating read-only HTTP file store at ${config}`);
42
+ return new HttpFileStore(config, logger);
43
+ } else {
44
+ return await createFileStore(config, logger);
45
+ }
46
+ }
@@ -0,0 +1,22 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
+ import { type Logger } from '@aztec/foundation/log';
4
+ import type { FileStore, FileStoreSaveOptions } from './interface.js';
5
+ export declare class GoogleCloudFileStore implements FileStore {
6
+ private readonly bucketName;
7
+ private readonly basePath;
8
+ private readonly log;
9
+ private readonly storage;
10
+ constructor(bucketName: string, basePath: string, log?: Logger);
11
+ checkCredentials(): Promise<void>;
12
+ save(path: string, data: Buffer, opts?: FileStoreSaveOptions): Promise<string>;
13
+ upload(destPath: string, srcPath: string, opts?: FileStoreSaveOptions): Promise<string>;
14
+ private handleUploadedFile;
15
+ read(pathOrUrlStr: string): Promise<Buffer>;
16
+ download(pathOrUrlStr: string, destPath: string): Promise<void>;
17
+ exists(pathOrUrlStr: string): Promise<boolean>;
18
+ private getFileObject;
19
+ private getBucketAndFullPath;
20
+ private getFullPath;
21
+ }
22
+ //# sourceMappingURL=gcs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gcs.d.ts","sourceRoot":"","sources":["../../src/file-store/gcs.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAKlE,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,qBAAa,oBAAqB,YAAW,SAAS;IAIlD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;gBAGf,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAA8C;IAKzD,gBAAgB;IAIhB,IAAI,CACf,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,oBAAuE,GAC5E,OAAO,CAAC,MAAM,CAAC;IAYL,MAAM,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,oBAAsE,GAC3E,OAAO,CAAC,MAAM,CAAC;YAiBJ,kBAAkB;IAmBnB,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM3C,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK/D,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;YAQ7C,aAAa;IAU3B,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,WAAW;CAGpB"}
@@ -0,0 +1,115 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { Storage } from '@google-cloud/storage';
3
+ import { join } from 'path';
4
+ export class GoogleCloudFileStore {
5
+ bucketName;
6
+ basePath;
7
+ log;
8
+ storage;
9
+ constructor(bucketName, basePath, log = createLogger('stdlib:gcs-file-store')){
10
+ this.bucketName = bucketName;
11
+ this.basePath = basePath;
12
+ this.log = log;
13
+ this.storage = new Storage();
14
+ }
15
+ async checkCredentials() {
16
+ await this.storage.getServiceAccount();
17
+ }
18
+ async save(path, data, opts = {
19
+ public: false,
20
+ metadata: {},
21
+ compress: false
22
+ }) {
23
+ const fullPath = this.getFullPath(path);
24
+ try {
25
+ const bucket = this.storage.bucket(this.bucketName);
26
+ const file = bucket.file(fullPath);
27
+ await file.save(data, {
28
+ metadata: opts.metadata,
29
+ gzip: opts.compress
30
+ });
31
+ return this.handleUploadedFile(file, opts);
32
+ } catch (err) {
33
+ throw new Error(`Error saving file to google cloud storage at ${fullPath}: ${err.message ?? err}`);
34
+ }
35
+ }
36
+ async upload(destPath, srcPath, opts = {
37
+ compress: true,
38
+ public: false,
39
+ metadata: {}
40
+ }) {
41
+ const fullPath = this.getFullPath(destPath);
42
+ try {
43
+ const bucket = this.storage.bucket(this.bucketName);
44
+ const file = bucket.file(fullPath);
45
+ const uploadOpts = {
46
+ destination: file,
47
+ gzip: opts.compress,
48
+ metadata: opts.metadata
49
+ };
50
+ await bucket.upload(srcPath, uploadOpts);
51
+ return this.handleUploadedFile(file, opts);
52
+ } catch (err) {
53
+ throw new Error(`Error saving file to google cloud storage at ${fullPath}: ${err.message ?? err}`);
54
+ }
55
+ }
56
+ async handleUploadedFile(file, opts) {
57
+ if (opts.public) {
58
+ try {
59
+ if (!await file.isPublic()) {
60
+ await file.makePublic();
61
+ }
62
+ } catch (err) {
63
+ this.log.warn(`Error making file ${file.name} public: ${err.message ?? err}. This is expected if we handle public access at the bucket level.`);
64
+ }
65
+ return file.publicUrl().replaceAll('%2F', '/');
66
+ } else {
67
+ return file.cloudStorageURI.toString();
68
+ }
69
+ }
70
+ async read(pathOrUrlStr) {
71
+ const file = await this.getFileObject(pathOrUrlStr);
72
+ const contents = await file.download();
73
+ return contents[0];
74
+ }
75
+ async download(pathOrUrlStr, destPath) {
76
+ const file = await this.getFileObject(pathOrUrlStr);
77
+ await file.download({
78
+ destination: destPath
79
+ });
80
+ }
81
+ async exists(pathOrUrlStr) {
82
+ const { bucketName, fullPath } = this.getBucketAndFullPath(pathOrUrlStr);
83
+ const bucket = this.storage.bucket(bucketName);
84
+ const file = bucket.file(fullPath);
85
+ const [exists] = await file.exists();
86
+ return exists;
87
+ }
88
+ async getFileObject(pathOrUrlStr) {
89
+ const { bucketName, fullPath } = this.getBucketAndFullPath(pathOrUrlStr);
90
+ const bucket = this.storage.bucket(bucketName);
91
+ const file = bucket.file(fullPath);
92
+ if (!await file.exists()) {
93
+ throw new Error(`File at ${fullPath} in gcs bucket ${bucketName} does not exist`);
94
+ }
95
+ return file;
96
+ }
97
+ getBucketAndFullPath(pathOrUrlStr) {
98
+ if (URL.canParse(pathOrUrlStr)) {
99
+ const url = new URL(pathOrUrlStr);
100
+ // Note that we accept reading from anywhere, not just our bucket
101
+ return {
102
+ fullPath: url.pathname.replace(/^\/+/, ''),
103
+ bucketName: url.host
104
+ };
105
+ } else {
106
+ return {
107
+ fullPath: this.getFullPath(pathOrUrlStr),
108
+ bucketName: this.bucketName
109
+ };
110
+ }
111
+ }
112
+ getFullPath(path) {
113
+ return this.basePath && this.basePath.length > 0 ? join(this.basePath, path) : path;
114
+ }
115
+ }
@@ -0,0 +1,15 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
+ import { type Logger } from '@aztec/foundation/log';
4
+ import type { ReadOnlyFileStore } from './interface.js';
5
+ export declare class HttpFileStore implements ReadOnlyFileStore {
6
+ private readonly baseUrl;
7
+ private readonly log;
8
+ private readonly fetch;
9
+ constructor(baseUrl: string, log?: Logger);
10
+ read(pathOrUrl: string): Promise<Buffer>;
11
+ download(pathOrUrl: string, destPath: string): Promise<void>;
12
+ exists(pathOrUrl: string): Promise<boolean>;
13
+ private getUrl;
14
+ }
15
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/file-store/http.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AASlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,qBAAa,aAAc,YAAW,iBAAiB;IAGzC,OAAO,CAAC,QAAQ,CAAC,OAAO;IAAU,OAAO,CAAC,QAAQ,CAAC,GAAG;IAFlE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;gBAER,OAAO,EAAE,MAAM,EAAmB,GAAG,GAAE,MAA+C;IAYtG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAUxC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY5D,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMxD,OAAO,CAAC,MAAM;CAGf"}
@@ -0,0 +1,53 @@
1
+ import { createLogger } from '@aztec/foundation/log';
2
+ import { makeBackoff, retry } from '@aztec/foundation/retry';
3
+ import { createWriteStream } from 'fs';
4
+ import { mkdir } from 'fs/promises';
5
+ import { dirname } from 'path';
6
+ import { Readable } from 'stream';
7
+ import { finished } from 'stream/promises';
8
+ export class HttpFileStore {
9
+ baseUrl;
10
+ log;
11
+ fetch;
12
+ constructor(baseUrl, log = createLogger('stdlib:http-file-store')){
13
+ this.baseUrl = baseUrl;
14
+ this.log = log;
15
+ this.fetch = async (...args)=>{
16
+ return await retry(()=>fetch(...args), `Fetching ${args[0]}`, makeBackoff([
17
+ 1,
18
+ 1,
19
+ 3
20
+ ]), this.log, /*failSilently=*/ true);
21
+ };
22
+ }
23
+ async read(pathOrUrl) {
24
+ const url = this.getUrl(pathOrUrl);
25
+ const response = await this.fetch(url);
26
+ if (response.ok) {
27
+ return Buffer.from(await response.arrayBuffer());
28
+ } else {
29
+ throw new Error(`Error fetching file from ${url}: ${response.statusText}`);
30
+ }
31
+ }
32
+ async download(pathOrUrl, destPath) {
33
+ const url = this.getUrl(pathOrUrl);
34
+ const response = await this.fetch(url);
35
+ if (response.ok) {
36
+ await mkdir(dirname(destPath), {
37
+ recursive: true
38
+ });
39
+ // Typescript complains about Readable.fromWeb, hence the cast
40
+ await finished(Readable.fromWeb(response.body).pipe(createWriteStream(destPath)));
41
+ } else {
42
+ throw new Error(`Error fetching file from ${url}: ${response.statusText}`);
43
+ }
44
+ }
45
+ async exists(pathOrUrl) {
46
+ const url = this.getUrl(pathOrUrl);
47
+ const response = await this.fetch(url);
48
+ return response.ok;
49
+ }
50
+ getUrl(path) {
51
+ return URL.canParse(path) ? path : `${this.baseUrl.replace(/\/$/, '')}/${path}`;
52
+ }
53
+ }
@@ -0,0 +1,3 @@
1
+ export * from './interface.js';
2
+ export * from './factory.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file-store/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './interface.js';
2
+ export * from './factory.js';
@@ -0,0 +1,24 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
+ /** Simple read-only file store. */
4
+ export interface ReadOnlyFileStore {
5
+ /** Reads a file given a path, or an URI as returned by calling `save`. Returns file contents. */
6
+ read(pathOrUrl: string): Promise<Buffer>;
7
+ /** Downloads a file given a path, or an URI as returned by calling `save`. Saves file to local path. */
8
+ download(pathOrUrlStr: string, destPath: string): Promise<void>;
9
+ /** Returns whether a file at the given path or URI exists. */
10
+ exists(pathOrUrl: string): Promise<boolean>;
11
+ }
12
+ export type FileStoreSaveOptions = {
13
+ public?: boolean;
14
+ metadata?: Record<string, string>;
15
+ compress?: boolean;
16
+ };
17
+ /** Simple file store. */
18
+ export interface FileStore extends ReadOnlyFileStore {
19
+ /** Saves contents to the given path. Returns an URI that can be used later to `read` the file. */
20
+ save(path: string, data: Buffer, opts?: FileStoreSaveOptions): Promise<string>;
21
+ /** Uploads contents from a local file. Returns an URI that can be used later to `read` the file. */
22
+ upload(destPath: string, srcPath: string, opts?: FileStoreSaveOptions): Promise<string>;
23
+ }
24
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/file-store/interface.ts"],"names":[],"mappings":";;AAAA,mCAAmC;AACnC,MAAM,WAAW,iBAAiB;IAChC,iGAAiG;IACjG,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,8DAA8D;IAC9D,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,MAAM,oBAAoB,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE/G,yBAAyB;AACzB,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAClD,kGAAkG;IAClG,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E,oGAAoG;IACpG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzF"}
@@ -0,0 +1 @@
1
+ /** Simple read-only file store. */ /** Simple file store. */ export { };
@@ -0,0 +1,16 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ /// <reference types="node" resolution-mode="require"/>
3
+ import type { FileStore } from './interface.js';
4
+ export declare class LocalFileStore implements FileStore {
5
+ private readonly basePath;
6
+ constructor(basePath: string);
7
+ save(path: string, data: Buffer): Promise<string>;
8
+ upload(destPath: string, srcPath: string, _opts: {
9
+ compress: boolean;
10
+ }): Promise<string>;
11
+ read(pathOrUrlStr: string): Promise<Buffer>;
12
+ download(pathOrUrlStr: string, destPath: string): Promise<void>;
13
+ exists(pathOrUrlStr: string): Promise<boolean>;
14
+ private getFullPath;
15
+ }
16
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../src/file-store/local.ts"],"names":[],"mappings":";;AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,qBAAa,cAAe,YAAW,SAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,MAAM;IAEhC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOjD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9F,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMrE,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAOrD,OAAO,CAAC,WAAW;CAOpB"}
@@ -0,0 +1,40 @@
1
+ import { access, mkdir, readFile, writeFile } from 'fs/promises';
2
+ import { dirname, resolve } from 'path';
3
+ export class LocalFileStore {
4
+ basePath;
5
+ constructor(basePath){
6
+ this.basePath = basePath;
7
+ }
8
+ async save(path, data) {
9
+ const fullPath = this.getFullPath(path);
10
+ await mkdir(dirname(fullPath), {
11
+ recursive: true
12
+ });
13
+ await writeFile(fullPath, data);
14
+ return `file://${fullPath}`;
15
+ }
16
+ async upload(destPath, srcPath, _opts) {
17
+ const data = await readFile(srcPath);
18
+ return this.save(destPath, data);
19
+ }
20
+ read(pathOrUrlStr) {
21
+ const fullPath = this.getFullPath(pathOrUrlStr);
22
+ return readFile(fullPath);
23
+ }
24
+ async download(pathOrUrlStr, destPath) {
25
+ const data = await this.read(pathOrUrlStr);
26
+ const fullPath = this.getFullPath(destPath);
27
+ await writeFile(fullPath, data);
28
+ }
29
+ exists(pathOrUrlStr) {
30
+ const fullPath = this.getFullPath(pathOrUrlStr);
31
+ return access(fullPath).then(()=>true).catch(()=>false);
32
+ }
33
+ getFullPath(pathOrUrl) {
34
+ if (URL.canParse(pathOrUrl)) {
35
+ return new URL(pathOrUrl).pathname;
36
+ } else {
37
+ return resolve(this.basePath, pathOrUrl);
38
+ }
39
+ }
40
+ }
@@ -12,8 +12,16 @@ export interface AztecNodeAdmin {
12
12
  * @param config - Updated configuration to be merged with the current one.
13
13
  */
14
14
  setConfig(config: Partial<SequencerConfig & ProverConfig>): Promise<void>;
15
- /** Forces the next block to be built bypassing all time and pending checks. Useful for testing. */
15
+ /**
16
+ * Forces the next block to be built bypassing all time and pending checks.
17
+ * Useful for testing.
18
+ */
16
19
  flushTxs(): Promise<void>;
20
+ /**
21
+ * Pauses syncing, creates a backup of archiver and world-state databases, and uploads them. Returns immediately.
22
+ * @param location - The location to upload the snapshot to.
23
+ */
24
+ startSnapshotUpload(location: string): Promise<void>;
17
25
  }
18
26
  export declare const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin>;
19
27
  export declare function createAztecNodeAdminClient(url: string, versions?: Partial<ComponentsVersions>, fetch?: typeof defaultFetch): AztecNodeAdmin;
@@ -1 +1 @@
1
- {"version":3,"file":"aztec-node-admin.d.ts","sourceRoot":"","sources":["../../src/interfaces/aztec-node-admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAI1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,kBAAkB,EAAgC,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1E,mGAAmG;IACnG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,cAAc,CAGhE,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,cAAc,CAMhB"}
1
+ {"version":3,"file":"aztec-node-admin.d.ts","sourceRoot":"","sources":["../../src/interfaces/aztec-node-admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAI1F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,kBAAkB,EAAgC,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAE,KAAK,eAAe,EAAyB,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,oBAAoB,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1E;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;OAGG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD;AAED,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,cAAc,CAIhE,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,cAAc,CAMhB"}
@@ -5,7 +5,8 @@ import { SequencerConfigSchema } from './configs.js';
5
5
  import { ProverConfigSchema } from './prover-client.js';
6
6
  export const AztecNodeAdminApiSchema = {
7
7
  setConfig: z.function().args(SequencerConfigSchema.merge(ProverConfigSchema).partial()).returns(z.void()),
8
- flushTxs: z.function().returns(z.void())
8
+ flushTxs: z.function().returns(z.void()),
9
+ startSnapshotUpload: z.function().args(z.string()).returns(z.void())
9
10
  };
10
11
  export function createAztecNodeAdminClient(url, versions = {}, fetch = defaultFetch) {
11
12
  return createSafeJsonRpcClient(url, AztecNodeAdminApiSchema, {
@@ -19,6 +19,7 @@ import { NullifierMembershipWitness } from '../trees/nullifier_membership_witnes
19
19
  import { PublicDataWitness } from '../trees/public_data_witness.js';
20
20
  import { BlockHeader, PublicSimulationOutput, Tx, TxHash, TxReceipt, type TxValidationResult } from '../tx/index.js';
21
21
  import { TxEffect } from '../tx/tx_effect.js';
22
+ import type { ValidatorsStats } from '../validators/types.js';
22
23
  import { type ComponentsVersions } from '../versioning/index.js';
23
24
  import { type GetContractClassLogsResponse, type GetPublicLogsResponse } from './get_logs_response.js';
24
25
  import type { ProverCoordination } from './prover-coordination.js';
@@ -280,6 +281,8 @@ export interface AztecNode extends ProverCoordination, Pick<L2BlockSource, 'getB
280
281
  * @returns The current committed block header.
281
282
  */
282
283
  getBlockHeader(blockNumber?: L2BlockNumber): Promise<BlockHeader | undefined>;
284
+ /** Returns stats for validators if enabled. */
285
+ getValidatorsStats(): Promise<ValidatorsStats>;
283
286
  /**
284
287
  * Simulates the public part of a transaction with the current state.
285
288
  * This currently just checks that the transaction execution succeeds.