@lodestar/types 1.45.0 → 1.46.0-dev.18a1510f34
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/gloas/sszTypes.d.ts +983 -180
- 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/sszTypes.d.ts +7704 -7540
- package/lib/sszTypes.d.ts.map +1 -1
- package/lib/types.d.ts +13 -13
- package/lib/types.d.ts.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/package.json +13 -13
- package/src/gloas/sszTypes.ts +304 -72
- package/src/gloas/types.ts +33 -1
- package/src/types.ts +13 -13
- package/src/utils/typeguards.ts +12 -2
package/src/gloas/sszTypes.ts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BitVectorType,
|
|
3
|
-
ByteListType,
|
|
4
3
|
ContainerType,
|
|
5
4
|
ListBasicType,
|
|
6
5
|
ListCompositeType,
|
|
6
|
+
ProgressiveBitListType,
|
|
7
|
+
ProgressiveByteListType,
|
|
8
|
+
ProgressiveContainerType,
|
|
9
|
+
ProgressiveListBasicType,
|
|
10
|
+
ProgressiveListCompositeType,
|
|
7
11
|
VectorBasicType,
|
|
8
12
|
VectorCompositeType,
|
|
9
13
|
} from "@chainsafe/ssz";
|
|
10
14
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
CURRENT_SYNC_COMMITTEE_DEPTH_GLOAS,
|
|
16
|
+
EPOCHS_PER_SYNC_COMMITTEE_PERIOD,
|
|
17
|
+
EXECUTION_BLOCK_HASH_DEPTH_GLOAS,
|
|
18
|
+
FINALIZED_ROOT_DEPTH_GLOAS,
|
|
13
19
|
HISTORICAL_ROOTS_LIMIT,
|
|
14
|
-
MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD,
|
|
15
|
-
MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD,
|
|
16
|
-
MAX_BYTES_PER_TRANSACTION,
|
|
17
|
-
MAX_PAYLOAD_ATTESTATIONS,
|
|
18
20
|
MIN_SEED_LOOKAHEAD,
|
|
21
|
+
NEXT_SYNC_COMMITTEE_DEPTH_GLOAS,
|
|
19
22
|
NUMBER_OF_COLUMNS,
|
|
20
23
|
PTC_SIZE,
|
|
21
24
|
SLOTS_PER_EPOCH,
|
|
@@ -47,38 +50,101 @@ const {
|
|
|
47
50
|
Uint8,
|
|
48
51
|
BuilderIndex,
|
|
49
52
|
EpochInf,
|
|
53
|
+
ParticipationFlags,
|
|
50
54
|
} = primitiveSsz;
|
|
51
55
|
|
|
52
|
-
|
|
56
|
+
function activeFields(count: number): boolean[] {
|
|
57
|
+
return Array.from({length: count}, () => true);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const ExecutionBranch = new VectorCompositeType(Bytes32, EXECUTION_BLOCK_HASH_DEPTH_GLOAS);
|
|
61
|
+
|
|
62
|
+
export const CurrentSyncCommitteeBranch = new VectorCompositeType(Bytes32, CURRENT_SYNC_COMMITTEE_DEPTH_GLOAS);
|
|
63
|
+
|
|
64
|
+
export const FinalityBranch = new VectorCompositeType(Bytes32, FINALIZED_ROOT_DEPTH_GLOAS);
|
|
65
|
+
|
|
66
|
+
export const NextSyncCommitteeBranch = new VectorCompositeType(Bytes32, NEXT_SYNC_COMMITTEE_DEPTH_GLOAS);
|
|
67
|
+
|
|
68
|
+
export const AggregationBits = new ProgressiveBitListType({typeName: "AggregationBits"});
|
|
69
|
+
export const AttestingIndices = new ProgressiveListBasicType(ValidatorIndex, {typeName: "AttestingIndices"});
|
|
70
|
+
export const Transaction = new ProgressiveByteListType({typeName: "Transaction"});
|
|
71
|
+
export const Transactions = new ProgressiveListCompositeType(Transaction, {typeName: "Transactions"});
|
|
72
|
+
export const Withdrawals = new ProgressiveListCompositeType(capellaSsz.Withdrawal, {typeName: "Withdrawals"});
|
|
73
|
+
export const BlobKzgCommitments = new ProgressiveListCompositeType(denebSsz.KZGCommitment, {
|
|
74
|
+
typeName: "BlobKzgCommitments",
|
|
75
|
+
});
|
|
76
|
+
export const KZGProofs = new ProgressiveListCompositeType(denebSsz.KZGProof, {typeName: "KZGProofs"});
|
|
77
|
+
export const DataColumn = new ProgressiveListCompositeType(fuluSsz.Cell, {typeName: "DataColumn"});
|
|
78
|
+
|
|
79
|
+
export const Attestation = new ProgressiveContainerType(
|
|
53
80
|
{
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
depositEpoch: EpochInf,
|
|
59
|
-
withdrawableEpoch: EpochInf,
|
|
81
|
+
aggregationBits: AggregationBits,
|
|
82
|
+
data: phase0Ssz.AttestationData,
|
|
83
|
+
signature: BLSSignature,
|
|
84
|
+
committeeBits: electraSsz.CommitteeBits,
|
|
60
85
|
},
|
|
61
|
-
|
|
86
|
+
activeFields(4),
|
|
87
|
+
{typeName: "Attestation", jsonCase: "eth2"}
|
|
62
88
|
);
|
|
63
89
|
|
|
64
|
-
export const
|
|
90
|
+
export const IndexedAttestation = new ProgressiveContainerType(
|
|
65
91
|
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
92
|
+
attestingIndices: AttestingIndices,
|
|
93
|
+
data: phase0Ssz.AttestationData,
|
|
94
|
+
signature: BLSSignature,
|
|
69
95
|
},
|
|
70
|
-
|
|
96
|
+
activeFields(3),
|
|
97
|
+
{typeName: "IndexedAttestation", jsonCase: "eth2"}
|
|
71
98
|
);
|
|
72
99
|
|
|
73
|
-
|
|
100
|
+
/** Same as `IndexedAttestation` but epoch, slot and index are not bounded and must be a bigint */
|
|
101
|
+
export const IndexedAttestationBigint = new ProgressiveContainerType(
|
|
74
102
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
103
|
+
attestingIndices: AttestingIndices,
|
|
104
|
+
data: phase0Ssz.AttestationDataBigint,
|
|
105
|
+
signature: BLSSignature,
|
|
78
106
|
},
|
|
79
|
-
|
|
107
|
+
activeFields(3),
|
|
108
|
+
{typeName: "IndexedAttestation", jsonCase: "eth2"}
|
|
80
109
|
);
|
|
81
110
|
|
|
111
|
+
export const AttesterSlashing = new ContainerType(
|
|
112
|
+
{
|
|
113
|
+
attestation1: IndexedAttestationBigint,
|
|
114
|
+
attestation2: IndexedAttestationBigint,
|
|
115
|
+
},
|
|
116
|
+
{typeName: "AttesterSlashing", jsonCase: "eth2"}
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
export const AggregateAndProof = new ContainerType(
|
|
120
|
+
{
|
|
121
|
+
aggregatorIndex: ValidatorIndex,
|
|
122
|
+
aggregate: Attestation,
|
|
123
|
+
selectionProof: BLSSignature,
|
|
124
|
+
},
|
|
125
|
+
{typeName: "AggregateAndProof", jsonCase: "eth2", cachePermanentRootStruct: true}
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
export const SignedAggregateAndProof = new ContainerType(
|
|
129
|
+
{
|
|
130
|
+
message: AggregateAndProof,
|
|
131
|
+
signature: BLSSignature,
|
|
132
|
+
},
|
|
133
|
+
{typeName: "SignedAggregateAndProof", jsonCase: "eth2"}
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
export const DepositRequest = electraSsz.DepositRequest;
|
|
137
|
+
export const DepositRequests = new ProgressiveListCompositeType(DepositRequest, {typeName: "DepositRequests"});
|
|
138
|
+
export const WithdrawalRequest = electraSsz.WithdrawalRequest;
|
|
139
|
+
export const WithdrawalRequests = new ProgressiveListCompositeType(WithdrawalRequest, {
|
|
140
|
+
typeName: "WithdrawalRequests",
|
|
141
|
+
});
|
|
142
|
+
export const ConsolidationRequest = electraSsz.ConsolidationRequest;
|
|
143
|
+
export const ConsolidationRequests = new ProgressiveListCompositeType(ConsolidationRequest, {
|
|
144
|
+
typeName: "ConsolidationRequests",
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// New in GLOAS:EIP8282
|
|
82
148
|
export const BuilderDepositRequest = new ContainerType(
|
|
83
149
|
{
|
|
84
150
|
pubkey: BLSPubkey,
|
|
@@ -88,12 +154,11 @@ export const BuilderDepositRequest = new ContainerType(
|
|
|
88
154
|
},
|
|
89
155
|
{typeName: "BuilderDepositRequest", jsonCase: "eth2"}
|
|
90
156
|
);
|
|
157
|
+
export const BuilderDepositRequests = new ProgressiveListCompositeType(BuilderDepositRequest, {
|
|
158
|
+
typeName: "BuilderDepositRequests",
|
|
159
|
+
});
|
|
91
160
|
|
|
92
|
-
|
|
93
|
-
BuilderDepositRequest,
|
|
94
|
-
MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD
|
|
95
|
-
);
|
|
96
|
-
|
|
161
|
+
// New in GLOAS:EIP8282
|
|
97
162
|
export const BuilderExitRequest = new ContainerType(
|
|
98
163
|
{
|
|
99
164
|
sourceAddress: ExecutionAddress,
|
|
@@ -101,21 +166,88 @@ export const BuilderExitRequest = new ContainerType(
|
|
|
101
166
|
},
|
|
102
167
|
{typeName: "BuilderExitRequest", jsonCase: "eth2"}
|
|
103
168
|
);
|
|
169
|
+
export const BuilderExitRequests = new ProgressiveListCompositeType(BuilderExitRequest, {
|
|
170
|
+
typeName: "BuilderExitRequests",
|
|
171
|
+
});
|
|
104
172
|
|
|
105
|
-
export const
|
|
106
|
-
|
|
107
|
-
// New in GLOAS:EIP8282 — extends electra ExecutionRequests with builder deposits and exits
|
|
108
|
-
export const ExecutionRequests = new ContainerType(
|
|
173
|
+
export const ExecutionRequests = new ProgressiveContainerType(
|
|
109
174
|
{
|
|
110
|
-
deposits:
|
|
111
|
-
withdrawals:
|
|
112
|
-
consolidations:
|
|
113
|
-
builderDeposits: BuilderDepositRequests,
|
|
114
|
-
builderExits: BuilderExitRequests,
|
|
175
|
+
deposits: DepositRequests,
|
|
176
|
+
withdrawals: WithdrawalRequests,
|
|
177
|
+
consolidations: ConsolidationRequests,
|
|
178
|
+
builderDeposits: BuilderDepositRequests, // New in GLOAS:EIP8282
|
|
179
|
+
builderExits: BuilderExitRequests, // New in GLOAS:EIP8282
|
|
115
180
|
},
|
|
181
|
+
activeFields(5),
|
|
116
182
|
{typeName: "ExecutionRequests", jsonCase: "eth2"}
|
|
117
183
|
);
|
|
118
184
|
|
|
185
|
+
export const ProposerSlashings = new ProgressiveListCompositeType(phase0Ssz.ProposerSlashing, {
|
|
186
|
+
typeName: "ProposerSlashings",
|
|
187
|
+
});
|
|
188
|
+
export const AttesterSlashings = new ProgressiveListCompositeType(AttesterSlashing, {
|
|
189
|
+
typeName: "AttesterSlashings",
|
|
190
|
+
});
|
|
191
|
+
export const Attestations = new ProgressiveListCompositeType(Attestation, {typeName: "Attestations"});
|
|
192
|
+
export const Deposits = new ProgressiveListCompositeType(phase0Ssz.Deposit, {typeName: "Deposits"});
|
|
193
|
+
export const VoluntaryExits = new ProgressiveListCompositeType(phase0Ssz.SignedVoluntaryExit, {
|
|
194
|
+
typeName: "VoluntaryExits",
|
|
195
|
+
});
|
|
196
|
+
export const BlsToExecutionChanges = new ProgressiveListCompositeType(capellaSsz.SignedBLSToExecutionChange, {
|
|
197
|
+
typeName: "BLSToExecutionChanges",
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
export const Validators = new ProgressiveListCompositeType(phase0Ssz.Validator, {typeName: "Validators"});
|
|
201
|
+
export const Balances = new ProgressiveListBasicType(UintNum64, {typeName: "Balances"});
|
|
202
|
+
export const EpochParticipation = new ProgressiveListBasicType(ParticipationFlags, {
|
|
203
|
+
typeName: "EpochParticipation",
|
|
204
|
+
});
|
|
205
|
+
export const InactivityScores = new ProgressiveListBasicType(UintNum64, {typeName: "InactivityScores"});
|
|
206
|
+
export const PendingDeposits = new ProgressiveListCompositeType(electraSsz.PendingDeposit, {
|
|
207
|
+
typeName: "PendingDeposits",
|
|
208
|
+
});
|
|
209
|
+
export const PendingPartialWithdrawals = new ProgressiveListCompositeType(electraSsz.PendingPartialWithdrawal, {
|
|
210
|
+
typeName: "PendingPartialWithdrawals",
|
|
211
|
+
});
|
|
212
|
+
export const PendingConsolidations = new ProgressiveListCompositeType(electraSsz.PendingConsolidation, {
|
|
213
|
+
typeName: "PendingConsolidations",
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
export const Builder = new ContainerType(
|
|
217
|
+
{
|
|
218
|
+
pubkey: BLSPubkey,
|
|
219
|
+
version: Uint8,
|
|
220
|
+
executionAddress: ExecutionAddress,
|
|
221
|
+
balance: UintNum64,
|
|
222
|
+
depositEpoch: EpochInf,
|
|
223
|
+
withdrawableEpoch: EpochInf,
|
|
224
|
+
},
|
|
225
|
+
{typeName: "Builder", jsonCase: "eth2"}
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
export const BuilderPendingWithdrawal = new ContainerType(
|
|
229
|
+
{
|
|
230
|
+
feeRecipient: ExecutionAddress,
|
|
231
|
+
amount: UintNum64,
|
|
232
|
+
builderIndex: BuilderIndex,
|
|
233
|
+
},
|
|
234
|
+
{typeName: "BuilderPendingWithdrawal", jsonCase: "eth2"}
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
export const BuilderPendingPayment = new ContainerType(
|
|
238
|
+
{
|
|
239
|
+
weight: UintNum64,
|
|
240
|
+
withdrawal: BuilderPendingWithdrawal,
|
|
241
|
+
proposerIndex: ValidatorIndex,
|
|
242
|
+
},
|
|
243
|
+
{typeName: "BuilderPendingPayment", jsonCase: "eth2"}
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
export const Builders = new ProgressiveListCompositeType(Builder, {typeName: "Builders"});
|
|
247
|
+
export const BuilderPendingWithdrawals = new ProgressiveListCompositeType(BuilderPendingWithdrawal, {
|
|
248
|
+
typeName: "BuilderPendingWithdrawals",
|
|
249
|
+
});
|
|
250
|
+
|
|
119
251
|
export const PayloadTimelinessCommittee = new VectorBasicType(ValidatorIndex, PTC_SIZE);
|
|
120
252
|
export const PtcWindow = new VectorCompositeType(
|
|
121
253
|
PayloadTimelinessCommittee,
|
|
@@ -132,15 +264,20 @@ export const PayloadAttestationData = new ContainerType(
|
|
|
132
264
|
{typeName: "PayloadAttestationData", jsonCase: "eth2"}
|
|
133
265
|
);
|
|
134
266
|
|
|
135
|
-
export const PayloadAttestation = new
|
|
267
|
+
export const PayloadAttestation = new ProgressiveContainerType(
|
|
136
268
|
{
|
|
137
269
|
aggregationBits: new BitVectorType(PTC_SIZE),
|
|
138
270
|
data: PayloadAttestationData,
|
|
139
271
|
signature: BLSSignature,
|
|
140
272
|
},
|
|
273
|
+
activeFields(3),
|
|
141
274
|
{typeName: "PayloadAttestation", jsonCase: "eth2"}
|
|
142
275
|
);
|
|
143
276
|
|
|
277
|
+
export const PayloadAttestations = new ProgressiveListCompositeType(PayloadAttestation, {
|
|
278
|
+
typeName: "PayloadAttestations",
|
|
279
|
+
});
|
|
280
|
+
|
|
144
281
|
export const PayloadAttestationMessage = new ContainerType(
|
|
145
282
|
{
|
|
146
283
|
validatorIndex: ValidatorIndex,
|
|
@@ -150,12 +287,13 @@ export const PayloadAttestationMessage = new ContainerType(
|
|
|
150
287
|
{typeName: "PayloadAttestationMessage", jsonCase: "eth2"}
|
|
151
288
|
);
|
|
152
289
|
|
|
153
|
-
export const IndexedPayloadAttestation = new
|
|
290
|
+
export const IndexedPayloadAttestation = new ProgressiveContainerType(
|
|
154
291
|
{
|
|
155
292
|
attestingIndices: new ListBasicType(ValidatorIndex, PTC_SIZE),
|
|
156
293
|
data: PayloadAttestationData,
|
|
157
294
|
signature: BLSSignature,
|
|
158
295
|
},
|
|
296
|
+
activeFields(3),
|
|
159
297
|
{typeName: "IndexedPayloadAttestation", jsonCase: "eth2"}
|
|
160
298
|
);
|
|
161
299
|
|
|
@@ -165,7 +303,10 @@ export const ProposerPreferences = new ContainerType(
|
|
|
165
303
|
proposalSlot: Slot,
|
|
166
304
|
validatorIndex: ValidatorIndex,
|
|
167
305
|
feeRecipient: ExecutionAddress,
|
|
168
|
-
targetGasLimit
|
|
306
|
+
// targetGasLimit is a proposer-set uint64 with no bound; use UintBn64 so a value above 2**53
|
|
307
|
+
// round-trips exactly (this container is not in the block HTR, but the value is emitted to the
|
|
308
|
+
// EL via engine PayloadAttributesV4 and over the SSE payload_attributes event).
|
|
309
|
+
targetGasLimit: UintBn64,
|
|
169
310
|
},
|
|
170
311
|
{typeName: "ProposerPreferences", jsonCase: "eth2"}
|
|
171
312
|
);
|
|
@@ -178,21 +319,27 @@ export const SignedProposerPreferences = new ContainerType(
|
|
|
178
319
|
{typeName: "SignedProposerPreferences", jsonCase: "eth2"}
|
|
179
320
|
);
|
|
180
321
|
|
|
181
|
-
export const ExecutionPayloadBid = new
|
|
322
|
+
export const ExecutionPayloadBid = new ProgressiveContainerType(
|
|
182
323
|
{
|
|
183
324
|
parentBlockHash: Bytes32,
|
|
184
325
|
parentBlockRoot: Root,
|
|
185
326
|
blockHash: Bytes32,
|
|
186
327
|
prevRandao: Bytes32,
|
|
187
328
|
feeRecipient: ExecutionAddress,
|
|
188
|
-
gasLimit
|
|
329
|
+
// gasLimit is a uint64 with no bound in process_execution_payload_bid (the gas-limit target
|
|
330
|
+
// check is gossip-only), so a block can carry any value; use UintBn64 so the bid hashTreeRoot
|
|
331
|
+
// matches exact-uint64 clients for values above 2**53.
|
|
332
|
+
gasLimit: UintBn64,
|
|
189
333
|
builderIndex: BuilderIndex,
|
|
190
334
|
slot: Slot,
|
|
191
335
|
value: UintNum64,
|
|
192
|
-
executionPayment
|
|
193
|
-
|
|
336
|
+
// executionPayment is a uint64 with no bound in process_execution_payload_bid, so a block can
|
|
337
|
+
// carry any value; use UintBn64 so the hashTreeRoot matches exact-uint64 clients for values > 2**53.
|
|
338
|
+
executionPayment: UintBn64,
|
|
339
|
+
blobKzgCommitments: BlobKzgCommitments,
|
|
194
340
|
executionRequestsRoot: Root,
|
|
195
341
|
},
|
|
342
|
+
activeFields(12),
|
|
196
343
|
{typeName: "ExecutionPayloadBid", jsonCase: "eth2"}
|
|
197
344
|
);
|
|
198
345
|
|
|
@@ -204,18 +351,21 @@ export const SignedExecutionPayloadBid = new ContainerType(
|
|
|
204
351
|
{typeName: "SignedExecutionPayloadBid", jsonCase: "eth2"}
|
|
205
352
|
);
|
|
206
353
|
|
|
207
|
-
export const BlockAccessList = new
|
|
354
|
+
export const BlockAccessList = new ProgressiveByteListType({typeName: "BlockAccessList"});
|
|
208
355
|
|
|
209
|
-
export const ExecutionPayload = new
|
|
356
|
+
export const ExecutionPayload = new ProgressiveContainerType(
|
|
210
357
|
{
|
|
211
358
|
...electraSsz.ExecutionPayload.fields,
|
|
359
|
+
transactions: Transactions,
|
|
360
|
+
withdrawals: Withdrawals,
|
|
212
361
|
blockAccessList: BlockAccessList, // New in GLOAS:EIP-7928
|
|
213
362
|
slotNumber: Slot, // New in GLOAS:EIP-7843
|
|
214
363
|
},
|
|
364
|
+
activeFields(19),
|
|
215
365
|
{typeName: "ExecutionPayload", jsonCase: "eth2"}
|
|
216
366
|
);
|
|
217
367
|
|
|
218
|
-
export const ExecutionPayloadEnvelope = new
|
|
368
|
+
export const ExecutionPayloadEnvelope = new ProgressiveContainerType(
|
|
219
369
|
{
|
|
220
370
|
payload: ExecutionPayload,
|
|
221
371
|
executionRequests: ExecutionRequests,
|
|
@@ -223,6 +373,7 @@ export const ExecutionPayloadEnvelope = new ContainerType(
|
|
|
223
373
|
beaconBlockRoot: Root,
|
|
224
374
|
parentBeaconBlockRoot: Root,
|
|
225
375
|
},
|
|
376
|
+
activeFields(5),
|
|
226
377
|
{typeName: "ExecutionPayloadEnvelope", jsonCase: "eth2"}
|
|
227
378
|
);
|
|
228
379
|
|
|
@@ -234,25 +385,35 @@ export const SignedExecutionPayloadEnvelope = new ContainerType(
|
|
|
234
385
|
{typeName: "SignedExecutionPayloadEnvelope", jsonCase: "eth2"}
|
|
235
386
|
);
|
|
236
387
|
|
|
237
|
-
export const
|
|
388
|
+
export const SignedExecutionPayloadEnvelopeContents = new ContainerType(
|
|
389
|
+
{
|
|
390
|
+
signedExecutionPayloadEnvelope: SignedExecutionPayloadEnvelope,
|
|
391
|
+
kzgProofs: fuluSsz.KZGProofs,
|
|
392
|
+
blobs: denebSsz.Blobs,
|
|
393
|
+
},
|
|
394
|
+
{typeName: "SignedExecutionPayloadEnvelopeContents", jsonCase: "eth2"}
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
export const BeaconBlockBody = new ProgressiveContainerType(
|
|
238
398
|
{
|
|
239
399
|
randaoReveal: phase0Ssz.BeaconBlockBody.fields.randaoReveal,
|
|
240
400
|
eth1Data: phase0Ssz.BeaconBlockBody.fields.eth1Data,
|
|
241
401
|
graffiti: phase0Ssz.BeaconBlockBody.fields.graffiti,
|
|
242
|
-
proposerSlashings:
|
|
243
|
-
attesterSlashings:
|
|
244
|
-
attestations:
|
|
245
|
-
deposits:
|
|
246
|
-
voluntaryExits:
|
|
402
|
+
proposerSlashings: ProposerSlashings,
|
|
403
|
+
attesterSlashings: AttesterSlashings,
|
|
404
|
+
attestations: Attestations,
|
|
405
|
+
deposits: Deposits,
|
|
406
|
+
voluntaryExits: VoluntaryExits,
|
|
247
407
|
syncAggregate: altairSsz.BeaconBlockBody.fields.syncAggregate,
|
|
248
408
|
// executionPayload: ExecutionPayload, // Removed in GLOAS:EIP7732
|
|
249
|
-
blsToExecutionChanges:
|
|
409
|
+
blsToExecutionChanges: BlsToExecutionChanges,
|
|
250
410
|
// blobKzgCommitments: denebSsz.BeaconBlockBody.fields.blobKzgCommitments, // Removed in GLOAS:EIP7732
|
|
251
411
|
// executionRequests: ExecutionRequests, // Removed in GLOAS:EIP7732
|
|
252
412
|
signedExecutionPayloadBid: SignedExecutionPayloadBid, // New in GLOAS:EIP7732
|
|
253
|
-
payloadAttestations:
|
|
413
|
+
payloadAttestations: PayloadAttestations, // New in GLOAS:EIP7732
|
|
254
414
|
parentExecutionRequests: ExecutionRequests, // New in GLOAS:EIP7732
|
|
255
415
|
},
|
|
416
|
+
activeFields(13),
|
|
256
417
|
{typeName: "BeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
|
|
257
418
|
);
|
|
258
419
|
|
|
@@ -272,7 +433,77 @@ export const SignedBeaconBlock = new ContainerType(
|
|
|
272
433
|
{typeName: "SignedBeaconBlock", jsonCase: "eth2"}
|
|
273
434
|
);
|
|
274
435
|
|
|
275
|
-
|
|
436
|
+
// Full block production response for self-builds, enables stateless envelope publishing
|
|
437
|
+
export const BlockContents = new ContainerType(
|
|
438
|
+
{
|
|
439
|
+
block: BeaconBlock,
|
|
440
|
+
executionPayloadEnvelope: ExecutionPayloadEnvelope,
|
|
441
|
+
kzgProofs: fuluSsz.KZGProofs,
|
|
442
|
+
blobs: denebSsz.Blobs,
|
|
443
|
+
},
|
|
444
|
+
{typeName: "BlockContents", jsonCase: "eth2"}
|
|
445
|
+
);
|
|
446
|
+
|
|
447
|
+
export const LightClientHeader = new ContainerType(
|
|
448
|
+
{
|
|
449
|
+
beacon: phase0Ssz.BeaconBlockHeader,
|
|
450
|
+
executionBlockHash: Bytes32,
|
|
451
|
+
executionBranch: ExecutionBranch,
|
|
452
|
+
},
|
|
453
|
+
{typeName: "LightClientHeader", jsonCase: "eth2"}
|
|
454
|
+
);
|
|
455
|
+
|
|
456
|
+
export const LightClientBootstrap = new ContainerType(
|
|
457
|
+
{
|
|
458
|
+
header: LightClientHeader,
|
|
459
|
+
currentSyncCommittee: altairSsz.SyncCommittee,
|
|
460
|
+
currentSyncCommitteeBranch: CurrentSyncCommitteeBranch,
|
|
461
|
+
},
|
|
462
|
+
{typeName: "LightClientBootstrap", jsonCase: "eth2"}
|
|
463
|
+
);
|
|
464
|
+
|
|
465
|
+
export const LightClientUpdate = new ContainerType(
|
|
466
|
+
{
|
|
467
|
+
attestedHeader: LightClientHeader,
|
|
468
|
+
nextSyncCommittee: altairSsz.SyncCommittee,
|
|
469
|
+
nextSyncCommitteeBranch: NextSyncCommitteeBranch,
|
|
470
|
+
finalizedHeader: LightClientHeader,
|
|
471
|
+
finalityBranch: FinalityBranch,
|
|
472
|
+
syncAggregate: altairSsz.SyncAggregate,
|
|
473
|
+
signatureSlot: Slot,
|
|
474
|
+
},
|
|
475
|
+
{typeName: "LightClientUpdate", jsonCase: "eth2"}
|
|
476
|
+
);
|
|
477
|
+
|
|
478
|
+
export const LightClientFinalityUpdate = new ContainerType(
|
|
479
|
+
{
|
|
480
|
+
attestedHeader: LightClientHeader,
|
|
481
|
+
finalizedHeader: LightClientHeader,
|
|
482
|
+
finalityBranch: FinalityBranch,
|
|
483
|
+
syncAggregate: altairSsz.SyncAggregate,
|
|
484
|
+
signatureSlot: Slot,
|
|
485
|
+
},
|
|
486
|
+
{typeName: "LightClientFinalityUpdate", jsonCase: "eth2"}
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
export const LightClientOptimisticUpdate = new ContainerType(
|
|
490
|
+
{
|
|
491
|
+
attestedHeader: LightClientHeader,
|
|
492
|
+
syncAggregate: altairSsz.SyncAggregate,
|
|
493
|
+
signatureSlot: Slot,
|
|
494
|
+
},
|
|
495
|
+
{typeName: "LightClientOptimisticUpdate", jsonCase: "eth2"}
|
|
496
|
+
);
|
|
497
|
+
|
|
498
|
+
export const LightClientStore = new ContainerType(
|
|
499
|
+
{
|
|
500
|
+
snapshot: LightClientBootstrap,
|
|
501
|
+
validUpdates: new ListCompositeType(LightClientUpdate, EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH),
|
|
502
|
+
},
|
|
503
|
+
{typeName: "LightClientStore", jsonCase: "eth2"}
|
|
504
|
+
);
|
|
505
|
+
|
|
506
|
+
export const BeaconState = new ProgressiveContainerType(
|
|
276
507
|
{
|
|
277
508
|
genesisTime: UintNum64,
|
|
278
509
|
genesisValidatorsRoot: Root,
|
|
@@ -289,21 +520,21 @@ export const BeaconState = new ContainerType(
|
|
|
289
520
|
eth1DataVotes: phase0Ssz.Eth1DataVotes,
|
|
290
521
|
eth1DepositIndex: UintNum64,
|
|
291
522
|
// Registry
|
|
292
|
-
validators:
|
|
293
|
-
balances:
|
|
523
|
+
validators: Validators,
|
|
524
|
+
balances: Balances,
|
|
294
525
|
randaoMixes: phase0Ssz.RandaoMixes,
|
|
295
526
|
// Slashings
|
|
296
527
|
slashings: phase0Ssz.Slashings,
|
|
297
528
|
// Participation
|
|
298
|
-
previousEpochParticipation:
|
|
299
|
-
currentEpochParticipation:
|
|
529
|
+
previousEpochParticipation: EpochParticipation,
|
|
530
|
+
currentEpochParticipation: EpochParticipation,
|
|
300
531
|
// Finality
|
|
301
532
|
justificationBits: phase0Ssz.JustificationBits,
|
|
302
533
|
previousJustifiedCheckpoint: phase0Ssz.Checkpoint,
|
|
303
534
|
currentJustifiedCheckpoint: phase0Ssz.Checkpoint,
|
|
304
535
|
finalizedCheckpoint: phase0Ssz.Checkpoint,
|
|
305
536
|
// Inactivity
|
|
306
|
-
inactivityScores:
|
|
537
|
+
inactivityScores: InactivityScores,
|
|
307
538
|
// Sync
|
|
308
539
|
currentSyncCommittee: altairSsz.SyncCommittee,
|
|
309
540
|
nextSyncCommittee: altairSsz.SyncCommittee,
|
|
@@ -321,28 +552,29 @@ export const BeaconState = new ContainerType(
|
|
|
321
552
|
earliestExitEpoch: Epoch,
|
|
322
553
|
consolidationBalanceToConsume: Gwei,
|
|
323
554
|
earliestConsolidationEpoch: Epoch,
|
|
324
|
-
pendingDeposits:
|
|
325
|
-
pendingPartialWithdrawals:
|
|
326
|
-
pendingConsolidations:
|
|
555
|
+
pendingDeposits: PendingDeposits,
|
|
556
|
+
pendingPartialWithdrawals: PendingPartialWithdrawals,
|
|
557
|
+
pendingConsolidations: PendingConsolidations,
|
|
327
558
|
proposerLookahead: fuluSsz.BeaconState.fields.proposerLookahead,
|
|
328
|
-
builders:
|
|
559
|
+
builders: Builders, // New in GLOAS:EIP7732
|
|
329
560
|
nextWithdrawalBuilderIndex: BuilderIndex, // New in GLOAS:EIP7732
|
|
330
561
|
executionPayloadAvailability: new BitVectorType(SLOTS_PER_HISTORICAL_ROOT), // New in GLOAS:EIP7732
|
|
331
562
|
builderPendingPayments: new VectorCompositeType(BuilderPendingPayment, 2 * SLOTS_PER_EPOCH), // New in GLOAS:EIP7732
|
|
332
|
-
builderPendingWithdrawals:
|
|
563
|
+
builderPendingWithdrawals: BuilderPendingWithdrawals, // New in GLOAS:EIP7732
|
|
333
564
|
latestExecutionPayloadBid: ExecutionPayloadBid, // New in GLOAS:EIP7732
|
|
334
|
-
payloadExpectedWithdrawals:
|
|
565
|
+
payloadExpectedWithdrawals: Withdrawals, // New in GLOAS:EIP7732
|
|
335
566
|
ptcWindow: PtcWindow, // New in GLOAS:EIP7732
|
|
336
567
|
},
|
|
568
|
+
activeFields(46),
|
|
337
569
|
{typeName: "BeaconState", jsonCase: "eth2"}
|
|
338
570
|
);
|
|
339
571
|
|
|
340
572
|
export const DataColumnSidecar = new ContainerType(
|
|
341
573
|
{
|
|
342
574
|
index: fuluSsz.DataColumnSidecar.fields.index,
|
|
343
|
-
column:
|
|
575
|
+
column: DataColumn,
|
|
344
576
|
// kzgCommitments: denebSsz.BlobKzgCommitments, // Removed in GLOAS:EIP7732
|
|
345
|
-
kzgProofs:
|
|
577
|
+
kzgProofs: KZGProofs,
|
|
346
578
|
// signedBlockHeader: phase0Ssz.SignedBeaconBlockHeader, // Removed in GLOAS:EIP7732
|
|
347
579
|
// kzgCommitmentsInclusionProof: KzgCommitmentsInclusionProof, // Removed in GLOAS:EIP7732
|
|
348
580
|
slot: Slot, // New in GLOAS:EIP7732
|
|
@@ -363,7 +595,7 @@ export const PayloadAttributes = new ContainerType(
|
|
|
363
595
|
{
|
|
364
596
|
...denebSsz.PayloadAttributes.fields,
|
|
365
597
|
slotNumber: Slot,
|
|
366
|
-
targetGasLimit:
|
|
598
|
+
targetGasLimit: UintBn64,
|
|
367
599
|
},
|
|
368
600
|
{typeName: "PayloadAttributes", jsonCase: "eth2"}
|
|
369
601
|
);
|
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>;
|
package/src/types.ts
CHANGED
|
@@ -294,12 +294,12 @@ type TypesByFork = {
|
|
|
294
294
|
SignedBeaconBlock: gloas.SignedBeaconBlock;
|
|
295
295
|
Metadata: fulu.Metadata;
|
|
296
296
|
Status: fulu.Status;
|
|
297
|
-
LightClientHeader:
|
|
298
|
-
LightClientBootstrap:
|
|
299
|
-
LightClientUpdate:
|
|
300
|
-
LightClientFinalityUpdate:
|
|
301
|
-
LightClientOptimisticUpdate:
|
|
302
|
-
LightClientStore:
|
|
297
|
+
LightClientHeader: gloas.LightClientHeader;
|
|
298
|
+
LightClientBootstrap: gloas.LightClientBootstrap;
|
|
299
|
+
LightClientUpdate: gloas.LightClientUpdate;
|
|
300
|
+
LightClientFinalityUpdate: gloas.LightClientFinalityUpdate;
|
|
301
|
+
LightClientOptimisticUpdate: gloas.LightClientOptimisticUpdate;
|
|
302
|
+
LightClientStore: gloas.LightClientStore;
|
|
303
303
|
BlindedBeaconBlock: electra.BlindedBeaconBlock;
|
|
304
304
|
BlindedBeaconBlockBody: electra.BlindedBeaconBlockBody;
|
|
305
305
|
SignedBlindedBeaconBlock: electra.SignedBlindedBeaconBlock;
|
|
@@ -308,19 +308,19 @@ type TypesByFork = {
|
|
|
308
308
|
BuilderBid: electra.BuilderBid;
|
|
309
309
|
SignedBuilderBid: electra.SignedBuilderBid;
|
|
310
310
|
SSEPayloadAttributes: gloas.SSEPayloadAttributes;
|
|
311
|
-
BlockContents:
|
|
311
|
+
BlockContents: gloas.BlockContents;
|
|
312
312
|
SignedBlockContents: fulu.SignedBlockContents;
|
|
313
313
|
ExecutionPayloadAndBlobsBundle: fulu.ExecutionPayloadAndBlobsBundle;
|
|
314
314
|
BlobsBundle: fulu.BlobsBundle;
|
|
315
315
|
SyncCommittee: altair.SyncCommittee;
|
|
316
316
|
SyncAggregate: altair.SyncAggregate;
|
|
317
317
|
SingleAttestation: electra.SingleAttestation;
|
|
318
|
-
Attestation:
|
|
319
|
-
IndexedAttestation:
|
|
320
|
-
IndexedAttestationBigint:
|
|
321
|
-
AttesterSlashing:
|
|
322
|
-
AggregateAndProof:
|
|
323
|
-
SignedAggregateAndProof:
|
|
318
|
+
Attestation: gloas.Attestation;
|
|
319
|
+
IndexedAttestation: gloas.IndexedAttestation;
|
|
320
|
+
IndexedAttestationBigint: gloas.IndexedAttestationBigint;
|
|
321
|
+
AttesterSlashing: gloas.AttesterSlashing;
|
|
322
|
+
AggregateAndProof: gloas.AggregateAndProof;
|
|
323
|
+
SignedAggregateAndProof: gloas.SignedAggregateAndProof;
|
|
324
324
|
ExecutionRequests: gloas.ExecutionRequests;
|
|
325
325
|
ExecutionPayloadBid: gloas.ExecutionPayloadBid;
|
|
326
326
|
DataColumnSidecar: gloas.DataColumnSidecar;
|