@obolnetwork/obol-sdk 2.11.13 → 2.12.1
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/dist/browser/src/index.js +702 -212
- package/dist/browser/src/index.js.map +1 -1
- package/dist/cjs/src/blsUtils.js +3843 -0
- package/dist/cjs/src/blsUtils.js.map +1 -0
- package/dist/cjs/src/index.js +790 -299
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/verification/clusterLockValidationWorker.js +14696 -0
- package/dist/cjs/src/verification/clusterLockValidationWorker.js.map +1 -0
- package/dist/cjs/src/verification/lockWorker.js +3840 -0
- package/dist/cjs/src/verification/lockWorker.js.map +1 -0
- package/dist/cjs/src/verification/parallelPool.js +4185 -0
- package/dist/cjs/src/verification/parallelPool.js.map +1 -0
- package/dist/esm/src/blsUtils.js +21 -0
- package/dist/esm/src/blsUtils.js.map +1 -0
- package/dist/esm/src/chunk-5ASVONSJ.js +10242 -0
- package/dist/esm/src/chunk-5ASVONSJ.js.map +1 -0
- package/dist/esm/src/chunk-LOSYOJC3.js +4370 -0
- package/dist/esm/src/chunk-LOSYOJC3.js.map +1 -0
- package/dist/esm/src/chunk-RYTIXFRX.js +382 -0
- package/dist/esm/src/chunk-RYTIXFRX.js.map +1 -0
- package/dist/esm/src/index.js +215 -14508
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/verification/clusterLockValidationWorker.js +18 -0
- package/dist/esm/src/verification/clusterLockValidationWorker.js.map +1 -0
- package/dist/esm/src/verification/lockWorker.js +55 -0
- package/dist/esm/src/verification/lockWorker.js.map +1 -0
- package/dist/esm/src/verification/parallelPool.js +16 -0
- package/dist/esm/src/verification/parallelPool.js.map +1 -0
- package/dist/types/src/blsUtils.d.ts +5 -0
- package/dist/types/src/errors.d.ts +13 -0
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/services.d.ts +4 -1
- package/dist/types/src/types.d.ts +6 -0
- package/dist/types/src/verification/clusterLockValidationWorker.d.ts +1 -0
- package/dist/types/src/verification/common.d.ts +26 -7
- package/dist/types/src/verification/lockWorker.d.ts +18 -0
- package/dist/types/src/verification/parallelPool.d.ts +11 -0
- package/dist/types/test/verification/parallelPool.spec.d.ts +1 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isValidClusterLock
|
|
3
|
+
} from "../chunk-5ASVONSJ.js";
|
|
4
|
+
import "../chunk-RYTIXFRX.js";
|
|
5
|
+
import "../chunk-LOSYOJC3.js";
|
|
6
|
+
|
|
7
|
+
// src/verification/clusterLockValidationWorker.ts
|
|
8
|
+
import { parentPort, workerData } from "worker_threads";
|
|
9
|
+
var input = workerData;
|
|
10
|
+
if (parentPort) {
|
|
11
|
+
const port = parentPort;
|
|
12
|
+
void isValidClusterLock(input.lock, input.safeRpcUrl).then((ok) => {
|
|
13
|
+
port.postMessage(ok);
|
|
14
|
+
}).catch(() => {
|
|
15
|
+
port.postMessage(false);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=clusterLockValidationWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/verification/clusterLockValidationWorker.ts"],"sourcesContent":["// Runs isValidClusterLock in a worker thread so obol-api's main thread stays responsive.\nimport { parentPort, workerData } from 'node:worker_threads';\nimport type { ClusterLock, SafeRpcUrl } from '../types.js';\nimport { isValidClusterLock } from './common.js';\n\nconst input = workerData as {\n lock: ClusterLock;\n safeRpcUrl?: SafeRpcUrl;\n};\n\nif (parentPort) {\n const port = parentPort;\n void isValidClusterLock(input.lock, input.safeRpcUrl)\n .then(ok => {\n port.postMessage(ok);\n })\n .catch(() => {\n port.postMessage(false);\n });\n}\n"],"mappings":";;;;;;;AACA,SAAS,YAAY,kBAAkB;AAIvC,IAAM,QAAQ;AAKd,IAAI,YAAY;AACd,QAAM,OAAO;AACb,OAAK,mBAAmB,MAAM,MAAM,MAAM,UAAU,EACjD,KAAK,QAAM;AACV,SAAK,YAAY,EAAE;AAAA,EACrB,CAAC,EACA,MAAM,MAAM;AACX,SAAK,YAAY,KAAK;AAAA,EACxB,CAAC;AACL;","names":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
blsAggregatePublicKeys,
|
|
3
|
+
blsAggregateSignatures,
|
|
4
|
+
blsRecoverDistributedPubkeyFromShares,
|
|
5
|
+
blsVerifyExtraShares,
|
|
6
|
+
blsVerifyMultiple
|
|
7
|
+
} from "../chunk-LOSYOJC3.js";
|
|
8
|
+
|
|
9
|
+
// src/verification/lockWorker.ts
|
|
10
|
+
import { parentPort, workerData } from "worker_threads";
|
|
11
|
+
import { fromHexString } from "@chainsafe/ssz";
|
|
12
|
+
function verifyShareBindingChunk(input) {
|
|
13
|
+
const { shares, distributedKeys, threshold } = input;
|
|
14
|
+
if (shares.length !== distributedKeys.length) return false;
|
|
15
|
+
for (let i = 0; i < shares.length; i++) {
|
|
16
|
+
const sharesBytes = shares[i].map((s) => fromHexString(s));
|
|
17
|
+
const dkBytes = fromHexString(distributedKeys[i]);
|
|
18
|
+
const recovered = blsRecoverDistributedPubkeyFromShares(
|
|
19
|
+
sharesBytes,
|
|
20
|
+
threshold
|
|
21
|
+
);
|
|
22
|
+
if (!recovered) return false;
|
|
23
|
+
if (recovered.length !== dkBytes.length) return false;
|
|
24
|
+
for (let j = 0; j < recovered.length; j++) {
|
|
25
|
+
if (recovered[j] !== dkBytes[j]) return false;
|
|
26
|
+
}
|
|
27
|
+
if (!blsVerifyExtraShares(sharesBytes, threshold, dkBytes)) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
function verifyBatchChunk(input) {
|
|
34
|
+
return blsVerifyMultiple(
|
|
35
|
+
input.pubkeys,
|
|
36
|
+
input.messages,
|
|
37
|
+
blsAggregateSignatures(input.signatures)
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
function dispatch(input) {
|
|
41
|
+
if (input.mode === "shareBinding") return verifyShareBindingChunk(input);
|
|
42
|
+
if (input.mode === "verifyBatch") return verifyBatchChunk(input);
|
|
43
|
+
if (input.mode === "aggregatePubkeys") {
|
|
44
|
+
return blsAggregatePublicKeys(input.pubkeys);
|
|
45
|
+
}
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (parentPort) {
|
|
49
|
+
try {
|
|
50
|
+
parentPort.postMessage(dispatch(workerData));
|
|
51
|
+
} catch (e) {
|
|
52
|
+
parentPort.postMessage(false);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=lockWorker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/verification/lockWorker.ts"],"sourcesContent":["// Worker entry point loaded by parallelPool via Node's worker_threads.\n//\n// Two modes (dispatched on workerData.mode):\n// 'shareBinding' — Lagrange + extra-share verification for a validator chunk.\n// 'verifyBatch' — blsVerifyMultiple on a (pubkeys, messages, aggregateSig)\n// chunk of the deposit+builder batch.\n// 'aggregatePubkeys' — partial G1 aggregate of a pubkey chunk (for lock sig).\n//\n// shareBinding / verifyBatch return boolean; aggregatePubkeys returns bytes.\n\nimport { parentPort, workerData } from 'node:worker_threads';\nimport { fromHexString } from '@chainsafe/ssz';\nimport {\n blsAggregatePublicKeys,\n blsAggregateSignatures,\n blsRecoverDistributedPubkeyFromShares,\n blsVerifyExtraShares,\n blsVerifyMultiple,\n} from '../blsUtils.js';\n\nexport interface ShareBindingInput {\n mode: 'shareBinding';\n shares: string[][];\n distributedKeys: string[];\n threshold: number;\n}\n\nexport interface VerifyBatchInput {\n mode: 'verifyBatch';\n pubkeys: Uint8Array[];\n messages: Uint8Array[];\n signatures: Uint8Array[];\n}\n\nexport interface AggregatePubkeysInput {\n mode: 'aggregatePubkeys';\n pubkeys: Uint8Array[];\n}\n\nexport type WorkerInput =\n | ShareBindingInput\n | VerifyBatchInput\n | AggregatePubkeysInput;\n\nexport type WorkerResult = boolean | Uint8Array;\n\nfunction verifyShareBindingChunk(input: ShareBindingInput): boolean {\n const { shares, distributedKeys, threshold } = input;\n if (shares.length !== distributedKeys.length) return false;\n\n for (let i = 0; i < shares.length; i++) {\n const sharesBytes = shares[i].map(s => fromHexString(s));\n const dkBytes = fromHexString(distributedKeys[i]);\n\n const recovered = blsRecoverDistributedPubkeyFromShares(\n sharesBytes,\n threshold,\n );\n if (!recovered) return false;\n if (recovered.length !== dkBytes.length) return false;\n for (let j = 0; j < recovered.length; j++) {\n if (recovered[j] !== dkBytes[j]) return false;\n }\n if (!blsVerifyExtraShares(sharesBytes, threshold, dkBytes)) {\n return false;\n }\n }\n return true;\n}\n\nfunction verifyBatchChunk(input: VerifyBatchInput): boolean {\n return blsVerifyMultiple(\n input.pubkeys,\n input.messages,\n blsAggregateSignatures(input.signatures),\n );\n}\n\nfunction dispatch(input: WorkerInput): WorkerResult {\n if (input.mode === 'shareBinding') return verifyShareBindingChunk(input);\n if (input.mode === 'verifyBatch') return verifyBatchChunk(input);\n if (input.mode === 'aggregatePubkeys') {\n return blsAggregatePublicKeys(input.pubkeys);\n }\n return false;\n}\n\nif (parentPort) {\n try {\n parentPort.postMessage(dispatch(workerData as WorkerInput));\n } catch {\n parentPort.postMessage(false);\n }\n}\n"],"mappings":";;;;;;;;;AAUA,SAAS,YAAY,kBAAkB;AACvC,SAAS,qBAAqB;AAmC9B,SAAS,wBAAwB,OAAmC;AAClE,QAAM,EAAE,QAAQ,iBAAiB,UAAU,IAAI;AAC/C,MAAI,OAAO,WAAW,gBAAgB,OAAQ,QAAO;AAErD,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,UAAM,cAAc,OAAO,CAAC,EAAE,IAAI,OAAK,cAAc,CAAC,CAAC;AACvD,UAAM,UAAU,cAAc,gBAAgB,CAAC,CAAC;AAEhD,UAAM,YAAY;AAAA,MAChB;AAAA,MACA;AAAA,IACF;AACA,QAAI,CAAC,UAAW,QAAO;AACvB,QAAI,UAAU,WAAW,QAAQ,OAAQ,QAAO;AAChD,aAAS,IAAI,GAAG,IAAI,UAAU,QAAQ,KAAK;AACzC,UAAI,UAAU,CAAC,MAAM,QAAQ,CAAC,EAAG,QAAO;AAAA,IAC1C;AACA,QAAI,CAAC,qBAAqB,aAAa,WAAW,OAAO,GAAG;AAC1D,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,iBAAiB,OAAkC;AAC1D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,MAAM;AAAA,IACN,uBAAuB,MAAM,UAAU;AAAA,EACzC;AACF;AAEA,SAAS,SAAS,OAAkC;AAClD,MAAI,MAAM,SAAS,eAAgB,QAAO,wBAAwB,KAAK;AACvE,MAAI,MAAM,SAAS,cAAe,QAAO,iBAAiB,KAAK;AAC/D,MAAI,MAAM,SAAS,oBAAoB;AACrC,WAAO,uBAAuB,MAAM,OAAO;AAAA,EAC7C;AACA,SAAO;AACT;AAEA,IAAI,YAAY;AACd,MAAI;AACF,eAAW,YAAY,SAAS,UAAyB,CAAC;AAAA,EAC5D,SAAQ;AACN,eAAW,YAAY,KAAK;AAAA,EAC9B;AACF;","names":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validateClusterLockInWorker,
|
|
3
|
+
verifyAggregateParallel,
|
|
4
|
+
verifyBatchParallel,
|
|
5
|
+
verifyBlsChecksParallel,
|
|
6
|
+
verifySharesBinding
|
|
7
|
+
} from "../chunk-RYTIXFRX.js";
|
|
8
|
+
import "../chunk-LOSYOJC3.js";
|
|
9
|
+
export {
|
|
10
|
+
validateClusterLockInWorker,
|
|
11
|
+
verifyAggregateParallel,
|
|
12
|
+
verifyBatchParallel,
|
|
13
|
+
verifyBlsChecksParallel,
|
|
14
|
+
verifySharesBinding
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=parallelPool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export declare function blsVerify(pubkey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
|
|
2
|
+
export declare function blsAggregatePublicKeys(pubkeys: Uint8Array[]): Uint8Array;
|
|
2
3
|
export declare function blsVerifyAggregate(pubkeys: Uint8Array[], message: Uint8Array, signature: Uint8Array): boolean;
|
|
4
|
+
/** Verify when the pubkey set is already aggregated to a single G1 key. */
|
|
5
|
+
export declare function blsVerifyWithAggregatedPubkey(aggregatedPubkey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
|
|
3
6
|
export declare function blsVerifyMultiple(pubkeys: Uint8Array[], messages: Uint8Array[], signature: Uint8Array): boolean;
|
|
4
7
|
export declare function blsAggregateSignatures(signatures: Uint8Array[]): Uint8Array;
|
|
8
|
+
export declare function blsRecoverDistributedPubkeyFromShares(pubshares: Uint8Array[], threshold: number): Uint8Array | null;
|
|
9
|
+
export declare function blsVerifyExtraShares(pubshares: Uint8Array[], threshold: number, distributedPubkey: Uint8Array): boolean;
|
|
@@ -25,3 +25,16 @@ export declare class UnsupportedChainError extends Error {
|
|
|
25
25
|
name: string;
|
|
26
26
|
constructor(chainId: number, operation: string);
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Thrown when full lock validation (`validateClusterLock` worker path) exceeds
|
|
30
|
+
* the worker time limit (large clusters). HTTP gateways should respond with
|
|
31
|
+
* **504**; this is distinct from cryptographic failure (**false** → **400**).
|
|
32
|
+
*/
|
|
33
|
+
export declare class ClusterLockValidationTimeoutError extends Error {
|
|
34
|
+
readonly timeoutMs: number;
|
|
35
|
+
name: string;
|
|
36
|
+
/**
|
|
37
|
+
* @param timeoutMs - Same value as SDK whole-lock validation worker timeout.
|
|
38
|
+
*/
|
|
39
|
+
constructor(timeoutMs: number);
|
|
40
|
+
}
|
|
@@ -9,7 +9,7 @@ export * from './services.js';
|
|
|
9
9
|
export * from './verification/signature-validator.js';
|
|
10
10
|
export * from './verification/common.js';
|
|
11
11
|
export * from './constants.js';
|
|
12
|
-
export { ConflictError, SignerRequiredError, UnsupportedChainError, } from './errors.js';
|
|
12
|
+
export { ConflictError, ClusterLockValidationTimeoutError, SignerRequiredError, UnsupportedChainError, } from './errors.js';
|
|
13
13
|
export { Incentives } from './incentives/incentives.js';
|
|
14
14
|
export { Exit } from './exits/exit.js';
|
|
15
15
|
export { ObolSplits } from './splits/splits.js';
|
|
@@ -16,7 +16,10 @@ import { type SafeRpcUrl, type ClusterLock } from './types.js';
|
|
|
16
16
|
* @param safeRpcUrl - Optional RPC URL for Safe Wallet signature verification.
|
|
17
17
|
* If omitted, falls back to the `RPC_MAINNET` / `RPC_HOODI` / etc. env vars.
|
|
18
18
|
* @returns `true` if the lock is cryptographically valid; `false` if invalid
|
|
19
|
-
* (e.g. missing keys, invalid signatures, hash mismatches)
|
|
19
|
+
* (e.g. missing keys, invalid signatures, hash mismatches).
|
|
20
|
+
* @throws `ClusterLockValidationTimeoutError` when whole-lock validation
|
|
21
|
+
* exceeds the SDK worker deadline (typically large clusters). HTTP APIs should map
|
|
22
|
+
* this to **504 Gateway Timeout**.
|
|
20
23
|
*
|
|
21
24
|
* @example
|
|
22
25
|
* ```typescript
|
|
@@ -241,6 +241,12 @@ export type BuilderRegistration = {
|
|
|
241
241
|
/** BLS signature of the builder registration message. */
|
|
242
242
|
signature: string;
|
|
243
243
|
};
|
|
244
|
+
/** Pubkey + message + signature checked together in batch BLS verification. */
|
|
245
|
+
export type BlsSignatureCheck = {
|
|
246
|
+
pubkey: Uint8Array;
|
|
247
|
+
message: Uint8Array;
|
|
248
|
+
signature: Uint8Array;
|
|
249
|
+
};
|
|
244
250
|
/**
|
|
245
251
|
* Required deposit data for validator activation
|
|
246
252
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ClusterDefinition, type ClusterLock, type DepositData, type DistributedValidator, type SafeRpcUrl } from '../types.js';
|
|
1
|
+
import { type BlsSignatureCheck, type ClusterDefinition, type ClusterLock, type DepositData, type DistributedValidator, type SafeRpcUrl } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* @param cluster The cluster configuration or the cluster definition
|
|
4
4
|
* @param configOnly a boolean to indicate config hash or definition hash
|
|
@@ -11,21 +11,40 @@ export declare const clusterConfigOrDefinitionHash: (cluster: ClusterDefinition,
|
|
|
11
11
|
* @returns The cluster lock hash in of the corresponding cluster lock
|
|
12
12
|
*/
|
|
13
13
|
export declare const clusterLockHash: (clusterLock: ClusterLock) => string;
|
|
14
|
+
export declare const depositDomainForFork: (forkVersion: string) => Uint8Array;
|
|
15
|
+
export declare const builderDomainForFork: (forkVersion: string) => Uint8Array;
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
* Structural deposit checks + signing root (no BLS). Used before batch BLS verify.
|
|
18
|
+
*/
|
|
19
|
+
export declare const validateDepositDataStructure: (distributedPublicKey: string, depositData: Partial<DepositData>, withdrawalAddress: string, forkVersion: string, compounding?: boolean, precomputedDepositDomain?: Uint8Array) => {
|
|
20
|
+
valid: boolean;
|
|
21
|
+
message: Uint8Array;
|
|
22
|
+
};
|
|
23
|
+
/** Deposit fields + BLS triple for batch verification. Returns null if structure is invalid. */
|
|
24
|
+
export declare const depositBlsCheck: (distributedPublicKey: string, depositData: Partial<DepositData>, withdrawalAddress: string, forkVersion: string, compounding?: boolean, precomputedDepositDomain?: Uint8Array) => BlsSignatureCheck | null;
|
|
25
|
+
/**
|
|
26
|
+
* Verify deposit data withdrawal credintials and signature (structure + BLS in one call).
|
|
27
|
+
* Prefer `depositBlsCheck` + batch verify in lock validation for large locks.
|
|
20
28
|
*/
|
|
21
29
|
export declare const verifyDepositData: (distributedPublicKey: string, depositData: Partial<DepositData>, withdrawalAddress: string, forkVersion: string, compounding?: boolean) => {
|
|
22
30
|
isValidDepositData: boolean;
|
|
23
31
|
depositDataMsg: Uint8Array;
|
|
24
32
|
};
|
|
25
|
-
export declare const verifyBuilderRegistration: (validator: DistributedValidator, feeRecipientAddress: string, forkVersion: string) => {
|
|
33
|
+
export declare const verifyBuilderRegistration: (validator: DistributedValidator, feeRecipientAddress: string, forkVersion: string, precomputedBuilderDomain?: Uint8Array) => {
|
|
26
34
|
isValidBuilderRegistration: boolean;
|
|
27
35
|
builderRegistrationMsg: Uint8Array;
|
|
28
36
|
};
|
|
37
|
+
/** Builder registration BLS triple for batch verification. Returns null if structure is invalid. */
|
|
38
|
+
export declare const builderBlsCheck: (validator: DistributedValidator, feeRecipientAddress: string, forkVersion: string, precomputedBuilderDomain?: Uint8Array) => BlsSignatureCheck | null;
|
|
29
39
|
export declare const verifyNodeSignatures: (clusterLock: ClusterLock) => boolean;
|
|
30
40
|
export declare const signingRoot: (domain: Uint8Array, messageBuffer: Buffer) => Uint8Array;
|
|
41
|
+
/**
|
|
42
|
+
* Returns true iff every validator's distributed_public_key is unique across
|
|
43
|
+
* the lock. Normalizes hex case (charon emits lowercase today, but mixed-case
|
|
44
|
+
* copies shouldn't sneak through). Exported so it can be unit-tested
|
|
45
|
+
* independently of the rest of validateClusterLock — a tampered lock that
|
|
46
|
+
* trips a downstream check (signature_aggregate, node sigs) cannot isolate
|
|
47
|
+
* this branch.
|
|
48
|
+
*/
|
|
49
|
+
export declare const hasUniqueDistributedKeys: (clusterLock: ClusterLock) => boolean;
|
|
31
50
|
export declare const isValidClusterLock: (clusterLock: ClusterLock, safeRpcUrl?: SafeRpcUrl) => Promise<boolean>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ShareBindingInput {
|
|
2
|
+
mode: 'shareBinding';
|
|
3
|
+
shares: string[][];
|
|
4
|
+
distributedKeys: string[];
|
|
5
|
+
threshold: number;
|
|
6
|
+
}
|
|
7
|
+
export interface VerifyBatchInput {
|
|
8
|
+
mode: 'verifyBatch';
|
|
9
|
+
pubkeys: Uint8Array[];
|
|
10
|
+
messages: Uint8Array[];
|
|
11
|
+
signatures: Uint8Array[];
|
|
12
|
+
}
|
|
13
|
+
export interface AggregatePubkeysInput {
|
|
14
|
+
mode: 'aggregatePubkeys';
|
|
15
|
+
pubkeys: Uint8Array[];
|
|
16
|
+
}
|
|
17
|
+
export type WorkerInput = ShareBindingInput | VerifyBatchInput | AggregatePubkeysInput;
|
|
18
|
+
export type WorkerResult = boolean | Uint8Array;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BlsSignatureCheck, ClusterLock, SafeRpcUrl } from '../types.js';
|
|
2
|
+
export declare function verifySharesBinding(shares: string[][], distributedKeys: string[], threshold: number): Promise<boolean>;
|
|
3
|
+
/** Verify deposit + builder BLS signatures collected from `depositBlsCheck` / `builderBlsCheck`. */
|
|
4
|
+
export declare function verifyBlsChecksParallel(checks: BlsSignatureCheck[]): Promise<boolean>;
|
|
5
|
+
export declare function verifyBatchParallel(pubkeys: Uint8Array[], messages: Uint8Array[], signatures: Uint8Array[]): Promise<boolean>;
|
|
6
|
+
export declare function verifyAggregateParallel(pubkeys: Uint8Array[], message: Uint8Array, signature: Uint8Array): Promise<boolean>;
|
|
7
|
+
/**
|
|
8
|
+
* Large locks: run full validation off the main thread (obol-api stays responsive).
|
|
9
|
+
* Returns null when workers are unavailable — caller should use sync validation.
|
|
10
|
+
*/
|
|
11
|
+
export declare function validateClusterLockInWorker(lock: ClusterLock, safeRpcUrl?: SafeRpcUrl): Promise<boolean | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../tsup.config.ts","../../src/ajv.ts","../../src/base.ts","../../src/blsUtils.ts","../../src/bytecodes.ts","../../src/constants.ts","../../src/errors.ts","../../src/index.ts","../../src/schema.ts","../../src/services.ts","../../src/types.ts","../../src/utils.ts","../../src/abi/BatchDeposit.ts","../../src/abi/MerkleDistributorWithDeadline.ts","../../src/abi/Multicall3.ts","../../src/abi/OVM.ts","../../src/abi/OWR.ts","../../src/abi/SplitMain.ts","../../src/abi/splitV2FactoryAbi.ts","../../src/eoa/eoa.ts","../../src/eoa/eoaHelpers.ts","../../src/exits/ethUtils.ts","../../src/exits/exit.ts","../../src/exits/verificationHelpers.ts","../../src/incentives/incentiveHelpers.ts","../../src/incentives/incentives.ts","../../src/splits/splitHelpers.ts","../../src/splits/splits.ts","../../src/verification/common.ts","../../src/verification/signature-validator.ts","../../src/verification/sszTypes.ts","../../src/verification/v1.10.0.ts","../../src/verification/v1.6.0.ts","../../src/verification/v1.7.0.ts","../../src/verification/v1.8.0.ts","../../test/fixtures.ts","../../test/client/ajv.spec.ts","../../test/client/methods.spec.ts","../../test/eoa/eoa.spec.ts","../../test/exit/ethUtils.spec.ts","../../test/exit/exit.spec.ts","../../test/exit/verificationHelpers.spec.ts","../../test/incentives/incentives.spec.ts","../../test/splits/splits.spec.ts"],"version":"5.9.3"}
|
|
1
|
+
{"root":["../../tsup.config.ts","../../src/ajv.ts","../../src/base.ts","../../src/blsUtils.ts","../../src/bytecodes.ts","../../src/constants.ts","../../src/errors.ts","../../src/index.ts","../../src/schema.ts","../../src/services.ts","../../src/types.ts","../../src/utils.ts","../../src/abi/BatchDeposit.ts","../../src/abi/MerkleDistributorWithDeadline.ts","../../src/abi/Multicall3.ts","../../src/abi/OVM.ts","../../src/abi/OWR.ts","../../src/abi/SplitMain.ts","../../src/abi/splitV2FactoryAbi.ts","../../src/eoa/eoa.ts","../../src/eoa/eoaHelpers.ts","../../src/exits/ethUtils.ts","../../src/exits/exit.ts","../../src/exits/verificationHelpers.ts","../../src/incentives/incentiveHelpers.ts","../../src/incentives/incentives.ts","../../src/splits/splitHelpers.ts","../../src/splits/splits.ts","../../src/verification/clusterLockValidationWorker.ts","../../src/verification/common.ts","../../src/verification/lockWorker.ts","../../src/verification/parallelPool.ts","../../src/verification/signature-validator.ts","../../src/verification/sszTypes.ts","../../src/verification/v1.10.0.ts","../../src/verification/v1.6.0.ts","../../src/verification/v1.7.0.ts","../../src/verification/v1.8.0.ts","../../test/fixtures.ts","../../test/client/ajv.spec.ts","../../test/client/methods.spec.ts","../../test/eoa/eoa.spec.ts","../../test/exit/ethUtils.spec.ts","../../test/exit/exit.spec.ts","../../test/exit/verificationHelpers.spec.ts","../../test/incentives/incentives.spec.ts","../../test/splits/splits.spec.ts","../../test/verification/parallelPool.spec.ts"],"version":"5.9.3"}
|
package/package.json
CHANGED