@aztec/stdlib 3.0.0-nightly.20250910 → 3.0.0-nightly.20250912

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 (72) hide show
  1. package/dest/block/index.d.ts +2 -0
  2. package/dest/block/index.d.ts.map +1 -1
  3. package/dest/block/index.js +2 -0
  4. package/dest/block/l2_block.d.ts +2 -8
  5. package/dest/block/l2_block.d.ts.map +1 -1
  6. package/dest/block/l2_block.js +5 -3
  7. package/dest/block/l2_block_info.d.ts +41 -0
  8. package/dest/block/l2_block_info.d.ts.map +1 -0
  9. package/dest/block/l2_block_info.js +40 -0
  10. package/dest/block/l2_block_source.d.ts +1 -428
  11. package/dest/block/l2_block_source.d.ts.map +1 -1
  12. package/dest/block/l2_block_source.js +0 -28
  13. package/dest/block/published_l2_block.d.ts +25 -1
  14. package/dest/block/published_l2_block.d.ts.map +1 -1
  15. package/dest/block/published_l2_block.js +20 -1
  16. package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
  17. package/dest/block/test/l2_tips_store_test_suite.js +2 -1
  18. package/dest/block/validate_block_result.d.ts +222 -0
  19. package/dest/block/validate_block_result.d.ts.map +1 -0
  20. package/dest/block/validate_block_result.js +83 -0
  21. package/dest/interfaces/archiver.d.ts +43 -0
  22. package/dest/interfaces/archiver.d.ts.map +1 -1
  23. package/dest/interfaces/archiver.js +10 -1
  24. package/dest/interfaces/aztec-node-admin.d.ts +17 -3
  25. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  26. package/dest/interfaces/aztec-node-admin.js +6 -1
  27. package/dest/p2p/block_attestation.d.ts +1 -0
  28. package/dest/p2p/block_attestation.d.ts.map +1 -1
  29. package/dest/p2p/block_attestation.js +3 -0
  30. package/dest/p2p/block_proposal.d.ts +2 -2
  31. package/dest/p2p/block_proposal.d.ts.map +1 -1
  32. package/dest/p2p/block_proposal.js +3 -1
  33. package/dest/p2p/consensus_payload.d.ts +1 -0
  34. package/dest/p2p/consensus_payload.d.ts.map +1 -1
  35. package/dest/p2p/consensus_payload.js +6 -4
  36. package/dest/tests/mocks.d.ts +1 -1
  37. package/dest/tests/mocks.d.ts.map +1 -1
  38. package/dest/tests/mocks.js +5 -8
  39. package/dest/tx/content_commitment.d.ts +1 -0
  40. package/dest/tx/content_commitment.d.ts.map +1 -1
  41. package/dest/tx/content_commitment.js +3 -0
  42. package/dest/tx/partial_state_reference.d.ts +1 -0
  43. package/dest/tx/partial_state_reference.d.ts.map +1 -1
  44. package/dest/tx/partial_state_reference.js +3 -0
  45. package/dest/tx/proposed_block_header.d.ts +1 -0
  46. package/dest/tx/proposed_block_header.d.ts.map +1 -1
  47. package/dest/tx/proposed_block_header.js +3 -0
  48. package/dest/tx/state_reference.d.ts +1 -0
  49. package/dest/tx/state_reference.d.ts.map +1 -1
  50. package/dest/tx/state_reference.js +3 -0
  51. package/dest/update-checker/update-checker.d.ts +1 -1
  52. package/dest/update-checker/update-checker.d.ts.map +1 -1
  53. package/dest/update-checker/update-checker.js +1 -1
  54. package/package.json +8 -8
  55. package/src/block/index.ts +2 -0
  56. package/src/block/l2_block.ts +6 -11
  57. package/src/block/l2_block_info.ts +63 -0
  58. package/src/block/l2_block_source.ts +1 -51
  59. package/src/block/published_l2_block.ts +38 -5
  60. package/src/block/test/l2_tips_store_test_suite.ts +7 -6
  61. package/src/block/validate_block_result.ts +122 -0
  62. package/src/interfaces/archiver.ts +38 -1
  63. package/src/interfaces/aztec-node-admin.ts +12 -1
  64. package/src/p2p/block_attestation.ts +4 -0
  65. package/src/p2p/block_proposal.ts +5 -3
  66. package/src/p2p/consensus_payload.ts +7 -4
  67. package/src/tests/mocks.ts +5 -5
  68. package/src/tx/content_commitment.ts +4 -0
  69. package/src/tx/partial_state_reference.ts +8 -0
  70. package/src/tx/proposed_block_header.ts +13 -0
  71. package/src/tx/state_reference.ts +4 -0
  72. package/src/update-checker/update-checker.ts +1 -1
@@ -1,3 +1,5 @@
1
+ import { BufferReader } from '@aztec/foundation/serialize';
2
+ import type { FieldsOf } from '@aztec/foundation/types';
1
3
  import { z } from 'zod';
