@aztec-labs/stdlib 6.1.0-nightly.20261113 → 6.1.0-rc.1

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 (81) hide show
  1. package/dest/abi/utils.d.ts +1 -1
  2. package/dest/abi/utils.d.ts.map +1 -1
  3. package/dest/abi/utils.js +3 -2
  4. package/dest/block/proposal/attestations_and_signers.js +2 -2
  5. package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts +18 -19
  6. package/dest/checkpoint/checkpoint_reexecution_tracker.d.ts.map +1 -1
  7. package/dest/checkpoint/checkpoint_reexecution_tracker.js +25 -24
  8. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts +1 -1
  9. package/dest/delayed_public_mutable/delayed_public_mutable_values.d.ts.map +1 -1
  10. package/dest/delayed_public_mutable/delayed_public_mutable_values.js +2 -3
  11. package/dest/file-store/s3.d.ts +3 -4
  12. package/dest/file-store/s3.d.ts.map +1 -1
  13. package/dest/file-store/s3.js +10 -7
  14. package/dest/interfaces/allowed_element.d.ts +32 -12
  15. package/dest/interfaces/allowed_element.d.ts.map +1 -1
  16. package/dest/interfaces/allowed_element.js +9 -6
  17. package/dest/interfaces/archiver.d.ts +2 -2
  18. package/dest/interfaces/archiver.d.ts.map +1 -1
  19. package/dest/interfaces/aztec-node-admin.d.ts +49 -6
  20. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  21. package/dest/interfaces/aztec-node-admin.js +30 -1
  22. package/dest/interfaces/configs.d.ts +19 -5
  23. package/dest/interfaces/configs.d.ts.map +1 -1
  24. package/dest/interfaces/proving-job.d.ts +70 -70
  25. package/dest/interfaces/validator.d.ts +19 -5
  26. package/dest/interfaces/validator.d.ts.map +1 -1
  27. package/dest/logs/contract_class_log.d.ts +1 -1
  28. package/dest/logs/contract_class_log.d.ts.map +1 -1
  29. package/dest/logs/contract_class_log.js +4 -9
  30. package/dest/logs/public_log.d.ts +1 -1
  31. package/dest/logs/public_log.d.ts.map +1 -1
  32. package/dest/logs/public_log.js +2 -3
  33. package/dest/messaging/l1_to_l2_message_bundle.js +3 -7
  34. package/dest/messaging/l2_to_l1_membership.d.ts +1 -1
  35. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  36. package/dest/messaging/l2_to_l1_membership.js +2 -3
  37. package/dest/note/note.d.ts +1 -1
  38. package/dest/note/note.d.ts.map +1 -1
  39. package/dest/note/note.js +2 -3
  40. package/dest/parity/inbox_parity_private_inputs.js +2 -4
  41. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +1 -1
  42. package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
  43. package/dest/rollup/checkpoint_root_rollup_private_inputs.js +2 -3
  44. package/dest/tests/factories.d.ts +1 -1
  45. package/dest/tests/factories.d.ts.map +1 -1
  46. package/dest/tests/factories.js +13 -16
  47. package/dest/tests/mocks.js +1 -3
  48. package/dest/tx/execution_payload.d.ts +1 -1
  49. package/dest/tx/execution_payload.d.ts.map +1 -1
  50. package/dest/tx/execution_payload.js +2 -1
  51. package/dest/tx/tx_effect.d.ts +1 -1
  52. package/dest/tx/tx_effect.d.ts.map +1 -1
  53. package/dest/tx/tx_effect.js +2 -1
  54. package/dest/tx/validator/error_texts.d.ts +3 -1
  55. package/dest/tx/validator/error_texts.d.ts.map +1 -1
  56. package/dest/tx/validator/error_texts.js +2 -0
  57. package/dest/zkpassport/index.d.ts +1 -1
  58. package/dest/zkpassport/index.d.ts.map +1 -1
  59. package/dest/zkpassport/index.js +5 -6
  60. package/package.json +5 -5
  61. package/src/abi/utils.ts +3 -2
  62. package/src/block/proposal/attestations_and_signers.ts +2 -2
  63. package/src/checkpoint/checkpoint_reexecution_tracker.ts +31 -28
  64. package/src/delayed_public_mutable/delayed_public_mutable_values.ts +2 -1
  65. package/src/file-store/s3.ts +9 -4
  66. package/src/interfaces/allowed_element.ts +23 -13
  67. package/src/interfaces/archiver.ts +1 -1
  68. package/src/interfaces/aztec-node-admin.ts +29 -2
  69. package/src/logs/contract_class_log.ts +4 -7
  70. package/src/logs/public_log.ts +2 -1
  71. package/src/messaging/l1_to_l2_message_bundle.ts +3 -3
  72. package/src/messaging/l2_to_l1_membership.ts +2 -1
  73. package/src/note/note.ts +2 -1
  74. package/src/parity/inbox_parity_private_inputs.ts +2 -2
  75. package/src/rollup/checkpoint_root_rollup_private_inputs.ts +2 -1
  76. package/src/tests/factories.ts +13 -16
  77. package/src/tests/mocks.ts +1 -1
  78. package/src/tx/execution_payload.ts +3 -6
  79. package/src/tx/tx_effect.ts +2 -1
  80. package/src/tx/validator/error_texts.ts +2 -0
  81. package/src/zkpassport/index.ts +5 -4
