@lodestar/native 1.52.0-dev.47827ac6f8 → 1.52.0-dev.50261a81cb
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/package.json +13 -9
- package/src/bls-verifier.d.ts +20 -1
- package/src/committee-pubkeys.d.ts +27 -0
- package/src/committee-pubkeys.js +9 -0
- package/src/index.d.ts +1 -0
- package/src/metrics.d.ts +1 -1
- package/src/pubkeys.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lodestar/native",
|
|
3
|
-
"version": "1.52.0-dev.
|
|
3
|
+
"version": "1.52.0-dev.50261a81cb",
|
|
4
4
|
"description": "Native consensus modules for Lodestar",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/"
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"types": "./src/pubkeys.d.ts",
|
|
24
24
|
"import": "./src/pubkeys.js"
|
|
25
25
|
},
|
|
26
|
+
"./committee-pubkeys": {
|
|
27
|
+
"types": "./src/committee-pubkeys.d.ts",
|
|
28
|
+
"import": "./src/committee-pubkeys.js"
|
|
29
|
+
},
|
|
26
30
|
"./state-transition": {
|
|
27
31
|
"types": "./src/state-transition.d.ts",
|
|
28
32
|
"import": "./src/state-transition.js"
|
|
@@ -90,18 +94,18 @@
|
|
|
90
94
|
},
|
|
91
95
|
"devDependencies": {
|
|
92
96
|
"@chainsafe/benchmark": "2.1.0",
|
|
93
|
-
"@chainsafe/ssz": "^1.9.
|
|
97
|
+
"@chainsafe/ssz": "^1.9.1"
|
|
94
98
|
},
|
|
95
99
|
"publishConfig": {
|
|
96
100
|
"access": "public"
|
|
97
101
|
},
|
|
98
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "e57ee2553cc4fa7b114fddc5e83a1b6a0ebff815",
|
|
99
103
|
"optionalDependencies": {
|
|
100
|
-
"@lodestar/native-aarch64-apple-darwin": "1.52.0-dev.
|
|
101
|
-
"@lodestar/native-aarch64-unknown-linux-gnu": "1.52.0-dev.
|
|
102
|
-
"@lodestar/native-aarch64-unknown-linux-musl": "1.52.0-dev.
|
|
103
|
-
"@lodestar/native-x86_64-apple-darwin": "1.52.0-dev.
|
|
104
|
-
"@lodestar/native-x86_64-unknown-linux-gnu": "1.52.0-dev.
|
|
105
|
-
"@lodestar/native-x86_64-unknown-linux-musl": "1.52.0-dev.
|
|
104
|
+
"@lodestar/native-aarch64-apple-darwin": "1.52.0-dev.50261a81cb",
|
|
105
|
+
"@lodestar/native-aarch64-unknown-linux-gnu": "1.52.0-dev.50261a81cb",
|
|
106
|
+
"@lodestar/native-aarch64-unknown-linux-musl": "1.52.0-dev.50261a81cb",
|
|
107
|
+
"@lodestar/native-x86_64-apple-darwin": "1.52.0-dev.50261a81cb",
|
|
108
|
+
"@lodestar/native-x86_64-unknown-linux-gnu": "1.52.0-dev.50261a81cb",
|
|
109
|
+
"@lodestar/native-x86_64-unknown-linux-musl": "1.52.0-dev.50261a81cb"
|
|
106
110
|
}
|
|
107
111
|
}
|
package/src/bls-verifier.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const BLS_VERIFIER_SET_TYPE: {
|
|
|
2
2
|
readonly indexed: 0;
|
|
3
3
|
readonly aggregate: 1;
|
|
4
4
|
readonly single: 2;
|
|
5
|
+
readonly committee: 3;
|
|
5
6
|
};
|
|
6
7
|
|
|
7
8
|
export declare const BLS_VERIFIER_MAX_BATCH_SIZE: 256;
|
|
@@ -30,7 +31,25 @@ export type SingleSignatureSet = {
|
|
|
30
31
|
signature: Uint8Array;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
/**
|
|
35
|
+
* An attestation over whole committees of one slot, verified with the committee pubkeys from
|
|
36
|
+
* `computeCommitteePubkeys()`. Its aggregation bits are concatenated in `committeeIndices` order. `indices` lists the
|
|
37
|
+
* participants and is aggregated instead when the entry is not cached. Only the participant count is checked, so
|
|
38
|
+
* callers must derive `indices` and the aggregation bits from the same attestation.
|
|
39
|
+
*/
|
|
40
|
+
export type CommitteeSignatureSet = {
|
|
41
|
+
type: typeof BLS_VERIFIER_SET_TYPE.committee;
|
|
42
|
+
indices: Uint32Array;
|
|
43
|
+
committeePubkeysId: number;
|
|
44
|
+
slot: number;
|
|
45
|
+
committeeIndices: Uint32Array;
|
|
46
|
+
aggregationBits: Uint8Array;
|
|
47
|
+
bitLen: number;
|
|
48
|
+
message: Uint8Array;
|
|
49
|
+
signature: Uint8Array;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type BlsSignatureSet = IndexedSignatureSet | AggregateSignatureSet | SingleSignatureSet | CommitteeSignatureSet;
|
|
34
53
|
|
|
35
54
|
export type SameMessageSignatureSet = {
|
|
36
55
|
index: number;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregate pubkeys of the beacon committees of an epoch shuffling, held in native memory. Signature sets reference an
|
|
3
|
+
* entry by id, so BLS worker threads can use it too.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/** Entries the cache holds at most, counting computations in flight. */
|
|
7
|
+
export declare const COMMITTEE_PUBKEYS_MAX_ENTRIES: number;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Aggregate the pubkeys of every committee of a shuffling on a libuv worker thread and resolve to the entry id.
|
|
11
|
+
* `shuffling` is the shuffled active validator indices, and it is copied before this returns. Throws when
|
|
12
|
+
* `COMMITTEE_PUBKEYS_MAX_ENTRIES` entries are cached or being computed.
|
|
13
|
+
*/
|
|
14
|
+
export declare function computeCommitteePubkeys(
|
|
15
|
+
shuffling: Uint32Array,
|
|
16
|
+
slotsPerEpoch: number,
|
|
17
|
+
committeesPerSlot: number
|
|
18
|
+
): Promise<number>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Free an entry. Returns false if `id` is unknown. A signature set that still references it falls back to its
|
|
22
|
+
* participant indices.
|
|
23
|
+
*/
|
|
24
|
+
export declare function releaseCommitteePubkeys(id: number): boolean;
|
|
25
|
+
|
|
26
|
+
/** Number of cached entries. */
|
|
27
|
+
export declare function committeePubkeysCount(): number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import bindings from "./bindings.js";
|
|
2
|
+
|
|
3
|
+
const native = bindings.committeePubkeys;
|
|
4
|
+
|
|
5
|
+
export const COMMITTEE_PUBKEYS_MAX_ENTRIES = native.MAX_ENTRIES;
|
|
6
|
+
|
|
7
|
+
export const computeCommitteePubkeys = native.compute;
|
|
8
|
+
export const releaseCommitteePubkeys = native.release;
|
|
9
|
+
export const committeePubkeysCount = native.size;
|
package/src/index.d.ts
CHANGED
|
@@ -322,6 +322,7 @@ export declare class BeaconStateView {
|
|
|
322
322
|
builderPendingWithdrawals: BuilderPendingWithdrawal[];
|
|
323
323
|
getBuilder(index: number): Builder;
|
|
324
324
|
canBuilderCoverBid(builderIndex: number, bidAmount: number): boolean;
|
|
325
|
+
getBuilderBidLimit(builderIndex: number): number;
|
|
325
326
|
getEpochPTCs(epoch: number): Uint32Array[];
|
|
326
327
|
getPayloadTimelinessCommittee(slot: number): Uint32Array;
|
|
327
328
|
getInclusionListCommittee(slot: number): Uint32Array;
|
package/src/metrics.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function registerLocalValidator(index: number): void;
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Remove a validator index from the native validator monitor, so its
|
|
15
|
-
* `
|
|
15
|
+
* `validator_monitor_*` status metrics stop being recorded. Mirrors the pruning
|
|
16
16
|
* of stale registrations in lodestar's validator monitor.
|
|
17
17
|
*/
|
|
18
18
|
export declare function unregisterLocalValidator(index: number): void;
|
package/src/pubkeys.d.ts
CHANGED
|
@@ -48,7 +48,10 @@ export interface PubkeyCache {
|
|
|
48
48
|
* recorded in the file is discarded above this limit.
|
|
49
49
|
*/
|
|
50
50
|
load(filepath: string, maxCapacity: number): void;
|
|
51
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Testing-only reset from the control environment while no workers are using the cache.
|
|
53
|
+
* Also drops the committee pubkeys aggregated from the cleared keys.
|
|
54
|
+
*/
|
|
52
55
|
reset(): void;
|
|
53
56
|
/** Save from the control environment. */
|
|
54
57
|
save(filepath: string): void;
|