@aztec/stdlib 2.0.0-nightly.20250903 → 2.0.0-rc.2

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 (46) hide show
  1. package/dest/avm/avm.d.ts +1 -1
  2. package/dest/avm/avm.d.ts.map +1 -1
  3. package/dest/avm/avm.js +2 -2
  4. package/dest/epoch-helpers/index.d.ts +6 -2
  5. package/dest/epoch-helpers/index.d.ts.map +1 -1
  6. package/dest/epoch-helpers/index.js +6 -0
  7. package/dest/fees/transaction_fee.d.ts.map +1 -1
  8. package/dest/fees/transaction_fee.js +3 -0
  9. package/dest/interfaces/aztec-node-admin.d.ts +25 -2
  10. package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
  11. package/dest/interfaces/aztec-node-admin.js +2 -1
  12. package/dest/interfaces/server.d.ts +1 -0
  13. package/dest/interfaces/server.d.ts.map +1 -1
  14. package/dest/interfaces/server.js +1 -0
  15. package/dest/interfaces/slasher.d.ts +4 -0
  16. package/dest/interfaces/slasher.d.ts.map +1 -1
  17. package/dest/interfaces/slasher.js +1 -0
  18. package/dest/interfaces/validator.d.ts +60 -0
  19. package/dest/interfaces/validator.d.ts.map +1 -0
  20. package/dest/interfaces/validator.js +10 -0
  21. package/dest/rollup/block_constant_data.d.ts +4 -4
  22. package/dest/rollup/block_constant_data.d.ts.map +1 -1
  23. package/dest/rollup/block_constant_data.js +4 -4
  24. package/dest/tests/factories.d.ts +2 -1
  25. package/dest/tests/factories.d.ts.map +1 -1
  26. package/dest/tests/factories.js +5 -1
  27. package/dest/tx/tree_snapshots.d.ts +4 -4
  28. package/dest/tx/tree_snapshots.d.ts.map +1 -1
  29. package/dest/validators/schemas.d.ts +42 -4
  30. package/dest/validators/schemas.d.ts.map +1 -1
  31. package/dest/validators/schemas.js +5 -4
  32. package/dest/validators/types.d.ts +8 -10
  33. package/dest/validators/types.d.ts.map +1 -1
  34. package/package.json +9 -8
  35. package/src/avm/avm.ts +2 -5
  36. package/src/epoch-helpers/index.ts +16 -2
  37. package/src/fees/transaction_fee.ts +11 -0
  38. package/src/interfaces/aztec-node-admin.ts +6 -1
  39. package/src/interfaces/server.ts +1 -0
  40. package/src/interfaces/slasher.ts +2 -0
  41. package/src/interfaces/validator.ts +70 -0
  42. package/src/rollup/block_constant_data.ts +3 -3
  43. package/src/tests/factories.ts +6 -0
  44. package/src/tx/tree_snapshots.ts +4 -4
  45. package/src/validators/schemas.ts +6 -4
  46. package/src/validators/types.ts +9 -10
@@ -12,10 +12,10 @@ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
12
12
  */
13
13
  export class TreeSnapshots {
14
14
  constructor(
15
- public readonly l1ToL2MessageTree: AppendOnlyTreeSnapshot,
16
- public readonly noteHashTree: AppendOnlyTreeSnapshot,
17
- public readonly nullifierTree: AppendOnlyTreeSnapshot,
18
- public readonly publicDataTree: AppendOnlyTreeSnapshot,
15
+ public l1ToL2MessageTree: AppendOnlyTreeSnapshot,
16
+ public noteHashTree: AppendOnlyTreeSnapshot,
17
+ public nullifierTree: AppendOnlyTreeSnapshot,
18
+ public publicDataTree: AppendOnlyTreeSnapshot,
19
19
  ) {}
20
20
 
21
21
  static get schema() {
@@ -4,6 +4,7 @@ import { z } from 'zod';
4
4
 
5
5
  import type {
6
6
  SingleValidatorStats,
7
+ ValidatorMissedStats,
7
8
  ValidatorStats,
8
9
  ValidatorStatusHistory,
9
10
  ValidatorStatusInSlot,
@@ -35,19 +36,20 @@ const ValidatorTimeStatSchema = z.object({
35
36
  date: z.string(),
36
37
  });
37
38
 
38
- const ValidatorFilteredHistorySchema = z.object({
39
+ const ValidatorMissedStatsSchema = z.object({
39
40
  currentStreak: schemas.Integer,
40
41
  rate: z.number().optional(),
41
42
  count: schemas.Integer,
42
- });
43
+ total: schemas.Integer,
44
+ }) satisfies ZodFor<ValidatorMissedStats>;
43
45
 
44
46
  export const ValidatorStatsSchema = z.object({
45
47
  address: schemas.EthAddress,
46
48
  lastProposal: ValidatorTimeStatSchema.optional(),
47
49
  lastAttestation: ValidatorTimeStatSchema.optional(),
48
50
  totalSlots: schemas.Integer,
49
- missedProposals: ValidatorFilteredHistorySchema,
50
- missedAttestations: ValidatorFilteredHistorySchema,
51
+ missedProposals: ValidatorMissedStatsSchema,
52
+ missedAttestations: ValidatorMissedStatsSchema,
51
53
  history: ValidatorStatusHistorySchema,
52
54
  }) satisfies ZodFor<ValidatorStats>;
53
55
 
@@ -11,21 +11,20 @@ export type ValidatorStatusInSlot =
11
11
 
12
12
  export type ValidatorStatusHistory = { slot: bigint; status: ValidatorStatusInSlot }[];
13
13
 
14
+ export type ValidatorMissedStats = {
15
+ currentStreak: number;
16
+ rate?: number;
17
+ count: number;
18
+ total: number;
19
+ };
20
+
14
21
  export type ValidatorStats = {
15
22
  address: EthAddress;
16
23
  lastProposal?: { timestamp: bigint; slot: bigint; date: string };
17
24
  lastAttestation?: { timestamp: bigint; slot: bigint; date: string };
18
25
  totalSlots: number;
19
- missedProposals: {
20
- currentStreak: number;
21
- rate?: number;
22
- count: number;
23
- };
24
- missedAttestations: {
25
- currentStreak: number;
26
- rate?: number;
27
- count: number;
28
- };
26
+ missedProposals: ValidatorMissedStats;
27
+ missedAttestations: ValidatorMissedStats;
29
28
  history: ValidatorStatusHistory;
30
29
  };
31
30