@lodestar/types 1.45.0 → 1.46.0-dev.1680f4f4dc
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 +10 -10
- package/lib/fulu/sszTypes.d.ts +6 -6
- package/lib/gloas/sszTypes.d.ts +988 -185
- package/lib/gloas/sszTypes.d.ts.map +1 -1
- package/lib/gloas/sszTypes.js +218 -63
- package/lib/gloas/sszTypes.js.map +1 -1
- package/lib/gloas/types.d.ts +29 -1
- package/lib/gloas/types.d.ts.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 +13238 -6806
- 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 +56 -13
- 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.d.ts +2 -0
- package/lib/utils/typeguards.d.ts.map +1 -1
- package/lib/utils/typeguards.js +8 -3
- package/lib/utils/typeguards.js.map +1 -1
- package/lib/utils/validatorStatus.js.map +1 -1
- package/package.json +15 -15
- package/src/gloas/sszTypes.ts +304 -72
- package/src/gloas/types.ts +33 -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 +56 -13
- package/src/utils/typeguards.ts +12 -2
package/src/gloas/types.ts
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
import {ValueOf} from "@chainsafe/ssz";
|
|
2
2
|
import * as ssz from "./sszTypes.js";
|
|
3
3
|
|
|
4
|
+
export type AggregationBits = ValueOf<typeof ssz.AggregationBits>;
|
|
5
|
+
export type AttestingIndices = ValueOf<typeof ssz.AttestingIndices>;
|
|
6
|
+
export type Transaction = ValueOf<typeof ssz.Transaction>;
|
|
7
|
+
export type Transactions = ValueOf<typeof ssz.Transactions>;
|
|
8
|
+
export type Withdrawals = ValueOf<typeof ssz.Withdrawals>;
|
|
9
|
+
export type BlobKzgCommitments = ValueOf<typeof ssz.BlobKzgCommitments>;
|
|
10
|
+
export type KZGProofs = ValueOf<typeof ssz.KZGProofs>;
|
|
11
|
+
export type DataColumn = ValueOf<typeof ssz.DataColumn>;
|
|
12
|
+
|
|
13
|
+
export type Attestation = ValueOf<typeof ssz.Attestation>;
|
|
14
|
+
export type IndexedAttestation = ValueOf<typeof ssz.IndexedAttestation>;
|
|
15
|
+
export type IndexedAttestationBigint = ValueOf<typeof ssz.IndexedAttestationBigint>;
|
|
16
|
+
export type AttesterSlashing = ValueOf<typeof ssz.AttesterSlashing>;
|
|
17
|
+
|
|
18
|
+
export type AggregateAndProof = ValueOf<typeof ssz.AggregateAndProof>;
|
|
19
|
+
export type SignedAggregateAndProof = ValueOf<typeof ssz.SignedAggregateAndProof>;
|
|
20
|
+
|
|
21
|
+
export type DepositRequest = ValueOf<typeof ssz.DepositRequest>;
|
|
22
|
+
export type DepositRequests = ValueOf<typeof ssz.DepositRequests>;
|
|
23
|
+
export type WithdrawalRequest = ValueOf<typeof ssz.WithdrawalRequest>;
|
|
24
|
+
export type WithdrawalRequests = ValueOf<typeof ssz.WithdrawalRequests>;
|
|
25
|
+
export type ConsolidationRequest = ValueOf<typeof ssz.ConsolidationRequest>;
|
|
26
|
+
export type ConsolidationRequests = ValueOf<typeof ssz.ConsolidationRequests>;
|
|
27
|
+
export type ExecutionRequests = ValueOf<typeof ssz.ExecutionRequests>;
|
|
28
|
+
|
|
4
29
|
export type Builder = ValueOf<typeof ssz.Builder>;
|
|
5
30
|
export type BuilderPendingWithdrawal = ValueOf<typeof ssz.BuilderPendingWithdrawal>;
|
|
6
31
|
export type BuilderPendingPayment = ValueOf<typeof ssz.BuilderPendingPayment>;
|
|
@@ -8,7 +33,6 @@ export type BuilderDepositRequest = ValueOf<typeof ssz.BuilderDepositRequest>;
|
|
|
8
33
|
export type BuilderDepositRequests = ValueOf<typeof ssz.BuilderDepositRequests>;
|
|
9
34
|
export type BuilderExitRequest = ValueOf<typeof ssz.BuilderExitRequest>;
|
|
10
35
|
export type BuilderExitRequests = ValueOf<typeof ssz.BuilderExitRequests>;
|
|
11
|
-
export type ExecutionRequests = ValueOf<typeof ssz.ExecutionRequests>;
|
|
12
36
|
export type PayloadTimelinessCommittee = ValueOf<typeof ssz.PayloadTimelinessCommittee>;
|
|
13
37
|
export type PtcWindow = ValueOf<typeof ssz.PtcWindow>;
|
|
14
38
|
export type PayloadAttestationData = ValueOf<typeof ssz.PayloadAttestationData>;
|
|
@@ -23,9 +47,17 @@ export type SignedExecutionPayloadBid = ValueOf<typeof ssz.SignedExecutionPayloa
|
|
|
23
47
|
export type BlockAccessList = ValueOf<typeof ssz.BlockAccessList>;
|
|
24
48
|
export type ExecutionPayloadEnvelope = ValueOf<typeof ssz.ExecutionPayloadEnvelope>;
|
|
25
49
|
export type SignedExecutionPayloadEnvelope = ValueOf<typeof ssz.SignedExecutionPayloadEnvelope>;
|
|
50
|
+
export type SignedExecutionPayloadEnvelopeContents = ValueOf<typeof ssz.SignedExecutionPayloadEnvelopeContents>;
|
|
26
51
|
export type BeaconBlockBody = ValueOf<typeof ssz.BeaconBlockBody>;
|
|
27
52
|
export type BeaconBlock = ValueOf<typeof ssz.BeaconBlock>;
|
|
28
53
|
export type SignedBeaconBlock = ValueOf<typeof ssz.SignedBeaconBlock>;
|
|
54
|
+
export type BlockContents = ValueOf<typeof ssz.BlockContents>;
|
|
55
|
+
export type LightClientHeader = ValueOf<typeof ssz.LightClientHeader>;
|
|
56
|
+
export type LightClientBootstrap = ValueOf<typeof ssz.LightClientBootstrap>;
|
|
57
|
+
export type LightClientUpdate = ValueOf<typeof ssz.LightClientUpdate>;
|
|
58
|
+
export type LightClientFinalityUpdate = ValueOf<typeof ssz.LightClientFinalityUpdate>;
|
|
59
|
+
export type LightClientOptimisticUpdate = ValueOf<typeof ssz.LightClientOptimisticUpdate>;
|
|
60
|
+
export type LightClientStore = ValueOf<typeof ssz.LightClientStore>;
|
|
29
61
|
export type BeaconState = ValueOf<typeof ssz.BeaconState>;
|
|
30
62
|
|
|
31
63
|
export type DataColumnSidecar = ValueOf<typeof ssz.DataColumnSidecar>;
|
|
@@ -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
|
|
|
@@ -294,12 +296,12 @@ type TypesByFork = {
|
|
|
294
296
|
SignedBeaconBlock: gloas.SignedBeaconBlock;
|
|
295
297
|
Metadata: fulu.Metadata;
|
|
296
298
|
Status: fulu.Status;
|
|
297
|
-
LightClientHeader:
|
|
298
|
-
LightClientBootstrap:
|
|
299
|
-
LightClientUpdate:
|
|
300
|
-
LightClientFinalityUpdate:
|
|
301
|
-
LightClientOptimisticUpdate:
|
|
302
|
-
LightClientStore:
|
|
299
|
+
LightClientHeader: gloas.LightClientHeader;
|
|
300
|
+
LightClientBootstrap: gloas.LightClientBootstrap;
|
|
301
|
+
LightClientUpdate: gloas.LightClientUpdate;
|
|
302
|
+
LightClientFinalityUpdate: gloas.LightClientFinalityUpdate;
|
|
303
|
+
LightClientOptimisticUpdate: gloas.LightClientOptimisticUpdate;
|
|
304
|
+
LightClientStore: gloas.LightClientStore;
|
|
303
305
|
BlindedBeaconBlock: electra.BlindedBeaconBlock;
|
|
304
306
|
BlindedBeaconBlockBody: electra.BlindedBeaconBlockBody;
|
|
305
307
|
SignedBlindedBeaconBlock: electra.SignedBlindedBeaconBlock;
|
|
@@ -308,24 +310,65 @@ type TypesByFork = {
|
|
|
308
310
|
BuilderBid: electra.BuilderBid;
|
|
309
311
|
SignedBuilderBid: electra.SignedBuilderBid;
|
|
310
312
|
SSEPayloadAttributes: gloas.SSEPayloadAttributes;
|
|
311
|
-
BlockContents:
|
|
313
|
+
BlockContents: gloas.BlockContents;
|
|
312
314
|
SignedBlockContents: fulu.SignedBlockContents;
|
|
313
315
|
ExecutionPayloadAndBlobsBundle: fulu.ExecutionPayloadAndBlobsBundle;
|
|
314
316
|
BlobsBundle: fulu.BlobsBundle;
|
|
315
317
|
SyncCommittee: altair.SyncCommittee;
|
|
316
318
|
SyncAggregate: altair.SyncAggregate;
|
|
317
319
|
SingleAttestation: electra.SingleAttestation;
|
|
318
|
-
Attestation:
|
|
319
|
-
IndexedAttestation:
|
|
320
|
-
IndexedAttestationBigint:
|
|
321
|
-
AttesterSlashing:
|
|
322
|
-
AggregateAndProof:
|
|
323
|
-
SignedAggregateAndProof:
|
|
320
|
+
Attestation: gloas.Attestation;
|
|
321
|
+
IndexedAttestation: gloas.IndexedAttestation;
|
|
322
|
+
IndexedAttestationBigint: gloas.IndexedAttestationBigint;
|
|
323
|
+
AttesterSlashing: gloas.AttesterSlashing;
|
|
324
|
+
AggregateAndProof: gloas.AggregateAndProof;
|
|
325
|
+
SignedAggregateAndProof: gloas.SignedAggregateAndProof;
|
|
324
326
|
ExecutionRequests: gloas.ExecutionRequests;
|
|
325
327
|
ExecutionPayloadBid: gloas.ExecutionPayloadBid;
|
|
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
|
package/src/utils/typeguards.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FINALIZED_ROOT_DEPTH_ELECTRA,
|
|
3
|
+
FINALIZED_ROOT_DEPTH_GLOAS,
|
|
3
4
|
ForkPostBellatrix,
|
|
4
5
|
ForkPostDeneb,
|
|
5
6
|
ForkPostElectra,
|
|
6
7
|
ForkPostGloas,
|
|
7
8
|
} from "@lodestar/params";
|
|
9
|
+
import {SignedExecutionPayloadEnvelope, SignedExecutionPayloadEnvelopeContents} from "../gloas/types.js";
|
|
8
10
|
import {
|
|
9
11
|
Attestation,
|
|
10
12
|
BeaconBlock,
|
|
@@ -90,7 +92,8 @@ export function isElectraLightClientUpdate(update: LightClientUpdate): update is
|
|
|
90
92
|
const updatePostElectra = update as LightClientUpdate<ForkPostElectra>;
|
|
91
93
|
return (
|
|
92
94
|
updatePostElectra.finalityBranch !== undefined &&
|
|
93
|
-
updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA
|
|
95
|
+
(updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA ||
|
|
96
|
+
updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_GLOAS)
|
|
94
97
|
);
|
|
95
98
|
}
|
|
96
99
|
|
|
@@ -100,7 +103,8 @@ export function isELectraLightClientFinalityUpdate(
|
|
|
100
103
|
const updatePostElectra = update as LightClientUpdate<ForkPostElectra>;
|
|
101
104
|
return (
|
|
102
105
|
updatePostElectra.finalityBranch !== undefined &&
|
|
103
|
-
updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA
|
|
106
|
+
(updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_ELECTRA ||
|
|
107
|
+
updatePostElectra.finalityBranch.length === FINALIZED_ROOT_DEPTH_GLOAS)
|
|
104
108
|
);
|
|
105
109
|
}
|
|
106
110
|
|
|
@@ -111,3 +115,9 @@ export function isGloasBeaconBlock(block: BeaconBlock): block is BeaconBlock<For
|
|
|
111
115
|
export function isGloasDataColumnSidecar(sidecar: DataColumnSidecar): sidecar is DataColumnSidecar<ForkPostGloas> {
|
|
112
116
|
return (sidecar as DataColumnSidecar<ForkPostGloas>).beaconBlockRoot !== undefined;
|
|
113
117
|
}
|
|
118
|
+
|
|
119
|
+
export function isSignedExecutionPayloadEnvelopeContents(
|
|
120
|
+
signedEnvelope: SignedExecutionPayloadEnvelopeContents | SignedExecutionPayloadEnvelope
|
|
121
|
+
): signedEnvelope is SignedExecutionPayloadEnvelopeContents {
|
|
122
|
+
return (signedEnvelope as SignedExecutionPayloadEnvelopeContents).signedExecutionPayloadEnvelope !== undefined;
|
|
123
|
+
}
|