@lodestar/types 1.50.1 → 1.51.0-dev.0586e6e617
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/lib/altair/index.d.ts +1 -1
- package/lib/altair/index.d.ts.map +1 -1
- package/lib/altair/index.js +1 -1
- package/lib/altair/index.js.map +1 -1
- package/lib/bellatrix/index.d.ts +1 -1
- package/lib/bellatrix/index.d.ts.map +1 -1
- package/lib/bellatrix/index.js +1 -1
- package/lib/bellatrix/index.js.map +1 -1
- package/lib/bellatrix/sszTypes.d.ts +7 -7
- package/lib/bellatrix/sszTypes.d.ts.map +1 -1
- package/lib/bellatrix/sszTypes.js +2 -2
- package/lib/bellatrix/sszTypes.js.map +1 -1
- package/lib/capella/index.d.ts +1 -1
- package/lib/capella/index.d.ts.map +1 -1
- package/lib/capella/index.js +1 -1
- package/lib/capella/index.js.map +1 -1
- package/lib/capella/sszTypes.d.ts +5 -5
- package/lib/deneb/index.d.ts +1 -1
- package/lib/deneb/index.d.ts.map +1 -1
- package/lib/deneb/index.js +1 -1
- package/lib/deneb/index.js.map +1 -1
- package/lib/deneb/sszTypes.d.ts +8 -8
- package/lib/eip8025/index.d.ts +5 -0
- package/lib/eip8025/index.d.ts.map +1 -0
- package/lib/eip8025/index.js +5 -0
- package/lib/eip8025/index.js.map +1 -0
- package/lib/eip8025/sszTypes.d.ts +34 -0
- package/lib/eip8025/sszTypes.d.ts.map +1 -0
- package/lib/eip8025/sszTypes.js +28 -0
- package/lib/eip8025/sszTypes.js.map +1 -0
- package/lib/eip8025/types.d.ts +9 -0
- package/lib/eip8025/types.d.ts.map +1 -0
- package/lib/eip8025/types.js +2 -0
- package/lib/eip8025/types.js.map +1 -0
- package/lib/electra/index.d.ts +1 -1
- package/lib/electra/index.d.ts.map +1 -1
- package/lib/electra/index.js +1 -1
- package/lib/electra/index.js.map +1 -1
- package/lib/electra/sszTypes.d.ts +7 -7
- package/lib/fulu/index.d.ts +1 -1
- package/lib/fulu/index.d.ts.map +1 -1
- package/lib/fulu/index.js +1 -1
- package/lib/fulu/index.js.map +1 -1
- package/lib/fulu/sszTypes.d.ts +5 -5
- package/lib/gloas/index.d.ts +1 -1
- package/lib/gloas/index.d.ts.map +1 -1
- package/lib/gloas/index.js +1 -1
- package/lib/gloas/index.js.map +1 -1
- package/lib/gloas/sszTypes.d.ts +8 -8
- package/lib/gloas/sszTypes.d.ts.map +1 -1
- package/lib/gloas/sszTypes.js +2 -2
- package/lib/gloas/sszTypes.js.map +1 -1
- package/lib/gloas/types.d.ts +3 -0
- package/lib/gloas/types.d.ts.map +1 -1
- package/lib/heze/index.d.ts +1 -1
- package/lib/heze/index.d.ts.map +1 -1
- package/lib/heze/index.js +1 -1
- package/lib/heze/index.js.map +1 -1
- package/lib/heze/sszTypes.d.ts +5 -73
- package/lib/heze/sszTypes.d.ts.map +1 -1
- package/lib/heze/sszTypes.js +12 -6
- package/lib/heze/sszTypes.js.map +1 -1
- package/lib/heze/types.d.ts +3 -0
- package/lib/heze/types.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/phase0/index.d.ts +1 -1
- package/lib/phase0/index.d.ts.map +1 -1
- package/lib/phase0/index.js +1 -1
- package/lib/phase0/index.js.map +1 -1
- package/lib/primitive/index.d.ts +1 -1
- package/lib/primitive/index.d.ts.map +1 -1
- package/lib/primitive/index.js +1 -1
- package/lib/primitive/index.js.map +1 -1
- package/lib/sszTypes.d.ts +124 -258
- package/lib/sszTypes.d.ts.map +1 -1
- package/lib/sszTypes.js +2 -0
- package/lib/sszTypes.js.map +1 -1
- package/lib/types.d.ts +3 -2
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +1 -0
- package/lib/types.js.map +1 -1
- package/lib/utils/typeguards.d.ts +2 -2
- package/lib/utils/typeguards.d.ts.map +1 -1
- package/lib/utils/typeguards.js +1 -1
- package/lib/utils/typeguards.js.map +1 -1
- package/package.json +4 -4
- package/src/altair/index.ts +2 -1
- package/src/bellatrix/index.ts +2 -1
- package/src/bellatrix/sszTypes.ts +2 -2
- package/src/capella/index.ts +2 -1
- package/src/deneb/index.ts +2 -1
- package/src/eip8025/index.ts +6 -0
- package/src/eip8025/sszTypes.ts +46 -0
- package/src/eip8025/types.ts +9 -0
- package/src/electra/index.ts +2 -1
- package/src/fulu/index.ts +2 -1
- package/src/gloas/index.ts +2 -1
- package/src/gloas/sszTypes.ts +2 -1
- package/src/gloas/types.ts +1 -0
- package/src/heze/index.ts +2 -1
- package/src/heze/sszTypes.ts +18 -6
- package/src/heze/types.ts +1 -0
- package/src/index.ts +1 -1
- package/src/phase0/index.ts +2 -1
- package/src/primitive/index.ts +2 -1
- package/src/sszTypes.ts +2 -0
- package/src/types.ts +3 -2
- package/src/utils/typeguards.ts +3 -2
package/src/heze/sszTypes.ts
CHANGED
|
@@ -5,8 +5,8 @@ import {ssz as primitiveSsz} from "../primitive/index.js";
|
|
|
5
5
|
|
|
6
6
|
const {Slot, Root, BLSSignature, ValidatorIndex} = primitiveSsz;
|
|
7
7
|
|
|
8
|
-
function activeFields(count: number): boolean[] {
|
|
9
|
-
return Array.from({length: count}, () =>
|
|
8
|
+
function activeFields(count: number, gaps: number[] = []): boolean[] {
|
|
9
|
+
return Array.from({length: count}, (_, index) => !gaps.includes(index));
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const InclusionListCommittee = new VectorBasicType(ValidatorIndex, INCLUSION_LIST_COMMITTEE_SIZE);
|
|
@@ -60,21 +60,33 @@ export const SignedExecutionPayloadBid = new ContainerType(
|
|
|
60
60
|
export const DataColumnSidecar = gloasSsz.DataColumnSidecar;
|
|
61
61
|
export const DataColumnSidecars = gloasSsz.DataColumnSidecars;
|
|
62
62
|
|
|
63
|
+
const {
|
|
64
|
+
eth1Data: _eth1Data,
|
|
65
|
+
eth1DataVotes: _eth1DataVotes,
|
|
66
|
+
eth1DepositIndex: _eth1DepositIndex,
|
|
67
|
+
depositRequestsStartIndex: _depositRequestsStartIndex,
|
|
68
|
+
...gloasBeaconStateFields
|
|
69
|
+
} = gloasSsz.BeaconState.fields;
|
|
70
|
+
|
|
63
71
|
export const BeaconState = new ProgressiveContainerType(
|
|
64
72
|
{
|
|
65
|
-
...
|
|
73
|
+
...gloasBeaconStateFields,
|
|
66
74
|
latestExecutionPayloadBid: ExecutionPayloadBid, // [Modified in Heze:EIP7805]
|
|
67
75
|
},
|
|
68
|
-
|
|
76
|
+
// [Modified in Heze:EIP8015] gaps keep the surviving generalized indices stable
|
|
77
|
+
activeFields(46, [8, 9, 10, 28]),
|
|
69
78
|
{typeName: "BeaconState", jsonCase: "eth2"}
|
|
70
79
|
);
|
|
71
80
|
|
|
81
|
+
const {eth1Data: _bodyEth1Data, deposits: _deposits, ...gloasBeaconBlockBodyFields} = gloasSsz.BeaconBlockBody.fields;
|
|
82
|
+
|
|
72
83
|
export const BeaconBlockBody = new ProgressiveContainerType(
|
|
73
84
|
{
|
|
74
|
-
...
|
|
85
|
+
...gloasBeaconBlockBodyFields,
|
|
75
86
|
signedExecutionPayloadBid: SignedExecutionPayloadBid, // [Modified in Heze:EIP7805]
|
|
76
87
|
},
|
|
77
|
-
|
|
88
|
+
// [Modified in Heze:EIP8015] gaps keep the surviving generalized indices stable
|
|
89
|
+
activeFields(13, [1, 6]),
|
|
78
90
|
{typeName: "BeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
|
|
79
91
|
);
|
|
80
92
|
|
package/src/heze/types.ts
CHANGED
|
@@ -14,4 +14,5 @@ export type BeaconBlockBody = ValueOf<typeof ssz.BeaconBlockBody>;
|
|
|
14
14
|
export type BeaconBlock = ValueOf<typeof ssz.BeaconBlock>;
|
|
15
15
|
export type SignedBeaconBlock = ValueOf<typeof ssz.SignedBeaconBlock>;
|
|
16
16
|
export type BlockContents = ValueOf<typeof ssz.BlockContents>;
|
|
17
|
+
export type SignedBlockContents = {signedBlock: SignedBeaconBlock};
|
|
17
18
|
export type SSEPayloadAttributes = ValueOf<typeof ssz.SSEPayloadAttributes>;
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from "./types.js";
|
|
|
3
3
|
import type {SSZTypesFor} from "./sszTypes.js";
|
|
4
4
|
import * as ssz from "./sszTypes.js";
|
|
5
5
|
import {sszTypesFor} from "./sszTypes.js";
|
|
6
|
-
export {sszTypesFor, SSZTypesFor, ssz};
|
|
7
6
|
|
|
8
7
|
export * from "./utils/array.js";
|
|
9
8
|
// Container utils
|
|
@@ -15,3 +14,4 @@ export {StringType, stringType} from "./utils/stringType.js";
|
|
|
15
14
|
// Typeguards
|
|
16
15
|
export * from "./utils/typeguards.js";
|
|
17
16
|
export * from "./utils/validatorStatus.js";
|
|
17
|
+
export {SSZTypesFor, ssz, sszTypesFor};
|
package/src/phase0/index.ts
CHANGED
package/src/primitive/index.ts
CHANGED
package/src/sszTypes.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {ssz as altairSsz} from "./altair/index.js";
|
|
|
4
4
|
import {ssz as bellatrixSsz} from "./bellatrix/index.js";
|
|
5
5
|
import {ssz as capellaSsz} from "./capella/index.js";
|
|
6
6
|
import {ssz as denebSsz} from "./deneb/index.js";
|
|
7
|
+
import {ssz as eip8025Ssz} from "./eip8025/index.js";
|
|
7
8
|
import {ssz as electraSsz} from "./electra/index.js";
|
|
8
9
|
import {ssz as fuluSsz} from "./fulu/index.js";
|
|
9
10
|
import {ssz as gloasSsz} from "./gloas/index.js";
|
|
@@ -59,6 +60,7 @@ export const electra = typesByFork[ForkName.electra];
|
|
|
59
60
|
export const fulu = typesByFork[ForkName.fulu];
|
|
60
61
|
export const gloas = typesByFork[ForkName.gloas];
|
|
61
62
|
export const heze = typesByFork[ForkName.heze];
|
|
63
|
+
export const eip8025 = eip8025Ssz;
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
66
|
* A type of union of forks must accept as any parameter the UNION of all fork types.
|
package/src/types.ts
CHANGED
|
@@ -23,6 +23,7 @@ export {ts as altair} from "./altair/index.js";
|
|
|
23
23
|
export {ts as bellatrix} from "./bellatrix/index.js";
|
|
24
24
|
export {ts as capella} from "./capella/index.js";
|
|
25
25
|
export {ts as deneb} from "./deneb/index.js";
|
|
26
|
+
export {ts as eip8025} from "./eip8025/index.js";
|
|
26
27
|
export {ts as electra} from "./electra/index.js";
|
|
27
28
|
export {ts as fulu} from "./fulu/index.js";
|
|
28
29
|
export {ts as gloas} from "./gloas/index.js";
|
|
@@ -317,7 +318,7 @@ type TypesByFork = {
|
|
|
317
318
|
SignedBuilderBid: electra.SignedBuilderBid;
|
|
318
319
|
SSEPayloadAttributes: gloas.SSEPayloadAttributes;
|
|
319
320
|
BlockContents: gloas.BlockContents;
|
|
320
|
-
SignedBlockContents:
|
|
321
|
+
SignedBlockContents: gloas.SignedBlockContents;
|
|
321
322
|
ExecutionPayloadAndBlobsBundle: fulu.ExecutionPayloadAndBlobsBundle;
|
|
322
323
|
BlobsBundle: fulu.BlobsBundle;
|
|
323
324
|
SyncCommittee: altair.SyncCommittee;
|
|
@@ -359,7 +360,7 @@ type TypesByFork = {
|
|
|
359
360
|
SignedBuilderBid: electra.SignedBuilderBid;
|
|
360
361
|
SSEPayloadAttributes: heze.SSEPayloadAttributes;
|
|
361
362
|
BlockContents: heze.BlockContents;
|
|
362
|
-
SignedBlockContents:
|
|
363
|
+
SignedBlockContents: heze.SignedBlockContents;
|
|
363
364
|
ExecutionPayloadAndBlobsBundle: fulu.ExecutionPayloadAndBlobsBundle;
|
|
364
365
|
BlobsBundle: fulu.BlobsBundle;
|
|
365
366
|
SyncCommittee: altair.SyncCommittee;
|
package/src/utils/typeguards.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ForkPostDeneb,
|
|
6
6
|
ForkPostElectra,
|
|
7
7
|
ForkPostGloas,
|
|
8
|
+
ForkPreGloas,
|
|
8
9
|
} from "@lodestar/params";
|
|
9
10
|
import {SignedExecutionPayloadEnvelope, SignedExecutionPayloadEnvelopeContents} from "../gloas/types.js";
|
|
10
11
|
import {
|
|
@@ -74,8 +75,8 @@ export function isDenebBlockContents(
|
|
|
74
75
|
|
|
75
76
|
export function isDenebSignedBlockContents(
|
|
76
77
|
data: BeaconBlock | BlockContents | SignedBeaconBlock | SignedBlockContents
|
|
77
|
-
): data is SignedBlockContents<ForkPostDeneb> {
|
|
78
|
-
return
|
|
78
|
+
): data is SignedBlockContents<ForkPostDeneb & ForkPreGloas> {
|
|
79
|
+
return "kzgProofs" in data && data.kzgProofs !== undefined;
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
export function isElectraAttestation(attestation: Attestation): attestation is Attestation<ForkPostElectra> {
|