@aztec/validator-client 0.0.1-commit.7d4e6cd → 0.0.1-commit.7ffbba4

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 (69) hide show
  1. package/README.md +95 -24
  2. package/dest/block_proposal_handler.d.ts +10 -10
  3. package/dest/block_proposal_handler.d.ts.map +1 -1
  4. package/dest/block_proposal_handler.js +76 -76
  5. package/dest/checkpoint_builder.d.ts +31 -25
  6. package/dest/checkpoint_builder.d.ts.map +1 -1
  7. package/dest/checkpoint_builder.js +114 -41
  8. package/dest/config.d.ts +1 -1
  9. package/dest/config.d.ts.map +1 -1
  10. package/dest/config.js +33 -14
  11. package/dest/duties/validation_service.d.ts +20 -7
  12. package/dest/duties/validation_service.d.ts.map +1 -1
  13. package/dest/duties/validation_service.js +69 -22
  14. package/dest/factory.d.ts +2 -2
  15. package/dest/factory.d.ts.map +1 -1
  16. package/dest/factory.js +3 -2
  17. package/dest/index.d.ts +1 -2
  18. package/dest/index.d.ts.map +1 -1
  19. package/dest/index.js +0 -1
  20. package/dest/key_store/ha_key_store.d.ts +99 -0
  21. package/dest/key_store/ha_key_store.d.ts.map +1 -0
  22. package/dest/key_store/ha_key_store.js +208 -0
  23. package/dest/key_store/index.d.ts +2 -1
  24. package/dest/key_store/index.d.ts.map +1 -1
  25. package/dest/key_store/index.js +1 -0
  26. package/dest/key_store/interface.d.ts +36 -6
  27. package/dest/key_store/interface.d.ts.map +1 -1
  28. package/dest/key_store/local_key_store.d.ts +10 -5
  29. package/dest/key_store/local_key_store.d.ts.map +1 -1
  30. package/dest/key_store/local_key_store.js +8 -4
  31. package/dest/key_store/node_keystore_adapter.d.ts +18 -5
  32. package/dest/key_store/node_keystore_adapter.d.ts.map +1 -1
  33. package/dest/key_store/node_keystore_adapter.js +18 -4
  34. package/dest/key_store/web3signer_key_store.d.ts +10 -5
  35. package/dest/key_store/web3signer_key_store.d.ts.map +1 -1
  36. package/dest/key_store/web3signer_key_store.js +8 -4
  37. package/dest/metrics.d.ts +12 -3
  38. package/dest/metrics.d.ts.map +1 -1
  39. package/dest/metrics.js +46 -5
  40. package/dest/validator.d.ts +45 -18
  41. package/dest/validator.d.ts.map +1 -1
  42. package/dest/validator.js +262 -98
  43. package/package.json +21 -17
  44. package/src/block_proposal_handler.ts +93 -95
  45. package/src/checkpoint_builder.ts +171 -48
  46. package/src/config.ts +32 -13
  47. package/src/duties/validation_service.ts +94 -25
  48. package/src/factory.ts +2 -0
  49. package/src/index.ts +0 -1
  50. package/src/key_store/ha_key_store.ts +269 -0
  51. package/src/key_store/index.ts +1 -0
  52. package/src/key_store/interface.ts +44 -5
  53. package/src/key_store/local_key_store.ts +13 -4
  54. package/src/key_store/node_keystore_adapter.ts +27 -4
  55. package/src/key_store/web3signer_key_store.ts +17 -4
  56. package/src/metrics.ts +63 -6
  57. package/src/validator.ts +326 -116
  58. package/dest/tx_validator/index.d.ts +0 -3
  59. package/dest/tx_validator/index.d.ts.map +0 -1
  60. package/dest/tx_validator/index.js +0 -2
  61. package/dest/tx_validator/nullifier_cache.d.ts +0 -14
  62. package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
  63. package/dest/tx_validator/nullifier_cache.js +0 -24
  64. package/dest/tx_validator/tx_validator_factory.d.ts +0 -18
  65. package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
  66. package/dest/tx_validator/tx_validator_factory.js +0 -53
  67. package/src/tx_validator/index.ts +0 -2
  68. package/src/tx_validator/nullifier_cache.ts +0 -30
  69. package/src/tx_validator/tx_validator_factory.ts +0 -133
@@ -1,8 +1,11 @@
1
+ import { BlockNumber } from '@aztec/foundation/branded-types';
1
2
  import { Buffer32 } from '@aztec/foundation/buffer';
2
3
  import { keccak256 } from '@aztec/foundation/crypto/keccak';
3
4
  import { Fr } from '@aztec/foundation/curves/bn254';
