@aztec/validator-ha-signer 0.0.1-commit.04852196a → 0.0.1-commit.04d373f

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 (39) hide show
  1. package/dest/db/lmdb.d.ts +6 -2
  2. package/dest/db/lmdb.d.ts.map +1 -1
  3. package/dest/db/lmdb.js +37 -2
  4. package/dest/db/migrations/1_initial-schema.d.ts +4 -2
  5. package/dest/db/migrations/1_initial-schema.d.ts.map +1 -1
  6. package/dest/db/migrations/1_initial-schema.js +34 -4
  7. package/dest/db/migrations/2_add-checkpoint-number.d.ts +7 -0
  8. package/dest/db/migrations/2_add-checkpoint-number.d.ts.map +1 -0
  9. package/dest/db/migrations/2_add-checkpoint-number.js +17 -0
  10. package/dest/db/postgres.d.ts +1 -1
  11. package/dest/db/postgres.d.ts.map +1 -1
  12. package/dest/db/postgres.js +2 -0
  13. package/dest/db/schema.d.ts +6 -6
  14. package/dest/db/schema.d.ts.map +1 -1
  15. package/dest/db/schema.js +9 -4
  16. package/dest/db/types.d.ts +11 -5
  17. package/dest/db/types.d.ts.map +1 -1
  18. package/dest/db/types.js +2 -1
  19. package/dest/factory.d.ts +18 -1
  20. package/dest/factory.d.ts.map +1 -1
  21. package/dest/factory.js +33 -4
  22. package/dest/slashing_protection_service.js +4 -4
  23. package/dest/types.d.ts +4 -3
  24. package/dest/types.d.ts.map +1 -1
  25. package/dest/types.js +2 -1
  26. package/dest/validator_ha_signer.d.ts +1 -1
  27. package/dest/validator_ha_signer.d.ts.map +1 -1
  28. package/dest/validator_ha_signer.js +4 -2
  29. package/package.json +7 -7
  30. package/src/db/lmdb.ts +46 -2
  31. package/src/db/migrations/1_initial-schema.ts +35 -4
  32. package/src/db/migrations/2_add-checkpoint-number.ts +19 -0
  33. package/src/db/postgres.ts +2 -0
  34. package/src/db/schema.ts +9 -4
  35. package/src/db/types.ts +11 -9
  36. package/src/factory.ts +56 -8
  37. package/src/slashing_protection_service.ts +4 -4
  38. package/src/types.ts +6 -0
  39. package/src/validator_ha_signer.ts +4 -1
@@ -15,6 +15,7 @@ import {
15
15
  DutyType,
16
16
  type HAProtectedSigningContext,
17
17
  getBlockNumberFromSigningContext,
18
+ getCheckpointNumberFromSigningContext,
18
19
  } from '@aztec/stdlib/ha-signing';
19
20
 
20
21
  import type { DutyIdentifier } from './db/types.js';
@@ -67,7 +68,7 @@ export class ValidatorHASigner {
67
68
  if (!config.nodeId || config.nodeId === '') {
68
69
  throw new Error('NODE_ID is required for high-availability setups');
69
70
  }
70
- this.rollupAddress = config.l1Contracts.rollupAddress;
71
+ this.rollupAddress = config.rollupAddress;
71
72
  this.slashingProtection = new SlashingProtectionService(db, config, {
72
73
  metrics: deps.metrics,
73
74
  dateProvider: deps.dateProvider,
@@ -125,9 +126,11 @@ export class ValidatorHASigner {
125
126
  // Acquire lock and get the token for ownership verification
126
127
  // DutyAlreadySignedError and SlashingProtectionError may be thrown here and are recorded in the service
127
128
  const blockNumber = getBlockNumberFromSigningContext(context);
129
+ const checkpointNumber = getCheckpointNumberFromSigningContext(context);
128
130
  const lockToken = await this.slashingProtection.checkAndRecord({
129
131
  ...dutyIdentifier,
130
132
  blockNumber,
133
+ checkpointNumber,
131
134
  messageHash: messageHash.toString(),
132
135
  nodeId: this.config.nodeId,
133
136
  });