@aztec/stdlib 1.0.0-nightly.20250729 → 1.0.0-nightly.20250801

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 (66) hide show
  1. package/dest/block/in_block.d.ts +5 -5
  2. package/dest/block/in_block.d.ts.map +1 -1
  3. package/dest/block/l2_block.d.ts +1 -0
  4. package/dest/block/l2_block.d.ts.map +1 -1
  5. package/dest/block/l2_block.js +1 -0
  6. package/dest/block/l2_block_source.d.ts +413 -1
  7. package/dest/block/l2_block_source.d.ts.map +1 -1
  8. package/dest/block/l2_block_source.js +21 -0
  9. package/dest/block/proposal/committee_attestation.d.ts +1 -0
  10. package/dest/block/proposal/committee_attestation.d.ts.map +1 -1
  11. package/dest/block/proposal/committee_attestation.js +3 -0
  12. package/dest/block/published_l2_block.d.ts +2 -1
  13. package/dest/block/published_l2_block.d.ts.map +1 -1
  14. package/dest/block/published_l2_block.js +6 -1
  15. package/dest/contract/interfaces/contract_class.d.ts +3 -3
  16. package/dest/interfaces/archiver.d.ts.map +1 -1
  17. package/dest/interfaces/archiver.js +4 -2
  18. package/dest/interfaces/aztec-node-admin.d.ts +55 -5
  19. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  20. package/dest/interfaces/aztec-node-admin.js +2 -1
  21. package/dest/interfaces/configs.d.ts +5 -0
  22. package/dest/interfaces/configs.d.ts.map +1 -1
  23. package/dest/interfaces/configs.js +2 -1
  24. package/dest/interfaces/proving-job.d.ts +6 -6
  25. package/dest/interfaces/server.d.ts +2 -1
  26. package/dest/interfaces/server.d.ts.map +1 -1
  27. package/dest/interfaces/server.js +2 -1
  28. package/dest/interfaces/slasher.d.ts +70 -0
  29. package/dest/interfaces/slasher.d.ts.map +1 -0
  30. package/dest/interfaces/slasher.js +19 -0
  31. package/dest/messaging/l2_to_l1_membership.d.ts +4 -1
  32. package/dest/messaging/l2_to_l1_membership.d.ts.map +1 -1
  33. package/dest/messaging/l2_to_l1_membership.js +49 -54
  34. package/dest/p2p/attestation_utils.d.ts +10 -0
  35. package/dest/p2p/attestation_utils.d.ts.map +1 -0
  36. package/dest/p2p/attestation_utils.js +21 -0
  37. package/dest/p2p/block_attestation.d.ts +3 -4
  38. package/dest/p2p/block_attestation.d.ts.map +1 -1
  39. package/dest/p2p/block_attestation.js +3 -4
  40. package/dest/p2p/index.d.ts +1 -0
  41. package/dest/p2p/index.d.ts.map +1 -1
  42. package/dest/p2p/index.js +1 -0
  43. package/dest/tests/mocks.d.ts +2 -0
  44. package/dest/tests/mocks.d.ts.map +1 -1
  45. package/dest/tests/mocks.js +10 -7
  46. package/dest/tx/indexed_tx_effect.d.ts +3 -3
  47. package/dest/tx/tx_effect.d.ts +2 -2
  48. package/dest/tx/tx_effect.d.ts.map +1 -1
  49. package/dest/tx/tx_effect.js +3 -18
  50. package/dest/tx/validator/tx_validator.d.ts +4 -4
  51. package/package.json +7 -7
  52. package/src/block/l2_block.ts +2 -0
  53. package/src/block/l2_block_source.ts +43 -1
  54. package/src/block/proposal/committee_attestation.ts +4 -0
  55. package/src/block/published_l2_block.ts +14 -5
  56. package/src/interfaces/archiver.ts +3 -1
  57. package/src/interfaces/aztec-node-admin.ts +5 -4
  58. package/src/interfaces/configs.ts +3 -0
  59. package/src/interfaces/server.ts +2 -1
  60. package/src/interfaces/slasher.ts +41 -0
  61. package/src/messaging/l2_to_l1_membership.ts +76 -85
  62. package/src/p2p/attestation_utils.ts +35 -0
  63. package/src/p2p/block_attestation.ts +3 -4
  64. package/src/p2p/index.ts +1 -0
  65. package/src/tests/mocks.ts +11 -11
  66. package/src/tx/tx_effect.ts +5 -20
