@aztec/stdlib 2.0.0-nightly.20250903 → 2.0.0-rc.10
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.
- package/dest/avm/avm.d.ts +1 -1
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +2 -2
- package/dest/epoch-helpers/index.d.ts +6 -2
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +6 -0
- package/dest/fees/transaction_fee.d.ts.map +1 -1
- package/dest/fees/transaction_fee.js +3 -0
- package/dest/interfaces/aztec-node-admin.d.ts +25 -2
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +2 -1
- package/dest/interfaces/server.d.ts +1 -0
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +1 -0
- package/dest/interfaces/slasher.d.ts +4 -0
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +1 -0
- package/dest/interfaces/validator.d.ts +60 -0
- package/dest/interfaces/validator.d.ts.map +1 -0
- package/dest/interfaces/validator.js +10 -0
- package/dest/rollup/block_constant_data.d.ts +4 -4
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.js +4 -4
- package/dest/tests/factories.d.ts +2 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +5 -1
- package/dest/tx/tree_snapshots.d.ts +4 -4
- package/dest/tx/tree_snapshots.d.ts.map +1 -1
- package/dest/validators/schemas.d.ts +42 -4
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +5 -4
- package/dest/validators/types.d.ts +8 -10
- package/dest/validators/types.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/avm/avm.ts +2 -5
- package/src/epoch-helpers/index.ts +16 -2
- package/src/fees/transaction_fee.ts +11 -0
- package/src/interfaces/aztec-node-admin.ts +6 -1
- package/src/interfaces/server.ts +1 -0
- package/src/interfaces/slasher.ts +2 -0
- package/src/interfaces/validator.ts +70 -0
- package/src/rollup/block_constant_data.ts +3 -3
- package/src/tests/factories.ts +6 -0
- package/src/tx/tree_snapshots.ts +4 -4
- package/src/validators/schemas.ts +6 -4
- package/src/validators/types.ts +9 -10
|
@@ -7,10 +7,10 @@ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
|
7
7
|
* Stores snapshots of all the trees but archive.
|
|
8
8
|
*/
|
|
9
9
|
export declare class TreeSnapshots {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
l1ToL2MessageTree: AppendOnlyTreeSnapshot;
|
|
11
|
+
noteHashTree: AppendOnlyTreeSnapshot;
|
|
12
|
+
nullifierTree: AppendOnlyTreeSnapshot;
|
|
13
|
+
publicDataTree: AppendOnlyTreeSnapshot;
|
|
14
14
|
constructor(l1ToL2MessageTree: AppendOnlyTreeSnapshot, noteHashTree: AppendOnlyTreeSnapshot, nullifierTree: AppendOnlyTreeSnapshot, publicDataTree: AppendOnlyTreeSnapshot);
|
|
15
15
|
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
16
16
|
l1ToL2MessageTree: z.ZodEffects<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree_snapshots.d.ts","sourceRoot":"","sources":["../../src/tx/tree_snapshots.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E;;GAEG;AACH,qBAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"tree_snapshots.d.ts","sourceRoot":"","sources":["../../src/tx/tree_snapshots.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E;;GAEG;AACH,qBAAa,aAAa;IAEf,iBAAiB,EAAE,sBAAsB;IACzC,YAAY,EAAE,sBAAsB;IACpC,aAAa,EAAE,sBAAsB;IACrC,cAAc,EAAE,sBAAsB;gBAHtC,iBAAiB,EAAE,sBAAsB,EACzC,YAAY,EAAE,sBAAsB,EACpC,aAAa,EAAE,sBAAsB,EACrC,cAAc,EAAE,sBAAsB;IAG/C,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAYhB;IAED,OAAO;IASP,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa;IAU/D,QAAQ;IAKR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IAW5C,QAAQ,IAAI,EAAE,EAAE;IAehB,MAAM,CAAC,KAAK,IAAI,aAAa;IAS7B,OAAO,IAAI,OAAO;IASlB,CAAC,OAAO,CAAC,MAAM,CAAC;CAQjB"}
|
|
@@ -63,26 +63,32 @@ export declare const ValidatorStatsSchema: z.ZodObject<{
|
|
|
63
63
|
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
64
64
|
rate: z.ZodOptional<z.ZodNumber>;
|
|
65
65
|
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
66
|
+
total: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
66
67
|
}, "strip", z.ZodTypeAny, {
|
|
67
68
|
currentStreak: number;
|
|
68
69
|
count: number;
|
|
70
|
+
total: number;
|
|
69
71
|
rate?: number | undefined;
|
|
70
72
|
}, {
|
|
71
73
|
currentStreak: string | number | bigint;
|
|
72
74
|
count: string | number | bigint;
|
|
75
|
+
total: string | number | bigint;
|
|
73
76
|
rate?: number | undefined;
|
|
74
77
|
}>;
|
|
75
78
|
missedAttestations: z.ZodObject<{
|
|
76
79
|
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
77
80
|
rate: z.ZodOptional<z.ZodNumber>;
|
|
78
81
|
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
82
|
+
total: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
79
83
|
}, "strip", z.ZodTypeAny, {
|
|
80
84
|
currentStreak: number;
|
|
81
85
|
count: number;
|
|
86
|
+
total: number;
|
|
82
87
|
rate?: number | undefined;
|
|
83
88
|
}, {
|
|
84
89
|
currentStreak: string | number | bigint;
|
|
85
90
|
count: string | number | bigint;
|
|
91
|
+
total: string | number | bigint;
|
|
86
92
|
rate?: number | undefined;
|
|
87
93
|
}>;
|
|
88
94
|
history: z.ZodArray<z.ZodObject<{
|
|
@@ -101,11 +107,13 @@ export declare const ValidatorStatsSchema: z.ZodObject<{
|
|
|
101
107
|
missedProposals: {
|
|
102
108
|
currentStreak: number;
|
|
103
109
|
count: number;
|
|
110
|
+
total: number;
|
|
104
111
|
rate?: number | undefined;
|
|
105
112
|
};
|
|
106
113
|
missedAttestations: {
|
|
107
114
|
currentStreak: number;
|
|
108
115
|
count: number;
|
|
116
|
+
total: number;
|
|
109
117
|
rate?: number | undefined;
|
|
110
118
|
};
|
|
111
119
|
history: {
|
|
@@ -128,11 +136,13 @@ export declare const ValidatorStatsSchema: z.ZodObject<{
|
|
|
128
136
|
missedProposals: {
|
|
129
137
|
currentStreak: string | number | bigint;
|
|
130
138
|
count: string | number | bigint;
|
|
139
|
+
total: string | number | bigint;
|
|
131
140
|
rate?: number | undefined;
|
|
132
141
|
};
|
|
133
142
|
missedAttestations: {
|
|
134
143
|
currentStreak: string | number | bigint;
|
|
135
144
|
count: string | number | bigint;
|
|
145
|
+
total: string | number | bigint;
|
|
136
146
|
rate?: number | undefined;
|
|
137
147
|
};
|
|
138
148
|
history: {
|
|
@@ -184,26 +194,32 @@ export declare const ValidatorsStatsSchema: z.ZodObject<{
|
|
|
184
194
|
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
185
195
|
rate: z.ZodOptional<z.ZodNumber>;
|
|
186
196
|
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
197
|
+
total: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
187
198
|
}, "strip", z.ZodTypeAny, {
|
|
188
199
|
currentStreak: number;
|
|
189
200
|
count: number;
|
|
201
|
+
total: number;
|
|
190
202
|
rate?: number | undefined;
|
|
191
203
|
}, {
|
|
192
204
|
currentStreak: string | number | bigint;
|
|
193
205
|
count: string | number | bigint;
|
|
206
|
+
total: string | number | bigint;
|
|
194
207
|
rate?: number | undefined;
|
|
195
208
|
}>;
|
|
196
209
|
missedAttestations: z.ZodObject<{
|
|
197
210
|
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
198
211
|
rate: z.ZodOptional<z.ZodNumber>;
|
|
199
212
|
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
213
|
+
total: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
200
214
|
}, "strip", z.ZodTypeAny, {
|
|
201
215
|
currentStreak: number;
|
|
202
216
|
count: number;
|
|
217
|
+
total: number;
|
|
203
218
|
rate?: number | undefined;
|
|
204
219
|
}, {
|
|
205
220
|
currentStreak: string | number | bigint;
|
|
206
221
|
count: string | number | bigint;
|
|
222
|
+
total: string | number | bigint;
|
|
207
223
|
rate?: number | undefined;
|
|
208
224
|
}>;
|
|
209
225
|
history: z.ZodArray<z.ZodObject<{
|
|
@@ -222,11 +238,13 @@ export declare const ValidatorsStatsSchema: z.ZodObject<{
|
|
|
222
238
|
missedProposals: {
|
|
223
239
|
currentStreak: number;
|
|
224
240
|
count: number;
|
|
241
|
+
total: number;
|
|
225
242
|
rate?: number | undefined;
|
|
226
243
|
};
|
|
227
244
|
missedAttestations: {
|
|
228
245
|
currentStreak: number;
|
|
229
246
|
count: number;
|
|
247
|
+
total: number;
|
|
230
248
|
rate?: number | undefined;
|
|
231
249
|
};
|
|
232
250
|
history: {
|
|
@@ -249,11 +267,13 @@ export declare const ValidatorsStatsSchema: z.ZodObject<{
|
|
|
249
267
|
missedProposals: {
|
|
250
268
|
currentStreak: string | number | bigint;
|
|
251
269
|
count: string | number | bigint;
|
|
270
|
+
total: string | number | bigint;
|
|
252
271
|
rate?: number | undefined;
|
|
253
272
|
};
|
|
254
273
|
missedAttestations: {
|
|
255
274
|
currentStreak: string | number | bigint;
|
|
256
275
|
count: string | number | bigint;
|
|
276
|
+
total: string | number | bigint;
|
|
257
277
|
rate?: number | undefined;
|
|
258
278
|
};
|
|
259
279
|
history: {
|
|
@@ -281,11 +301,13 @@ export declare const ValidatorsStatsSchema: z.ZodObject<{
|
|
|
281
301
|
missedProposals: {
|
|
282
302
|
currentStreak: number;
|
|
283
303
|
count: number;
|
|
304
|
+
total: number;
|
|
284
305
|
rate?: number | undefined;
|
|
285
306
|
};
|
|
286
307
|
missedAttestations: {
|
|
287
308
|
currentStreak: number;
|
|
288
309
|
count: number;
|
|
310
|
+
total: number;
|
|
289
311
|
rate?: number | undefined;
|
|
290
312
|
};
|
|
291
313
|
history: {
|
|
@@ -313,11 +335,13 @@ export declare const ValidatorsStatsSchema: z.ZodObject<{
|
|
|
313
335
|
missedProposals: {
|
|
314
336
|
currentStreak: string | number | bigint;
|
|
315
337
|
count: string | number | bigint;
|
|
338
|
+
total: string | number | bigint;
|
|
316
339
|
rate?: number | undefined;
|
|
317
340
|
};
|
|
318
341
|
missedAttestations: {
|
|
319
342
|
currentStreak: string | number | bigint;
|
|
320
343
|
count: string | number | bigint;
|
|
344
|
+
total: string | number | bigint;
|
|
321
345
|
rate?: number | undefined;
|
|
322
346
|
};
|
|
323
347
|
history: {
|
|
@@ -373,26 +397,32 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
373
397
|
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
374
398
|
rate: z.ZodOptional<z.ZodNumber>;
|
|
375
399
|
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
400
|
+
total: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
376
401
|
}, "strip", z.ZodTypeAny, {
|
|
377
402
|
currentStreak: number;
|
|
378
403
|
count: number;
|
|
404
|
+
total: number;
|
|
379
405
|
rate?: number | undefined;
|
|
380
406
|
}, {
|
|
381
407
|
currentStreak: string | number | bigint;
|
|
382
408
|
count: string | number | bigint;
|
|
409
|
+
total: string | number | bigint;
|
|
383
410
|
rate?: number | undefined;
|
|
384
411
|
}>;
|
|
385
412
|
missedAttestations: z.ZodObject<{
|
|
386
413
|
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
387
414
|
rate: z.ZodOptional<z.ZodNumber>;
|
|
388
415
|
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
416
|
+
total: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
389
417
|
}, "strip", z.ZodTypeAny, {
|
|
390
418
|
currentStreak: number;
|
|
391
419
|
count: number;
|
|
420
|
+
total: number;
|
|
392
421
|
rate?: number | undefined;
|
|
393
422
|
}, {
|
|
394
423
|
currentStreak: string | number | bigint;
|
|
395
424
|
count: string | number | bigint;
|
|
425
|
+
total: string | number | bigint;
|
|
396
426
|
rate?: number | undefined;
|
|
397
427
|
}>;
|
|
398
428
|
history: z.ZodArray<z.ZodObject<{
|
|
@@ -411,11 +441,13 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
411
441
|
missedProposals: {
|
|
412
442
|
currentStreak: number;
|
|
413
443
|
count: number;
|
|
444
|
+
total: number;
|
|
414
445
|
rate?: number | undefined;
|
|
415
446
|
};
|
|
416
447
|
missedAttestations: {
|
|
417
448
|
currentStreak: number;
|
|
418
449
|
count: number;
|
|
450
|
+
total: number;
|
|
419
451
|
rate?: number | undefined;
|
|
420
452
|
};
|
|
421
453
|
history: {
|
|
@@ -438,11 +470,13 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
438
470
|
missedProposals: {
|
|
439
471
|
currentStreak: string | number | bigint;
|
|
440
472
|
count: string | number | bigint;
|
|
473
|
+
total: string | number | bigint;
|
|
441
474
|
rate?: number | undefined;
|
|
442
475
|
};
|
|
443
476
|
missedAttestations: {
|
|
444
477
|
currentStreak: string | number | bigint;
|
|
445
478
|
count: string | number | bigint;
|
|
479
|
+
total: string | number | bigint;
|
|
446
480
|
rate?: number | undefined;
|
|
447
481
|
};
|
|
448
482
|
history: {
|
|
@@ -466,12 +500,12 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
466
500
|
epoch: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
467
501
|
}, "strip", z.ZodTypeAny, {
|
|
468
502
|
epoch: bigint;
|
|
469
|
-
missed: number;
|
|
470
503
|
total: number;
|
|
504
|
+
missed: number;
|
|
471
505
|
}, {
|
|
472
506
|
epoch: string | number | bigint;
|
|
473
|
-
missed: string | number | bigint;
|
|
474
507
|
total: string | number | bigint;
|
|
508
|
+
missed: string | number | bigint;
|
|
475
509
|
}>, "many">;
|
|
476
510
|
lastProcessedSlot: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>>;
|
|
477
511
|
initialSlot: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>>;
|
|
@@ -484,11 +518,13 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
484
518
|
missedProposals: {
|
|
485
519
|
currentStreak: number;
|
|
486
520
|
count: number;
|
|
521
|
+
total: number;
|
|
487
522
|
rate?: number | undefined;
|
|
488
523
|
};
|
|
489
524
|
missedAttestations: {
|
|
490
525
|
currentStreak: number;
|
|
491
526
|
count: number;
|
|
527
|
+
total: number;
|
|
492
528
|
rate?: number | undefined;
|
|
493
529
|
};
|
|
494
530
|
history: {
|
|
@@ -508,8 +544,8 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
508
544
|
};
|
|
509
545
|
allTimeProvenPerformance: {
|
|
510
546
|
epoch: bigint;
|
|
511
|
-
missed: number;
|
|
512
547
|
total: number;
|
|
548
|
+
missed: number;
|
|
513
549
|
}[];
|
|
514
550
|
lastProcessedSlot?: bigint | undefined;
|
|
515
551
|
initialSlot?: bigint | undefined;
|
|
@@ -521,11 +557,13 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
521
557
|
missedProposals: {
|
|
522
558
|
currentStreak: string | number | bigint;
|
|
523
559
|
count: string | number | bigint;
|
|
560
|
+
total: string | number | bigint;
|
|
524
561
|
rate?: number | undefined;
|
|
525
562
|
};
|
|
526
563
|
missedAttestations: {
|
|
527
564
|
currentStreak: string | number | bigint;
|
|
528
565
|
count: string | number | bigint;
|
|
566
|
+
total: string | number | bigint;
|
|
529
567
|
rate?: number | undefined;
|
|
530
568
|
};
|
|
531
569
|
history: {
|
|
@@ -545,8 +583,8 @@ export declare const SingleValidatorStatsSchema: z.ZodObject<{
|
|
|
545
583
|
};
|
|
546
584
|
allTimeProvenPerformance: {
|
|
547
585
|
epoch: string | number | bigint;
|
|
548
|
-
missed: string | number | bigint;
|
|
549
586
|
total: string | number | bigint;
|
|
587
|
+
missed: string | number | bigint;
|
|
550
588
|
}[];
|
|
551
589
|
lastProcessedSlot?: string | number | bigint | undefined;
|
|
552
590
|
initialSlot?: string | number | bigint | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/validators/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/validators/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,2BAA2B,wGAME,CAAC;AAE3C,eAAO,MAAM,4BAA4B;;;;;;;;;WAKC,CAAC;AAE3C,eAAO,MAAM,iCAAiC;;;;;;;;;oBAAwC,CAAC;AAEvF,eAAO,MAAM,+BAA+B;;;;;;;;;qBAA8C,CAAC;AAe3F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQE,CAAC;AAEpC,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKE,CAAC;AAErC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYE,CAAC"}
|
|
@@ -18,18 +18,19 @@ const ValidatorTimeStatSchema = z.object({
|
|
|
18
18
|
slot: schemas.BigInt,
|
|
19
19
|
date: z.string()
|
|
20
20
|
});
|
|
21
|
-
const
|
|
21
|
+
const ValidatorMissedStatsSchema = z.object({
|
|
22
22
|
currentStreak: schemas.Integer,
|
|
23
23
|
rate: z.number().optional(),
|
|
24
|
-
count: schemas.Integer
|
|
24
|
+
count: schemas.Integer,
|
|
25
|
+
total: schemas.Integer
|
|
25
26
|
});
|
|
26
27
|
export const ValidatorStatsSchema = z.object({
|
|
27
28
|
address: schemas.EthAddress,
|
|
28
29
|
lastProposal: ValidatorTimeStatSchema.optional(),
|
|
29
30
|
lastAttestation: ValidatorTimeStatSchema.optional(),
|
|
30
31
|
totalSlots: schemas.Integer,
|
|
31
|
-
missedProposals:
|
|
32
|
-
missedAttestations:
|
|
32
|
+
missedProposals: ValidatorMissedStatsSchema,
|
|
33
|
+
missedAttestations: ValidatorMissedStatsSchema,
|
|
33
34
|
history: ValidatorStatusHistorySchema
|
|
34
35
|
});
|
|
35
36
|
export const ValidatorsStatsSchema = z.object({
|
|
@@ -5,6 +5,12 @@ export type ValidatorStatusHistory = {
|
|
|
5
5
|
slot: bigint;
|
|
6
6
|
status: ValidatorStatusInSlot;
|
|
7
7
|
}[];
|
|
8
|
+
export type ValidatorMissedStats = {
|
|
9
|
+
currentStreak: number;
|
|
10
|
+
rate?: number;
|
|
11
|
+
count: number;
|
|
12
|
+
total: number;
|
|
13
|
+
};
|
|
8
14
|
export type ValidatorStats = {
|
|
9
15
|
address: EthAddress;
|
|
10
16
|
lastProposal?: {
|
|
@@ -18,16 +24,8 @@ export type ValidatorStats = {
|
|
|
18
24
|
date: string;
|
|
19
25
|
};
|
|
20
26
|
totalSlots: number;
|
|
21
|
-
missedProposals:
|
|
22
|
-
|
|
23
|
-
rate?: number;
|
|
24
|
-
count: number;
|
|
25
|
-
};
|
|
26
|
-
missedAttestations: {
|
|
27
|
-
currentStreak: number;
|
|
28
|
-
rate?: number;
|
|
29
|
-
count: number;
|
|
30
|
-
};
|
|
27
|
+
missedProposals: ValidatorMissedStats;
|
|
28
|
+
missedAttestations: ValidatorMissedStats;
|
|
31
29
|
history: ValidatorStatusHistory;
|
|
32
30
|
};
|
|
33
31
|
export type ValidatorsStats = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,aAAa,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,EAAE,CAAC;AAEvF,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,aAAa,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,EAAE,CAAC;AAEvF,MAAM,MAAM,oBAAoB,GAAG;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,eAAe,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACpE,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,oBAAoB,CAAC;IACtC,kBAAkB,EAAE,oBAAoB,CAAC;IACzC,OAAO,EAAE,sBAAsB,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAElG,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,cAAc,CAAC;IAC1B,wBAAwB,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/bb.js": "2.0.0-
|
|
73
|
-
"@aztec/blob-lib": "2.0.0-
|
|
74
|
-
"@aztec/constants": "2.0.0-
|
|
75
|
-
"@aztec/ethereum": "2.0.0-
|
|
76
|
-
"@aztec/foundation": "2.0.0-
|
|
77
|
-
"@aztec/l1-artifacts": "2.0.0-
|
|
78
|
-
"@aztec/noir-noirc_abi": "2.0.0-
|
|
72
|
+
"@aztec/bb.js": "2.0.0-rc.10",
|
|
73
|
+
"@aztec/blob-lib": "2.0.0-rc.10",
|
|
74
|
+
"@aztec/constants": "2.0.0-rc.10",
|
|
75
|
+
"@aztec/ethereum": "2.0.0-rc.10",
|
|
76
|
+
"@aztec/foundation": "2.0.0-rc.10",
|
|
77
|
+
"@aztec/l1-artifacts": "2.0.0-rc.10",
|
|
78
|
+
"@aztec/noir-noirc_abi": "2.0.0-rc.10",
|
|
79
79
|
"@google-cloud/storage": "^7.15.0",
|
|
80
80
|
"axios": "^1.9.0",
|
|
81
81
|
"json-stringify-deterministic": "1.0.12",
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@jest/expect": "^30.0.0",
|
|
94
94
|
"@jest/globals": "^30.0.0",
|
|
95
|
+
"@libp2p/interface": "1.3.1",
|
|
95
96
|
"@types/jest": "^30.0.0",
|
|
96
97
|
"@types/lodash.chunk": "^4.2.9",
|
|
97
98
|
"@types/lodash.isequal": "^4.5.8",
|
package/src/avm/avm.ts
CHANGED
|
@@ -408,15 +408,12 @@ export class AvmTxHint {
|
|
|
408
408
|
public readonly feePayer: AztecAddress,
|
|
409
409
|
) {}
|
|
410
410
|
|
|
411
|
-
static fromTx(tx: Tx): AvmTxHint {
|
|
411
|
+
static fromTx(tx: Tx, gasFees: GasFees): AvmTxHint {
|
|
412
412
|
const setupCallRequests = tx.getNonRevertiblePublicCallRequestsWithCalldata();
|
|
413
413
|
const appLogicCallRequests = tx.getRevertiblePublicCallRequestsWithCalldata();
|
|
414
414
|
const teardownCallRequest = tx.getTeardownPublicCallRequestWithCalldata();
|
|
415
415
|
const gasSettings = tx.data.constants.txContext.gasSettings;
|
|
416
|
-
const effectiveGasFees = computeEffectiveGasFees(
|
|
417
|
-
tx.data.constants.historicalHeader.globalVariables.gasFees,
|
|
418
|
-
gasSettings,
|
|
419
|
-
);
|
|
416
|
+
const effectiveGasFees = computeEffectiveGasFees(gasFees, gasSettings);
|
|
420
417
|
|
|
421
418
|
// For informational purposes. Assumed quick because it should be cached.
|
|
422
419
|
const txHash = tx.getTxHash();
|
|
@@ -56,7 +56,10 @@ export function getEpochAtSlot(slot: bigint, constants: Pick<L1RollupConstants,
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/** Returns the range of L2 slots (inclusive) for a given epoch number. */
|
|
59
|
-
export function getSlotRangeForEpoch(
|
|
59
|
+
export function getSlotRangeForEpoch(
|
|
60
|
+
epochNumber: bigint,
|
|
61
|
+
constants: Pick<L1RollupConstants, 'epochDuration'>,
|
|
62
|
+
): [bigint, bigint] {
|
|
60
63
|
const startSlot = epochNumber * BigInt(constants.epochDuration);
|
|
61
64
|
return [startSlot, startSlot + BigInt(constants.epochDuration) - 1n];
|
|
62
65
|
}
|
|
@@ -68,7 +71,7 @@ export function getSlotRangeForEpoch(epochNumber: bigint, constants: Pick<L1Roll
|
|
|
68
71
|
export function getTimestampRangeForEpoch(
|
|
69
72
|
epochNumber: bigint,
|
|
70
73
|
constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration' | 'ethereumSlotDuration'>,
|
|
71
|
-
) {
|
|
74
|
+
): [bigint, bigint] {
|
|
72
75
|
const [startSlot, endSlot] = getSlotRangeForEpoch(epochNumber, constants);
|
|
73
76
|
const ethereumSlotsPerL2Slot = constants.slotDuration / constants.ethereumSlotDuration;
|
|
74
77
|
return [
|
|
@@ -79,6 +82,17 @@ export function getTimestampRangeForEpoch(
|
|
|
79
82
|
];
|
|
80
83
|
}
|
|
81
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Returns the start timestamp for a given epoch number.
|
|
87
|
+
*/
|
|
88
|
+
export function getStartTimestampForEpoch(
|
|
89
|
+
epochNumber: bigint,
|
|
90
|
+
constants: Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration' | 'epochDuration'>,
|
|
91
|
+
) {
|
|
92
|
+
const [startSlot] = getSlotRangeForEpoch(epochNumber, constants);
|
|
93
|
+
return getTimestampForSlot(startSlot, constants);
|
|
94
|
+
}
|
|
95
|
+
|
|
82
96
|
/**
|
|
83
97
|
* Returns the epoch number at which proofs are no longer accepted for a given epoch.
|
|
84
98
|
* See l1-contracts/src/core/libraries/TimeLib.sol
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
|
|
3
|
+
import { strict as assert } from 'assert';
|
|
4
|
+
|
|
3
5
|
import type { Gas } from '../gas/gas.js';
|
|
4
6
|
import { GasFees } from '../gas/gas_fees.js';
|
|
5
7
|
import type { GasSettings } from '../gas/gas_settings.js';
|
|
@@ -11,6 +13,15 @@ import type { GasSettings } from '../gas/gas_settings.js';
|
|
|
11
13
|
export function computeEffectiveGasFees(gasFees: GasFees, gasSettings: GasSettings): GasFees {
|
|
12
14
|
const { maxFeesPerGas, maxPriorityFeesPerGas } = gasSettings;
|
|
13
15
|
const minBigInt = (f1: bigint, f2: bigint) => (f1 < f2 ? f1 : f2);
|
|
16
|
+
|
|
17
|
+
assert(
|
|
18
|
+
maxFeesPerGas.feePerDaGas >= gasFees.feePerDaGas,
|
|
19
|
+
`maxFeesPerGas.feePerDaGas must be greater than or equal to gasFees.feePerDaGas, but got maxFeesPerGas.feePerDaGas=${maxFeesPerGas.feePerDaGas} and gasFees.feePerDaGas=${gasFees.feePerDaGas}`,
|
|
20
|
+
);
|
|
21
|
+
assert(
|
|
22
|
+
maxFeesPerGas.feePerL2Gas >= gasFees.feePerL2Gas,
|
|
23
|
+
`maxFeesPerGas.feePerL2Gas must be greater than or equal to gasFees.feePerL2Gas, but got maxFeesPerGas.feePerL2Gas=${maxFeesPerGas.feePerL2Gas} and gasFees.feePerL2Gas=${gasFees.feePerL2Gas}`,
|
|
24
|
+
);
|
|
14
25
|
const priorityFees = new GasFees(
|
|
15
26
|
minBigInt(maxPriorityFeesPerGas.feePerDaGas, maxFeesPerGas.feePerDaGas - gasFees.feePerDaGas),
|
|
16
27
|
minBigInt(maxPriorityFeesPerGas.feePerL2Gas, maxFeesPerGas.feePerL2Gas - gasFees.feePerL2Gas),
|
|
@@ -8,6 +8,7 @@ import { type ComponentsVersions, getVersioningResponseHandler } from '../versio
|
|
|
8
8
|
import { type SequencerConfig, SequencerConfigSchema } from './configs.js';
|
|
9
9
|
import { type ProverConfig, ProverConfigSchema } from './prover-client.js';
|
|
10
10
|
import { type SlasherConfig, SlasherConfigSchema } from './slasher.js';
|
|
11
|
+
import { ValidatorClientConfigSchema, type ValidatorClientFullConfig } from './validator.js';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Aztec node admin API.
|
|
@@ -50,10 +51,14 @@ export interface AztecNodeAdmin {
|
|
|
50
51
|
getSlashOffenses(round: bigint | 'all' | 'current'): Promise<Offense[]>;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
export type AztecNodeAdminConfig =
|
|
54
|
+
export type AztecNodeAdminConfig = ValidatorClientFullConfig &
|
|
55
|
+
SequencerConfig &
|
|
56
|
+
ProverConfig &
|
|
57
|
+
SlasherConfig & { maxTxPoolSize: number };
|
|
54
58
|
|
|
55
59
|
export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
|
|
56
60
|
.merge(SlasherConfigSchema)
|
|
61
|
+
.merge(ValidatorClientConfigSchema)
|
|
57
62
|
.merge(z.object({ maxTxPoolSize: z.number() }));
|
|
58
63
|
|
|
59
64
|
export const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin> = {
|
package/src/interfaces/server.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface SlasherConfig {
|
|
|
13
13
|
slashValidatorsAlways: EthAddress[]; // Array of validator addresses
|
|
14
14
|
slashValidatorsNever: EthAddress[]; // Array of validator addresses
|
|
15
15
|
slashInactivityTargetPercentage: number; // 0-1, 0.9 means 90%. Must be greater than 0
|
|
16
|
+
slashInactivityConsecutiveEpochThreshold: number; // Number of consecutive epochs a validator must be inactive before slashing
|
|
16
17
|
slashPrunePenalty: bigint;
|
|
17
18
|
slashDataWithholdingPenalty: bigint;
|
|
18
19
|
slashInactivityPenalty: bigint;
|
|
@@ -34,6 +35,7 @@ export const SlasherConfigSchema = z.object({
|
|
|
34
35
|
slashPrunePenalty: schemas.BigInt,
|
|
35
36
|
slashDataWithholdingPenalty: schemas.BigInt,
|
|
36
37
|
slashInactivityTargetPercentage: z.number(),
|
|
38
|
+
slashInactivityConsecutiveEpochThreshold: z.number(),
|
|
37
39
|
slashInactivityPenalty: schemas.BigInt,
|
|
38
40
|
slashProposeInvalidAttestationsPenalty: schemas.BigInt,
|
|
39
41
|
slashAttestDescendantOfInvalidPenalty: schemas.BigInt,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { SecretValue } from '@aztec/foundation/config';
|
|
2
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { type ZodFor, schemas } from '@aztec/foundation/schemas';
|
|
5
|
+
import type { SequencerConfig, SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
6
|
+
import type { BlockAttestation, BlockProposal, BlockProposalOptions } from '@aztec/stdlib/p2p';
|
|
7
|
+
import type { ProposedBlockHeader, StateReference, Tx } from '@aztec/stdlib/tx';
|
|
8
|
+
|
|
9
|
+
import type { PeerId } from '@libp2p/interface';
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Validator client configuration
|
|
14
|
+
*/
|
|
15
|
+
export interface ValidatorClientConfig {
|
|
16
|
+
/** The private keys of the validators participating in attestation duties */
|
|
17
|
+
validatorPrivateKeys?: SecretValue<`0x${string}`[]>;
|
|
18
|
+
|
|
19
|
+
/** The addresses of the validators to use with remote signers */
|
|
20
|
+
validatorAddresses?: EthAddress[];
|
|
21
|
+
|
|
22
|
+
/** Do not run the validator */
|
|
23
|
+
disableValidator: boolean;
|
|
24
|
+
|
|
25
|
+
/** Temporarily disable these specific validator addresses */
|
|
26
|
+
disabledValidators: EthAddress[];
|
|
27
|
+
|
|
28
|
+
/** Interval between polling for new attestations from peers */
|
|
29
|
+
attestationPollingIntervalMs: number;
|
|
30
|
+
|
|
31
|
+
/** Re-execute transactions before attesting */
|
|
32
|
+
validatorReexecute: boolean;
|
|
33
|
+
|
|
34
|
+
/** Will re-execute until this many milliseconds are left in the slot */
|
|
35
|
+
validatorReexecuteDeadlineMs: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
39
|
+
Pick<SequencerConfig, 'txPublicSetupAllowList'> &
|
|
40
|
+
Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'>;
|
|
41
|
+
|
|
42
|
+
export const ValidatorClientConfigSchema = z.object({
|
|
43
|
+
validatorAddresses: z.array(schemas.EthAddress).optional(),
|
|
44
|
+
disableValidator: z.boolean(),
|
|
45
|
+
disabledValidators: z.array(schemas.EthAddress),
|
|
46
|
+
attestationPollingIntervalMs: z.number().min(0),
|
|
47
|
+
validatorReexecute: z.boolean(),
|
|
48
|
+
validatorReexecuteDeadlineMs: z.number().min(0),
|
|
49
|
+
}) satisfies ZodFor<Omit<ValidatorClientConfig, 'validatorPrivateKeys'>>;
|
|
50
|
+
|
|
51
|
+
export interface Validator {
|
|
52
|
+
start(): Promise<void>;
|
|
53
|
+
registerBlockProposalHandler(): void;
|
|
54
|
+
updateConfig(config: Partial<ValidatorClientFullConfig>): void;
|
|
55
|
+
|
|
56
|
+
// Block validation responsibilities
|
|
57
|
+
createBlockProposal(
|
|
58
|
+
blockNumber: number,
|
|
59
|
+
header: ProposedBlockHeader,
|
|
60
|
+
archive: Fr,
|
|
61
|
+
stateReference: StateReference,
|
|
62
|
+
txs: Tx[],
|
|
63
|
+
proposerAddress: EthAddress | undefined,
|
|
64
|
+
options: BlockProposalOptions,
|
|
65
|
+
): Promise<BlockProposal | undefined>;
|
|
66
|
+
attestToProposal(proposal: BlockProposal, sender: PeerId): Promise<BlockAttestation[] | undefined>;
|
|
67
|
+
|
|
68
|
+
broadcastBlockProposal(proposal: BlockProposal): Promise<void>;
|
|
69
|
+
collectAttestations(proposal: BlockProposal, required: number, deadline: Date): Promise<BlockAttestation[]>;
|
|
70
|
+
}
|
|
@@ -12,8 +12,8 @@ export class BlockConstantData {
|
|
|
12
12
|
constructor(
|
|
13
13
|
/** Archive tree snapshot at the very beginning of the entire rollup. */
|
|
14
14
|
public lastArchive: AppendOnlyTreeSnapshot,
|
|
15
|
-
/** L1 to L2 message tree snapshot
|
|
16
|
-
public
|
|
15
|
+
/** L1 to L2 message tree snapshot after this block lands. */
|
|
16
|
+
public newL1ToL2: AppendOnlyTreeSnapshot,
|
|
17
17
|
/** Root of the verification key tree. */
|
|
18
18
|
public vkTreeRoot: Fr,
|
|
19
19
|
/** Root of the protocol contract tree. */
|
|
@@ -40,7 +40,7 @@ export class BlockConstantData {
|
|
|
40
40
|
static getFields(fields: FieldsOf<BlockConstantData>) {
|
|
41
41
|
return [
|
|
42
42
|
fields.lastArchive,
|
|
43
|
-
fields.
|
|
43
|
+
fields.newL1ToL2,
|
|
44
44
|
fields.vkTreeRoot,
|
|
45
45
|
fields.protocolContractTreeRoot,
|
|
46
46
|
fields.globalVariables,
|
package/src/tests/factories.ts
CHANGED
|
@@ -1607,6 +1607,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1607
1607
|
vkTreeRoot = Fr.ZERO,
|
|
1608
1608
|
protocolContractTreeRoot = Fr.ZERO,
|
|
1609
1609
|
globalVariables = GlobalVariables.empty(),
|
|
1610
|
+
newL1ToL2Snapshot = AppendOnlyTreeSnapshot.empty(),
|
|
1610
1611
|
feePayer,
|
|
1611
1612
|
feePaymentPublicDataWrite,
|
|
1612
1613
|
privateOnly = false,
|
|
@@ -1619,6 +1620,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1619
1620
|
gasSettings?: GasSettings;
|
|
1620
1621
|
vkTreeRoot?: Fr;
|
|
1621
1622
|
globalVariables?: GlobalVariables;
|
|
1623
|
+
newL1ToL2Snapshot?: AppendOnlyTreeSnapshot;
|
|
1622
1624
|
protocolContractTreeRoot?: Fr;
|
|
1623
1625
|
feePayer?: AztecAddress;
|
|
1624
1626
|
feePaymentPublicDataWrite?: PublicDataWrite;
|
|
@@ -1672,6 +1674,9 @@ export async function makeBloatedProcessedTx({
|
|
|
1672
1674
|
|
|
1673
1675
|
// Create avm output.
|
|
1674
1676
|
const avmOutput = AvmCircuitPublicInputs.empty();
|
|
1677
|
+
// Assign data from hints.
|
|
1678
|
+
avmOutput.startTreeSnapshots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
|
1679
|
+
avmOutput.endTreeSnapshots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
|
1675
1680
|
// Assign data from private.
|
|
1676
1681
|
avmOutput.globalVariables = globalVariables;
|
|
1677
1682
|
avmOutput.startGasUsed = tx.data.gasUsed;
|
|
@@ -1715,6 +1720,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1715
1720
|
avmOutput.gasSettings = gasSettings;
|
|
1716
1721
|
|
|
1717
1722
|
const avmCircuitInputs = await makeAvmCircuitInputs(seed + 0x3000, { publicInputs: avmOutput });
|
|
1723
|
+
avmCircuitInputs.hints.startingTreeRoots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
|
1718
1724
|
|
|
1719
1725
|
const gasUsed = {
|
|
1720
1726
|
totalGas: Gas.empty(),
|