4
5
  import { createLogger } from '@aztec/foundation/log';
5
6
  import { BlockProposal, CheckpointAttestation, CheckpointProposal, ConsensusPayload, SignatureDomainSeparator } from '@aztec/stdlib/p2p';
7
+ import { DutyAlreadySignedError, SlashingProtectionError } from '@aztec/validator-ha-signer/errors';
8
+ import { DutyType } from '@aztec/validator-ha-signer/types';
6
9
  export class ValidationService {
7
10
  keyStore;
8
11
  log;
@@ -14,21 +17,26 @@ export class ValidationService {
14
17
  * Create a block proposal with the given header, archive, and transactions
15
18
  *
16
19
  * @param blockHeader - The block header
17
- * @param indexWithinCheckpoint - Index of this block within the checkpoint (0-indexed)
20
+ * @param blockIndexWithinCheckpoint - The block index within checkpoint for HA signing context
18
21
  * @param inHash - Hash of L1 to L2 messages for this checkpoint
19
22
  * @param archive - The archive of the current block
20
- * @param txs - TxHash[] ordered list of transactions
23
+ * @param txs - Ordered list of transactions (Tx[])
24
+ * @param proposerAttesterAddress - The address of the proposer/attester, or undefined
21
25
  * @param options - Block proposal options (including broadcastInvalidBlockProposal for testing)
22
26
  *
23
27
  * @returns A block proposal signing the above information
24
- */ createBlockProposal(blockHeader, indexWithinCheckpoint, inHash, archive, txs, proposerAttesterAddress, options) {
25
- const payloadSigner = this.getPayloadSigner(proposerAttesterAddress);
28
+ * @throws DutyAlreadySignedError if HA signer indicates duty already signed by another node
29
+ * @throws SlashingProtectionError if attempting to sign different data for same slot
30
+ */ createBlockProposal(blockHeader, blockIndexWithinCheckpoint, inHash, archive, txs, proposerAttesterAddress, options) {
26
31
  // For testing: change the new archive to trigger state_mismatch validation failure
27
32
  if (options.broadcastInvalidBlockProposal) {
28
33
  archive = Fr.random();
29
34
  this.log.warn(`Creating INVALID block proposal for slot ${blockHeader.globalVariables.slotNumber}`);
30
35
  }
31
- return BlockProposal.createProposalFromSigner(blockHeader, indexWithinCheckpoint, inHash, archive, txs.map((tx)=>tx.getTxHash()), options.publishFullTxs ? txs : undefined, payloadSigner);
36
+ // Create a signer that uses the appropriate address
37
+ const address = proposerAttesterAddress ?? this.keyStore.getAddress(0);
38
+ const payloadSigner = (payload, context)=>this.keyStore.signMessageWithAddress(address, payload, context);
39
+ return BlockProposal.createProposalFromSigner(blockHeader, blockIndexWithinCheckpoint, inHash, archive, txs.map((tx)=>tx.getTxHash()), options.publishFullTxs ? txs : undefined, payloadSigner);
32
40
  }
33
41
  /**
34
42
  * Create a checkpoint proposal with the last block header and checkpoint header
@@ -40,13 +48,17 @@ export class ValidationService {
40
48
  * @param options - Checkpoint proposal options
41
49
  *
42
50
  * @returns A checkpoint proposal signing the above information
43
- */ createCheckpointProposal(checkpointHeader, archive, lastBlockInfo, proposerAttesterAddress, options) {
44
- const payloadSigner = this.getPayloadSigner(proposerAttesterAddress);
51
+ */ createCheckpointProposal(checkpointHeader, archive, feeAssetPriceModifier, lastBlockInfo, proposerAttesterAddress, options) {
45
52
  // For testing: change the archive to trigger state_mismatch validation failure
46
53
  if (options.broadcastInvalidCheckpointProposal) {
47
54
  archive = Fr.random();
48
55
  this.log.warn(`Creating INVALID checkpoint proposal for slot ${checkpointHeader.slotNumber}`);
49
56
  }
57
+ // Create a signer that takes payload and context, and uses the appropriate address
58
+ const payloadSigner = (payload, context)=>{
59
+ const address = proposerAttesterAddress ?? this.keyStore.getAddress(0);
60
+ return this.keyStore.signMessageWithAddress(address, payload, context);
61
+ };
50
62
  // Last block to include in the proposal
51
63
  const lastBlock = lastBlockInfo && {
52
64
  blockHeader: lastBlockInfo.blockHeader,
@@ -54,16 +66,7 @@ export class ValidationService {
54
66
  txHashes: lastBlockInfo.txs.map((tx)=>tx.getTxHash()),
55
67
  txs: options.publishFullTxs ? lastBlockInfo.txs : undefined
56
68
  };
57
- return CheckpointProposal.createProposalFromSigner(checkpointHeader, archive, lastBlock, payloadSigner);
58
- }
59
- getPayloadSigner(proposerAttesterAddress) {
60
- if (proposerAttesterAddress !== undefined) {
61
- return (payload)=>this.keyStore.signMessageWithAddress(proposerAttesterAddress, payload);
62
- } else {
63
- // if there is no proposer attester address, just use the first signer
64
- const signer = this.keyStore.getAddress(0);
65
- return (payload)=>this.keyStore.signMessageWithAddress(signer, payload);
66
- }
69
+ return CheckpointProposal.createProposalFromSigner(checkpointHeader, archive, feeAssetPriceModifier, lastBlock, payloadSigner);
67
70
  }
68
71
  /**
69
72
  * Attest with selection of validators to the given checkpoint proposal
@@ -76,13 +79,57 @@ export class ValidationService {
76
79
  * @returns checkpoint attestations
77
80
  */ async attestToCheckpointProposal(proposal, attestors) {
78
81
  // Create the attestation payload from the checkpoint proposal
79
- const payload = new ConsensusPayload(proposal.checkpointHeader, proposal.archive);
82
+ const payload = new ConsensusPayload(proposal.checkpointHeader, proposal.archive, proposal.feeAssetPriceModifier);
80
83
  const buf = Buffer32.fromBuffer(keccak256(payload.getPayloadToSign(SignatureDomainSeparator.checkpointAttestation)));
81
- const signatures = await Promise.all(attestors.map((attestor)=>this.keyStore.signMessageWithAddress(attestor, buf)));
82
- return signatures.map((sig)=>new CheckpointAttestation(payload, sig, proposal.signature));
84
+ // TODO(spy/ha): Use checkpointNumber instead of blockNumber once CheckpointHeader includes it.
85
+ // CheckpointProposalCore doesn't have lastBlock info, so use 0 as a proxy.
86
+ // blockNumber is NOT used for the primary key so it's safe to use here.
87
+ // See CheckpointHeader TODO and SigningContext types documentation.
88
+ const blockNumber = BlockNumber(0);
89
+ const context = {
90
+ slot: proposal.slotNumber,
91
+ blockNumber,
92
+ dutyType: DutyType.ATTESTATION
93
+ };
94
+ // Sign each attestor in parallel, catching HA errors per-attestor
95
+ const results = await Promise.allSettled(attestors.map(async (attestor)=>{
96
+ const sig = await this.keyStore.signMessageWithAddress(attestor, buf, context);
97
+ // return new BlockAttestation(proposal.payload, sig, proposal.signature);
98
+ return new CheckpointAttestation(payload, sig, proposal.signature);
99
+ }));
100
+ const attestations = [];
101
+ for(let i = 0; i < results.length; i++){
102
+ const result = results[i];
103
+ if (result.status === 'fulfilled') {
104
+ attestations.push(result.value);
105
+ } else {
106
+ const error = result.reason;
107
+ if (error instanceof DutyAlreadySignedError || error instanceof SlashingProtectionError) {
108
+ this.log.info(`Attestation for slot ${proposal.slotNumber} by ${attestors[i]} already signed by another High-Availability node`);
109
+ // Continue with remaining attestors
110
+ } else {
111
+ throw error;
112
+ }
113
+ }
114
+ }
115
+ return attestations;
83
116
  }
84
- async signAttestationsAndSigners(attestationsAndSigners, proposer) {
117
+ /**
118
+ * Sign attestations and signers payload
119
+ * @param attestationsAndSigners - The attestations and signers to sign
120
+ * @param proposer - The proposer address to sign with
121
+ * @param slot - The slot number for HA signing context
122
+ * @param blockNumber - The block or checkpoint number for HA signing context
123
+ * @returns signature
124
+ * @throws DutyAlreadySignedError if already signed by another HA node
125
+ * @throws SlashingProtectionError if attempting to sign different data for same slot
126
+ */ signAttestationsAndSigners(attestationsAndSigners, proposer, slot, blockNumber) {
127
+ const context = {
128
+ slot,
129
+ blockNumber,
130
+ dutyType: DutyType.ATTESTATIONS_AND_SIGNERS
131
+ };
85
132
  const buf = Buffer32.fromBuffer(keccak256(attestationsAndSigners.getPayloadToSign(SignatureDomainSeparator.attestationsAndSigners)));
86
- return await this.keyStore.signMessageWithAddress(proposer, buf);
133
+ return this.keyStore.signMessageWithAddress(proposer, buf, context);
87
134
  }
88
135
  }
package/dest/factory.d.ts CHANGED
@@ -31,5 +31,5 @@ export declare function createValidatorClient(config: ValidatorClientFullConfig,
31
31
  epochCache: EpochCache;
32
32
  keyStoreManager: KeystoreManager | undefined;
33
33
  blobClient: BlobClientInterface;
34
- }): ValidatorClient | undefined;
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2ZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNyRSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFB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,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE;IACJ,kBAAkB,EAAE,0BAA0B,CAAC;IAC/C,UAAU,EAAE,sBAAsB,CAAC;IACnC,WAAW,EAAE,aAAa,GAAG,WAAW,CAAC;IACzC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,eAAe,CAAC;CAC5B,wBAoBF;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE;IACJ,kBAAkB,EAAE,0BAA0B,CAAC;IAC/C,UAAU,EAAE,sBAAsB,CAAC;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,aAAa,GAAG,WAAW,CAAC;IACzC,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,SAAS,EAAE,eAAe,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,eAAe,GAAG,SAAS,CAAC;IAC7C,UAAU,EAAE,mBAAmB,CAAC;CACjC,wCAqBF"}
package/dest/factory.js CHANGED
@@ -5,9 +5,10 @@ import { ValidatorClient } from './validator.js';
5
5
  export function createBlockProposalHandler(config, deps) {
6
6
  const metrics = new ValidatorMetrics(deps.telemetry);
7
7
  const blockProposalValidator = new BlockProposalValidator(deps.epochCache, {
8
- txsPermitted: !config.disableTransactions
8
+ txsPermitted: !config.disableTransactions,
9
+ maxTxsPerBlock: config.validateMaxTxsPerBlock
9
10
  });
10
- return new BlockProposalHandler(deps.checkpointsBuilder, deps.worldState, deps.blockSource, deps.l1ToL2MessageSource, deps.p2pClient.getTxProvider(), blockProposalValidator, config, metrics, deps.dateProvider, deps.telemetry);
11
+ return new BlockProposalHandler(deps.checkpointsBuilder, deps.worldState, deps.blockSource, deps.l1ToL2MessageSource, deps.p2pClient.getTxProvider(), blockProposalValidator, deps.epochCache, config, metrics, deps.dateProvider, deps.telemetry);
11
12
  }
12
13
  export function createValidatorClient(config, deps) {
13
14
  if (config.disableValidator || !deps.keyStoreManager) {
package/dest/index.d.ts CHANGED
@@ -4,5 +4,4 @@ export * from './config.js';
4
4
  export * from './factory.js';
5
5
  export * from './validator.js';
6
6
  export * from './key_store/index.js';
7
- export * from './tx_validator/index.js';
8
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMseUJBQXlCLENBQUMifQ==
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLHNCQUFzQixDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
package/dest/index.js CHANGED
@@ -4,4 +4,3 @@ export * from './config.js';
4
4
  export * from './factory.js';
5
5
  export * from './validator.js';
6
6
  export * from './key_store/index.js';
7
- export * from './tx_validator/index.js';
@@ -0,0 +1,99 @@
1
+ /**
2
+ * High Availability Key Store
3
+ *
4
+ * A ValidatorKeyStore wrapper that adds slashing protection for HA validator setups.
5
+ * When multiple validator nodes are running, only one node will sign for a given duty.
6
+ */
7
+ import { Buffer32 } from '@aztec/foundation/buffer';
8
+ import type { EthAddress } from '@aztec/foundation/eth-address';
9
+ import type { Signature } from '@aztec/foundation/eth-signature';
10
+ import type { EthRemoteSignerConfig } from '@aztec/node-keystore';
11
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
12
+ import { type SigningContext } from '@aztec/validator-ha-signer/types';
13
+ import type { ValidatorHASigner } from '@aztec/validator-ha-signer/validator-ha-signer';
14
+ import { type TypedDataDefinition } from 'viem';
15
+ import type { ExtendedValidatorKeyStore } from './interface.js';
16
+ /**
17
+ * High Availability Key Store
18
+ *
19
+ * Wraps a base ExtendedValidatorKeyStore and ValidatorHASigner to provide
20
+ * HA-protected signing operations (when context is provided).
21
+ *
22
+ * The extended interface methods (getAttesterAddresses, getCoinbaseAddress, etc.)
23
+ * are pure pass-through since they don't require HA coordination.
24
+ *
25
+ * Usage:
26
+ * ```typescript
27
+ * const baseKeyStore = NodeKeystoreAdapter.fromPrivateKeys(privateKeys);
28
+ * const haSigner = new ValidatorHASigner(db, config);
29
+ * const haKeyStore = new HAKeyStore(baseKeyStore, haSigner);
30
+ *
31
+ * // Without context - signs directly (no HA protection)
32
+ * const sig = await haKeyStore.signMessageWithAddress(addr, msg);
33
+ *
34
+ * // With context - HA protected, throws DutyAlreadySignedError if already signed
35
+ * const result = await haKeyStore.signMessageWithAddress(addr, msg, {
36
+ * slot: 100n,
37
+ * blockNumber: 50n,
38
+ * dutyType: DutyType.BLOCK_PROPOSAL,
39
+ * });
40
+ * ```
41
+ */
42
+ export declare class HAKeyStore implements ExtendedValidatorKeyStore {
43
+ private readonly baseKeyStore;
44
+ private readonly haSigner;
45
+ private readonly log;
46
+ constructor(baseKeyStore: ExtendedValidatorKeyStore, haSigner: ValidatorHASigner);
47
+ /**
48
+ * Sign typed data with all addresses.
49
+ * Coordinates across nodes to prevent double-signing for most duty types.
50
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
51
+ * Returns only signatures that were successfully claimed by this node.
52
+ */
53
+ signTypedData(typedData: TypedDataDefinition, context: SigningContext): Promise<Signature[]>;
54
+ /**
55
+ * Sign a message with all addresses.
56
+ * Coordinates across nodes to prevent double-signing for most duty types.
57
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
58
+ * Returns only signatures that were successfully claimed by this node.
59
+ */
60
+ signMessage(message: Buffer32, context: SigningContext): Promise<Signature[]>;
61
+ /**
62
+ * Sign typed data with a specific address.
63
+ * Coordinates across nodes to prevent double-signing for most duty types.
64
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
65
+ * @throws DutyAlreadySignedError if the duty was already signed by another node
66
+ * @throws SlashingProtectionError if attempting to sign different data for the same slot
67
+ */
68
+ signTypedDataWithAddress(address: EthAddress, typedData: TypedDataDefinition, context: SigningContext): Promise<Signature>;
69
+ /**
70
+ * Sign a message with a specific address.
71
+ * Coordinates across nodes to prevent double-signing for most duty types.
72
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
73
+ * @throws DutyAlreadySignedError if the duty was already signed by another node
74
+ * @throws SlashingProtectionError if attempting to sign different data for the same slot
75
+ */
76
+ signMessageWithAddress(address: EthAddress, message: Buffer32, context: SigningContext): Promise<Signature>;
77
+ getAddress(index: number): EthAddress;
78
+ getAddresses(): EthAddress[];
79
+ getAttesterAddresses(): EthAddress[];
80
+ getCoinbaseAddress(attesterAddress: EthAddress): EthAddress;
81
+ getPublisherAddresses(attesterAddress: EthAddress): EthAddress[];
82
+ getFeeRecipient(attesterAddress: EthAddress): AztecAddress;
83
+ getRemoteSignerConfig(attesterAddress: EthAddress): EthRemoteSignerConfig | undefined;
84
+ /**
85
+ * Process signing errors from the HA signer.
86
+ * Logs expected HA errors (already signed) at appropriate levels.
87
+ * Re-throws unexpected errors.
88
+ */
89
+ private processSigningError;
90
+ /**
91
+ * Start the high-availability key store
92
+ */
93
+ start(): Promise<void>;
94
+ /**
95
+ * Stop the high-availability key store
96
+ */
97
+ stop(): Promise<void>;
98
+ }
99
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFfa2V5X3N0b3JlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMva2V5X3N0b3JlL2hhX2tleV9zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7R0FLRztBQUNILE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQk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SAAS,CAAC,CAchH;IAMD,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEpC;IAED,YAAY,IAAI,UAAU,EAAE,CAE3B;IAED,oBAAoB,IAAI,UAAU,EAAE,CAEnC;IAED,kBAAkB,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,CAE1D;IAED,qBAAqB,CAAC,eAAe,EAAE,UAAU,GAAG,UAAU,EAAE,CAE/D;IAED,eAAe,CAAC,eAAe,EAAE,UAAU,GAAG,YAAY,CAEzD;IAED,qBAAqB,CAAC,eAAe,EAAE,UAAU,GAAG,qBAAqB,GAAG,SAAS,CAEpF;IAED;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAwB3B;;OAEG;IACU,KAAK,kBAEjB;IAED;;OAEG;IACU,IAAI,kBAEhB;CACF"}
@@ -0,0 +1,208 @@
1
+ /**
2
+ * High Availability Key Store
3
+ *
4
+ * A ValidatorKeyStore wrapper that adds slashing protection for HA validator setups.
5
+ * When multiple validator nodes are running, only one node will sign for a given duty.
6
+ */ import { Buffer32 } from '@aztec/foundation/buffer';
7
+ import { createLogger } from '@aztec/foundation/log';
8
+ import { DutyAlreadySignedError, SlashingProtectionError } from '@aztec/validator-ha-signer/errors';
9
+ import { isHAProtectedContext } from '@aztec/validator-ha-signer/types';
10
+ import { hashTypedData } from 'viem';
11
+ /**
12
+ * High Availability Key Store
13
+ *
14
+ * Wraps a base ExtendedValidatorKeyStore and ValidatorHASigner to provide
15
+ * HA-protected signing operations (when context is provided).
16
+ *
17
+ * The extended interface methods (getAttesterAddresses, getCoinbaseAddress, etc.)
18
+ * are pure pass-through since they don't require HA coordination.
19
+ *
20
+ * Usage:
21
+ * ```typescript
22
+ * const baseKeyStore = NodeKeystoreAdapter.fromPrivateKeys(privateKeys);
23
+ * const haSigner = new ValidatorHASigner(db, config);
24
+ * const haKeyStore = new HAKeyStore(baseKeyStore, haSigner);
25
+ *
26
+ * // Without context - signs directly (no HA protection)
27
+ * const sig = await haKeyStore.signMessageWithAddress(addr, msg);
28
+ *
29
+ * // With context - HA protected, throws DutyAlreadySignedError if already signed
30
+ * const result = await haKeyStore.signMessageWithAddress(addr, msg, {
31
+ * slot: 100n,
32
+ * blockNumber: 50n,
33
+ * dutyType: DutyType.BLOCK_PROPOSAL,
34
+ * });
35
+ * ```
36
+ */ export class HAKeyStore {
37
+ baseKeyStore;
38
+ haSigner;
39
+ log;
40
+ constructor(baseKeyStore, haSigner){
41
+ this.baseKeyStore = baseKeyStore;
42
+ this.haSigner = haSigner;
43
+ this.log = createLogger('ha-key-store');
44
+ this.log.info('HAKeyStore initialized', {
45
+ nodeId: haSigner.nodeId
46
+ });
47
+ }
48
+ /**
49
+ * Sign typed data with all addresses.
50
+ * Coordinates across nodes to prevent double-signing for most duty types.
51
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
52
+ * Returns only signatures that were successfully claimed by this node.
53
+ */ async signTypedData(typedData, context) {
54
+ // no need for HA protection on auth request and txs signatures
55
+ if (!isHAProtectedContext(context)) {
56
+ return this.baseKeyStore.signTypedData(typedData, context);
57
+ }
58
+ // Sign each address with HA protection
59
+ const addresses = this.getAddresses();
60
+ const results = await Promise.allSettled(addresses.map((addr)=>this.signTypedDataWithAddress(addr, typedData, context)));
61
+ // Filter out failures (already signed by other nodes or other errors)
62
+ return results.filter((result)=>{
63
+ if (result.status === 'fulfilled') {
64
+ return true;
65
+ }
66
+ // Log expected HA errors (already signed) at debug level
67
+ if (result.reason instanceof DutyAlreadySignedError) {
68
+ this.log.debug(`Duty already signed by another node`, {
69
+ dutyType: context.dutyType,
70
+ slot: context.slot,
71
+ signedByNode: result.reason.signedByNode
72
+ });
73
+ return false;
74
+ }
75
+ // Re-throw unexpected errors
76
+ throw result.reason;
77
+ }).map((result)=>result.value);
78
+ }
79
+ /**
80
+ * Sign a message with all addresses.
81
+ * Coordinates across nodes to prevent double-signing for most duty types.
82
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
83
+ * Returns only signatures that were successfully claimed by this node.
84
+ */ async signMessage(message, context) {
85
+ // no need for HA protection on auth request and txs signatures
86
+ if (!isHAProtectedContext(context)) {
87
+ return this.baseKeyStore.signMessage(message, context);
88
+ }
89
+ // Sign each address with HA protection
90
+ const addresses = this.getAddresses();
91
+ const results = await Promise.allSettled(addresses.map((addr)=>this.signMessageWithAddress(addr, message, context)));
92
+ // Filter out failures (already signed by other nodes or other errors)
93
+ return results.filter((result)=>{
94
+ if (result.status === 'fulfilled') {
95
+ return true;
96
+ }
97
+ // Log expected HA errors (already signed) at debug level
98
+ if (result.reason instanceof DutyAlreadySignedError) {
99
+ this.log.debug(`Duty already signed by another node`, {
100
+ dutyType: context.dutyType,
101
+ slot: context.slot,
102
+ signedByNode: result.reason.signedByNode
103
+ });
104
+ return false;
105
+ }
106
+ // Re-throw unexpected errors
107
+ throw result.reason;
108
+ }).map((result)=>result.value);
109
+ }
110
+ /**
111
+ * Sign typed data with a specific address.
112
+ * Coordinates across nodes to prevent double-signing for most duty types.
113
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
114
+ * @throws DutyAlreadySignedError if the duty was already signed by another node
115
+ * @throws SlashingProtectionError if attempting to sign different data for the same slot
116
+ */ async signTypedDataWithAddress(address, typedData, context) {
117
+ // AUTH_REQUEST and TXS bypass HA protection - multiple signatures are safe
118
+ if (!isHAProtectedContext(context)) {
119
+ return this.baseKeyStore.signTypedDataWithAddress(address, typedData, context);
120
+ }
121
+ // Compute signing root from typed data for HA tracking
122
+ const digest = hashTypedData(typedData);
123
+ const messageHash = Buffer32.fromString(digest);
124
+ try {
125
+ return await this.haSigner.signWithProtection(address, messageHash, context, ()=>this.baseKeyStore.signTypedDataWithAddress(address, typedData, context));
126
+ } catch (error) {
127
+ this.processSigningError(error, context);
128
+ throw error;
129
+ }
130
+ }
131
+ /**
132
+ * Sign a message with a specific address.
133
+ * Coordinates across nodes to prevent double-signing for most duty types.
134
+ * AUTH_REQUEST and TXS duties bypass HA protection since signing multiple times is safe.
135
+ * @throws DutyAlreadySignedError if the duty was already signed by another node
136
+ * @throws SlashingProtectionError if attempting to sign different data for the same slot
137
+ */ async signMessageWithAddress(address, message, context) {
138
+ // no need for HA protection on auth request and txs signatures
139
+ if (!isHAProtectedContext(context)) {
140
+ return this.baseKeyStore.signMessageWithAddress(address, message, context);
141
+ }
142
+ try {
143
+ return await this.haSigner.signWithProtection(address, message, context, (messageHash)=>this.baseKeyStore.signMessageWithAddress(address, messageHash, context));
144
+ } catch (error) {
145
+ this.processSigningError(error, context);
146
+ throw error;
147
+ }
148
+ }
149
+ // ─────────────────────────────────────────────────────────────────────────────
150
+ // pass-through methods (no HA logic needed)
151
+ // ─────────────────────────────────────────────────────────────────────────────
152
+ getAddress(index) {
153
+ return this.baseKeyStore.getAddress(index);
154
+ }
155
+ getAddresses() {
156
+ return this.baseKeyStore.getAddresses();
157
+ }
158
+ getAttesterAddresses() {
159
+ return this.baseKeyStore.getAttesterAddresses();
160
+ }
161
+ getCoinbaseAddress(attesterAddress) {
162
+ return this.baseKeyStore.getCoinbaseAddress(attesterAddress);
163
+ }
164
+ getPublisherAddresses(attesterAddress) {
165
+ return this.baseKeyStore.getPublisherAddresses(attesterAddress);
166
+ }
167
+ getFeeRecipient(attesterAddress) {
168
+ return this.baseKeyStore.getFeeRecipient(attesterAddress);
169
+ }
170
+ getRemoteSignerConfig(attesterAddress) {
171
+ return this.baseKeyStore.getRemoteSignerConfig(attesterAddress);
172
+ }
173
+ /**
174
+ * Process signing errors from the HA signer.
175
+ * Logs expected HA errors (already signed) at appropriate levels.
176
+ * Re-throws unexpected errors.
177
+ */ processSigningError(error, context) {
178
+ if (error instanceof DutyAlreadySignedError) {
179
+ this.log.debug(`Duty already signed by another node with the same payload`, {
180
+ dutyType: context.dutyType,
181
+ slot: context.slot,
182
+ signedByNode: error.signedByNode
183
+ });
184
+ return;
185
+ }
186
+ if (error instanceof SlashingProtectionError) {
187
+ this.log.warn(`Duty already signed by another node with different payload`, {
188
+ dutyType: context.dutyType,
189
+ slot: context.slot,
190
+ existingMessageHash: error.existingMessageHash,
191
+ attemptedMessageHash: error.attemptedMessageHash
192
+ });
193
+ return;
194
+ }
195
+ // Re-throw errors
196
+ throw error;
197
+ }
198
+ /**
199
+ * Start the high-availability key store
200
+ */ async start() {
201
+ await this.haSigner.start();
202
+ }
203
+ /**
204
+ * Stop the high-availability key store
205
+ */ async stop() {
206
+ await this.haSigner.stop();
207
+ }
208
+ }
@@ -2,4 +2,5 @@ export * from './interface.js';
2
2
  export * from './local_key_store.js';
3
3
  export * from './node_keystore_adapter.js';
4
4
  export * from './web3signer_key_store.js';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9rZXlfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYywyQkFBMkIsQ0FBQyJ9
5
+ export * from './ha_key_store.js';
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9rZXlfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLHNCQUFzQixDQUFDO0FBQ3JDLGNBQWMsNEJBQTRCLENBQUM7QUFDM0MsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLG1CQUFtQixDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/key_store/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/key_store/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
@@ -2,3 +2,4 @@ export * from './interface.js';
2
2
  export * from './local_key_store.js';
3
3
  export * from './node_keystore_adapter.js';
4
4
  export * from './web3signer_key_store.js';
5
+ export * from './ha_key_store.js';
@@ -3,6 +3,7 @@ import type { EthAddress } from '@aztec/foundation/eth-address';
3
3
  import type { Signature } from '@aztec/foundation/eth-signature';
4
4
  import type { EthRemoteSignerConfig } from '@aztec/node-keystore';
5
5
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
6
+ import type { SigningContext } from '@aztec/validator-ha-signer/types';
6
7
  import type { TypedDataDefinition } from 'viem';
7
8
  /** Key Store
8
9
  *
@@ -22,17 +23,38 @@ export interface ValidatorKeyStore {
22
23
  * @returns all addresses
23
24
  */
24
25
  getAddresses(): EthAddress[];
25
- signTypedData(typedData: TypedDataDefinition): Promise<Signature[]>;
26
- signTypedDataWithAddress(address: EthAddress, typedData: TypedDataDefinition): Promise<Signature>;
26
+ /**
27
+ * Sign typed data with all keystore private keys
28
+ * @param typedData - The complete EIP-712 typed data structure
29
+ * @param context - Signing context for HA slashing protection
30
+ * @returns signatures (when context provided with HA, only successfully claimed signatures are returned)
31
+ */
32
+ signTypedData(typedData: TypedDataDefinition, context: SigningContext): Promise<Signature[]>;
33
+ /**
34
+ * Sign typed data with a specific address's private key
35
+ * @param address - The address of the signer to use
36
+ * @param typedData - The complete EIP-712 typed data structure
37
+ * @param context - Signing context for HA slashing protection
38
+ * @returns signature
39
+ */
40
+ signTypedDataWithAddress(address: EthAddress, typedData: TypedDataDefinition, context: SigningContext): Promise<Signature>;
27
41
  /**
28
42
  * Flavor of sign message that followed EIP-712 eth signed message prefix
29
43
  * Note: this is only required when we are using ecdsa signatures over secp256k1
30
44
  *
31
45
  * @param message - The message to sign.
32
- * @returns The signatures.
46
+ * @param context - Signing context for HA slashing protection
47
+ * @returns The signatures (when context provided with HA, only successfully claimed signatures are returned).
48
+ */
49
+ signMessage(message: Buffer32, context: SigningContext): Promise<Signature[]>;
50
+ /**
51
+ * Sign a message with a specific address's private key
52
+ * @param address - The address of the signer to use
53
+ * @param message - The message to sign
54
+ * @param context - Signing context for HA slashing protection
55
+ * @returns signature
33
56
  */
34
- signMessage(message: Buffer32): Promise<Signature[]>;
35
- signMessageWithAddress(address: EthAddress, message: Buffer32): Promise<Signature>;
57
+ signMessageWithAddress(address: EthAddress, message: Buffer32, context: SigningContext): Promise<Signature>;
36
58
  }
37
59
  /**
38
60
  * Extended ValidatorKeyStore interface that supports the new keystore configuration model
@@ -70,5 +92,13 @@ export interface ExtendedValidatorKeyStore extends ValidatorKeyStore {
70
92
  * @returns the remote signer configuration or undefined
71
93
  */
72
94
  getRemoteSignerConfig(attesterAddress: EthAddress): EthRemoteSignerConfig | undefined;
95
+ /**
96
+ * Start the key store
97
+ */
98
+ start(): Promise<void>;
99
+ /**
100
+ * Stop the key store
101
+ */
102
+ stop(): Promise<void>;
73
103
  }
74
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMva2V5X3N0b3JlL2ludGVyZmFjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxVQUFVLEV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