@lodestar/state-transition 1.44.0-dev.6ef8199cfa → 1.44.0-dev.762dd5f186
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/block/index.d.ts +2 -0
- package/lib/block/index.d.ts.map +1 -1
- package/lib/block/index.js +3 -1
- package/lib/block/index.js.map +1 -1
- package/lib/block/processBuilderDepositRequest.d.ts +10 -0
- package/lib/block/processBuilderDepositRequest.d.ts.map +1 -0
- package/lib/block/processBuilderDepositRequest.js +27 -0
- package/lib/block/processBuilderDepositRequest.js.map +1 -0
- package/lib/block/processBuilderExitRequest.d.ts +13 -0
- package/lib/block/processBuilderExitRequest.d.ts.map +1 -0
- package/lib/block/processBuilderExitRequest.js +29 -0
- package/lib/block/processBuilderExitRequest.js.map +1 -0
- package/lib/block/processDepositRequest.d.ts +2 -8
- package/lib/block/processDepositRequest.d.ts.map +1 -1
- package/lib/block/processDepositRequest.js +3 -98
- package/lib/block/processDepositRequest.js.map +1 -1
- package/lib/block/processExecutionPayloadBid.d.ts +2 -3
- package/lib/block/processExecutionPayloadBid.d.ts.map +1 -1
- package/lib/block/processExecutionPayloadBid.js +16 -8
- package/lib/block/processExecutionPayloadBid.js.map +1 -1
- package/lib/block/processOperations.d.ts.map +1 -1
- package/lib/block/processOperations.js +3 -2
- package/lib/block/processOperations.js.map +1 -1
- package/lib/block/processParentExecutionPayload.d.ts +2 -2
- package/lib/block/processParentExecutionPayload.d.ts.map +1 -1
- package/lib/block/processParentExecutionPayload.js +16 -8
- package/lib/block/processParentExecutionPayload.js.map +1 -1
- package/lib/block/processProposerSlashing.d.ts.map +1 -1
- package/lib/block/processProposerSlashing.js +9 -1
- package/lib/block/processProposerSlashing.js.map +1 -1
- package/lib/block/processVoluntaryExit.d.ts +1 -1
- package/lib/block/processVoluntaryExit.d.ts.map +1 -1
- package/lib/block/processVoluntaryExit.js +1 -35
- package/lib/block/processVoluntaryExit.js.map +1 -1
- package/lib/cache/epochCache.d.ts.map +1 -1
- package/lib/cache/epochCache.js +10 -7
- package/lib/cache/epochCache.js.map +1 -1
- package/lib/epoch/processPendingDeposits.d.ts.map +1 -1
- package/lib/epoch/processPendingDeposits.js +4 -3
- package/lib/epoch/processPendingDeposits.js.map +1 -1
- package/lib/epoch/processProposerLookahead.d.ts.map +1 -1
- package/lib/epoch/processProposerLookahead.js +7 -2
- package/lib/epoch/processProposerLookahead.js.map +1 -1
- package/lib/slot/upgradeStateToGloas.js +35 -29
- package/lib/slot/upgradeStateToGloas.js.map +1 -1
- package/lib/stateView/beaconStateView.d.ts +5 -2
- package/lib/stateView/beaconStateView.d.ts.map +1 -1
- package/lib/stateView/beaconStateView.js +14 -0
- package/lib/stateView/beaconStateView.js.map +1 -1
- package/lib/stateView/interface.d.ts +30 -2
- package/lib/stateView/interface.d.ts.map +1 -1
- package/lib/stateView/interface.js.map +1 -1
- package/lib/stateView/nativeBeaconStateView.d.ts +230 -0
- package/lib/stateView/nativeBeaconStateView.d.ts.map +1 -0
- package/lib/stateView/nativeBeaconStateView.js +717 -0
- package/lib/stateView/nativeBeaconStateView.js.map +1 -0
- package/lib/stateView/stateViewFactory.d.ts.map +1 -1
- package/lib/stateView/stateViewFactory.js +2 -0
- package/lib/stateView/stateViewFactory.js.map +1 -1
- package/lib/util/epochShuffling.js +1 -1
- package/lib/util/epochShuffling.js.map +1 -1
- package/lib/util/gloas.d.ts +31 -0
- package/lib/util/gloas.d.ts.map +1 -1
- package/lib/util/gloas.js +83 -1
- package/lib/util/gloas.js.map +1 -1
- package/lib/util/shuffling.d.ts +2 -2
- package/lib/util/shuffling.d.ts.map +1 -1
- package/lib/util/shuffling.js +4 -3
- package/lib/util/shuffling.js.map +1 -1
- package/package.json +7 -8
- package/src/block/index.ts +6 -1
- package/src/block/processBuilderDepositRequest.ts +43 -0
- package/src/block/processBuilderExitRequest.ts +39 -0
- package/src/block/processDepositRequest.ts +4 -124
- package/src/block/processExecutionPayloadBid.ts +24 -9
- package/src/block/processOperations.ts +3 -2
- package/src/block/processParentExecutionPayload.ts +23 -11
- package/src/block/processProposerSlashing.ts +9 -4
- package/src/block/processVoluntaryExit.ts +2 -61
- package/src/cache/epochCache.ts +10 -7
- package/src/epoch/processPendingDeposits.ts +2 -0
- package/src/epoch/processProposerLookahead.ts +8 -1
- package/src/slot/upgradeStateToGloas.ts +49 -33
- package/src/stateView/beaconStateView.ts +18 -1
- package/src/stateView/interface.ts +34 -1
- package/src/stateView/nativeBeaconStateView.ts +915 -0
- package/src/stateView/stateViewFactory.ts +2 -0
- package/src/util/epochShuffling.ts +1 -1
- package/src/util/gloas.ts +104 -1
- package/src/util/shuffling.ts +4 -3
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
BlindedBeaconBlock,
|
|
24
24
|
BuilderIndex,
|
|
25
25
|
Bytes32,
|
|
26
|
+
CommitteeIndex,
|
|
26
27
|
Epoch,
|
|
27
28
|
ExecutionPayloadBid,
|
|
28
29
|
ExecutionPayloadHeader,
|
|
@@ -75,6 +76,8 @@ export interface IBeaconStateView {
|
|
|
75
76
|
|
|
76
77
|
// Shuffling and committees
|
|
77
78
|
getShufflingAtEpoch(epoch: Epoch): EpochShuffling;
|
|
79
|
+
getBeaconCommittee(slot: Slot, index: CommitteeIndex): Uint32Array;
|
|
80
|
+
getBeaconCommitteeCountPerSlot(epoch: Epoch): number;
|
|
78
81
|
// Decision roots
|
|
79
82
|
previousDecisionRoot: RootHex;
|
|
80
83
|
currentDecisionRoot: RootHex;
|
|
@@ -89,6 +92,7 @@ export interface IBeaconStateView {
|
|
|
89
92
|
currentProposers: ValidatorIndex[];
|
|
90
93
|
nextProposers: ValidatorIndex[];
|
|
91
94
|
getBeaconProposer(slot: Slot): ValidatorIndex;
|
|
95
|
+
getBeaconProposerOrNull(slot: Slot): ValidatorIndex | null;
|
|
92
96
|
|
|
93
97
|
// Validators and balances
|
|
94
98
|
effectiveBalanceIncrements: EffectiveBalanceIncrements;
|
|
@@ -260,7 +264,7 @@ export interface IBeaconStateViewGloas extends IBeaconStateViewFulu {
|
|
|
260
264
|
* operation selection (e.g. voluntary exits) see the same post-apply state that the block
|
|
261
265
|
* processor will see at import.
|
|
262
266
|
*/
|
|
263
|
-
withParentPayloadApplied(executionRequests:
|
|
267
|
+
withParentPayloadApplied(executionRequests: gloas.ExecutionRequests): IBeaconStateViewGloas;
|
|
264
268
|
}
|
|
265
269
|
|
|
266
270
|
/**
|
|
@@ -277,6 +281,35 @@ export type IBeaconStateViewLatestFork = Omit<
|
|
|
277
281
|
latestExecutionPayloadHeader: ExecutionPayloadHeader;
|
|
278
282
|
payloadBlockNumber: number;
|
|
279
283
|
};
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Contract a BeaconStateView backing implementation must satisfy.
|
|
287
|
+
*
|
|
288
|
+
* Differs from `IBeaconStateViewLatestFork` in two ways:
|
|
289
|
+
* - `executionPayloadAvailability` is a raw `{uint8Array, bitLen}` POJO — a
|
|
290
|
+
* native (`.node`) binding cannot construct a `BitArray` across FFI.
|
|
291
|
+
* `NativeBeaconStateView` lifts it back to `BitArray` for beacon-node.
|
|
292
|
+
* - Methods that produce another view (`stateTransition`, `processSlots`,
|
|
293
|
+
* `loadOtherState`, `withParentPayloadApplied`) return `IBeaconStateViewNative`
|
|
294
|
+
* so callers can re-wrap without an `as unknown` cast. Param lists are reused
|
|
295
|
+
* via `Parameters<...>` to avoid duplicating signatures.
|
|
296
|
+
*
|
|
297
|
+
* The TS-side `BeaconStateView` also structurally satisfies this contract since
|
|
298
|
+
* `BitArray` exposes `uint8Array` and `bitLen`.
|
|
299
|
+
*/
|
|
300
|
+
export type IBeaconStateViewNative = Omit<
|
|
301
|
+
IBeaconStateViewLatestFork,
|
|
302
|
+
"executionPayloadAvailability" | "loadOtherState" | "stateTransition" | "processSlots" | "withParentPayloadApplied"
|
|
303
|
+
> & {
|
|
304
|
+
executionPayloadAvailability: {uint8Array: Uint8Array; bitLen: number};
|
|
305
|
+
loadOtherState(...args: Parameters<IBeaconStateViewLatestFork["loadOtherState"]>): IBeaconStateViewNative;
|
|
306
|
+
stateTransition(...args: Parameters<IBeaconStateViewLatestFork["stateTransition"]>): IBeaconStateViewNative;
|
|
307
|
+
processSlots(...args: Parameters<IBeaconStateViewLatestFork["processSlots"]>): IBeaconStateViewNative;
|
|
308
|
+
withParentPayloadApplied(
|
|
309
|
+
...args: Parameters<IBeaconStateViewLatestFork["withParentPayloadApplied"]>
|
|
310
|
+
): IBeaconStateViewNative;
|
|
311
|
+
};
|
|
312
|
+
|
|
280
313
|
export function isStatePostAltair(state: IBeaconStateView): state is IBeaconStateViewAltair {
|
|
281
314
|
return isForkPostAltair(state.forkName);
|
|
282
315
|
}
|