@lodestar/types 1.35.0-dev.fcf8d024ea → 1.35.0-dev.feed916580

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.
Files changed (86) hide show
  1. package/lib/altair/sszTypes.d.ts +1 -1
  2. package/lib/bellatrix/sszTypes.d.ts +15 -15
  3. package/lib/capella/sszTypes.d.ts +41 -41
  4. package/lib/deneb/sszTypes.d.ts +44 -44
  5. package/lib/electra/sszTypes.d.ts +67 -67
  6. package/lib/fulu/sszTypes.d.ts +22 -22
  7. package/lib/gloas/sszTypes.d.ts +234 -535
  8. package/lib/gloas/sszTypes.js +3 -162
  9. package/lib/gloas/sszTypes.js.map +1 -1
  10. package/lib/gloas/types.d.ts +0 -13
  11. package/lib/sszTypes.d.ts +1446 -1664
  12. package/lib/types.d.ts +4 -3
  13. package/lib/types.js.map +1 -1
  14. package/package.json +8 -14
  15. package/lib/altair/index.d.ts.map +0 -1
  16. package/lib/altair/sszTypes.d.ts.map +0 -1
  17. package/lib/altair/types.d.ts.map +0 -1
  18. package/lib/bellatrix/index.d.ts.map +0 -1
  19. package/lib/bellatrix/sszTypes.d.ts.map +0 -1
  20. package/lib/bellatrix/types.d.ts.map +0 -1
  21. package/lib/capella/index.d.ts.map +0 -1
  22. package/lib/capella/sszTypes.d.ts.map +0 -1
  23. package/lib/capella/types.d.ts.map +0 -1
  24. package/lib/deneb/index.d.ts.map +0 -1
  25. package/lib/deneb/sszTypes.d.ts.map +0 -1
  26. package/lib/deneb/types.d.ts.map +0 -1
  27. package/lib/electra/index.d.ts.map +0 -1
  28. package/lib/electra/sszTypes.d.ts.map +0 -1
  29. package/lib/electra/types.d.ts.map +0 -1
  30. package/lib/fulu/index.d.ts.map +0 -1
  31. package/lib/fulu/sszTypes.d.ts.map +0 -1
  32. package/lib/fulu/types.d.ts.map +0 -1
  33. package/lib/gloas/index.d.ts.map +0 -1
  34. package/lib/gloas/sszTypes.d.ts.map +0 -1
  35. package/lib/gloas/types.d.ts.map +0 -1
  36. package/lib/index.d.ts.map +0 -1
  37. package/lib/phase0/index.d.ts.map +0 -1
  38. package/lib/phase0/sszTypes.d.ts.map +0 -1
  39. package/lib/phase0/types.d.ts.map +0 -1
  40. package/lib/phase0/validator.d.ts.map +0 -1
  41. package/lib/primitive/index.d.ts.map +0 -1
  42. package/lib/primitive/sszTypes.d.ts.map +0 -1
  43. package/lib/primitive/types.d.ts.map +0 -1
  44. package/lib/sszTypes.d.ts.map +0 -1
  45. package/lib/types.d.ts.map +0 -1
  46. package/lib/utils/container.d.ts.map +0 -1
  47. package/lib/utils/executionAddress.d.ts.map +0 -1
  48. package/lib/utils/stringType.d.ts.map +0 -1
  49. package/lib/utils/typeguards.d.ts.map +0 -1
  50. package/lib/utils/validatorStatus.d.ts.map +0 -1
  51. package/src/altair/index.ts +0 -5
  52. package/src/altair/sszTypes.ts +0 -243
  53. package/src/altair/types.ts +0 -24
  54. package/src/bellatrix/index.ts +0 -5
  55. package/src/bellatrix/sszTypes.ts +0 -238
  56. package/src/bellatrix/types.ts +0 -24
  57. package/src/capella/index.ts +0 -5
  58. package/src/capella/sszTypes.ts +0 -281
  59. package/src/capella/types.ts +0 -33
  60. package/src/deneb/index.ts +0 -5
  61. package/src/deneb/sszTypes.ts +0 -329
  62. package/src/deneb/types.ts +0 -55
  63. package/src/electra/index.ts +0 -5
  64. package/src/electra/sszTypes.ts +0 -451
  65. package/src/electra/types.ts +0 -54
  66. package/src/fulu/index.ts +0 -5
  67. package/src/fulu/sszTypes.ts +0 -138
  68. package/src/fulu/types.ts +0 -31
  69. package/src/gloas/index.ts +0 -5
  70. package/src/gloas/sszTypes.ts +0 -234
  71. package/src/gloas/types.ts +0 -20
  72. package/src/index.ts +0 -15
  73. package/src/phase0/index.ts +0 -6
  74. package/src/phase0/sszTypes.ts +0 -514
  75. package/src/phase0/types.ts +0 -46
  76. package/src/phase0/validator.ts +0 -78
  77. package/src/primitive/index.ts +0 -3
  78. package/src/primitive/sszTypes.ts +0 -70
  79. package/src/primitive/types.ts +0 -53
  80. package/src/sszTypes.ts +0 -86
  81. package/src/types.ts +0 -374
  82. package/src/utils/container.ts +0 -38
  83. package/src/utils/executionAddress.ts +0 -48
  84. package/src/utils/stringType.ts +0 -58
  85. package/src/utils/typeguards.ts +0 -98
  86. package/src/utils/validatorStatus.ts +0 -52