@@ -12,21 +12,21 @@ export declare function inBlockSchemaFor<T extends ZodTypeAny>(schema: T): z.Zod
12
12
  data: T;
13
13
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
14
14
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
15
- }, "strip", ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
15
+ }, "strip", ZodTypeAny, { [k in keyof z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
16
16
  data: T;
17
17
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
18
18
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
19
- }>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
19
+ }>, any>]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
20
20
  data: T;
21
21
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
22
22
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
23
- }>, any>[k]; } : never, z.baseObjectInputType<{
23
+ }>, any>[k]; }, { [k_1 in keyof z.baseObjectInputType<{
24
24
  data: T;
25
25
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
26
26
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
27
- }> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
27
+ }>]: z.baseObjectInputType<{
28
28
  data: T;
29
29
  l2BlockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
30
30
  l2BlockHash: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, Buffer<ArrayBuffer>, string>, L2BlockHash, string>;
31
- }>[k_1]; } : never>;
31
+ }>[k_1]; }>;
32
32
  //# sourceMappingURL=in_block.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"in_block.d.ts","sourceRoot":"","sources":["../../src/block/in_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMpD;AAED,wBAAsB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAMjF;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;oBAM/D"}
1
+ {"version":3,"file":"in_block.d.ts","sourceRoot":"","sources":["../../src/block/in_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,EAAE,CAAC,CAAC;CACT,CAAC;AAEF,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAMpD;AAED,wBAAsB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAMjF;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;YAM/D"}
@@ -116,6 +116,7 @@ export declare class L2Block {
116
116
  equals(other: L2Block): boolean;
117
117
  }
118
118
  export type BlockInfo = {
119
+ blockHash?: string;
119
120
  archive: string;
120
121
  blockNumber: number;
121
122
  slotNumber: number;
@@ -1 +1 @@
1
- {"version":3,"file":"l2_block.d.ts","sourceRoot":"","sources":["../../src/block/l2_block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;GAEG;AACH,qBAAa,OAAO;IAEhB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,IAAI;IACjB,OAAO,CAAC,SAAS;;IANjB,2DAA2D;IACpD,OAAO,EAAE,sBAAsB;IACtC,uBAAuB;IAChB,MAAM,EAAE,WAAW;IAC1B,qBAAqB;IACd,IAAI,EAAE,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xB,MAAM,CAAC,KAAK,EAAE,OAAO;CAGtB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -103,6 +103,7 @@ import { makeAppendOnlyTreeSnapshot, makeHeader } from './l2_block_code_to_purge
103
103
  }
104
104
  toBlockInfo() {
105
105
  return {
106
+ blockHash: this.blockHash?.toString(),
106
107
  archive: this.archive.root.toString(),
107
108
  blockNumber: this.number,
108
109
  slotNumber: Number(this.header.getSlot()),
@@ -1,4 +1,5 @@
1
1
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { type ZodFor } from '@aztec/foundation/schemas';
2
3
  import type { TypedEventEmitter } from '@aztec/foundation/types';
3
4
  import { z } from 'zod';
4
5
  import type { L1RollupConstants } from '../epoch-helpers/index.js';
@@ -7,7 +8,7 @@ import type { IndexedTxEffect } from '../tx/indexed_tx_effect.js';
7
8
  import type { TxHash } from '../tx/tx_hash.js';
8
9
  import type { TxReceipt } from '../tx/tx_receipt.js';
9
10
  import type { L2Block } from './l2_block.js';
10
- import type { PublishedL2Block } from './published_l2_block.js';
11
+ import { PublishedL2Block } from './published_l2_block.js';
11
12
  /**
12
13
  * Interface of classes allowing for the retrieval of L2 blocks.
13
14
  */
@@ -101,9 +102,420 @@ export interface L2BlockSource {
101
102
  getL1Constants(): Promise<L1RollupConstants>;
102
103
  /** Latest synced L1 timestamp. */
103
104
  getL1Timestamp(): Promise<bigint>;
105
+ /**
106
+ * Returns whether the latest block in the pending chain on L1 is invalid (ie its attestations are incorrect).
107
+ * Note that invalid blocks do not get synced, so the latest block returned by the block source is always a valid one.
108
+ */
109
+ isPendingChainInvalid(): Promise<boolean>;
110
+ /**
111
+ * Returns the status of the pending chain validation.
112
+ * This includes whether the chain is valid, and if not, the reason for invalidation.
113
+ */
114
+ getPendingChainValidationStatus(): Promise<ValidateBlockResult>;
104
115
  /** Force a sync. */
105
116
  syncImmediate(): Promise<void>;
106
117
  }
118
+ /** Result type for validating a block attestations */
119
+ export type ValidateBlockResult = {
120
+ valid: true;
121
+ block?: PublishedL2Block;
122
+ } | {
123
+ valid: false;
124
+ block: PublishedL2Block;
125
+ committee: EthAddress[];
126
+ reason: 'insufficient-attestations';
127
+ } | {
128
+ valid: false;
129
+ block: PublishedL2Block;
130
+ committee: EthAddress[];
131
+ reason: 'invalid-attestation';
132
+ invalidIndex: number;
133
+ };
134
+ export declare const ValidateBlockResultSchema: z.ZodUnion<[z.ZodObject<{
135
+ valid: z.ZodLiteral<true>;
136
+ block: z.ZodOptional<z.ZodObject<{
137
+ block: z.ZodEffects<z.ZodObject<{
138
+ archive: z.ZodEffects<z.ZodObject<{
139
+ root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
140
+ nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
141
+ }, "strip", z.ZodTypeAny, {
142
+ root: import("@aztec/foundation/schemas").Fr;
143
+ nextAvailableLeafIndex: number;
144
+ }, {
145
+ root: string;
146
+ nextAvailableLeafIndex: string | number | bigint;
147
+ }>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
148
+ root: string;
149
+ nextAvailableLeafIndex: string | number | bigint;
150
+ }>;
151
+ header: ZodFor<BlockHeader>;
152
+ body: ZodFor<import("./body.js").Body>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
155
+ header: BlockHeader;
156
+ body: import("./body.js").Body;
157
+ }, {
158
+ archive: {
159
+ root: string;
160
+ nextAvailableLeafIndex: string | number | bigint;
161
+ };
162
+ header?: any;
163
+ body?: any;
164
+ }>, L2Block, {
165
+ archive: {
166
+ root: string;
167
+ nextAvailableLeafIndex: string | number | bigint;
168
+ };
169
+ header?: any;
170
+ body?: any;
171
+ }>;
172
+ l1: z.ZodObject<{
173
+ blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
174
+ timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
175
+ blockHash: z.ZodString;
176
+ }, "strip", z.ZodTypeAny, {
177
+ blockNumber: bigint;
178
+ timestamp: bigint;
179
+ blockHash: string;
180
+ }, {
181
+ blockNumber: string | number | bigint;
182
+ timestamp: string | number | bigint;
183
+ blockHash: string;
184
+ }>;
185
+ attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
186
+ address: z.ZodType<EthAddress, any, string>;
187
+ signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
188
+ }, "strip", z.ZodTypeAny, {
189
+ address: EthAddress;
190
+ signature: import("./index.js").Signature;
191
+ }, {
192
+ address: string;
193
+ signature: string;
194
+ }>, import("./index.js").CommitteeAttestation, {
195
+ address: string;
196
+ signature: string;
197
+ }>, "many">;
198
+ }, "strip", z.ZodTypeAny, {
199
+ block: L2Block;
200
+ l1: {
201
+ blockNumber: bigint;
202
+ timestamp: bigint;
203
+ blockHash: string;
204
+ };
205
+ attestations: import("./index.js").CommitteeAttestation[];
206
+ }, {
207
+ block: {
208
+ archive: {
209
+ root: string;
210
+ nextAvailableLeafIndex: string | number | bigint;
211
+ };
212
+ header?: any;
213
+ body?: any;
214
+ };
215
+ l1: {
216
+ blockNumber: string | number | bigint;
217
+ timestamp: string | number | bigint;
218
+ blockHash: string;
219
+ };
220
+ attestations: {
221
+ address: string;
222
+ signature: string;
223
+ }[];
224
+ }>>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ valid: true;
227
+ block?: {
228
+ block: L2Block;
229
+ l1: {
230
+ blockNumber: bigint;
231
+ timestamp: bigint;
232
+ blockHash: string;
233
+ };
234
+ attestations: import("./index.js").CommitteeAttestation[];
235
+ } | undefined;
236
+ }, {
237
+ valid: true;
238
+ block?: {
239
+ block: {
240
+ archive: {
241
+ root: string;
242
+ nextAvailableLeafIndex: string | number | bigint;
243
+ };
244
+ header?: any;
245
+ body?: any;
246
+ };
247
+ l1: {
248
+ blockNumber: string | number | bigint;
249
+ timestamp: string | number | bigint;
250
+ blockHash: string;
251
+ };
252
+ attestations: {
253
+ address: string;
254
+ signature: string;
255
+ }[];
256
+ } | undefined;
257
+ }>, z.ZodObject<{
258
+ valid: z.ZodLiteral<false>;
259
+ block: z.ZodObject<{
260
+ block: z.ZodEffects<z.ZodObject<{
261
+ archive: z.ZodEffects<z.ZodObject<{
262
+ root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
263
+ nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ root: import("@aztec/foundation/schemas").Fr;
266
+ nextAvailableLeafIndex: number;
267
+ }, {
268
+ root: string;
269
+ nextAvailableLeafIndex: string | number | bigint;
270
+ }>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
271
+ root: string;
272
+ nextAvailableLeafIndex: string | number | bigint;
273
+ }>;
274
+ header: ZodFor<BlockHeader>;
275
+ body: ZodFor<import("./body.js").Body>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
278
+ header: BlockHeader;
279
+ body: import("./body.js").Body;
280
+ }, {
281
+ archive: {
282
+ root: string;
283
+ nextAvailableLeafIndex: string | number | bigint;
284
+ };
285
+ header?: any;
286
+ body?: any;
287
+ }>, L2Block, {
288
+ archive: {
289
+ root: string;
290
+ nextAvailableLeafIndex: string | number | bigint;
291
+ };
292
+ header?: any;
293
+ body?: any;
294
+ }>;
295
+ l1: z.ZodObject<{
296
+ blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
297
+ timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
298
+ blockHash: z.ZodString;
299
+ }, "strip", z.ZodTypeAny, {
300
+ blockNumber: bigint;
301
+ timestamp: bigint;
302
+ blockHash: string;
303
+ }, {
304
+ blockNumber: string | number | bigint;
305
+ timestamp: string | number | bigint;
306
+ blockHash: string;
307
+ }>;
308
+ attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
309
+ address: z.ZodType<EthAddress, any, string>;
310
+ signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
311
+ }, "strip", z.ZodTypeAny, {
312
+ address: EthAddress;
313
+ signature: import("./index.js").Signature;
314
+ }, {
315
+ address: string;
316
+ signature: string;
317
+ }>, import("./index.js").CommitteeAttestation, {
318
+ address: string;
319
+ signature: string;
320
+ }>, "many">;
321
+ }, "strip", z.ZodTypeAny, {
322
+ block: L2Block;
323
+ l1: {
324
+ blockNumber: bigint;
325
+ timestamp: bigint;
326
+ blockHash: string;
327
+ };
328
+ attestations: import("./index.js").CommitteeAttestation[];
329
+ }, {
330
+ block: {
331
+ archive: {
332
+ root: string;
333
+ nextAvailableLeafIndex: string | number | bigint;
334
+ };
335
+ header?: any;
336
+ body?: any;
337
+ };
338
+ l1: {
339
+ blockNumber: string | number | bigint;
340
+ timestamp: string | number | bigint;
341
+ blockHash: string;
342
+ };
343
+ attestations: {
344
+ address: string;
345
+ signature: string;
346
+ }[];
347
+ }>;
348
+ committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
349
+ reason: z.ZodLiteral<"insufficient-attestations">;
350
+ }, "strip", z.ZodTypeAny, {
351
+ valid: false;
352
+ block: {
353
+ block: L2Block;
354
+ l1: {
355
+ blockNumber: bigint;
356
+ timestamp: bigint;
357
+ blockHash: string;
358
+ };
359
+ attestations: import("./index.js").CommitteeAttestation[];
360
+ };
361
+ committee: EthAddress[];
362
+ reason: "insufficient-attestations";
363
+ }, {
364
+ valid: false;
365
+ block: {
366
+ block: {
367
+ archive: {
368
+ root: string;
369
+ nextAvailableLeafIndex: string | number | bigint;
370
+ };
371
+ header?: any;
372
+ body?: any;
373
+ };
374
+ l1: {
375
+ blockNumber: string | number | bigint;
376
+ timestamp: string | number | bigint;
377
+ blockHash: string;
378
+ };
379
+ attestations: {
380
+ address: string;
381
+ signature: string;
382
+ }[];
383
+ };
384
+ committee: string[];
385
+ reason: "insufficient-attestations";
386
+ }>, z.ZodObject<{
387
+ valid: z.ZodLiteral<false>;
388
+ block: z.ZodObject<{
389
+ block: z.ZodEffects<z.ZodObject<{
390
+ archive: z.ZodEffects<z.ZodObject<{
391
+ root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
392
+ nextAvailableLeafIndex: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
393
+ }, "strip", z.ZodTypeAny, {
394
+ root: import("@aztec/foundation/schemas").Fr;
395
+ nextAvailableLeafIndex: number;
396
+ }, {
397
+ root: string;
398
+ nextAvailableLeafIndex: string | number | bigint;
399
+ }>, import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot, {
400
+ root: string;
401
+ nextAvailableLeafIndex: string | number | bigint;
402
+ }>;
403
+ header: ZodFor<BlockHeader>;
404
+ body: ZodFor<import("./body.js").Body>;
405
+ }, "strip", z.ZodTypeAny, {
406
+ archive: import("../trees/append_only_tree_snapshot.js").AppendOnlyTreeSnapshot;
407
+ header: BlockHeader;
408
+ body: import("./body.js").Body;
409
+ }, {
410
+ archive: {
411
+ root: string;
412
+ nextAvailableLeafIndex: string | number | bigint;
413
+ };
414
+ header?: any;
415
+ body?: any;
416
+ }>, L2Block, {
417
+ archive: {
418
+ root: string;
419
+ nextAvailableLeafIndex: string | number | bigint;
420
+ };
421
+ header?: any;
422
+ body?: any;
423
+ }>;
424
+ l1: z.ZodObject<{
425
+ blockNumber: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
426
+ timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
427
+ blockHash: z.ZodString;
428
+ }, "strip", z.ZodTypeAny, {
429
+ blockNumber: bigint;
430
+ timestamp: bigint;
431
+ blockHash: string;
432
+ }, {
433
+ blockNumber: string | number | bigint;
434
+ timestamp: string | number | bigint;
435
+ blockHash: string;
436
+ }>;
437
+ attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
438
+ address: z.ZodType<EthAddress, any, string>;
439
+ signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./index.js").Signature, string>;
440
+ }, "strip", z.ZodTypeAny, {
441
+ address: EthAddress;
442
+ signature: import("./index.js").Signature;
443
+ }, {
444
+ address: string;
445
+ signature: string;
446
+ }>, import("./index.js").CommitteeAttestation, {
447
+ address: string;
448
+ signature: string;
449
+ }>, "many">;
450
+ }, "strip", z.ZodTypeAny, {
451
+ block: L2Block;
452
+ l1: {
453
+ blockNumber: bigint;
454
+ timestamp: bigint;
455
+ blockHash: string;
456
+ };
457
+ attestations: import("./index.js").CommitteeAttestation[];
458
+ }, {
459
+ block: {
460
+ archive: {
461
+ root: string;
462
+ nextAvailableLeafIndex: string | number | bigint;
463
+ };
464
+ header?: any;
465
+ body?: any;
466
+ };
467
+ l1: {
468
+ blockNumber: string | number | bigint;
469
+ timestamp: string | number | bigint;
470
+ blockHash: string;
471
+ };
472
+ attestations: {
473
+ address: string;
474
+ signature: string;
475
+ }[];
476
+ }>;
477
+ committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
478
+ reason: z.ZodLiteral<"invalid-attestation">;
479
+ invalidIndex: z.ZodNumber;
480
+ }, "strip", z.ZodTypeAny, {
481
+ valid: false;
482
+ block: {
483
+ block: L2Block;
484
+ l1: {
485
+ blockNumber: bigint;
486
+ timestamp: bigint;
487
+ blockHash: string;
488
+ };
489
+ attestations: import("./index.js").CommitteeAttestation[];
490
+ };
491
+ committee: EthAddress[];
492
+ reason: "invalid-attestation";
493
+ invalidIndex: number;
494
+ }, {
495
+ valid: false;
496
+ block: {
497
+ block: {
498
+ archive: {
499
+ root: string;
500
+ nextAvailableLeafIndex: string | number | bigint;
501
+ };
502
+ header?: any;
503
+ body?: any;
504
+ };
505
+ l1: {
506
+ blockNumber: string | number | bigint;
507
+ timestamp: string | number | bigint;
508
+ blockHash: string;
509
+ };
510
+ attestations: {
511
+ address: string;
512
+ signature: string;
513
+ }[];
514
+ };
515
+ committee: string[];
516
+ reason: "invalid-attestation";
517
+ invalidIndex: number;
518
+ }>]>;
107
519
  /**
108
520
  * L2BlockSource that emits events upon pending / proven chain changes.
109
521
  * see L2BlockSourceEvents for the events emitted.
@@ -1 +1 @@
1
- {"version":3,"file":"l2_block_source.d.ts","sourceRoot":"","sources":["../../src/block/l2_block_source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,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;;;EAIK,CAAC;AAE/B,oBAAY,mBAAmB;IAC7B,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;CAChC;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,eAAe,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,CAAC;CACnB,CAAC"}
@@ -1,4 +1,25 @@
1
+ import { schemas } from '@aztec/foundation/schemas';
1
2
  import { z } from 'zod';
3
+ import { PublishedL2Block } from './published_l2_block.js';
4
+ export const ValidateBlockResultSchema = z.union([
5
+ z.object({
6
+ valid: z.literal(true),
7
+ block: PublishedL2Block.schema.optional()
8
+ }),
9
+ z.object({
10
+ valid: z.literal(false),
11
+ block: PublishedL2Block.schema,
12
+ committee: z.array(schemas.EthAddress),
13
+ reason: z.literal('insufficient-attestations')
14
+ }),
15
+ z.object({
16
+ valid: z.literal(false),
17
+ block: PublishedL2Block.schema,
18
+ committee: z.array(schemas.EthAddress),
19
+ reason: z.literal('invalid-attestation'),
20
+ invalidIndex: z.number()
21
+ })
22
+ ]);
2
23
  /** Creates an L2 block id */ export function makeL2BlockId(number, hash) {
3
24
  if (number !== 0 && !hash) {
4
25
  throw new Error(`Hash is required for non-genesis blocks (got block number ${number})`);
@@ -23,6 +23,7 @@ export declare class CommitteeAttestation {
23
23
  }>;
24
24
  static fromAddress(address: EthAddress): CommitteeAttestation;
25
25
  static fromAddressAndSignature(address: EthAddress, signature: Signature): CommitteeAttestation;
26
+ static fromSignature(signature: Signature): CommitteeAttestation;
26
27
  static fromViem(viem: ViemCommitteeAttestation): CommitteeAttestation;
27
28
  static fromBuffer(buffer: Buffer | BufferReader): CommitteeAttestation;
28
29
  static random(): CommitteeAttestation;
@@ -1 +1 @@
1
- {"version":3,"file":"committee_attestation.d.ts","sourceRoot":"","sources":["../../../src/block/proposal/committee_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AAEjC,qBAAa,oBAAoB;aAEb,OAAO,EAAE,UAAU;aACnB,SAAS,EAAE,SAAS;gBADpB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,SAAS;IAGtC,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;IAGD,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,UAAU,GAAG,oBAAoB;IAK7D,MAAM,CAAC,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,oBAAoB;IAI/F,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,GAAG,oBAAoB;IAIrE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,oBAAoB;IAOtE,MAAM,CAAC,MAAM,IAAI,oBAAoB;IAKrC,MAAM,CAAC,KAAK,IAAI,oBAAoB;IAIpC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,GAAG,oBAAoB,EAAE;IA+CnG,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO;IAI5C,MAAM,IAAI,wBAAwB;CAMnC"}
1
+ {"version":3,"file":"committee_attestation.d.ts","source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24
24
  static fromAddressAndSignature(address, signature) {
25
25
  return new CommitteeAttestation(address, signature);
26
26
  }
27
+ static fromSignature(signature) {
28
+ return new CommitteeAttestation(EthAddress.ZERO, signature);
29
+ }
27
30
  static fromViem(viem) {
28
31
  return new CommitteeAttestation(EthAddress.fromString(viem.addr), Signature.fromViemSignature(viem.signature));
29
32
  }
@@ -20,6 +20,7 @@ export declare class L1PublishedData {
20
20
  timestamp: string | number | bigint;
21
21
  blockHash: string;
22
22
  }>;
23
+ static random(): L1PublishedData;
23
24
  }
24
25
  export declare class PublishedL2Block {
25
26
  block: L2Block;
@@ -116,5 +117,5 @@ export declare class PublishedL2Block {
116
117
  }[];
117
118
  }>;
118
119
  }
119
- export declare function getAttestationsFromPublishedL2Block(block: PublishedL2Block): BlockAttestation[];
120
+ export declare function getAttestationsFromPublishedL2Block(block: Pick<PublishedL2Block, 'attestations' | 'block'>): BlockAttestation[];
120
121
  //# sourceMappingURL=published_l2_block.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"published_l2_block.d.ts","sourceRoot":"","sources":["../../src/block/published_l2_block.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,qBAAa,eAAe;IAEjB,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;gBAFjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM;IAG1B,MAAM,KAAK,MAAM;;;;;;;;;;;;OAMhB;CACF;AAED,qBAAa,gBAAgB;IAElB,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,eAAe;IACnB,YAAY,EAAE,oBAAoB,EAAE;gBAFpC,KAAK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CAKpB"}
@@ -1,4 +1,6 @@
1
1
  // Ignoring import issue to fix portable inferred type issue in zod schema
2
+ import { Buffer32 } from '@aztec/foundation/buffer';
3
+ import { randomBigInt } from '@aztec/foundation/crypto';
2
4
  import { schemas } from '@aztec/foundation/schemas';
3
5
  import { z } from 'zod';
4
6
  import { BlockAttestation } from '../p2p/block_attestation.js';
@@ -21,6 +23,9 @@ export class L1PublishedData {
21
23
  blockHash: z.string()
22
24
  });
23
25
  }