2
4
  import { BlockAttestation } from '../p2p/block_attestation.js';
3
5
  import { L2Block } from './l2_block.js';
@@ -21,13 +23,14 @@ export declare class L1PublishedData {
21
23
  blockHash: string;
22
24
  }>;
23
25
  static random(): L1PublishedData;
26
+ static fromFields(fields: FieldsOf<L1PublishedData>): L1PublishedData;
24
27
  }
25
28
  export declare class PublishedL2Block {
26
29
  block: L2Block;
27
30
  l1: L1PublishedData;
28
31
  attestations: CommitteeAttestation[];
29
32
  constructor(block: L2Block, l1: L1PublishedData, attestations: CommitteeAttestation[]);
30
- static get schema(): z.ZodObject<{
33
+ static get schema(): z.ZodEffects<z.ZodObject<{
31
34
  block: z.ZodEffects<z.ZodObject<{
32
35
  archive: z.ZodEffects<z.ZodObject<{
33
36
  root: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
@@ -115,7 +118,28 @@ export declare class PublishedL2Block {
115
118
  address: string;
116
119
  signature: string;
117
120
  }[];
121
+ }>, PublishedL2Block, {
122
+ block: {
123
+ archive: {
124
+ root: string;
125
+ nextAvailableLeafIndex: string | number | bigint;
126
+ };
127
+ header?: any;
128
+ body?: any;
129
+ };
130
+ l1: {
131
+ blockNumber: string | number | bigint;
132
+ timestamp: string | number | bigint;
133
+ blockHash: string;
134
+ };
135
+ attestations: {
136
+ address: string;
137
+ signature: string;
138
+ }[];
118
139
  }>;
140
+ static fromBuffer(bufferOrReader: Buffer | BufferReader): PublishedL2Block;
141
+ static fromFields(fields: FieldsOf<PublishedL2Block>): PublishedL2Block;
142
+ toBuffer(): Buffer;
119
143
  }
120
144
  export declare function getAttestationsFromPublishedL2Block(block: Pick<PublishedL2Block, 'attestations' | 'block'>): BlockAttestation[];
121
145
  //# 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":[],"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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;IAED,MAAM,CAAC,MAAM;IAQb,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC;CAGpD;AAED,qBAAa,gBAAgB;IAElB,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,eAAe;IACnB,YAAY,EAAE,oBAAoB,EAAE;gBAFpC,KAAK,EAAE,OAAO,EACd,EAAE,EAAE,eAAe,EACnB,YAAY,EAAE,oBAAoB,EAAE;IAG7C,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAQhB;IAED,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB;IAU1E,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAI7C,QAAQ,IAAI,MAAM;CAU1B;AAED,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,cAAc,GAAG,OAAO,CAAC,GACtD,gBAAgB,EAAE,CAKpB"}
@@ -2,6 +2,7 @@
2
2
  import { Buffer32 } from '@aztec/foundation/buffer';
3
3
  import { randomBigInt } from '@aztec/foundation/crypto';
4
4
  import { schemas } from '@aztec/foundation/schemas';
5
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
5
6
  import { z } from 'zod';
6
7
  import { BlockAttestation } from '../p2p/block_attestation.js';
7
8
  import { ConsensusPayload } from '../p2p/consensus_payload.js';
@@ -26,6 +27,9 @@ export class L1PublishedData {
26
27
  static random() {
27
28
  return new L1PublishedData(randomBigInt(1000n) + 1n, BigInt(Math.floor(Date.now() / 1000)), Buffer32.random().toString());
28
29
  }
30
+ static fromFields(fields) {
31
+ return new L1PublishedData(fields.blockNumber, fields.timestamp, fields.blockHash);
32
+ }
29
33
  }
30
34
  export class PublishedL2Block {
31
35
  block;
@@ -41,7 +45,22 @@ export class PublishedL2Block {
41
45
  block: L2Block.schema,
42
46
  l1: L1PublishedData.schema,
43
47
  attestations: z.array(CommitteeAttestation.schema)
44
- });
48
+ }).transform((obj)=>PublishedL2Block.fromFields(obj));
49
+ }
50
+ static fromBuffer(bufferOrReader) {
51
+ const reader = BufferReader.asReader(bufferOrReader);
52
+ const block = reader.readObject(L2Block);
53
+ const l1BlockNumber = reader.readBigInt();
54
+ const l1BlockHash = reader.readString();
55
+ const l1Timestamp = reader.readBigInt();
56
+ const attestations = reader.readVector(CommitteeAttestation);
57
+ return new PublishedL2Block(block, new L1PublishedData(l1BlockNumber, l1Timestamp, l1BlockHash), attestations);
58
+ }
59
+ static fromFields(fields) {
60
+ return new PublishedL2Block(fields.block, fields.l1, fields.attestations);
61
+ }
62
+ toBuffer() {
63
+ return serializeToBuffer(this.block, this.l1.blockNumber, this.l1.blockHash, this.l1.timestamp, this.attestations.length, this.attestations);
45
64
  }
