@lodestar/native 0.0.0-stage → 1.51.0-dev.8d8efcbf5f
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/LICENSE +202 -0
- package/README.md +44 -2
- package/package.json +93 -3
- package/src/bindings.js +6 -0
- package/src/bls-verifier.d.ts +62 -0
- package/src/bls-verifier.js +12 -0
- package/src/blst.d.ts +183 -0
- package/src/blst.js +15 -0
- package/src/execution-proof-verifier.d.ts +46 -0
- package/src/execution-proof-verifier.js +17 -0
- package/src/index.d.ts +513 -0
- package/src/index.js +2 -0
- package/src/metrics.d.ts +18 -0
- package/src/metrics.js +8 -0
- package/src/pubkeys.d.ts +59 -0
- package/src/pubkeys.js +72 -0
- package/src/shuffle.d.ts +77 -0
- package/src/shuffle.js +12 -0
- package/src/state-transition.d.ts +11 -0
- package/src/state-transition.js +5 -0
package/src/shuffle.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** Shuffles `out` in place, no allocation. */
|
|
2
|
+
export declare function innerShuffleList(out: Uint32Array, seed: Uint8Array, rounds: number, forwards: boolean): void;
|
|
3
|
+
|
|
4
|
+
export declare function unshuffleList(activeIndices: Uint32Array, seed: Uint8Array, rounds: number): Uint32Array;
|
|
5
|
+
|
|
6
|
+
export declare function computeProposerIndex(
|
|
7
|
+
seed: Uint8Array,
|
|
8
|
+
activeIndices: Uint32Array,
|
|
9
|
+
effectiveBalanceIncrements: Uint16Array,
|
|
10
|
+
randByteCount: 1 | 2,
|
|
11
|
+
maxEffectiveBalance: number,
|
|
12
|
+
effectiveBalanceIncrement: number,
|
|
13
|
+
rounds: number
|
|
14
|
+
): number;
|
|
15
|
+
|
|
16
|
+
export declare function computeSyncCommitteeIndices(
|
|
17
|
+
seed: Uint8Array,
|
|
18
|
+
activeIndices: Uint32Array,
|
|
19
|
+
effectiveBalanceIncrements: Uint16Array,
|
|
20
|
+
randByteCount: 1 | 2,
|
|
21
|
+
syncCommitteeSize: number,
|
|
22
|
+
maxEffectiveBalance: number,
|
|
23
|
+
effectiveBalanceIncrement: number,
|
|
24
|
+
rounds: number
|
|
25
|
+
): Uint32Array;
|
|
26
|
+
|
|
27
|
+
/** Samples the payload timeliness committee for one slot from its (pre-shuffled) indices. */
|
|
28
|
+
export declare function computePtcIndices(
|
|
29
|
+
seed: Uint8Array,
|
|
30
|
+
indices: Uint32Array,
|
|
31
|
+
effectiveBalanceIncrements: Uint16Array,
|
|
32
|
+
ptcSize: number,
|
|
33
|
+
maxEffectiveBalanceElectra: number,
|
|
34
|
+
effectiveBalanceIncrement: number
|
|
35
|
+
): Uint32Array;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Samples the payload timeliness committees for all slots of an epoch from
|
|
39
|
+
* the flat epoch shuffling; `slotOffsets` (length slotsPerEpoch + 1) marks
|
|
40
|
+
* each slot's window. Returns the concatenated per-slot committees
|
|
41
|
+
* (slotsPerEpoch * ptcSize entries).
|
|
42
|
+
*/
|
|
43
|
+
export declare function computePtcIndicesForEpoch(
|
|
44
|
+
epochSeed: Uint8Array,
|
|
45
|
+
startSlot: number,
|
|
46
|
+
slotsPerEpoch: number,
|
|
47
|
+
shuffling: Uint32Array,
|
|
48
|
+
slotOffsets: Uint32Array,
|
|
49
|
+
effectiveBalanceIncrements: Uint16Array,
|
|
50
|
+
ptcSize: number,
|
|
51
|
+
maxEffectiveBalanceElectra: number,
|
|
52
|
+
effectiveBalanceIncrement: number
|
|
53
|
+
): Uint32Array;
|
|
54
|
+
|
|
55
|
+
/** Fills `out` (length = ptc size) instead of allocating a new array. */
|
|
56
|
+
export declare function computePtcIndicesInto(
|
|
57
|
+
out: Uint32Array,
|
|
58
|
+
seed: Uint8Array,
|
|
59
|
+
indices: Uint32Array,
|
|
60
|
+
effectiveBalanceIncrements: Uint16Array,
|
|
61
|
+
maxEffectiveBalanceElectra: number,
|
|
62
|
+
effectiveBalanceIncrement: number
|
|
63
|
+
): void;
|
|
64
|
+
|
|
65
|
+
/** Fills `out` (length = slotsPerEpoch * ptcSize) instead of allocating a new array. */
|
|
66
|
+
export declare function computePtcIndicesForEpochInto(
|
|
67
|
+
out: Uint32Array,
|
|
68
|
+
epochSeed: Uint8Array,
|
|
69
|
+
startSlot: number,
|
|
70
|
+
slotsPerEpoch: number,
|
|
71
|
+
shuffling: Uint32Array,
|
|
72
|
+
slotOffsets: Uint32Array,
|
|
73
|
+
effectiveBalanceIncrements: Uint16Array,
|
|
74
|
+
ptcSize: number,
|
|
75
|
+
maxEffectiveBalanceElectra: number,
|
|
76
|
+
effectiveBalanceIncrement: number
|
|
77
|
+
): void;
|
package/src/shuffle.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import bindings from "./bindings.js";
|
|
2
|
+
|
|
3
|
+
const native = bindings.shuffle;
|
|
4
|
+
|
|
5
|
+
export const innerShuffleList = native.innerShuffleList;
|
|
6
|
+
export const unshuffleList = native.unshuffleList;
|
|
7
|
+
export const computeProposerIndex = native.computeProposerIndex;
|
|
8
|
+
export const computeSyncCommitteeIndices = native.computeSyncCommitteeIndices;
|
|
9
|
+
export const computePtcIndices = native.computePtcIndices;
|
|
10
|
+
export const computePtcIndicesForEpoch = native.computePtcIndicesForEpoch;
|
|
11
|
+
export const computePtcIndicesInto = native.computePtcIndicesInto;
|
|
12
|
+
export const computePtcIndicesForEpochInto = native.computePtcIndicesForEpochInto;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
ProcessSlotsOpts,
|
|
3
|
+
SignedVoluntaryExit,
|
|
4
|
+
TransitionOpts,
|
|
5
|
+
VoluntaryExit,
|
|
6
|
+
VoluntaryExitValidity,
|
|
7
|
+
} from "./index.js";
|
|
8
|
+
export {BeaconConfig, BeaconStateView} from "./index.js";
|
|
9
|
+
|
|
10
|
+
/** Callers must exclude STF operations in this thread until teardown returns. */
|
|
11
|
+
export declare function deinitReusedEpochTransitionCache(): void;
|