26
+ static random() {
27
+ return new L1PublishedData(randomBigInt(1000n) + 1n, BigInt(Math.floor(Date.now() / 1000)), Buffer32.random().toString());
28
+ }
24
29
  }
25
30
  export class PublishedL2Block {
26
31
  block;
@@ -41,5 +46,5 @@ export class PublishedL2Block {
41
46
  }
42
47
  export function getAttestationsFromPublishedL2Block(block) {
43
48
  const payload = ConsensusPayload.fromBlock(block.block);
44
- return block.attestations.filter((attestation)=>!attestation.signature.isEmpty()).map((attestation)=>new BlockAttestation(block.block.header.globalVariables.blockNumber, payload, attestation.signature));
49
+ return block.attestations.filter((attestation)=>!attestation.signature.isEmpty()).map((attestation)=>new BlockAttestation(block.block.number, payload, attestation.signature));
45
50
  }
@@ -120,7 +120,7 @@ interface ContractClassCommitments {
120
120
  }
121
121
  /** A contract class with its precomputed id. */
122
122
  export type ContractClassWithId = ContractClass & Pick<ContractClassCommitments, 'id'>;
123
- export declare const ContractClassWithIdSchema: z.ZodObject<{
123
+ export declare const ContractClassWithIdSchema: z.ZodObject<z.objectUtil.extendShape<{
124
124
  version: z.ZodLiteral<1>;
125
125
  artifactHash: z.ZodType<Fr, any, string>;
126
126
  privateFunctions: z.ZodArray<z.ZodObject<{
@@ -146,9 +146,9 @@ export declare const ContractClassWithIdSchema: z.ZodObject<{
146
146
  type: "Buffer";
147
147
  data: number[];
148
148
  }>]>;
149
- } & {
149
+ }, {
150
150
  id: z.ZodType<Fr, any, string>;
151
- }, "strip", z.ZodTypeAny, {
151
+ }>, "strip", z.ZodTypeAny, {
152
152
  version: 1;
153
153
  id: Fr;
154
154
  artifactHash: Fr;
@@ -1 +1 @@
1
- {"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/interfaces/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK9D,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAOnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,aAAa,GAAG,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,EACvE,OAAO,GAAG,MAAM,CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CA+CvD,CAAC"}
1
+ {"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/interfaces/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK9D,OAAO,EAAE,KAAK,aAAa,EAA2C,MAAM,6BAA6B,CAAC;AAE1G,OAAO,EAEL,KAAK,kBAAkB,EAExB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAOnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,aAAa,GAAG,YAAY,GAAG,kBAAkB,GAAG,mBAAmB,EACvE,OAAO,GAAG,MAAM,CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAiDvD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { L2Block } from '../block/l2_block.js';
3
- import { L2TipsSchema } from '../block/l2_block_source.js';
3
+ import { L2TipsSchema, ValidateBlockResultSchema } from '../block/l2_block_source.js';
4
4
  import { PublishedL2Block } from '../block/published_l2_block.js';
5
5
  import { ContractClassPublicSchema, ContractInstanceWithAddressSchema } from '../contract/index.js';
6
6
  import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
@@ -47,5 +47,7 @@ export const ArchiverApiSchema = {
47
47
  getDebugFunctionName: z.function().args(schemas.AztecAddress, schemas.FunctionSelector).returns(optional(z.string())),
48
48
  getL1Constants: z.function().args().returns(L1RollupConstantsSchema),
49
49
  getL1Timestamp: z.function().args().returns(schemas.BigInt),
50
- syncImmediate: z.function().args().returns(z.void())
50
+ syncImmediate: z.function().args().returns(z.void()),
51
+ isPendingChainInvalid: z.function().args().returns(z.boolean()),
52
+ getPendingChainValidationStatus: z.function().args().returns(ValidateBlockResultSchema)
51
53
  };