46
65
  }
47
66
  export function getAttestationsFromPublishedL2Block(block) {
@@ -1 +1 @@
1
- {"version":3,"file":"l2_tips_store_test_suite.d.ts","sourceRoot":"","sources":["../../../src/block/test/l2_tips_store_test_suite.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,QA6ExE"}
1
+ {"version":3,"file":"l2_tips_store_test_suite.d.ts","sourceRoot":"","sources":["../../../src/block/test/l2_tips_store_test_suite.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,QA8ExE"}
@@ -1,12 +1,13 @@
1
1
  import { times } from '@aztec/foundation/collection';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
+ import { PublishedL2Block } from '@aztec/stdlib/block';
3
4
  import { jestExpect as expect } from '@jest/expect';
4
5
  export function testL2TipsStore(makeTipsStore) {
5
6
  let tipsStore;
6
7
  beforeEach(async ()=>{
7
8
  tipsStore = await makeTipsStore();
8
9
  });
9
- const makeBlock = (number)=>({
10
+ const makeBlock = (number)=>PublishedL2Block.fromFields({
10
11
  block: {
11
12
  number,
12
13
  header: {
@@ -0,0 +1,222 @@
1
+ import { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { BufferReader } from '@aztec/foundation/serialize';
3
+ import { z } from 'zod';
4
+ import { type L2BlockInfo } from './l2_block_info.js';
5
+ import { CommitteeAttestation } from './proposal/committee_attestation.js';
6
+ /** Subtype for invalid block validation results */
7
+ export type ValidateBlockNegativeResult = {
8
+ valid: false;
9
+ /** Identifiers from the invalid block */
10
+ block: L2BlockInfo;
11
+ /** Committee members at the epoch this block was proposed */
12
+ committee: EthAddress[];
13
+ /** Epoch in which this block was proposed */
14
+ epoch: bigint;
15
+ /** Proposer selection seed for the epoch */
16
+ seed: bigint;
17
+ /** List of committee members who signed this block proposal */
18
+ attestors: EthAddress[];
19
+ /** Committee attestations for this block as they were posted to L1 */
20
+ attestations: CommitteeAttestation[];
21
+ /** Reason for the block being invalid: not enough attestations were posted */
22
+ reason: 'insufficient-attestations';
23
+ } | {
24
+ valid: false;
25
+ /** Identifiers from the invalid block */
26
+ block: L2BlockInfo;
27
+ /** Committee members at the epoch this block was proposed */
28
+ committee: EthAddress[];
29
+ /** Epoch in which this block was proposed */
30
+ epoch: bigint;
31
+ /** Proposer selection seed for the epoch */
32
+ seed: bigint;
33
+ /** List of committee members who signed this block proposal */
34
+ attestors: EthAddress[];
35
+ /** Committee attestations for this block as they were posted to L1 */
36
+ attestations: CommitteeAttestation[];
37
+ /** Reason for the block being invalid: an invalid attestation was posted */
38
+ reason: 'invalid-attestation';
39
+ /** Index in the attestations array of the invalid attestation posted */
40
+ invalidIndex: number;
41
+ };
42
+ /** Result type for validating a block attestations */
43
+ export type ValidateBlockResult = {
44
+ valid: true;
45
+ } | ValidateBlockNegativeResult;
46
+ export declare const ValidateBlockResultSchema: z.ZodUnion<[z.ZodObject<{
47
+ valid: z.ZodLiteral<true>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ valid: true;
50
+ }, {
51
+ valid: true;
52
+ }>, z.ZodObject<{
53
+ valid: z.ZodLiteral<false>;
54
+ block: z.ZodObject<{
55
+ blockHash: z.ZodOptional<z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>>;
56
+ archive: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
57
+ lastArchive: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
58
+ blockNumber: z.ZodNumber;
59
+ slotNumber: z.ZodNumber;
60
+ txCount: z.ZodNumber;
61
+ timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ blockNumber: number;
64
+ slotNumber: number;
65
+ timestamp: bigint;
66
+ lastArchive: import("@aztec/foundation/schemas").Fr;
67
+ archive: import("@aztec/foundation/schemas").Fr;
68
+ txCount: number;
69
+ blockHash?: import("@aztec/foundation/schemas").Fr | undefined;
70
+ }, {
71
+ blockNumber: number;
72
+ slotNumber: number;
73
+ timestamp: string | number | bigint;
74
+ lastArchive: string;
75
+ archive: string;
76
+ txCount: number;
77
+ blockHash?: string | undefined;
78
+ }>;
79
+ committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
80
+ epoch: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
81
+ seed: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
82
+ attestors: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
83
+ attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
84
+ address: z.ZodType<EthAddress, any, string>;
85
+ signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./proposal/committee_attestation.js").Signature, string>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ address: EthAddress;
88
+ signature: import("./proposal/committee_attestation.js").Signature;
89
+ }, {
90
+ address: string;
91
+ signature: string;
92
+ }>, CommitteeAttestation, {
93
+ address: string;
94
+ signature: string;
95
+ }>, "many">;
96
+ reason: z.ZodLiteral<"insufficient-attestations">;
97
+ }, "strip", z.ZodTypeAny, {
98
+ valid: false;
99
+ block: {
100
+ blockNumber: number;
101
+ slotNumber: number;
102
+ timestamp: bigint;
103
+ lastArchive: import("@aztec/foundation/schemas").Fr;
104
+ archive: import("@aztec/foundation/schemas").Fr;
105
+ txCount: number;
106
+ blockHash?: import("@aztec/foundation/schemas").Fr | undefined;
107
+ };
108
+ attestations: CommitteeAttestation[];
109
+ committee: EthAddress[];
110
+ epoch: bigint;
111
+ seed: bigint;
112
+ attestors: EthAddress[];
113
+ reason: "insufficient-attestations";
114
+ }, {
115
+ valid: false;
116
+ block: {
117
+ blockNumber: number;
118
+ slotNumber: number;
119
+ timestamp: string | number | bigint;
120
+ lastArchive: string;
121
+ archive: string;
122
+ txCount: number;
123
+ blockHash?: string | undefined;
124
+ };
125
+ attestations: {
126
+ address: string;
127
+ signature: string;
128
+ }[];
129
+ committee: string[];
130
+ epoch: string | number | bigint;
131
+ seed: string | number | bigint;
132
+ attestors: string[];
133
+ reason: "insufficient-attestations";
134
+ }>, z.ZodObject<{
135
+ valid: z.ZodLiteral<false>;
136
+ block: z.ZodObject<{
137
+ blockHash: z.ZodOptional<z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>>;
138
+ archive: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
139
+ lastArchive: z.ZodType<import("@aztec/foundation/schemas").Fr, any, string>;
140
+ blockNumber: z.ZodNumber;
141
+ slotNumber: z.ZodNumber;
142
+ txCount: z.ZodNumber;
143
+ timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
144
+ }, "strip", z.ZodTypeAny, {
145
+ blockNumber: number;
146
+ slotNumber: number;
147
+ timestamp: bigint;
148
+ lastArchive: import("@aztec/foundation/schemas").Fr;
149
+ archive: import("@aztec/foundation/schemas").Fr;
150
+ txCount: number;
151
+ blockHash?: import("@aztec/foundation/schemas").Fr | undefined;
152
+ }, {
153
+ blockNumber: number;
154
+ slotNumber: number;
155
+ timestamp: string | number | bigint;
156
+ lastArchive: string;
157
+ archive: string;
158
+ txCount: number;
159
+ blockHash?: string | undefined;
160
+ }>;
161
+ committee: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
162
+ epoch: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
163
+ seed: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
164
+ attestors: z.ZodArray<z.ZodType<EthAddress, any, string>, "many">;
165
+ attestations: z.ZodArray<z.ZodEffects<z.ZodObject<{
166
+ address: z.ZodType<EthAddress, any, string>;
167
+ signature: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, `0x${string}`, string>, import("./proposal/committee_attestation.js").Signature, string>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ address: EthAddress;
170
+ signature: import("./proposal/committee_attestation.js").Signature;
171
+ }, {
172
+ address: string;
173
+ signature: string;
174
+ }>, CommitteeAttestation, {
175
+ address: string;
176
+ signature: string;
177
+ }>, "many">;
178
+ reason: z.ZodLiteral<"invalid-attestation">;
179
+ invalidIndex: z.ZodNumber;
180
+ }, "strip", z.ZodTypeAny, {
181
+ valid: false;
182
+ block: {
183
+ blockNumber: number;
184
+ slotNumber: number;
185
+ timestamp: bigint;
186
+ lastArchive: import("@aztec/foundation/schemas").Fr;
187
+ archive: import("@aztec/foundation/schemas").Fr;
188
+ txCount: number;
189
+ blockHash?: import("@aztec/foundation/schemas").Fr | undefined;
190
+ };
191
+ attestations: CommitteeAttestation[];
192
+ committee: EthAddress[];
193
+ epoch: bigint;
194
+ seed: bigint;
195
+ attestors: EthAddress[];
196
+ reason: "invalid-attestation";
197
+ invalidIndex: number;
198
+ }, {
199
+ valid: false;
200
+ block: {
201
+ blockNumber: number;
202
+ slotNumber: number;
203
+ timestamp: string | number | bigint;
204
+ lastArchive: string;
205
+ archive: string;
206
+ txCount: number;
207
+ blockHash?: string | undefined;
208
+ };
209
+ attestations: {
210
+ address: string;
211
+ signature: string;
212
+ }[];
213
+ committee: string[];
214
+ epoch: string | number | bigint;
215
+ seed: string | number | bigint;
216
+ attestors: string[];
217
+ reason: "invalid-attestation";
218
+ invalidIndex: number;
219
+ }>]>;
220
+ export declare function serializeValidateBlockResult(result: ValidateBlockResult): Buffer;
221
+ export declare function deserializeValidateBlockResult(bufferOrReader: Buffer | BufferReader): ValidateBlockResult;
222
+ //# sourceMappingURL=validate_block_result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate_block_result.d.ts","sourceRoot":"","sources":["../../src/block/validate_block_result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmB,KAAK,WAAW,EAA4C,MAAM,oBAAoB,CAAC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;;;;;;;IAuBE,CAAC;AAEzC,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAqBhF;AAED,wBAAgB,8BAA8B,CAAC,cAAc,EAAE,MAAM,GAAG,YAAY,GAAG,mBAAmB,CAsBzG"}
@@ -0,0 +1,83 @@
1
+ import { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { schemas } from '@aztec/foundation/schemas';
3
+ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
4
+ import { z } from 'zod';
5
+ import { BlockInfoSchema, deserializeBlockInfo, serializeBlockInfo } from './l2_block_info.js';
6
+ import { CommitteeAttestation } from './proposal/committee_attestation.js';
7
+ export const ValidateBlockResultSchema = z.union([
8
+ z.object({
9
+ valid: z.literal(true)
10
+ }),
11
+ z.object({
12
+ valid: z.literal(false),
13
+ block: BlockInfoSchema,
14
+ committee: z.array(schemas.EthAddress),
15
+ epoch: schemas.BigInt,
16
+ seed: schemas.BigInt,
17
+ attestors: z.array(schemas.EthAddress),
18
+ attestations: z.array(CommitteeAttestation.schema),
19
+ reason: z.literal('insufficient-attestations')
20
+ }),
21
+ z.object({
22
+ valid: z.literal(false),
23
+ block: BlockInfoSchema,
24
+ committee: z.array(schemas.EthAddress),
25
+ epoch: schemas.BigInt,
26
+ seed: schemas.BigInt,
27
+ attestors: z.array(schemas.EthAddress),
28
+ attestations: z.array(CommitteeAttestation.schema),
29
+ reason: z.literal('invalid-attestation'),
30
+ invalidIndex: z.number()
31
+ })
32
+ ]);
33
+ export function serializeValidateBlockResult(result) {
34
+ if (result.valid) {
35
+ return serializeToBuffer(true);
36
+ }
37
+ const l2Block = serializeBlockInfo(result.block);
38
+ return serializeToBuffer(result.valid, result.reason, l2Block.length, l2Block, result.committee.length, result.committee, result.epoch, result.seed ?? 0n, result.attestors.length, result.attestors, result.attestations.length, result.attestations, result.reason === 'invalid-attestation' ? result.invalidIndex : 0);
39
+ }
40
+ export function deserializeValidateBlockResult(bufferOrReader) {
41
+ const reader = BufferReader.asReader(bufferOrReader);
42
+ const valid = reader.readBoolean();
43
+ if (valid) {
44
+ return {
45
+ valid
46
+ };
47
+ }
48
+ const reason = reader.readString();
49
+ const block = deserializeBlockInfo(reader.readBuffer());
50
+ const committee = reader.readVector(EthAddress);
51
+ const epoch = reader.readBigInt();
52
+ const seed = reader.readBigInt();
53
+ const attestors = reader.readVector(EthAddress);
54
+ const attestations = reader.readVector(CommitteeAttestation);
55
+ const invalidIndex = reader.readNumber();
56
+ if (reason === 'insufficient-attestations') {
57
+ return {
58
+ valid,
59
+ reason,
60
+ block,
61
+ committee,
62
+ epoch,
63
+ seed,
64
+ attestors,
65
+ attestations: attestations
66
+ };
67
+ } else if (reason === 'invalid-attestation') {
68
+ return {
69
+ valid,
70
+ reason,
71
+ block,
72
+ committee,
73
+ epoch,
74
+ seed,
75
+ attestors,
76
+ invalidIndex,
77
+ attestations: attestations
78
+ };
79
+ } else {
80
+ const _ = reason;
81
+ throw new Error(`Unknown reason: ${reason}`);
82
+ }
83
+ }
@@ -1,8 +1,51 @@
1
+ import type { L1ContractAddresses } from '@aztec/ethereum';
1
2
  import type { ApiSchemaFor } from '@aztec/foundation/schemas';
3
+ import { z } from 'zod';
2
4
  import { type L2BlockSource } from '../block/l2_block_source.js';
3
5
  import { type ContractDataSource } from '../contract/index.js';
4
6
  import type { L1ToL2MessageSource } from '../messaging/l1_to_l2_message_source.js';
5
7
  import type { L2LogsSource } from './l2_logs_source.js';
8
+ /**
9
+ * The archiver configuration.
10
+ */
11
+ export type ArchiverSpecificConfig = {
12
+ /** The polling interval in ms for retrieving new L2 blocks and encrypted logs. */
13
+ archiverPollingIntervalMS?: number;
14
+ /** The number of L2 blocks the archiver will attempt to download at a time. */
15
+ archiverBatchSize?: number;
16
+ /** The polling interval viem uses in ms */
17
+ viemPollingIntervalMS?: number;
18
+ /** The deployed L1 contract addresses */
19
+ l1Contracts: L1ContractAddresses;
20
+ /** The max number of logs that can be obtained in 1 "getPublicLogs" call. */
21
+ maxLogs?: number;
22
+ /** The maximum possible size of the archiver DB in KB. Overwrites the general dataStoreMapSizeKB. */
23
+ archiverStoreMapSizeKb?: number;
24
+ /** Whether to skip validating block attestations (use only for testing). */
25
+ skipValidateBlockAttestations?: boolean;
26
+ };
27
+ export declare const ArchiverSpecificConfigSchema: z.ZodObject<{
28
+ archiverPollingIntervalMS: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
29
+ archiverBatchSize: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
30
+ viemPollingIntervalMS: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
31
+ maxLogs: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
32
+ archiverStoreMapSizeKb: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
33
+ skipValidateBlockAttestations: z.ZodOptional<z.ZodBoolean>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ archiverPollingIntervalMS?: number | undefined;
36
+ archiverBatchSize?: number | undefined;
37
+ viemPollingIntervalMS?: number | undefined;
38
+ maxLogs?: number | undefined;
39
+ archiverStoreMapSizeKb?: number | undefined;
40
+ skipValidateBlockAttestations?: boolean | undefined;
41
+ }, {
42
+ archiverPollingIntervalMS?: string | number | bigint | undefined;
43
+ archiverBatchSize?: string | number | bigint | undefined;
44
+ viemPollingIntervalMS?: string | number | bigint | undefined;
45
+ maxLogs?: string | number | bigint | undefined;
46
+ archiverStoreMapSizeKb?: string | number | bigint | undefined;
47
+ skipValidateBlockAttestations?: boolean | undefined;
48
+ }>;
6
49
  export type ArchiverApi = Omit<L2BlockSource & L2LogsSource & ContractDataSource & L1ToL2MessageSource, 'start' | 'stop'>;
7
50
  export declare const ArchiverApiSchema: ApiSchemaFor<ArchiverApi>;
8
51
  //# sourceMappingURL=archiver.d.ts.map
@@ -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,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
+ {"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../src/interfaces/archiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,6BAA6B,CAAC;AAG/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;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,kFAAkF;IAClF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAEnC,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,2CAA2C;IAC3C,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,yCAAyC;IACzC,WAAW,EAAE,mBAAmB,CAAC;IAEjC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,qGAAqG;IACrG,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,4EAA4E;IAC5E,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;EAOvC,CAAC;AAEH,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,7 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { L2Block } from '../block/l2_block.js';
3
- import { L2TipsSchema, ValidateBlockResultSchema } from '../block/l2_block_source.js';
3
+ import { L2TipsSchema } from '../block/l2_block_source.js';
4
4
  import { PublishedL2Block } from '../block/published_l2_block.js';
5
+ import { ValidateBlockResultSchema } from '../block/validate_block_result.js';
5
6
  import { ContractClassPublicSchema, ContractInstanceWithAddressSchema } from '../contract/index.js';
6
7
  import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
7
8
  import { LogFilterSchema } from '../logs/log_filter.js';
@@ -13,6 +14,14 @@ import { indexedTxSchema } from '../tx/indexed_tx_effect.js';
13
14
  import { TxHash } from '../tx/tx_hash.js';
14
15
  import { TxReceipt } from '../tx/tx_receipt.js';
15
16
  import { GetContractClassLogsResponseSchema, GetPublicLogsResponseSchema } from './get_logs_response.js';
17
+ export const ArchiverSpecificConfigSchema = z.object({
18
+ archiverPollingIntervalMS: schemas.Integer.optional(),
19
+ archiverBatchSize: schemas.Integer.optional(),
20
+ viemPollingIntervalMS: schemas.Integer.optional(),
21
+ maxLogs: schemas.Integer.optional(),
22
+ archiverStoreMapSizeKb: schemas.Integer.optional(),
23
+ skipValidateBlockAttestations: z.boolean().optional()
24
+ });
16
25
  export const ArchiverApiSchema = {
17
26
  getRollupAddress: z.function().args().returns(schemas.EthAddress),
18
27
  getRegistryAddress: z.function().args().returns(schemas.EthAddress),
@@ -3,6 +3,7 @@ import { z } from 'zod';
3
3
  import type { ApiSchemaFor } from '../schemas/schemas.js';
4
4
  import { type Offense, type SlashPayloadRound } from '../slashing/index.js';
5
5
  import { type ComponentsVersions } from '../versioning/index.js';
6
+ import { type ArchiverSpecificConfig } from './archiver.js';
6
7
  import { type SequencerConfig } from './configs.js';
7
8
  import { type ProverConfig } from './prover-client.js';
8
9
  import { type SlasherConfig } from './slasher.js';
@@ -40,10 +41,10 @@ export interface AztecNodeAdmin {
40
41
  /** Returns all offenses applicable for the given round. */
41
42
  getSlashOffenses(round: bigint | 'all' | 'current'): Promise<Offense[]>;
42
43
  }
43
- export type AztecNodeAdminConfig = ValidatorClientFullConfig & SequencerConfig & ProverConfig & SlasherConfig & {
44
+ export type AztecNodeAdminConfig = ValidatorClientFullConfig & SequencerConfig & ProverConfig & SlasherConfig & Pick<ArchiverSpecificConfig, 'archiverPollingIntervalMS' | 'skipValidateBlockAttestations' | 'archiverBatchSize'> & {
44
45
  maxTxPoolSize: number;
45
46
  };
46
- export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
47
+ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
47
48
  transactionPollingIntervalMS: z.ZodOptional<z.ZodNumber>;
48
49
  maxTxsPerBlock: z.ZodOptional<z.ZodNumber>;
49
50
  minTxsPerBlock: z.ZodOptional<z.ZodNumber>;
@@ -128,7 +129,14 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
128
129
  attestationPollingIntervalMs: z.ZodNumber;
129
130
  validatorReexecute: z.ZodBoolean;
130
131
  validatorReexecuteDeadlineMs: z.ZodNumber;
131
- }>, {
132
+ }>, Pick<{
133
+ archiverPollingIntervalMS: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
134
+ archiverBatchSize: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
135
+ viemPollingIntervalMS: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
136
+ maxLogs: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
137
+ archiverStoreMapSizeKb: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>>;
138
+ skipValidateBlockAttestations: z.ZodOptional<z.ZodBoolean>;
139
+ }, "archiverPollingIntervalMS" | "archiverBatchSize" | "skipValidateBlockAttestations">>, {
132
140
  maxTxPoolSize: z.ZodNumber;
133
141
  }>, "strip", z.ZodTypeAny, {
134
142
  secondsBeforeInvalidatingBlockAsCommitteeMember: number;
@@ -189,6 +197,9 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
189
197
  attestationPropagationTime?: number | undefined;
190
198
  skipCollectingAttestations?: boolean | undefined;
191
199
  proverId?: import("@aztec/foundation/schemas").EthAddress | undefined;
200
+ archiverPollingIntervalMS?: number | undefined;
201
+ archiverBatchSize?: number | undefined;
202
+ skipValidateBlockAttestations?: boolean | undefined;
192
203
  slashOverridePayload?: import("@aztec/foundation/schemas").EthAddress | undefined;
193
204
  slashSelfAllowed?: boolean | undefined;
194
205
  nodeUrl?: string | undefined;
@@ -252,6 +263,9 @@ export declare const AztecNodeAdminConfigSchema: z.ZodObject<z.objectUtil.extend
252
263
  attestationPropagationTime?: number | undefined;
253
264
  skipCollectingAttestations?: boolean | undefined;
254
265
  proverId?: any;
266
+ archiverPollingIntervalMS?: string | number | bigint | undefined;
267
+ archiverBatchSize?: string | number | bigint | undefined;
268
+ skipValidateBlockAttestations?: boolean | undefined;
255
269
  slashOverridePayload?: string | undefined;
256
270
  slashSelfAllowed?: boolean | undefined;
257
271
  nodeUrl?: string | undefined;
@@ -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;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,OAAO,EAAiB,KAAK,iBAAiB,EAA2B,MAAM,sBAAsB,CAAC;AACpH,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;AAC3E,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,cAAc,CAAC;AACvE,OAAO,EAA+B,KAAK,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE3C;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,IAAI,CA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AC;IAEjD,2DAA2D;IAC3D,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CACzE;AAED,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAC1D,eAAe,GACf,YAAY,GACZ,aAAa,GACb,IAAI,CAAC,sBAAsB,EAAE,2BAA2B,GAAG,+BAA+B,GAAG,mBAAmB,CAAC,GAAG;IAClH,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEJ,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUU,CAAC;AAElD,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,cAAc,CAYhE,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,EACX,QAAQ,GAAE,OAAO,CAAC,kBAAkB,CAAM,EAC1C,KAAK,sBAAe,GACnB,cAAc,CAMhB"}
@@ -2,11 +2,16 @@ import { createSafeJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rp
2
2
  import { z } from 'zod';
3
3
  import { OffenseSchema, SlashPayloadRoundSchema } from '../slashing/index.js';
4
4
  import { getVersioningResponseHandler } from '../versioning/index.js';
5
+ import { ArchiverSpecificConfigSchema } from './archiver.js';
5
6
  import { SequencerConfigSchema } from './configs.js';
6
7
  import { ProverConfigSchema } from './prover-client.js';
7
8
  import { SlasherConfigSchema } from './slasher.js';
8
9
  import { ValidatorClientConfigSchema } from './validator.js';
9
- export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema).merge(SlasherConfigSchema).merge(ValidatorClientConfigSchema).merge(z.object({
10
+ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema).merge(SlasherConfigSchema).merge(ValidatorClientConfigSchema).merge(ArchiverSpecificConfigSchema.pick({
11
+ archiverPollingIntervalMS: true,
12
+ skipValidateBlockAttestations: true,
13
+ archiverBatchSize: true
14
+ })).merge(z.object({
10
15
  maxTxPoolSize: z.number()
11
16
  }));
12
17
  export const AztecNodeAdminApiSchema = {
@@ -46,6 +46,7 @@ export declare class BlockAttestation extends Gossipable {
46
46
  toBuffer(): Buffer;
47
47
  static fromBuffer(buf: Buffer | BufferReader): BlockAttestation;
48
48
  static empty(): BlockAttestation;
49
+ static random(): BlockAttestation;
49
50
  getSize(): number;
50
51
  }
51
52
  //# sourceMappingURL=block_attestation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block_attestation.d.ts","sourceRoot":"","sources":["../../src/p2p/block_attestation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAI9E,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,oBAAqB,SAAQ,QAAQ;gBACpC,IAAI,EAAE,MAAM;CAGzB;AAED;;;;;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AAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,qBAAa,oBAAqB,SAAQ,QAAQ;gBACpC,IAAI,EAAE,MAAM;CAGzB;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAM5C,2CAA2C;aAC3B,WAAW,EAAE,MAAM;IAEnC,iEAAiE;aACjD,OAAO,EAAE,gBAAgB;IAEzC,0CAA0C;aAC1B,SAAS,EAAE,SAAS;IAZtC,OAAgB,QAAQ,YAA+B;IAEvD,OAAO,CAAC,MAAM,CAAyB;;IAGrC,2CAA2C;IAC3B,WAAW,EAAE,MAAM;IAEnC,iEAAiE;IACjD,OAAO,EAAE,gBAAgB;IAEzC,0CAA0C;IAC1B,SAAS,EAAE,SAAS;IAKtC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAQ5C;IAEQ,4BAA4B,IAAI,OAAO,CAAC,QAAQ,CAAC;IAI1D,IAAI,OAAO,IAAI,EAAE,CAEhB;IAED,IAAI,UAAU,IAAI,EAAE,CAEnB;IAED;;;OAGG;IACH,SAAS,IAAI,UAAU;IAWvB,UAAU,IAAI,MAAM;IAIpB,QAAQ,IAAI,MAAM;IAIlB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,gBAAgB;IAK/D,MAAM,CAAC,KAAK,IAAI,gBAAgB;IAIhC,MAAM,CAAC,MAAM,IAAI,gBAAgB;IAIjC,OAAO,IAAI,MAAM;CAGlB"}
@@ -72,6 +72,9 @@ export class BlockAttestationHash extends Buffer32 {
72
72
  static empty() {
73
73
  return new BlockAttestation(0, ConsensusPayload.empty(), Signature.empty());
74
74
  }
75
+ static random() {
76
+ return new BlockAttestation(Math.floor(Math.random() * 1000) + 1, ConsensusPayload.random(), Signature.random());
77
+ }
75
78
  getSize() {
76
79
  return 4 /* blockNumber */ + this.payload.getSize() + this.signature.getSize();
77
80
  }
@@ -3,7 +3,7 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
3
3
  import { Signature } from '@aztec/foundation/eth-signature';
4
4
  import { Fr } from '@aztec/foundation/fields';
5
5
  import { BufferReader } from '@aztec/foundation/serialize';
6
- import type { BlockInfo } from '../block/l2_block.js';
6
+ import type { L2BlockInfo } from '../block/l2_block_info.js';
7
7
  import { TxHash } from '../tx/index.js';
8
8
  import { Tx } from '../tx/tx.js';
9
9
  import type { UInt32 } from '../types/index.js';
@@ -49,7 +49,7 @@ export declare class BlockProposal extends Gossipable {
49
49
  generateP2PMessageIdentifier(): Promise<Buffer32>;
50
50
  get archive(): Fr;
51
51
  get slotNumber(): Fr;
52
- toBlockInfo(): BlockInfo;
52
+ toBlockInfo(): L2BlockInfo;
53
53
  static createProposalFromSigner(blockNumber: UInt32, payload: ConsensusPayload, txHashes: TxHash[], txs: Tx[] | undefined, payloadSigner: (payload: Buffer32) => Promise<Signature>): Promise<BlockProposal>;
54
54
  /**Get Sender
55
55
  * Lazily evaluate the sender of the proposal; result is cached