@lodestar/state-transition 1.43.0 → 1.44.0-dev.00facd40a8
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/processDepositRequest.d.ts +3 -11
- package/lib/block/processDepositRequest.d.ts.map +1 -1
- package/lib/block/processDepositRequest.js +27 -35
- package/lib/block/processDepositRequest.js.map +1 -1
- package/lib/block/processParentExecutionPayload.d.ts.map +1 -1
- package/lib/block/processParentExecutionPayload.js +4 -3
- package/lib/block/processParentExecutionPayload.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/processProposerLookahead.d.ts.map +1 -1
- package/lib/epoch/processProposerLookahead.js +7 -2
- package/lib/epoch/processProposerLookahead.js.map +1 -1
- package/lib/lightClient/spec/index.d.ts +22 -0
- package/lib/lightClient/spec/index.d.ts.map +1 -0
- package/lib/lightClient/spec/index.js +58 -0
- package/lib/lightClient/spec/index.js.map +1 -0
- package/lib/lightClient/spec/isBetterUpdate.d.ts +23 -0
- package/lib/lightClient/spec/isBetterUpdate.d.ts.map +1 -0
- package/lib/lightClient/spec/isBetterUpdate.js +66 -0
- package/lib/lightClient/spec/isBetterUpdate.js.map +1 -0
- package/lib/lightClient/spec/processLightClientUpdate.d.ts +12 -0
- package/lib/lightClient/spec/processLightClientUpdate.d.ts.map +1 -0
- package/lib/lightClient/spec/processLightClientUpdate.js +80 -0
- package/lib/lightClient/spec/processLightClientUpdate.js.map +1 -0
- package/lib/lightClient/spec/store.d.ts +45 -0
- package/lib/lightClient/spec/store.d.ts.map +1 -0
- package/lib/lightClient/spec/store.js +56 -0
- package/lib/lightClient/spec/store.js.map +1 -0
- package/lib/lightClient/spec/utils.d.ts +47 -0
- package/lib/lightClient/spec/utils.d.ts.map +1 -0
- package/lib/lightClient/spec/utils.js +197 -0
- package/lib/lightClient/spec/utils.js.map +1 -0
- package/lib/lightClient/spec/validateLightClientBootstrap.d.ts +4 -0
- package/lib/lightClient/spec/validateLightClientBootstrap.d.ts.map +1 -0
- package/lib/lightClient/spec/validateLightClientBootstrap.js +22 -0
- package/lib/lightClient/spec/validateLightClientBootstrap.js.map +1 -0
- package/lib/lightClient/spec/validateLightClientUpdate.d.ts +5 -0
- package/lib/lightClient/spec/validateLightClientUpdate.d.ts.map +1 -0
- package/lib/lightClient/spec/validateLightClientUpdate.js +88 -0
- package/lib/lightClient/spec/validateLightClientUpdate.js.map +1 -0
- package/lib/slot/upgradeStateToGloas.d.ts.map +1 -1
- package/lib/slot/upgradeStateToGloas.js +35 -29
- package/lib/slot/upgradeStateToGloas.js.map +1 -1
- package/lib/stateView/beaconStateView.d.ts +9 -3
- package/lib/stateView/beaconStateView.d.ts.map +1 -1
- package/lib/stateView/beaconStateView.js +23 -4
- package/lib/stateView/beaconStateView.js.map +1 -1
- package/lib/stateView/interface.d.ts +27 -1
- package/lib/stateView/interface.d.ts.map +1 -1
- package/lib/stateView/interface.js.map +1 -1
- package/lib/stateView/nativeBeaconStateView.d.ts +226 -0
- package/lib/stateView/nativeBeaconStateView.d.ts.map +1 -0
- package/lib/stateView/nativeBeaconStateView.js +698 -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/gloas.d.ts +14 -0
- package/lib/util/gloas.d.ts.map +1 -1
- package/lib/util/gloas.js +24 -0
- package/lib/util/gloas.js.map +1 -1
- package/lib/util/index.d.ts +1 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +1 -0
- package/lib/util/index.js.map +1 -1
- package/lib/util/pendingDepositsLookup.d.ts +40 -0
- package/lib/util/pendingDepositsLookup.d.ts.map +1 -0
- package/lib/util/pendingDepositsLookup.js +84 -0
- package/lib/util/pendingDepositsLookup.js.map +1 -0
- package/lib/util/shuffling.d.ts +6 -5
- package/lib/util/shuffling.d.ts.map +1 -1
- package/lib/util/shuffling.js +13 -15
- package/lib/util/shuffling.js.map +1 -1
- package/package.json +12 -7
- package/src/block/processDepositRequest.ts +29 -47
- package/src/block/processParentExecutionPayload.ts +4 -3
- package/src/cache/epochCache.ts +10 -7
- package/src/epoch/processProposerLookahead.ts +8 -1
- package/src/lightClient/spec/index.ts +101 -0
- package/src/lightClient/spec/isBetterUpdate.ts +94 -0
- package/src/lightClient/spec/processLightClientUpdate.ts +119 -0
- package/src/lightClient/spec/store.ts +106 -0
- package/src/lightClient/spec/utils.ts +317 -0
- package/src/lightClient/spec/validateLightClientBootstrap.ts +39 -0
- package/src/lightClient/spec/validateLightClientUpdate.ts +145 -0
- package/src/slot/upgradeStateToGloas.ts +43 -45
- package/src/stateView/beaconStateView.ts +23 -4
- package/src/stateView/interface.ts +31 -1
- package/src/stateView/nativeBeaconStateView.ts +893 -0
- package/src/stateView/stateViewFactory.ts +2 -0
- package/src/util/gloas.ts +28 -0
- package/src/util/index.ts +1 -0
- package/src/util/pendingDepositsLookup.ts +105 -0
- package/src/util/shuffling.ts +17 -15
|
@@ -89,6 +89,7 @@ export interface IBeaconStateView {
|
|
|
89
89
|
currentProposers: ValidatorIndex[];
|
|
90
90
|
nextProposers: ValidatorIndex[];
|
|
91
91
|
getBeaconProposer(slot: Slot): ValidatorIndex;
|
|
92
|
+
getBeaconProposerOrNull(slot: Slot): ValidatorIndex | null;
|
|
92
93
|
|
|
93
94
|
// Validators and balances
|
|
94
95
|
effectiveBalanceIncrements: EffectiveBalanceIncrements;
|
|
@@ -253,7 +254,7 @@ export interface IBeaconStateViewGloas extends IBeaconStateViewFulu {
|
|
|
253
254
|
getBuilder(index: BuilderIndex): gloas.Builder;
|
|
254
255
|
canBuilderCoverBid(builderIndex: BuilderIndex, bidAmount: number): boolean;
|
|
255
256
|
getEpochPTCs(epoch: Epoch): Uint32Array[];
|
|
256
|
-
|
|
257
|
+
getIndicesInPayloadTimelinessCommittee(validatorIndex: ValidatorIndex, slot: Slot): number[];
|
|
257
258
|
/**
|
|
258
259
|
* Clone the state and apply parent execution payload effects.
|
|
259
260
|
* Used during block production and prepareNextSlot so that withdrawals and
|
|
@@ -277,6 +278,35 @@ export type IBeaconStateViewLatestFork = Omit<
|
|
|
277
278
|
latestExecutionPayloadHeader: ExecutionPayloadHeader;
|
|
278
279
|
payloadBlockNumber: number;
|
|
279
280
|
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Contract a BeaconStateView backing implementation must satisfy.
|
|
284
|
+
*
|
|
285
|
+
* Differs from `IBeaconStateViewLatestFork` in two ways:
|
|
286
|
+
* - `executionPayloadAvailability` is a raw `{uint8Array, bitLen}` POJO — a
|
|
287
|
+
* native (`.node`) binding cannot construct a `BitArray` across FFI.
|
|
288
|
+
* `NativeBeaconStateView` lifts it back to `BitArray` for beacon-node.
|
|
289
|
+
* - Methods that produce another view (`stateTransition`, `processSlots`,
|
|
290
|
+
* `loadOtherState`, `withParentPayloadApplied`) return `IBeaconStateViewNative`
|
|
291
|
+
* so callers can re-wrap without an `as unknown` cast. Param lists are reused
|
|
292
|
+
* via `Parameters<...>` to avoid duplicating signatures.
|
|
293
|
+
*
|
|
294
|
+
* The TS-side `BeaconStateView` also structurally satisfies this contract since
|
|
295
|
+
* `BitArray` exposes `uint8Array` and `bitLen`.
|
|
296
|
+
*/
|
|
297
|
+
export type IBeaconStateViewNative = Omit<
|
|
298
|
+
IBeaconStateViewLatestFork,
|
|
299
|
+
"executionPayloadAvailability" | "loadOtherState" | "stateTransition" | "processSlots" | "withParentPayloadApplied"
|
|
300
|
+
> & {
|
|
301
|
+
executionPayloadAvailability: {uint8Array: Uint8Array; bitLen: number};
|
|
302
|
+
loadOtherState(...args: Parameters<IBeaconStateViewLatestFork["loadOtherState"]>): IBeaconStateViewNative;
|
|
303
|
+
stateTransition(...args: Parameters<IBeaconStateViewLatestFork["stateTransition"]>): IBeaconStateViewNative;
|
|
304
|
+
processSlots(...args: Parameters<IBeaconStateViewLatestFork["processSlots"]>): IBeaconStateViewNative;
|
|
305
|
+
withParentPayloadApplied(
|
|
306
|
+
...args: Parameters<IBeaconStateViewLatestFork["withParentPayloadApplied"]>
|
|
307
|
+
): IBeaconStateViewNative;
|
|
308
|
+
};
|
|
309
|
+
|
|
280
310
|
export function isStatePostAltair(state: IBeaconStateView): state is IBeaconStateViewAltair {
|
|
281
311
|
return isForkPostAltair(state.forkName);
|
|
282
312
|
}
|