@@ -32,4 +32,4 @@ export declare class ZkPassportProofParams {
32
32
  static fromViem(params: ViemZkPassportProofParams): ZkPassportProofParams;
33
33
  toViem(): ViemZkPassportProofParams;
34
34
  }
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy96a3Bhc3Nwb3J0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUV6RCxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFHekQsT0FBTyxFQUFFLE1BQU0sRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUVoQyxNQUFNLE1BQU0seUJBQXlCLEdBQUc7SUFDdEMsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLENBQUM7SUFDdkIscUJBQXFCLEVBQUU7UUFDckIsUUFBUSxFQUFFLEtBQUssTUFBTSxFQUFFLENBQUM7UUFDeEIsS0FBSyxFQUFFLEtBQUssTUFBTSxFQUFFLENBQUM7UUFDckIsWUFBWSxFQUFFLEtBQUssTUFBTSxFQUF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,uBAAuB,EAAE,MAAM,CAAC;QAChC,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH,CAAC;AAIF,qBAAa,qBAAqB;IAEvB,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,MAAM;IACb,YAAY,EAAE,EAAE,EAAE;IAClB,eAAe,EAAE,MAAM;IACvB,uBAAuB,EAAE,MAAM;IAC/B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IARtB,YACS,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,EAAE,EAAE,EAClB,eAAe,EAAE,MAAM,EACvB,uBAAuB,EAAE,MAAM,EAC/B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EAClB;IAEJ,QAAQ,4BAcP;IAED,MAAM,CAAC,MAAM,0BAkBZ;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,yBAY/B;IAED,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,yBAWhD;IAED,MAAM,IAAI,yBAAyB,CAiBlC;CACF"}
@@ -1,8 +1,9 @@
1
1
  import { Buffer32 } from '@aztec-labs/foundation/buffer';
2
+ import { times } from '@aztec-labs/foundation/collection';
2
3
  import { randomBytes } from '@aztec-labs/foundation/crypto/random';
3
4
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
5
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
5
- import { withoutHexPrefix } from '@aztec-labs/foundation/string';
6
+ import { bufferToHex, withoutHexPrefix } from '@aztec-labs/foundation/string';
6
7
  import { Buffer } from 'buffer';
7
8
  // NOTE: Must match the ZkPassportProofParams struct in the zkpassport verifier contract
8
9
  // find here: ROOT/l1-contracts/lib/circuits/src/solidity/src/ZKPassportVerifier.sol
@@ -50,9 +51,7 @@ export class ZkPassportProofParams {
50
51
  const numberOfCommittedInputs = committedInputCounts.reduce((acc, count)=>acc + count, BigInt(0));
51
52
  const committedInputs = randomBytes(Number(numberOfCommittedInputs) * 32);
52
53
  const publicInputsCount = numberOfCommittedInputs + 16n;
53
- const publicInputs = Array.from({
54
- length: Number(publicInputsCount)
55
- }, ()=>Fr.random());
54
+ const publicInputs = times(Number(publicInputsCount), ()=>Fr.random());
56
55
  return new ZkPassportProofParams(false, Buffer32.random(), randomBytes(1024), publicInputs, committedInputs, BigInt(7 * 24 * 60 * 60), 'sequencer.alpha-testnet.aztec.network', 'personhood');
57
56
  }
