@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.
- package/dest/db/lmdb.d.ts +6 -2
- package/dest/db/lmdb.d.ts.map +1 -1
- package/dest/db/lmdb.js +37 -2
- package/dest/db/migrations/1_initial-schema.d.ts +4 -2
- package/dest/db/migrations/1_initial-schema.d.ts.map +1 -1
- package/dest/db/migrations/1_initial-schema.js +34 -4
- package/dest/db/migrations/2_add-checkpoint-number.d.ts +7 -0
- package/dest/db/migrations/2_add-checkpoint-number.d.ts.map +1 -0
- package/dest/db/migrations/2_add-checkpoint-number.js +17 -0
- package/dest/db/postgres.d.ts +1 -1
- package/dest/db/postgres.d.ts.map +1 -1
- package/dest/db/postgres.js +2 -0
- package/dest/db/schema.d.ts +6 -6
- package/dest/db/schema.d.ts.map +1 -1
- package/dest/db/schema.js +9 -4
- package/dest/db/types.d.ts +11 -5
- package/dest/db/types.d.ts.map +1 -1
- package/dest/db/types.js +2 -1
- package/dest/factory.d.ts +18 -1
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +33 -4
- package/dest/slashing_protection_service.js +4 -4
- package/dest/types.d.ts +4 -3
- package/dest/types.d.ts.map +1 -1
- package/dest/types.js +2 -1
- package/dest/validator_ha_signer.d.ts +1 -1
- package/dest/validator_ha_signer.d.ts.map +1 -1
- package/dest/validator_ha_signer.js +4 -2
- package/package.json +7 -7
- package/src/db/lmdb.ts +46 -2
- package/src/db/migrations/1_initial-schema.ts +35 -4
- package/src/db/migrations/2_add-checkpoint-number.ts +19 -0
- package/src/db/postgres.ts +2 -0
- package/src/db/schema.ts +9 -4
- package/src/db/types.ts +11 -9
- package/src/factory.ts +56 -8
- package/src/slashing_protection_service.ts +4 -4
- package/src/types.ts +6 -0
- 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.
|
|
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
|
});
|