@lodestar/types 1.46.0-dev.d9bad172a8 → 1.46.0-dev.de5f89eae1
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/sszTypes.d.ts +5 -5
- package/lib/bellatrix/sszTypes.d.ts +8 -8
- package/lib/capella/sszTypes.d.ts +8 -8
- package/lib/deneb/sszTypes.d.ts +10 -10
- package/lib/electra/sszTypes.d.ts +14 -14
- package/lib/electra/sszTypes.d.ts.map +1 -1
- package/lib/electra/sszTypes.js +2 -2
- package/lib/electra/sszTypes.js.map +1 -1
- package/lib/fulu/sszTypes.d.ts +7 -7
- package/lib/gloas/sszTypes.d.ts +8 -8
- package/lib/gloas/sszTypes.js.map +1 -1
- package/lib/heze/index.d.ts +5 -0
- package/lib/heze/index.d.ts.map +1 -0
- package/lib/heze/index.js +5 -0
- package/lib/heze/index.js.map +1 -0
- package/lib/heze/sszTypes.d.ts +1007 -0
- package/lib/heze/sszTypes.d.ts.map +1 -0
- package/lib/heze/sszTypes.js +67 -0
- package/lib/heze/sszTypes.js.map +1 -0
- package/lib/heze/types.d.ts +15 -0
- package/lib/heze/types.d.ts.map +1 -0
- package/lib/heze/types.js +2 -0
- package/lib/heze/types.js.map +1 -0
- package/lib/phase0/sszTypes.d.ts +7 -7
- package/lib/phase0/sszTypes.d.ts.map +1 -1
- package/lib/phase0/sszTypes.js +2 -1
- package/lib/phase0/sszTypes.js.map +1 -1
- package/lib/phase0/validator.d.ts.map +1 -1
- package/lib/phase0/validator.js.map +1 -1
- package/lib/sszTypes.d.ts +10689 -4421
- package/lib/sszTypes.d.ts.map +1 -1
- package/lib/sszTypes.js +13 -0
- package/lib/sszTypes.js.map +1 -1
- package/lib/types.d.ts +43 -0
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js +2 -2
- package/lib/types.js.map +1 -1
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/container.js.map +1 -1
- package/lib/utils/executionAddress.js.map +1 -1
- package/lib/utils/stringType.js.map +1 -1
- package/lib/utils/typeguards.js.map +1 -1
- package/lib/utils/validatorStatus.js.map +1 -1
- package/package.json +5 -5
- package/src/electra/sszTypes.ts +2 -1
- package/src/heze/index.ts +5 -0
- package/src/heze/sszTypes.ts +128 -0
- package/src/heze/types.ts +17 -0
- package/src/phase0/sszTypes.ts +2 -1
- package/src/sszTypes.ts +13 -0
- package/src/types.ts +43 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BitVectorType,
|
|
3
|
+
ContainerType,
|
|
4
|
+
ProgressiveContainerType,
|
|
5
|
+
ProgressiveListCompositeType,
|
|
6
|
+
VectorBasicType,
|
|
7
|
+
} from "@chainsafe/ssz";
|
|
8
|
+
import {INCLUSION_LIST_COMMITTEE_SIZE} from "@lodestar/params";
|
|
9
|
+
import {ssz as gloasSsz} from "../gloas/index.js";
|
|
10
|
+
import {ssz as primitiveSsz} from "../primitive/index.js";
|
|
11
|
+
|
|
12
|
+
const {Slot, Root, BLSSignature, ValidatorIndex} = primitiveSsz;
|
|
13
|
+
|
|
14
|
+
function activeFields(count: number): boolean[] {
|
|
15
|
+
return Array.from({length: count}, () => true);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const InclusionListCommittee = new VectorBasicType(ValidatorIndex, INCLUSION_LIST_COMMITTEE_SIZE);
|
|
19
|
+
|
|
20
|
+
export const InclusionListTransactions = new ProgressiveListCompositeType(gloasSsz.Transaction, {
|
|
21
|
+
typeName: "InclusionListTransactions",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const InclusionList = new ContainerType(
|
|
25
|
+
{
|
|
26
|
+
slot: Slot,
|
|
27
|
+
validatorIndex: ValidatorIndex,
|
|
28
|
+
inclusionListCommitteeRoot: Root,
|
|
29
|
+
transactions: InclusionListTransactions,
|
|
30
|
+
},
|
|
31
|
+
{typeName: "InclusionList", jsonCase: "eth2"}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export const SignedInclusionList = new ContainerType(
|
|
35
|
+
{
|
|
36
|
+
message: InclusionList,
|
|
37
|
+
signature: BLSSignature,
|
|
38
|
+
},
|
|
39
|
+
{typeName: "SignedInclusionList", jsonCase: "eth2"}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
export const InclusionListsByIndicesRequest = new ContainerType(
|
|
43
|
+
{
|
|
44
|
+
slot: Slot,
|
|
45
|
+
inclusionListCommitteeRoot: Root,
|
|
46
|
+
indices: new BitVectorType(INCLUSION_LIST_COMMITTEE_SIZE),
|
|
47
|
+
},
|
|
48
|
+
{typeName: "InclusionListsByIndicesRequest", jsonCase: "eth2"}
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export const ExecutionPayloadBid = new ProgressiveContainerType(
|
|
52
|
+
{
|
|
53
|
+
...gloasSsz.ExecutionPayloadBid.fields,
|
|
54
|
+
inclusionListBits: new BitVectorType(INCLUSION_LIST_COMMITTEE_SIZE), // [New in Heze:EIP7805]
|
|
55
|
+
},
|
|
56
|
+
activeFields(13),
|
|
57
|
+
{typeName: "ExecutionPayloadBid", jsonCase: "eth2"}
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export const SignedExecutionPayloadBid = new ContainerType(
|
|
61
|
+
{
|
|
62
|
+
message: ExecutionPayloadBid, // [Modified in Heze:EIP7805]
|
|
63
|
+
signature: BLSSignature,
|
|
64
|
+
},
|
|
65
|
+
{typeName: "SignedExecutionPayloadBid", jsonCase: "eth2"}
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export const DataColumnSidecar = gloasSsz.DataColumnSidecar;
|
|
69
|
+
export const DataColumnSidecars = gloasSsz.DataColumnSidecars;
|
|
70
|
+
|
|
71
|
+
export const BeaconState = new ProgressiveContainerType(
|
|
72
|
+
{
|
|
73
|
+
...gloasSsz.BeaconState.fields,
|
|
74
|
+
latestExecutionPayloadBid: ExecutionPayloadBid, // [Modified in Heze:EIP7805]
|
|
75
|
+
},
|
|
76
|
+
activeFields(46),
|
|
77
|
+
{typeName: "BeaconState", jsonCase: "eth2"}
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export const BeaconBlockBody = new ProgressiveContainerType(
|
|
81
|
+
{
|
|
82
|
+
...gloasSsz.BeaconBlockBody.fields,
|
|
83
|
+
signedExecutionPayloadBid: SignedExecutionPayloadBid, // [Modified in Heze:EIP7805]
|
|
84
|
+
},
|
|
85
|
+
activeFields(13),
|
|
86
|
+
{typeName: "BeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
export const BeaconBlock = new ContainerType(
|
|
90
|
+
{
|
|
91
|
+
...gloasSsz.BeaconBlock.fields,
|
|
92
|
+
body: BeaconBlockBody,
|
|
93
|
+
},
|
|
94
|
+
{typeName: "BeaconBlock", jsonCase: "eth2", cachePermanentRootStruct: true}
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
export const SignedBeaconBlock = new ContainerType(
|
|
98
|
+
{
|
|
99
|
+
message: BeaconBlock,
|
|
100
|
+
signature: BLSSignature,
|
|
101
|
+
},
|
|
102
|
+
{typeName: "SignedBeaconBlock", jsonCase: "eth2"}
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
export const BlockContents = new ContainerType(
|
|
106
|
+
{
|
|
107
|
+
...gloasSsz.BlockContents.fields,
|
|
108
|
+
block: BeaconBlock,
|
|
109
|
+
},
|
|
110
|
+
{typeName: "BlockContents", jsonCase: "eth2"}
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// PayloadAttributes primarily for SSE event
|
|
114
|
+
export const PayloadAttributes = new ContainerType(
|
|
115
|
+
{
|
|
116
|
+
...gloasSsz.PayloadAttributes.fields,
|
|
117
|
+
inclusionListTransactions: InclusionListTransactions, // [New in Heze:EIP7805]
|
|
118
|
+
},
|
|
119
|
+
{typeName: "PayloadAttributes", jsonCase: "eth2"}
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
export const SSEPayloadAttributes = new ContainerType(
|
|
123
|
+
{
|
|
124
|
+
...gloasSsz.SSEPayloadAttributes.fields,
|
|
125
|
+
payloadAttributes: PayloadAttributes, // [Modified in Heze:EIP7805]
|
|
126
|
+
},
|
|
127
|
+
{typeName: "SSEPayloadAttributes", jsonCase: "eth2"}
|
|
128
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {ValueOf} from "@chainsafe/ssz";
|
|
2
|
+
import * as ssz from "./sszTypes.js";
|
|
3
|
+
|
|
4
|
+
export type InclusionListCommittee = ValueOf<typeof ssz.InclusionListCommittee>;
|
|
5
|
+
export type InclusionList = ValueOf<typeof ssz.InclusionList>;
|
|
6
|
+
export type SignedInclusionList = ValueOf<typeof ssz.SignedInclusionList>;
|
|
7
|
+
export type InclusionListsByIndicesRequest = ValueOf<typeof ssz.InclusionListsByIndicesRequest>;
|
|
8
|
+
|
|
9
|
+
export type ExecutionPayloadBid = ValueOf<typeof ssz.ExecutionPayloadBid>;
|
|
10
|
+
export type SignedExecutionPayloadBid = ValueOf<typeof ssz.SignedExecutionPayloadBid>;
|
|
11
|
+
|
|
12
|
+
export type BeaconState = ValueOf<typeof ssz.BeaconState>;
|
|
13
|
+
export type BeaconBlockBody = ValueOf<typeof ssz.BeaconBlockBody>;
|
|
14
|
+
export type BeaconBlock = ValueOf<typeof ssz.BeaconBlock>;
|
|
15
|
+
export type SignedBeaconBlock = ValueOf<typeof ssz.SignedBeaconBlock>;
|
|
16
|
+
export type BlockContents = ValueOf<typeof ssz.BlockContents>;
|
|
17
|
+
export type SSEPayloadAttributes = ValueOf<typeof ssz.SSEPayloadAttributes>;
|
package/src/phase0/sszTypes.ts
CHANGED
|
@@ -146,7 +146,8 @@ export const DepositEvent = new ContainerType(
|
|
|
146
146
|
export const Eth1Data = new ContainerType(
|
|
147
147
|
{
|
|
148
148
|
depositRoot: Root,
|
|
149
|
-
|
|
149
|
+
// Proposer can set any value, must cover the full uint64 range
|
|
150
|
+
depositCount: UintBn64,
|
|
150
151
|
blockHash: Bytes32,
|
|
151
152
|
},
|
|
152
153
|
{typeName: "Eth1Data", jsonCase: "eth2"}
|
package/src/sszTypes.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {ssz as denebSsz} from "./deneb/index.js";
|
|
|
7
7
|
import {ssz as electraSsz} from "./electra/index.js";
|
|
8
8
|
import {ssz as fuluSsz} from "./fulu/index.js";
|
|
9
9
|
import {ssz as gloasSsz} from "./gloas/index.js";
|
|
10
|
+
import {ssz as hezeSsz} from "./heze/index.js";
|
|
10
11
|
import {ssz as phase0Ssz} from "./phase0/index.js";
|
|
11
12
|
|
|
12
13
|
export * from "./primitive/sszTypes.js";
|
|
@@ -33,6 +34,17 @@ const typesByFork = {
|
|
|
33
34
|
...fuluSsz,
|
|
34
35
|
...gloasSsz,
|
|
35
36
|
},
|
|
37
|
+
[ForkName.heze]: {
|
|
38
|
+
...phase0Ssz,
|
|
39
|
+
...altairSsz,
|
|
40
|
+
...bellatrixSsz,
|
|
41
|
+
...capellaSsz,
|
|
42
|
+
...denebSsz,
|
|
43
|
+
...electraSsz,
|
|
44
|
+
...fuluSsz,
|
|
45
|
+
...gloasSsz,
|
|
46
|
+
...hezeSsz,
|
|
47
|
+
},
|
|
36
48
|
};
|
|
37
49
|
|
|
38
50
|
// Export these types to ensure that each fork is a superset of the previous one (with overridden types obviously)
|
|
@@ -46,6 +58,7 @@ export const deneb = typesByFork[ForkName.deneb];
|
|
|
46
58
|
export const electra = typesByFork[ForkName.electra];
|
|
47
59
|
export const fulu = typesByFork[ForkName.fulu];
|
|
48
60
|
export const gloas = typesByFork[ForkName.gloas];
|
|
61
|
+
export const heze = typesByFork[ForkName.heze];
|
|
49
62
|
|
|
50
63
|
/**
|
|
51
64
|
* A type of union of forks must accept as any parameter the UNION of all fork types.
|
package/src/types.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {ts as deneb} from "./deneb/index.js";
|
|
|
15
15
|
import {ts as electra} from "./electra/index.js";
|
|
16
16
|
import {ts as fulu} from "./fulu/index.js";
|
|
17
17
|
import {ts as gloas} from "./gloas/index.js";
|
|
18
|
+
import {ts as heze} from "./heze/index.js";
|
|
18
19
|
import {ts as phase0} from "./phase0/index.js";
|
|
19
20
|
import {Slot} from "./primitive/types.js";
|
|
20
21
|
|
|
@@ -25,6 +26,7 @@ export {ts as deneb} from "./deneb/index.js";
|
|
|
25
26
|
export {ts as electra} from "./electra/index.js";
|
|
26
27
|
export {ts as fulu} from "./fulu/index.js";
|
|
27
28
|
export {ts as gloas} from "./gloas/index.js";
|
|
29
|
+
export {ts as heze} from "./heze/index.js";
|
|
28
30
|
export {ts as phase0} from "./phase0/index.js";
|
|
29
31
|
export * from "./primitive/types.js";
|
|
30
32
|
|
|
@@ -326,6 +328,47 @@ type TypesByFork = {
|
|
|
326
328
|
DataColumnSidecar: gloas.DataColumnSidecar;
|
|
327
329
|
DataColumnSidecars: gloas.DataColumnSidecars;
|
|
328
330
|
};
|
|
331
|
+
[ForkName.heze]: {
|
|
332
|
+
BeaconBlockHeader: phase0.BeaconBlockHeader;
|
|
333
|
+
SignedBeaconBlockHeader: phase0.SignedBeaconBlockHeader;
|
|
334
|
+
BeaconBlock: heze.BeaconBlock;
|
|
335
|
+
BeaconBlockBody: heze.BeaconBlockBody;
|
|
336
|
+
BeaconState: heze.BeaconState;
|
|
337
|
+
SignedBeaconBlock: heze.SignedBeaconBlock;
|
|
338
|
+
Metadata: fulu.Metadata;
|
|
339
|
+
Status: fulu.Status;
|
|
340
|
+
LightClientHeader: gloas.LightClientHeader;
|
|
341
|
+
LightClientBootstrap: gloas.LightClientBootstrap;
|
|
342
|
+
LightClientUpdate: gloas.LightClientUpdate;
|
|
343
|
+
LightClientFinalityUpdate: gloas.LightClientFinalityUpdate;
|
|
344
|
+
LightClientOptimisticUpdate: gloas.LightClientOptimisticUpdate;
|
|
345
|
+
LightClientStore: gloas.LightClientStore;
|
|
346
|
+
BlindedBeaconBlock: electra.BlindedBeaconBlock;
|
|
347
|
+
BlindedBeaconBlockBody: electra.BlindedBeaconBlockBody;
|
|
348
|
+
SignedBlindedBeaconBlock: electra.SignedBlindedBeaconBlock;
|
|
349
|
+
ExecutionPayload: gloas.ExecutionPayload;
|
|
350
|
+
ExecutionPayloadHeader: deneb.ExecutionPayloadHeader;
|
|
351
|
+
BuilderBid: electra.BuilderBid;
|
|
352
|
+
SignedBuilderBid: electra.SignedBuilderBid;
|
|
353
|
+
SSEPayloadAttributes: heze.SSEPayloadAttributes;
|
|
354
|
+
BlockContents: heze.BlockContents;
|
|
355
|
+
SignedBlockContents: fulu.SignedBlockContents;
|
|
356
|
+
ExecutionPayloadAndBlobsBundle: fulu.ExecutionPayloadAndBlobsBundle;
|
|
357
|
+
BlobsBundle: fulu.BlobsBundle;
|
|
358
|
+
SyncCommittee: altair.SyncCommittee;
|
|
359
|
+
SyncAggregate: altair.SyncAggregate;
|
|
360
|
+
SingleAttestation: electra.SingleAttestation;
|
|
361
|
+
Attestation: gloas.Attestation;
|
|
362
|
+
IndexedAttestation: gloas.IndexedAttestation;
|
|
363
|
+
IndexedAttestationBigint: gloas.IndexedAttestationBigint;
|
|
364
|
+
AttesterSlashing: gloas.AttesterSlashing;
|
|
365
|
+
AggregateAndProof: gloas.AggregateAndProof;
|
|
366
|
+
SignedAggregateAndProof: gloas.SignedAggregateAndProof;
|
|
367
|
+
ExecutionRequests: gloas.ExecutionRequests;
|
|
368
|
+
ExecutionPayloadBid: heze.ExecutionPayloadBid;
|
|
369
|
+
DataColumnSidecar: gloas.DataColumnSidecar;
|
|
370
|
+
DataColumnSidecars: gloas.DataColumnSidecars;
|
|
371
|
+
};
|
|
329
372
|
};
|
|
330
373
|
|
|
331
374
|
export type TypesFor<F extends ForkName, K extends keyof TypesByFork[F] | void = void> = K extends void
|