58
57
  static fromBuffer(buffer) {
@@ -68,10 +67,10 @@ export class ZkPassportProofParams {
68
67
  version: '0x0000000000000000000000000000000000000000000000000000000000000000',
69
68
  proofVerificationData: {
70
69
  vkeyHash: this.vkeyHash.toString(),
71
- proof: `0x${this.proof.toString('hex')}`,
70
+ proof: bufferToHex(this.proof),
72
71
  publicInputs: this.publicInputs.map((input)=>input.toString())
73
72
  },
74
- committedInputs: `0x${this.committedInputs.toString('hex')}`,
73
+ committedInputs: bufferToHex(this.committedInputs),
75
74
  serviceConfig: {
76
75
  devMode: this.devMode,
77
76
  validityPeriodInSeconds: this.validityPeriodInSeconds,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec-labs/stdlib",
3
- "version": "6.1.0-nightly.20261113",
3
+ "version": "6.1.0-rc.1",
4
4
  "type": "module",
5
5
  "inherits": [
6
6
  "../package.common.json",
@@ -94,10 +94,10 @@
94
94
  "@aws-sdk/client-s3": "^3.892.0",
95
95
  "@aztec-foundation/bb.js": "6.1.0-nightly.20261111",
96
96
  "@aztec-foundation/noir-noirc_abi": "6.1.0-nightly.20261111",
97
- "@aztec-labs/blob-lib": "6.1.0-nightly.20261113",
98
- "@aztec-labs/constants": "6.1.0-nightly.20261113",
99
- "@aztec-labs/ethereum": "6.1.0-nightly.20261113",
100
- "@aztec-labs/foundation": "6.1.0-nightly.20261113",
97
+ "@aztec-labs/blob-lib": "6.1.0-rc.1",
98
+ "@aztec-labs/constants": "6.1.0-rc.1",
99
+ "@aztec-labs/ethereum": "6.1.0-rc.1",
100
+ "@aztec-labs/foundation": "6.1.0-rc.1",
101
101
  "@google-cloud/storage": "^7.15.0",
102
102
  "axios": "^1.15.1",
103
103
  "buffer": "^6.0.3",
package/src/abi/utils.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { bufferToHex } from '@aztec-labs/foundation/string';
1
2
  import { Buffer } from 'buffer';
2
3
 
3
4
  import type { AbiType } from './abi.js';
@@ -131,9 +132,9 @@ export function parseSignedInt(b: Buffer, width?: number) {
131
132
  }
132
133
 
133
134
  // Add one, then negate it
134
- return -(BigInt(`0x${slicedBuf.toString('hex')}`) + 1n);
135
+ return -(BigInt(bufferToHex(slicedBuf)) + 1n);
135
136
  }
136
137
 
137
138
  // ...otherwise we just return our positive int
138
- return BigInt(`0x${slicedBuf.toString('hex')}`);
139
+ return BigInt(bufferToHex(slicedBuf));
139
140
  }
@@ -129,8 +129,8 @@ export class CommitteeAttestationsAndSigners implements Signable {
129
129
  }
130
130
 
131
131
  return {
132
- signatureIndices: `0x${Buffer.from(signatureIndices).toString('hex')}`,
133
- signaturesOrAddresses: `0x${Buffer.from(signaturesOrAddresses).toString('hex')}`,
132
+ signatureIndices: bufferToHex(Buffer.from(signatureIndices)),
133
+ signaturesOrAddresses: bufferToHex(Buffer.from(signaturesOrAddresses)),
134
134
  };
135
135
  }
136
136
 
@@ -1,6 +1,8 @@
1
1
  import type { CheckpointNumber, CheckpointProposalHash, SlotNumber } from '@aztec-labs/foundation/branded-types';
2
2
  import type { Fr } from '@aztec-labs/foundation/curves/bn254';
3
3
 
4
+ import type { TxHash } from '../tx/tx_hash.js';
5
+
4
6
  /**
5
7
  * Outcome of attempting to re-execute a checkpoint proposal locally.
6
8
  *
@@ -36,8 +38,8 @@ export type ReexecutionDetails = {
36
38
  /**
37
39
  * Tracks two pieces of per-slot state collected during proposal handling:
38
40
  *
39
- * 1. Whether each block proposal's transactions were successfully collected locally
40
- * (keyed by `slot` + `indexWithinCheckpoint`). Consumed by the data-withholding watcher.
41
+ * 1. The txs this node held at proposal time, from block proposals whose txs were all collected
42
+ * locally (per `slot`, by tx hash). Consumed by the data-withholding watcher.
41
43
  * 2. The outcome of locally re-executing each checkpoint proposal (keyed by
42
44
  * `(checkpointNumber, archiveRoot)` and by `slot`). Consumed by the data-withholding
43
45
  * watcher (via `hasReexecuted`) and the sentinel (via `getOutcomeForSlot` and `getRecordForSlot`).
@@ -56,8 +58,8 @@ interface Entry {
56
58
 
57
59
  slot: SlotNumber;
58
60
 
59
- // Per block-proposal at this slot: indexWithinCheckpoint → true (collected) | false (failed to collect).
60
- txsCollected: Map<number, boolean>;
61
+ // Hashes of the txs of every block proposal at this slot whose txs were all collected.
62
+ collectedTxs: Set<string>;
61
63
 
62
64
  // Set by recordEquivocation when a proposal equivocation is seen for this slot. Consumed by the
63
65
  // sentinel: an honest attestor may have seen an invalid version of an equivocated proposal and
@@ -88,7 +90,7 @@ export class CheckpointReexecutionTracker {
88
90
  ): void {
89
91
  const archiveRootStr = archiveRoot.toString();
90
92
 
91
- // Preserve any per-block txsCollected already accumulated for this slot.
93
+ // Preserve any collected txs already accumulated for this slot.
92
94
  const existing = this.bySlot.get(slot);
93
95
  const entry: Entry = {
94
96
  checkpointNumber,
@@ -97,7 +99,7 @@ export class CheckpointReexecutionTracker {
97
99
  payloadHash: details.payloadHash,
98
100
  slot,
99
101
  outcome,
100
- txsCollected: existing?.txsCollected ?? new Map(),
102
+ collectedTxs: existing?.collectedTxs ?? new Set(),
101
103
  equivocated: existing?.equivocated ?? false,
102
104
  };
103
105
 
@@ -114,18 +116,20 @@ export class CheckpointReexecutionTracker {
114
116
  }
115
117
 
116
118
  /**
117
- * Record whether the local node successfully collected the transactions for a block proposal.
118
- * Called from the validator's proposal handler immediately after tx collection completes
119
- * (regardless of whether re-execution will subsequently succeed). The data-withholding
120
- * watcher consults these records as an authoritative signal: tx availability now is too
121
- * weak (txs may have been evicted from the mempool by the time the watcher runs), but a
122
- * record that the txs *were* available at proposal time still vouches for the proposer.
119
+ * Record that the local node collected every transaction of a block proposal before the deadline. Called from the
120
+ * validator's proposal handler right after tx collection succeeds, before re-execution, so a failed collection
121
+ * records nothing. The data-withholding watcher consults these records as an authoritative signal: tx availability
122
+ * now is too weak (txs may have been evicted from the mempool by the time the watcher runs), but a record that the
123
+ * txs *were* available at proposal time still vouches for the block.
124
+ *
125
+ * The record vouches, per tx, that this node held each listed tx at proposal time for this slot. A vouched tx counts
126
+ * for whichever published block of the slot contains it, regardless of the block's index or the order of its txs,
127
+ * and records from every proposal for the slot accumulate, so a later proposal does not replace an earlier one.
123
128
  *
124
129
  * @param slot - Slot the block proposal was for.
125
- * @param indexWithinCheckpoint - Index of the block within its enclosing checkpoint.
126
- * @param collected - True if every tx in the proposal was collected locally before deadline.
130
+ * @param txHashes - The proposal's tx hashes.
127
131
  */
128
- public recordTxsCollected(slot: SlotNumber, indexWithinCheckpoint: number, collected: boolean): void {
132
+ public recordTxsCollected(slot: SlotNumber, txHashes: readonly TxHash[]): void {
129
133
  let entry = this.bySlot.get(slot);
130
134
  if (!entry) {
131
135
  entry = {
@@ -135,12 +139,14 @@ export class CheckpointReexecutionTracker {
135
139
  payloadHash: undefined,
136
140
  slot,
137
141
  outcome: undefined,
138
- txsCollected: new Map(),
142
+ collectedTxs: new Set(),
139
143
  equivocated: false,
140
144
  };
141
145
  this.bySlot.set(slot, entry);
142
146
  }
143
- entry.txsCollected.set(indexWithinCheckpoint, collected);
147
+ for (const txHash of txHashes) {
148
+ entry.collectedTxs.add(txHash.toString());
149
+ }
144
150
  }
145
151
 
146
152
  /**
@@ -158,7 +164,7 @@ export class CheckpointReexecutionTracker {
158
164
  payloadHash: undefined,
159
165
  slot,
160
166
  outcome: undefined,
161
- txsCollected: new Map(),
167
+ collectedTxs: new Set(),
162
168
  equivocated: true,
163
169
  });
164
170
  } else {
@@ -214,17 +220,14 @@ export class CheckpointReexecutionTracker {
214
220
  }
215
221
 
216
222
  /**
217
- * Returns the recorded tx-collection result for a block proposal at the given slot and
218
- * `indexWithinCheckpoint`, or `undefined` if no record exists.
219
- *
220
- * Three-valued by design:
221
- * - `true` — we collected every tx for this block proposal before the deadline.
222
- * - `false` — we tried and failed (missing txs at the deadline).
223
- * - `undefined` — no record (e.g. we never saw the block proposal). Callers should fall
224
- * back to a current-state check (e.g. mempool probe) for this case.
223
+ * Whether every given tx was recorded by {@link recordTxsCollected} for this slot, in any order and from any
224
+ * proposals. An empty list is always vouched for. `false` means some tx was not (we never saw a proposal carrying
225
+ * it, or failed to collect that proposal's txs), so callers should fall back to a current-state check such as a
226
+ * mempool probe.
225
227
  */
226
- public getTxsCollectedRecord(slot: SlotNumber, indexWithinCheckpoint: number): boolean | undefined {
227
- return this.bySlot.get(slot)?.txsCollected.get(indexWithinCheckpoint);
228
+ public hasCollectedTxs(slot: SlotNumber, txHashes: readonly TxHash[]): boolean {
229
+ const collected = this.bySlot.get(slot)?.collectedTxs;
230
+ return txHashes.every(txHash => collected?.has(txHash.toString()) ?? false);
228
231
  }
229
232
 
230
233
  /** Drops entries for checkpoints with `number < checkpointNumber`. */
@@ -1,4 +1,5 @@
1
1
  import { UPDATES_VALUE_SIZE } from '@aztec-labs/constants';
2
+ import { times } from '@aztec-labs/foundation/collection';
2
3
  import { poseidon2Hash } from '@aztec-labs/foundation/crypto/poseidon';
3
4
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
5
  import { BufferReader, FieldReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
@@ -69,7 +70,7 @@ export class DelayedPublicMutableValues {
69
70
  }
70
71
 
71
72
  static async readFromTree(delayedPublicMutableSlot: Fr, readStorage: (storageSlot: Fr) => Promise<Fr>) {
72
- const fieldPromises = Array.from({ length: DELAYED_PUBLIC_MUTABLE_VALUES_LEN }).map((_, i) =>
73
+ const fieldPromises = times(DELAYED_PUBLIC_MUTABLE_VALUES_LEN, i =>
73
74
  readStorage(delayedPublicMutableSlot.add(new Fr(i))),
74
75
  );
75
76
  return DelayedPublicMutableValues.fromFields(await Promise.all(fieldPromises));
@@ -6,7 +6,6 @@ import {
6
6
  S3Client,
7
7
  } from '@aws-sdk/client-s3';
8
8
  import { getEnv } from '@aztec-labs/foundation/config/env';
9
- import { type Logger, createLogger } from '@aztec-labs/foundation/log';
10
9
  import { Buffer } from 'buffer';
11
10
  import { createReadStream, createWriteStream } from 'fs';
12
11
  import { mkdir, mkdtemp, stat, unlink } from 'fs/promises';
@@ -36,7 +35,6 @@ export class S3FileStore implements FileStore {
36
35
  private readonly bucketName: string,
37
36
  private readonly basePath: string,
38
37
  opts: { endpoint?: string; publicBaseUrl?: string },
39
- private readonly log: Logger = createLogger('stdlib:s3-file-store'),
40
38
  ) {
41
39
  this.endpoint = opts.endpoint;
42
40
  this.region = this.endpoint ? 'auto' : (getEnv().AWS_REGION ?? getEnv().AWS_DEFAULT_REGION ?? 'us-east-1');
@@ -154,6 +152,7 @@ export class S3FileStore implements FileStore {
154
152
  await pipeline(out.Body as Readable, createWriteStream(destPath));
155
153
  }
156
154
 
155
+ /** Returns false only when the object is not found, and rethrows any other error (5xx, 403, timeouts). */
157
156
  public async exists(pathOrUrlStr: string): Promise<boolean> {
158
157
  try {
159
158
  const { bucket, key } = this.getBucketAndKey(pathOrUrlStr);
@@ -164,8 +163,14 @@ export class S3FileStore implements FileStore {
164
163
  if (code === 404 || code === 'NotFound' || code === 'NoSuchKey') {
165
164
  return false;
166
165
  }
167
- this.log.warn(`Error checking existence for ${pathOrUrlStr}: ${err?.message ?? String(err)}`);
168
- return false;
166
+ // S3 answers a HEAD on a missing key with 403 instead of 404 when the credentials lack s3:ListBucket, so that
167
+ // the response does not reveal which keys exist. For such credentials a 403 is how a missing object looks.
168
+ if (code === 403) {
169
+ return false;
170
+ }
171
+ // Anything else (5xx, timeouts, connection errors) says nothing about whether the object exists. Rethrow so a
172
+ // caller never mistakes an outage for a missing object, e.g. by overwriting an existing file it could not see.
173
+ throw err;
169
174
  }
170
175
  }
171
176
 
@@ -3,40 +3,50 @@ import { z } from 'zod';
3
3
 
4
4
  import type { FunctionSelector } from '../abi/function_selector.js';
5
5
  import type { AztecAddress } from '../aztec-address/index.js';
6
+ import { Gas } from '../gas/gas.js';
6
7
  import { schemas, zodFor } from '../schemas/index.js';
7
8
 
8
- type AllowedInstanceFunction = {
9
- address: AztecAddress;
10
- selector: FunctionSelector;
9
+ /** Constraints a setup call must satisfy, beyond targeting the entry's function, for the tx to be admitted. */
10
+ type AllowedCallConstraints = {
11
11
  onlySelf?: boolean;
12
12
  rejectNullMsgSender?: boolean;
13
13
  calldataLength?: number;
14
+ /**
15
+ * The most gas the call can use in setup, for any calldata the entry allows. The tx's gas limits must leave at least
16
+ * this much for setup.
17
+ */
18
+ minGas?: Gas;
19
+ };
20
+
21
+ type AllowedInstanceFunction = AllowedCallConstraints & {
22
+ address: AztecAddress;
23
+ selector: FunctionSelector;
14
24
  };
15
- type AllowedClassFunction = {
25
+ type AllowedClassFunction = AllowedCallConstraints & {
16
26
  classId: Fr;
17
27
  selector: FunctionSelector;
18
- onlySelf?: boolean;
19
- rejectNullMsgSender?: boolean;
20
- calldataLength?: number;
21
28
  };
22
29
 
23
30
  export type AllowedElement = AllowedInstanceFunction | AllowedClassFunction;
24
31
 
32
+ const allowedCallConstraintsSchema = {
33
+ onlySelf: z.boolean().optional(),
34
+ rejectNullMsgSender: z.boolean().optional(),
35
+ calldataLength: z.number().optional(),
36
+ minGas: Gas.schema.optional(),
37
+ };
38
+
25
39
  export const AllowedElementSchema = zodFor<AllowedElement>()(
26
40
  z.union([
27
41
  z.object({
28
42
  address: schemas.AztecAddress,
29
43
  selector: schemas.FunctionSelector,
30
- onlySelf: z.boolean().optional(),
31
- rejectNullMsgSender: z.boolean().optional(),
32
- calldataLength: z.number().optional(),
44
+ ...allowedCallConstraintsSchema,
33
45
  }),
34
46
  z.object({
35
47
  classId: schemas.Fr,
36
48
  selector: schemas.FunctionSelector,
37
- onlySelf: z.boolean().optional(),
38
- rejectNullMsgSender: z.boolean().optional(),
39
- calldataLength: z.number().optional(),
49
+ ...allowedCallConstraintsSchema,
40
50
  }),
41
51
  ]),
42
52
  );
@@ -61,7 +61,7 @@ export type ArchiverSpecificConfig = {
61
61
  /** Whether to allow starting the archiver without debug/trace method support on Ethereum hosts */
62
62
  ethereumAllowNoDebugHosts?: boolean;
63
63
 
64
- /** Skip the startup check that probes the L1 RPC for historical logs on the Rollup contract. */
64
+ /** Log a warning instead of failing startup when an L1 RPC returns empty results for logs it should have. */
65
65
  archiverSkipHistoricalLogsCheck?: boolean;
66
66
 
67
67
  /** Skip validating checkpoint attestations (for testing purposes only) */
@@ -14,6 +14,21 @@ import { type ProverConfig, ProverConfigSchema } from './prover-client.js';
14
14
  import { type SlasherConfig, SlasherConfigSchema } from './slasher.js';
15
15
  import { type ValidatorClientFullConfig, ValidatorClientFullConfigSchema } from './validator.js';
16
16
 
17
+ /** Snapshot upload outcome. Unknown means the ID was never seen, evicted, or lost on process restart. */
18
+ export const SnapshotUploadStatusSchema = z.discriminatedUnion('state', [
19
+ z.object({ state: z.literal('unknown') }),
20
+ z.object({ state: z.literal('capturing'), location: z.string() }),
21
+ z.object({ state: z.literal('uploading'), location: z.string() }),
22
+ z.object({ state: z.literal('succeeded'), location: z.string() }),
23
+ z.object({ state: z.literal('failed'), location: z.string(), error: z.string() }),
24
+ ]);
25
+
26
+ /**
27
+ * Status of a snapshot upload. Capturing covers local database backups; uploading means backups are complete and
28
+ * syncing has resumed, but the node may still need to catch up before serving traffic. Success includes index publication.
29
+ */
30
+ export type SnapshotUploadStatus = z.infer<typeof SnapshotUploadStatusSchema>;
31
+
17
32
  /**
18
33
  * Aztec node admin API.
19
34
  */
@@ -32,8 +47,16 @@ export interface AztecNodeAdmin {
32
47
  /**
33
48
  * Pauses syncing, creates a backup of archiver and world-state databases, and uploads them. Returns immediately.
34
49
  * @param location - The location to upload the snapshot to.
50
+ * @param operationId - Optional caller-generated UUID. Reusing a retained ID with the same location is a no-op;
51
+ * reusing it with a different location is rejected. Use a new ID to retry a failed upload.
35
52
  */
36
- startSnapshotUpload(location: string): Promise<void>;
53
+ startSnapshotUpload(location: string, operationId?: string): Promise<void>;
54
+
55
+ /**
56
+ * Gets the outcome of an upload started with a caller-generated UUID. Status is held in memory for up to 100
57
+ * operations, with least recently used eviction. Unknown is not evidence of completion; check publication before retrying.
58
+ */
59
+ getSnapshotUploadStatus(operationId: string): Promise<SnapshotUploadStatus>;
37
60
 
38
61
  /**
39
62
  * Pauses syncing and rolls back the database to the target L2 block number.
@@ -126,7 +149,11 @@ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConf
126
149
  export const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin> = {
127
150
  getConfig: z.function({ input: z.tuple([]), output: AztecNodeAdminConfigSchema }),
128
151
  setConfig: z.function({ input: z.tuple([AztecNodeAdminConfigSchema.partial()]), output: z.void() }),
129
- startSnapshotUpload: z.function({ input: z.tuple([z.string()]), output: z.void() }),
152
+ startSnapshotUpload: z.function({
153
+ input: z.tuple([z.string(), optional(z.uuid())]),
154
+ output: z.void(),
155
+ }),
156
+ getSnapshotUploadStatus: z.function({ input: z.tuple([z.uuid()]), output: SnapshotUploadStatusSchema }),
130
157
  rollbackTo: z.function({
131
158
  input: z.tuple([z.number(), optional(z.boolean()), optional(z.boolean())]),
132
159
  output: z.void(),
@@ -1,4 +1,5 @@
1
1
  import { CONTRACT_CLASS_LOG_LENGTH, CONTRACT_CLASS_LOG_SIZE_IN_FIELDS } from '@aztec-labs/constants';
2
+ import { times } from '@aztec-labs/foundation/collection';
2
3
  import { poseidon2Hash } from '@aztec-labs/foundation/crypto/poseidon';
3
4
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
5
  import { inspect } from '@aztec-labs/foundation/inspect';
@@ -56,9 +57,7 @@ export class ContractClassLogFields {
56
57
  const reader = FieldReader.asReader(fields);
57
58
  // Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
58
59
  // reader.readFieldArray(CONTRACT_CLASS_LOG_LENGTH);
59
- return new ContractClassLogFields(
60
- Array.from({ length: CONTRACT_CLASS_LOG_SIZE_IN_FIELDS }, () => reader.readField()),
61
- );
60
+ return new ContractClassLogFields(times(CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, () => reader.readField()));
62
61
  }
63
62
 
64
63
  toBuffer(): Buffer;
@@ -74,9 +73,7 @@ export class ContractClassLogFields {
74
73
  const reader = BufferReader.asReader(buffer);
75
74
  // Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
76
75
  // reader.readArray(CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, Fr)
77
- return new ContractClassLogFields(
78
- Array.from({ length: CONTRACT_CLASS_LOG_SIZE_IN_FIELDS }, () => reader.readObject(Fr)),
79
- );
76
+ return new ContractClassLogFields(times(CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, () => reader.readObject(Fr)));
80
77
  }
81
78
 
82
79
  equals(other: ContractClassLogFields) {
@@ -103,7 +100,7 @@ export class ContractClassLogFields {
103
100
 
104
101
  static random(emittedLength = CONTRACT_CLASS_LOG_SIZE_IN_FIELDS) {
105
102
  return new ContractClassLogFields(
106
- Array.from({ length: emittedLength }, () => Fr.random()).concat(
103
+ times(emittedLength, () => Fr.random()).concat(
107
104
  Array(CONTRACT_CLASS_LOG_SIZE_IN_FIELDS - emittedLength).fill(Fr.ZERO),
108
105
  ),
109
106
  );
@@ -4,6 +4,7 @@ import {
4
4
  PUBLIC_LOG_HEADER_LENGTH,
5
5
  } from '@aztec-labs/constants';
6
6
  import type { FieldsOf } from '@aztec-labs/foundation/array';
7
+ import { times } from '@aztec-labs/foundation/collection';
7
8
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
8
9
  import { inspect } from '@aztec-labs/foundation/inspect';
9
10
  import { type ZodFor, schemas } from '@aztec-labs/foundation/schemas';
@@ -190,7 +191,7 @@ export class PublicLog {
190
191
  static async random() {
191
192
  return new PublicLog(
192
193
  await AztecAddress.random(),
193
- Array.from({ length: 10 }, () => Fr.random()),
194
+ times(10, () => Fr.random()),
194
195
  );
195
196
  }
196
197
 
@@ -1,5 +1,5 @@
1
1
  import { MAX_L1_TO_L2_MSGS_PER_BLOCK } from '@aztec-labs/constants';
2
- import { padArrayEnd } from '@aztec-labs/foundation/collection';
2
+ import { padArrayEnd, times } from '@aztec-labs/foundation/collection';
3
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
4
  import { bufferSchemaFor } from '@aztec-labs/foundation/schemas';
5
5
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
@@ -22,7 +22,7 @@ export class L1ToL2MessageBundle {
22
22
  /** An empty bundle: no leaves inserted, nothing absorbed. */
23
23
  static empty(): L1ToL2MessageBundle {
24
24
  return new L1ToL2MessageBundle(
25
- Array.from({ length: MAX_L1_TO_L2_MSGS_PER_BLOCK }, () => Fr.ZERO),
25
+ times(MAX_L1_TO_L2_MSGS_PER_BLOCK, () => Fr.ZERO),
26
26
  0,
27
27
  );
28
28
  }
@@ -38,7 +38,7 @@ export class L1ToL2MessageBundle {
38
38
  static fromBuffer(buffer: Buffer | BufferReader) {
39
39
  const reader = BufferReader.asReader(buffer);
40
40
  // Array.from (not readArray with the literal cap) keeps the type `Fr[]` and avoids TS's deep-tuple instantiation.
41
- const messages = Array.from({ length: MAX_L1_TO_L2_MSGS_PER_BLOCK }, () => Fr.fromBuffer(reader));
41
+ const messages = times(MAX_L1_TO_L2_MSGS_PER_BLOCK, () => Fr.fromBuffer(reader));
42
42
  return new L1ToL2MessageBundle(messages, reader.readNumber());
43
43
  }
44
44
 
@@ -1,5 +1,6 @@
1
1
  import { MAX_CHECKPOINTS_PER_EPOCH, OUT_HASH_TREE_LEAF_COUNT } from '@aztec-labs/constants';
2
2
  import { type EpochNumber, EpochNumberSchema } from '@aztec-labs/foundation/branded-types';
3
+ import { times } from '@aztec-labs/foundation/collection';
3
4
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
5
  import { SiblingPath, UnbalancedMerkleTreeCalculator, computeUnbalancedShaRoot } from '@aztec-labs/foundation/trees';
5
6
  import { Buffer } from 'buffer';
@@ -292,7 +293,7 @@ export function computeL2ToL1MembershipWitnessFromMessagesInEpoch(
292
293
  });
293
294
  // Pad to OUT_HASH_TREE_LEAF_COUNT with zeros.
294
295
  checkpointOutHashes = checkpointOutHashes.concat(
295
- Array.from({ length: OUT_HASH_TREE_LEAF_COUNT - messagesInEpoch.length }, () => Buffer.alloc(32)),
296
+ times(OUT_HASH_TREE_LEAF_COUNT - messagesInEpoch.length, () => Buffer.alloc(32)),
296
297
  );
297
298
 
298
299
  // Build the epoch tree with all the checkpoint out hashes, including the padded zeros.
package/src/note/note.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { times } from '@aztec-labs/foundation/collection';
1
2
  import { randomInt } from '@aztec-labs/foundation/crypto/random';
2
3
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
3
4
  import { BufferReader } from '@aztec-labs/foundation/serialize';
@@ -41,7 +42,7 @@ export class Note extends Vector<Fr> {
41
42
  */
42
43
  static random() {
43
44
  const numItems = randomInt(10) + 1;
44
- const items = Array.from({ length: numItems }, () => Fr.random());
45
+ const items = times(numItems, () => Fr.random());
45
46
  return new Note(items);
46
47
  }
47
48
 
@@ -5,7 +5,7 @@ import {
5
5
  INBOX_PARITY_SIZE_XSMALL,
6
6
  INBOX_PARITY_SIZE_XXSMALL,
7
7
  } from '@aztec-labs/constants';
8
- import { padArrayEnd } from '@aztec-labs/foundation/collection';
8
+ import { padArrayEnd, times } from '@aztec-labs/foundation/collection';
9
9
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
10
10
  import { bufferSchemaFor } from '@aztec-labs/foundation/schemas';
11
11
  import { BufferReader, serializeToBuffer } from '@aztec-labs/foundation/serialize';
@@ -99,7 +99,7 @@ export class InboxParityPrivateInputs {
99
99
  const reader = BufferReader.asReader(buffer);
100
100
  const size = Fr.fromBuffer(reader).toNumber() as InboxParitySize;
101
101
  // Array.from keeps the type `Fr[]`; readArray with the union-literal `size` would infer a deep tuple.
102
- const messages = Array.from({ length: size }, () => Fr.fromBuffer(reader));
102
+ const messages = times(size, () => Fr.fromBuffer(reader));
103
103
  return new InboxParityPrivateInputs(
104
104
  size,
105
105
  messages,
@@ -1,5 +1,6 @@
1
1
  import { BlobAccumulator, FinalBlobBatchingChallenges } from '@aztec-labs/blob-lib/types';
2
2
  import { ARCHIVE_HEIGHT, BLOBS_PER_CHECKPOINT, FIELDS_PER_BLOB, OUT_HASH_TREE_HEIGHT } from '@aztec-labs/constants';
3
+ import { times } from '@aztec-labs/foundation/collection';
3
4
  import { BLS12Point } from '@aztec-labs/foundation/curves/bls12';
4
5
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
5
6
  import { bufferSchemaFor } from '@aztec-labs/foundation/schemas';
@@ -90,7 +91,7 @@ export class CheckpointRootRollupHints {
90
91
  reader.readObject(FinalBlobBatchingChallenges),
91
92
  // Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
92
93
  // reader.readArray(FIELDS_PER_BLOB, Fr),
93
- Array.from({ length: FIELDS_PER_BLOB * BLOBS_PER_CHECKPOINT }, () => Fr.fromBuffer(reader)),
94
+ times(FIELDS_PER_BLOB * BLOBS_PER_CHECKPOINT, () => Fr.fromBuffer(reader)),
94
95
  reader.readArray(BLOBS_PER_CHECKPOINT, BLS12Point),
95
96
  Fr.fromBuffer(reader),
96
97
  );