@aztec/validator-ha-signer 0.0.1-commit.358457c → 0.0.1-commit.3895657bc

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.
@@ -8,7 +8,7 @@ import { type Logger, createLogger } from '@aztec/foundation/log';
8
8
  import { RunningPromise } from '@aztec/foundation/promise';
9
9
  import { sleep } from '@aztec/foundation/sleep';
10
10
  import type { DateProvider } from '@aztec/foundation/timer';
11
- import type { ValidatorHASignerConfig } from '@aztec/stdlib/ha-signing';
11
+ import type { BaseSignerConfig } from '@aztec/stdlib/ha-signing';
12
12
 
13
13
  import {
14
14
  type CheckAndRecordParams,
@@ -55,7 +55,7 @@ export class SlashingProtectionService {
55
55
 
56
56
  constructor(
57
57
  private readonly db: SlashingProtectionDatabase,
58
- private readonly config: ValidatorHASignerConfig,
58
+ private readonly config: BaseSignerConfig,
59
59
  deps: SlashingProtectionServiceDeps,
60
60
  ) {
61
61
  this.log = createLogger('slashing-protection');
package/src/types.ts CHANGED
@@ -70,6 +70,11 @@ export interface CreateHASignerDeps {
70
70
  dateProvider?: DateProvider;
71
71
  }
72
72
 
73
+ /**
74
+ * deps for creating a local signing protection signer
75
+ */
76
+ export type CreateLocalSignerWithProtectionDeps = Omit<CreateHASignerDeps, 'pool'>;
77
+
73
78
  /**
74
79
  * Database interface for slashing protection operations
75
80
  * This abstraction allows for different database implementations (PostgreSQL, SQLite, etc.)
@@ -11,9 +11,9 @@ import type { Signature } from '@aztec/foundation/eth-signature';
11
11
  import { type Logger, createLogger } from '@aztec/foundation/log';
12
12
  import type { DateProvider } from '@aztec/foundation/timer';
13
13
  import {
14
+ type BaseSignerConfig,
14
15
  DutyType,
15
16
  type HAProtectedSigningContext,
16
- type ValidatorHASignerConfig,
17
17
  getBlockNumberFromSigningContext,
18
18
  } from '@aztec/stdlib/ha-signing';
19
19
 
@@ -56,7 +56,7 @@ export class ValidatorHASigner {
56
56
 
57
57
  constructor(
58
58
  db: SlashingProtectionDatabase,
59
- private readonly config: ValidatorHASignerConfig,
59
+ private readonly config: BaseSignerConfig,
60
60
  deps: ValidatorHASignerDeps,
61
61
  ) {
62
62
  this.log = createLogger('validator-ha-signer');
@@ -64,11 +64,6 @@ export class ValidatorHASigner {
64
64
  this.metrics = deps.metrics;
65
65
  this.dateProvider = deps.dateProvider;
66
66
 
67
- if (!config.haSigningEnabled) {
68
- // this shouldn't happen, the validator should use different signer for non-HA setups
69
- throw new Error('Validator HA Signer is not enabled in config');
70
- }
71
-
72
67
  if (!config.nodeId || config.nodeId === '') {
73
68
  throw new Error('NODE_ID is required for high-availability setups');
74
69
  }