@@ -1,281 +0,0 @@
1
- import {ContainerType, ListCompositeType, VectorCompositeType} from "@chainsafe/ssz";
2
- import {
3
- EPOCHS_PER_SYNC_COMMITTEE_PERIOD,
4
- BLOCK_BODY_EXECUTION_PAYLOAD_DEPTH as EXECUTION_PAYLOAD_DEPTH,
5
- HISTORICAL_ROOTS_LIMIT,
6
- MAX_BLS_TO_EXECUTION_CHANGES,
7
- MAX_WITHDRAWALS_PER_PAYLOAD,
8
- SLOTS_PER_EPOCH,
9
- } from "@lodestar/params";
10
- import {ssz as altairSsz} from "../altair/index.js";
11
- import {ssz as bellatrixSsz} from "../bellatrix/index.js";
12
- import {ssz as phase0Ssz} from "../phase0/index.js";
13
- import {ssz as primitiveSsz} from "../primitive/index.js";
14
-
15
- const {
16
- UintNum64,
17
- Slot,
18
- ValidatorIndex,
19
- WithdrawalIndex,
20
- Root,
21
- BLSSignature,
22
- BLSPubkey,
23
- ExecutionAddress,
24
- Gwei,
25
- UintBn256,
26
- Bytes32,
27
- } = primitiveSsz;
28
-
29
- export const ExecutionBranch = new VectorCompositeType(Bytes32, EXECUTION_PAYLOAD_DEPTH);
30
-
31
- export const Withdrawal = new ContainerType(
32
- {
33
- index: WithdrawalIndex,
34
- validatorIndex: ValidatorIndex,
35
- address: ExecutionAddress,
36
- amount: Gwei,
37
- },
38
- {typeName: "Withdrawal", jsonCase: "eth2"}
39
- );
40
-
41
- export const BLSToExecutionChange = new ContainerType(
42
- {
43
- validatorIndex: ValidatorIndex,
44
- fromBlsPubkey: BLSPubkey,
45
- toExecutionAddress: ExecutionAddress,
46
- },
47
- {typeName: "BLSToExecutionChange", jsonCase: "eth2"}
48
- );
49
-
50
- export const SignedBLSToExecutionChange = new ContainerType(
51
- {
52
- message: BLSToExecutionChange,
53
- signature: BLSSignature,
54
- },
55
- {typeName: "SignedBLSToExecutionChange", jsonCase: "eth2"}
56
- );
57
-
58
- export const Withdrawals = new ListCompositeType(Withdrawal, MAX_WITHDRAWALS_PER_PAYLOAD);
59
- export const ExecutionPayload = new ContainerType(
60
- {
61
- ...bellatrixSsz.ExecutionPayload.fields,
62
- withdrawals: Withdrawals, // New in capella
63
- },
64
- {typeName: "ExecutionPayload", jsonCase: "eth2"}
65
- );
66
-
67
- export const ExecutionPayloadHeader = new ContainerType(
68
- {
69
- ...bellatrixSsz.ExecutionPayloadHeader.fields,
70
- withdrawalsRoot: Root, // New in capella
71
- },
72
- {typeName: "ExecutionPayloadHeader", jsonCase: "eth2"}
73
- );
74
-
75
- export const BLSToExecutionChanges = new ListCompositeType(SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES);
76
- export const BeaconBlockBody = new ContainerType(
77
- {
78
- ...altairSsz.BeaconBlockBody.fields,
79
- executionPayload: ExecutionPayload, // Modified in capella
80
- blsToExecutionChanges: BLSToExecutionChanges,
81
- },
82
- {typeName: "BeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
83
- );
84
-
85
- export const BeaconBlock = new ContainerType(
86
- {
87
- slot: Slot,
88
- proposerIndex: ValidatorIndex,
89
- // Reclare expandedType() with altair block and altair state
90
- parentRoot: Root,
91
- stateRoot: Root,
92
- body: BeaconBlockBody, // Modified in Capella
93
- },
94
- {typeName: "BeaconBlock", jsonCase: "eth2", cachePermanentRootStruct: true}
95
- );
96
-
97
- export const SignedBeaconBlock = new ContainerType(
98
- {
99
- message: BeaconBlock, // Modified in capella
100
- signature: BLSSignature,
101
- },
102
- {typeName: "SignedBeaconBlock", jsonCase: "eth2"}
103
- );
104
-
105
- export const BuilderBid = new ContainerType(
106
- {
107
- header: ExecutionPayloadHeader,
108
- value: UintBn256,
109
- pubkey: BLSPubkey,
110
- },
111
- {typeName: "BuilderBid", jsonCase: "eth2"}
112
- );
113
-
114
- export const SignedBuilderBid = new ContainerType(
115
- {
116
- message: BuilderBid,
117
- signature: BLSSignature,
118
- },
119
- {typeName: "SignedBuilderBid", jsonCase: "eth2"}
120
- );
121
-
122
- export const HistoricalSummary = new ContainerType(
123
- {
124
- blockSummaryRoot: Root,
125
- stateSummaryRoot: Root,
126
- },
127
- {typeName: "HistoricalSummary", jsonCase: "eth2"}
128
- );
129
-
130
- export const HistoricalSummaries = new ListCompositeType(HistoricalSummary, HISTORICAL_ROOTS_LIMIT, {
131
- typeName: "HistoricalSummaries",
132
- });
133
-
134
- // we don't reuse bellatrix.BeaconState fields since we need to replace some keys
135
- // and we cannot keep order doing that
136
- export const BeaconState = new ContainerType(
137
- {
138
- genesisTime: UintNum64,
139
- genesisValidatorsRoot: Root,
140
- slot: primitiveSsz.Slot,
141
- fork: phase0Ssz.Fork,
142
- // History
143
- latestBlockHeader: phase0Ssz.BeaconBlockHeader,
144
- blockRoots: phase0Ssz.HistoricalBlockRoots,
145
- stateRoots: phase0Ssz.HistoricalStateRoots,
146
- // historical_roots Frozen in Capella, replaced by historical_summaries
147
- historicalRoots: new ListCompositeType(Root, HISTORICAL_ROOTS_LIMIT),
148
- // Eth1
149
- eth1Data: phase0Ssz.Eth1Data,
150
- eth1DataVotes: phase0Ssz.Eth1DataVotes,
151
- eth1DepositIndex: UintNum64,
152
- // Registry
153
- validators: phase0Ssz.Validators,
154
- balances: phase0Ssz.Balances,
155
- randaoMixes: phase0Ssz.RandaoMixes,
156
- // Slashings
157
- slashings: phase0Ssz.Slashings,
158
- // Participation
159
- previousEpochParticipation: altairSsz.EpochParticipation,
160
- currentEpochParticipation: altairSsz.EpochParticipation,
161
- // Finality
162
- justificationBits: phase0Ssz.JustificationBits,
163
- previousJustifiedCheckpoint: phase0Ssz.Checkpoint,
164
- currentJustifiedCheckpoint: phase0Ssz.Checkpoint,
165
- finalizedCheckpoint: phase0Ssz.Checkpoint,
166
- // Inactivity
167
- inactivityScores: altairSsz.InactivityScores,
168
- // Sync
169
- currentSyncCommittee: altairSsz.SyncCommittee,
170
- nextSyncCommittee: altairSsz.SyncCommittee,
171
- // Execution
172
- latestExecutionPayloadHeader: ExecutionPayloadHeader, // [Modified in Capella]
173
- // Withdrawals
174
- nextWithdrawalIndex: WithdrawalIndex, // [New in Capella]
175
- nextWithdrawalValidatorIndex: ValidatorIndex, // [New in Capella]
176
- // Deep history valid from Capella onwards
177
- historicalSummaries: HistoricalSummaries, // [New in Capella]
178
- },
179
- {typeName: "BeaconState", jsonCase: "eth2"}
180
- );
181
-
182
- export const BlindedBeaconBlockBody = new ContainerType(
183
- {
184
- ...altairSsz.BeaconBlockBody.fields,
185
- executionPayloadHeader: ExecutionPayloadHeader, // Modified in capella
186
- blsToExecutionChanges: BLSToExecutionChanges, // New in capella
187
- },
188
- {typeName: "BlindedBeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
189
- );
190
-
191
- export const BlindedBeaconBlock = new ContainerType(
192
- {
193
- ...bellatrixSsz.BlindedBeaconBlock.fields,
194
- body: BlindedBeaconBlockBody, // Modified in capella
195
- },
196
- {typeName: "BlindedBeaconBlock", jsonCase: "eth2", cachePermanentRootStruct: true}
197
- );
198
-
199
- export const SignedBlindedBeaconBlock = new ContainerType(
200
- {
201
- message: BlindedBeaconBlock, // Modified in capella
202
- signature: BLSSignature,
203
- },
204
- {typeName: "SignedBlindedBeaconBlock", jsonCase: "eth2"}
205
- );
206
-
207
- export const LightClientHeader = new ContainerType(
208
- {
209
- beacon: phase0Ssz.BeaconBlockHeader,
210
- execution: ExecutionPayloadHeader,
211
- executionBranch: ExecutionBranch,
212
- },
213
- {typeName: "LightClientHeader", jsonCase: "eth2"}
214
- );
215
-
216
- export const LightClientBootstrap = new ContainerType(
217
- {
218
- header: LightClientHeader,
219
- currentSyncCommittee: altairSsz.SyncCommittee,
220
- currentSyncCommitteeBranch: altairSsz.LightClientBootstrap.fields.currentSyncCommitteeBranch,
221
- },
222
- {typeName: "LightClientBootstrap", jsonCase: "eth2"}
223
- );
224
-
225
- export const LightClientUpdate = new ContainerType(
226
- {
227
- attestedHeader: LightClientHeader,
228
- nextSyncCommittee: altairSsz.SyncCommittee,
229
- nextSyncCommitteeBranch: altairSsz.LightClientUpdate.fields.nextSyncCommitteeBranch,
230
- finalizedHeader: LightClientHeader,
231
- finalityBranch: altairSsz.LightClientUpdate.fields.finalityBranch,
232
- syncAggregate: altairSsz.SyncAggregate,
233
- signatureSlot: Slot,
234
- },
235
- {typeName: "LightClientUpdate", jsonCase: "eth2"}
236
- );
237
-
238
- export const LightClientFinalityUpdate = new ContainerType(
239
- {
240
- attestedHeader: LightClientHeader,
241
- finalizedHeader: LightClientHeader,
242
- finalityBranch: altairSsz.LightClientFinalityUpdate.fields.finalityBranch,
243
- syncAggregate: altairSsz.SyncAggregate,
244
- signatureSlot: Slot,
245
- },
246
- {typeName: "LightClientFinalityUpdate", jsonCase: "eth2"}
247
- );
248
-
249
- export const LightClientOptimisticUpdate = new ContainerType(
250
- {
251
- attestedHeader: LightClientHeader,
252
- syncAggregate: altairSsz.SyncAggregate,
253
- signatureSlot: Slot,
254
- },
255
- {typeName: "LightClientOptimisticUpdate", jsonCase: "eth2"}
256
- );
257
-
258
- export const LightClientStore = new ContainerType(
259
- {
260
- snapshot: LightClientBootstrap,
261
- validUpdates: new ListCompositeType(LightClientUpdate, EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH),
262
- },
263
- {typeName: "LightClientStore", jsonCase: "eth2"}
264
- );
265
-
266
- // PayloadAttributes primarily for SSE event
267
- export const PayloadAttributes = new ContainerType(
268
- {
269
- ...bellatrixSsz.PayloadAttributes.fields,
270
- withdrawals: Withdrawals,
271
- },
272
- {typeName: "PayloadAttributes", jsonCase: "eth2"}
273
- );
274
-
275
- export const SSEPayloadAttributes = new ContainerType(
276
- {
277
- ...bellatrixSsz.SSEPayloadAttributesCommon.fields,
278
- payloadAttributes: PayloadAttributes,
279
- },
280
- {typeName: "SSEPayloadAttributes", jsonCase: "eth2"}
281
- );
@@ -1,33 +0,0 @@
1
- import {ValueOf} from "@chainsafe/ssz";
2
- import * as ssz from "./sszTypes.js";
3
-
4
- export type Withdrawal = ValueOf<typeof ssz.Withdrawal>;
5
- export type Withdrawals = ValueOf<typeof ssz.Withdrawals>;
6
- export type BLSToExecutionChange = ValueOf<typeof ssz.BLSToExecutionChange>;
7
- export type BLSToExecutionChanges = ValueOf<typeof ssz.BLSToExecutionChanges>;
8
- export type SignedBLSToExecutionChange = ValueOf<typeof ssz.SignedBLSToExecutionChange>;
9
-
10
- export type ExecutionPayload = ValueOf<typeof ssz.ExecutionPayload>;
11
- export type ExecutionPayloadHeader = ValueOf<typeof ssz.ExecutionPayloadHeader>;
12
-
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 BeaconState = ValueOf<typeof ssz.BeaconState>;
17
-
18
- export type BlindedBeaconBlockBody = ValueOf<typeof ssz.BlindedBeaconBlockBody>;
19
- export type BlindedBeaconBlock = ValueOf<typeof ssz.BlindedBeaconBlock>;
20
- export type SignedBlindedBeaconBlock = ValueOf<typeof ssz.SignedBlindedBeaconBlock>;
21
-
22
- export type FullOrBlindedExecutionPayload = ExecutionPayload | ExecutionPayloadHeader;
23
-
24
- export type BuilderBid = ValueOf<typeof ssz.BuilderBid>;
25
- export type SignedBuilderBid = ValueOf<typeof ssz.SignedBuilderBid>;
26
- export type SSEPayloadAttributes = ValueOf<typeof ssz.SSEPayloadAttributes>;
27
-
28
- export type LightClientHeader = ValueOf<typeof ssz.LightClientHeader>;
29
- export type LightClientBootstrap = ValueOf<typeof ssz.LightClientBootstrap>;
30
- export type LightClientUpdate = ValueOf<typeof ssz.LightClientUpdate>;
31
- export type LightClientFinalityUpdate = ValueOf<typeof ssz.LightClientFinalityUpdate>;
32
- export type LightClientOptimisticUpdate = ValueOf<typeof ssz.LightClientOptimisticUpdate>;
33
- export type LightClientStore = ValueOf<typeof ssz.LightClientStore>;
@@ -1,5 +0,0 @@
1
- export * from "./types.js";
2
-
3
- import * as ssz from "./sszTypes.js";
4
- import * as ts from "./types.js";
5
- export {ts, ssz};
@@ -1,329 +0,0 @@
1
- import {ByteVectorType, ContainerType, ListCompositeType, VectorCompositeType} from "@chainsafe/ssz";
2
- import {
3
- BYTES_PER_FIELD_ELEMENT,
4
- EPOCHS_PER_SYNC_COMMITTEE_PERIOD,
5
- FIELD_ELEMENTS_PER_BLOB,
6
- HISTORICAL_ROOTS_LIMIT,
7
- KZG_COMMITMENT_INCLUSION_PROOF_DEPTH,
8
- MAX_BLOB_COMMITMENTS_PER_BLOCK,
9
- SLOTS_PER_EPOCH,
10
- } from "@lodestar/params";
11
- import {ssz as altairSsz} from "../altair/index.js";
12
- import {ssz as bellatrixSsz} from "../bellatrix/index.js";
13
- import {ssz as capellaSsz} from "../capella/index.js";
14
- import {ssz as phase0Ssz} from "../phase0/index.js";
15
- import {ssz as primitiveSsz} from "../primitive/index.js";
16
-
17
- const {UintNum64, Slot, Root, BLSSignature, UintBn64, UintBn256, Bytes32, Bytes48, Bytes96, BLSPubkey, BlobIndex} =
18
- primitiveSsz;
19
-
20
- // Polynomial commitments
21
- // https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md
22
-
23
- // Custom types
24
- // https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md#custom-types
25
- export const G1Point = Bytes48;
26
- export const G2Point = Bytes96;
27
- export const BLSFieldElement = Bytes32;
28
- export const KZGCommitment = Bytes48;
29
- export const KZGProof = Bytes48;
30
-
31
- // Beacon chain
32
-
33
- // Custom types
34
- // https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/beacon-chain.md#custom-types
35
-
36
- export const Blob = new ByteVectorType(BYTES_PER_FIELD_ELEMENT * FIELD_ELEMENTS_PER_BLOB);
37
- export const Blobs = new ListCompositeType(Blob, MAX_BLOB_COMMITMENTS_PER_BLOCK);
38
- export const BlindedBlob = Bytes32;
39
- export const BlindedBlobs = new ListCompositeType(BlindedBlob, MAX_BLOB_COMMITMENTS_PER_BLOCK);
40
-
41
- export const VersionedHash = Bytes32;
42
- export const BlobKzgCommitments = new ListCompositeType(KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK);
43
- export const KZGProofs = new ListCompositeType(KZGProof, MAX_BLOB_COMMITMENTS_PER_BLOCK);
44
-
45
- // ReqResp types
46
- // =============
47
-
48
- export const BlobSidecarsByRangeRequest = new ContainerType(
49
- {
50
- startSlot: Slot,
51
- count: UintNum64,
52
- },
53
- {typeName: "BlobSidecarsByRangeRequest", jsonCase: "eth2"}
54
- );
55
-
56
- export const BlobIdentifier = new ContainerType(
57
- {
58
- blockRoot: Root,
59
- index: BlobIndex,
60
- },
61
- {typeName: "BlobIdentifier", jsonCase: "eth2"}
62
- );
63
-
64
- // Beacon Chain types
65
- // https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/beacon-chain.md#containers
66
-
67
- export const ExecutionPayload = new ContainerType(
68
- {
69
- ...capellaSsz.ExecutionPayload.fields,
70
- blobGasUsed: UintBn64, // New in DENEB
71
- excessBlobGas: UintBn64, // New in DENEB
72
- },
73
- {typeName: "ExecutionPayload", jsonCase: "eth2"}
74
- );
75
-
76
- export const ExecutionPayloadHeader = new ContainerType(
77
- {
78
- ...capellaSsz.ExecutionPayloadHeader.fields,
79
- blobGasUsed: UintBn64, // New in DENEB
80
- excessBlobGas: UintBn64, // New in DENEB
81
- },
82
- {typeName: "ExecutionPayloadHeader", jsonCase: "eth2"}
83
- );
84
-
85
- // We have to preserve Fields ordering while changing the type of ExecutionPayload
86
- export const BeaconBlockBody = new ContainerType(
87
- {
88
- ...altairSsz.BeaconBlockBody.fields,
89
- executionPayload: ExecutionPayload, // Modified in DENEB
90
- blsToExecutionChanges: capellaSsz.BeaconBlockBody.fields.blsToExecutionChanges,
91
- blobKzgCommitments: BlobKzgCommitments, // New in DENEB
92
- },
93
- {typeName: "BeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
94
- );
95
-
96
- export const BeaconBlock = new ContainerType(
97
- {
98
- ...capellaSsz.BeaconBlock.fields,
99
- body: BeaconBlockBody, // Modified in DENEB
100
- },
101
- {typeName: "BeaconBlock", jsonCase: "eth2", cachePermanentRootStruct: true}
102
- );
103
-
104
- export const SignedBeaconBlock = new ContainerType(
105
- {
106
- message: BeaconBlock, // Modified in DENEB
107
- signature: BLSSignature,
108
- },
109
- {typeName: "SignedBeaconBlock", jsonCase: "eth2"}
110
- );
111
-
112
- export const KzgCommitmentInclusionProof = new VectorCompositeType(Bytes32, KZG_COMMITMENT_INCLUSION_PROOF_DEPTH);
113
-
114
- export const BlobSidecar = new ContainerType(
115
- {
116
- index: BlobIndex,
117
- blob: Blob,
118
- kzgCommitment: KZGCommitment,
119
- kzgProof: KZGProof,
120
- signedBlockHeader: phase0Ssz.SignedBeaconBlockHeader,
121
- kzgCommitmentInclusionProof: KzgCommitmentInclusionProof,
122
- },
123
- {typeName: "BlobSidecar", jsonCase: "eth2"}
124
- );
125
-
126
- export const BlobSidecars = new ListCompositeType(BlobSidecar, MAX_BLOB_COMMITMENTS_PER_BLOCK);
127
-
128
- export const BlobsBundle = new ContainerType(
129
- {
130
- commitments: BlobKzgCommitments,
131
- proofs: KZGProofs,
132
- blobs: Blobs,
133
- },
134
- {typeName: "BlobsBundle", jsonCase: "eth2"}
135
- );
136
-
137
- export const BlindedBeaconBlockBody = new ContainerType(
138
- {
139
- ...altairSsz.BeaconBlockBody.fields,
140
- executionPayloadHeader: ExecutionPayloadHeader, // Modified in DENEB
141
- blsToExecutionChanges: capellaSsz.BeaconBlockBody.fields.blsToExecutionChanges,
142
- blobKzgCommitments: BlobKzgCommitments, // New in DENEB
143
- },
144
- {typeName: "BlindedBeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
145
- );
146
-
147
- export const BlindedBeaconBlock = new ContainerType(
148
- {
149
- ...capellaSsz.BlindedBeaconBlock.fields,
150
- body: BlindedBeaconBlockBody, // Modified in DENEB
151
- },
152
- {typeName: "BlindedBeaconBlock", jsonCase: "eth2", cachePermanentRootStruct: true}
153
- );
154
-
155
- export const SignedBlindedBeaconBlock = new ContainerType(
156
- {
157
- message: BlindedBeaconBlock, // Modified in DENEB
158
- signature: BLSSignature,
159
- },
160
- {typeName: "SignedBlindedBeaconBlock", jsonCase: "eth2"}
161
- );
162
-
163
- export const BuilderBid = new ContainerType(
164
- {
165
- header: ExecutionPayloadHeader,
166
- blobKzgCommitments: BlobKzgCommitments,
167
- value: UintBn256,
168
- pubkey: BLSPubkey,
169
- },
170
- {typeName: "BuilderBid", jsonCase: "eth2"}
171
- );
172
-
173
- export const SignedBuilderBid = new ContainerType(
174
- {
175
- message: BuilderBid,
176
- signature: BLSSignature,
177
- },
178
- {typeName: "SignedBuilderBid", jsonCase: "eth2"}
179
- );
180
-
181
- export const ExecutionPayloadAndBlobsBundle = new ContainerType(
182
- {
183
- executionPayload: ExecutionPayload,
184
- blobsBundle: BlobsBundle,
185
- },
186
- {typeName: "ExecutionPayloadAndBlobsBundle", jsonCase: "eth2"}
187
- );
188
-
189
- // We don't spread capella.BeaconState fields since we need to replace
190
- // latestExecutionPayloadHeader and we cannot keep order doing that
191
- export const BeaconState = new ContainerType(
192
- {
193
- genesisTime: UintNum64,
194
- genesisValidatorsRoot: Root,
195
- slot: primitiveSsz.Slot,
196
- fork: phase0Ssz.Fork,
197
- // History
198
- latestBlockHeader: phase0Ssz.BeaconBlockHeader,
199
- blockRoots: phase0Ssz.HistoricalBlockRoots,
200
- stateRoots: phase0Ssz.HistoricalStateRoots,
201
- // historical_roots Frozen in Capella, replaced by historical_summaries
202
- historicalRoots: new ListCompositeType(Root, HISTORICAL_ROOTS_LIMIT),
203
- // Eth1
204
- eth1Data: phase0Ssz.Eth1Data,
205
- eth1DataVotes: phase0Ssz.Eth1DataVotes,
206
- eth1DepositIndex: UintNum64,
207
- // Registry
208
- validators: phase0Ssz.Validators,
209
- balances: phase0Ssz.Balances,
210
- randaoMixes: phase0Ssz.RandaoMixes,
211
- // Slashings
212
- slashings: phase0Ssz.Slashings,
213
- // Participation
214
- previousEpochParticipation: altairSsz.EpochParticipation,
215
- currentEpochParticipation: altairSsz.EpochParticipation,
216
- // Finality
217
- justificationBits: phase0Ssz.JustificationBits,
218
- previousJustifiedCheckpoint: phase0Ssz.Checkpoint,
219
- currentJustifiedCheckpoint: phase0Ssz.Checkpoint,
220
- finalizedCheckpoint: phase0Ssz.Checkpoint,
221
- // Inactivity
222
- inactivityScores: altairSsz.InactivityScores,
223
- // Sync
224
- currentSyncCommittee: altairSsz.SyncCommittee,
225
- nextSyncCommittee: altairSsz.SyncCommittee,
226
- // Execution
227
- latestExecutionPayloadHeader: ExecutionPayloadHeader, // Modified in DENEB
228
- // Withdrawals
229
- nextWithdrawalIndex: capellaSsz.BeaconState.fields.nextWithdrawalIndex,
230
- nextWithdrawalValidatorIndex: capellaSsz.BeaconState.fields.nextWithdrawalValidatorIndex,
231
- // Deep history valid from Capella onwards
232
- historicalSummaries: capellaSsz.BeaconState.fields.historicalSummaries,
233
- },
234
- {typeName: "BeaconState", jsonCase: "eth2"}
235
- );
236
-
237
- export const LightClientHeader = new ContainerType(
238
- {
239
- beacon: phase0Ssz.BeaconBlockHeader,
240
- execution: ExecutionPayloadHeader,
241
- executionBranch: capellaSsz.LightClientHeader.fields.executionBranch,
242
- },
243
- {typeName: "LightClientHeader", jsonCase: "eth2"}
244
- );
245
-
246
- export const LightClientBootstrap = new ContainerType(
247
- {
248
- header: LightClientHeader,
249
- currentSyncCommittee: altairSsz.SyncCommittee,
250
- currentSyncCommitteeBranch: altairSsz.LightClientBootstrap.fields.currentSyncCommitteeBranch,
251
- },
252
- {typeName: "LightClientBootstrap", jsonCase: "eth2"}
253
- );
254
-
255
- export const LightClientUpdate = new ContainerType(
256
- {
257
- attestedHeader: LightClientHeader,
258
- nextSyncCommittee: altairSsz.SyncCommittee,
259
- nextSyncCommitteeBranch: altairSsz.LightClientUpdate.fields.nextSyncCommitteeBranch,
260
- finalizedHeader: LightClientHeader,
261
- finalityBranch: altairSsz.LightClientUpdate.fields.finalityBranch,
262
- syncAggregate: altairSsz.SyncAggregate,
263
- signatureSlot: Slot,
264
- },
265
- {typeName: "LightClientUpdate", jsonCase: "eth2"}
266
- );
267
-
268
- export const LightClientFinalityUpdate = new ContainerType(
269
- {
270
- attestedHeader: LightClientHeader,
271
- finalizedHeader: LightClientHeader,
272
- finalityBranch: altairSsz.LightClientFinalityUpdate.fields.finalityBranch,
273
- syncAggregate: altairSsz.SyncAggregate,
274
- signatureSlot: Slot,
275
- },
276
- {typeName: "LightClientFinalityUpdate", jsonCase: "eth2"}
277
- );
278
-
279
- export const LightClientOptimisticUpdate = new ContainerType(
280
- {
281
- attestedHeader: LightClientHeader,
282
- syncAggregate: altairSsz.SyncAggregate,
283
- signatureSlot: Slot,
284
- },
285
- {typeName: "LightClientOptimisticUpdate", jsonCase: "eth2"}
286
- );
287
-
288
- export const LightClientStore = new ContainerType(
289
- {
290
- snapshot: LightClientBootstrap,
291
- validUpdates: new ListCompositeType(LightClientUpdate, EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH),
292
- },
293
- {typeName: "LightClientStore", jsonCase: "eth2"}
294
- );
295
-
296
- // PayloadAttributes primarily for SSE event
297
- export const PayloadAttributes = new ContainerType(
298
- {
299
- ...capellaSsz.PayloadAttributes.fields,
300
- parentBeaconBlockRoot: Root,
301
- },
302
- {typeName: "PayloadAttributes", jsonCase: "eth2"}
303
- );
304
-
305
- export const SSEPayloadAttributes = new ContainerType(
306
- {
307
- ...bellatrixSsz.SSEPayloadAttributesCommon.fields,
308
- payloadAttributes: PayloadAttributes,
309
- },
310
- {typeName: "SSEPayloadAttributes", jsonCase: "eth2"}
311
- );
312
-
313
- export const BlockContents = new ContainerType(
314
- {
315
- block: BeaconBlock,
316
- kzgProofs: KZGProofs,
317
- blobs: Blobs,
318
- },
319
- {typeName: "BlockContents", jsonCase: "eth2"}
320
- );
321
-
322
- export const SignedBlockContents = new ContainerType(
323
- {
324
- signedBlock: SignedBeaconBlock,
325
- kzgProofs: KZGProofs,
326
- blobs: Blobs,
327
- },
328
- {typeName: "SignedBlockContents", jsonCase: "eth2"}
329
- );