@lodestar/state-transition 1.50.0-dev.033e6b7138 → 1.50.0-dev.03c05fa09a
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.map +1 -1
- package/lib/block/index.js +1 -1
- package/lib/block/index.js.map +1 -1
- package/lib/block/indexedBuilderState.d.ts +19 -0
- package/lib/block/indexedBuilderState.d.ts.map +1 -0
- package/lib/block/indexedBuilderState.js +60 -0
- package/lib/block/indexedBuilderState.js.map +1 -0
- package/lib/block/processBuilderDepositRequest.d.ts +2 -2
- package/lib/block/processBuilderDepositRequest.d.ts.map +1 -1
- package/lib/block/processBuilderDepositRequest.js +5 -4
- package/lib/block/processBuilderDepositRequest.js.map +1 -1
- package/lib/block/processBuilderExitRequest.d.ts +2 -2
- package/lib/block/processBuilderExitRequest.d.ts.map +1 -1
- package/lib/block/processBuilderExitRequest.js +4 -3
- package/lib/block/processBuilderExitRequest.js.map +1 -1
- package/lib/block/processDeposit.d.ts +2 -2
- package/lib/block/processDeposit.d.ts.map +1 -1
- package/lib/block/processDeposit.js.map +1 -1
- package/lib/block/processEth1Data.d.ts +3 -3
- package/lib/block/processEth1Data.d.ts.map +1 -1
- package/lib/block/processEth1Data.js.map +1 -1
- package/lib/block/processOperations.d.ts.map +1 -1
- package/lib/block/processOperations.js +8 -6
- package/lib/block/processOperations.js.map +1 -1
- package/lib/block/processParentExecutionPayload.d.ts.map +1 -1
- package/lib/block/processParentExecutionPayload.js +23 -18
- package/lib/block/processParentExecutionPayload.js.map +1 -1
- package/lib/block/processProposerSlashing.d.ts.map +1 -1
- package/lib/block/processProposerSlashing.js +0 -23
- package/lib/block/processProposerSlashing.js.map +1 -1
- package/lib/block/slashValidator.d.ts.map +1 -1
- package/lib/block/slashValidator.js +11 -0
- package/lib/block/slashValidator.js.map +1 -1
- package/lib/cache/stateCache.d.ts +2 -1
- package/lib/cache/stateCache.d.ts.map +1 -1
- package/lib/cache/stateCache.js.map +1 -1
- package/lib/cache/types.d.ts +2 -1
- package/lib/cache/types.d.ts.map +1 -1
- package/lib/epoch/index.d.ts.map +1 -1
- package/lib/epoch/index.js +3 -1
- package/lib/epoch/index.js.map +1 -1
- package/lib/epoch/processEth1DataReset.d.ts +2 -2
- package/lib/epoch/processEth1DataReset.d.ts.map +1 -1
- package/lib/epoch/processEth1DataReset.js.map +1 -1
- package/lib/epoch/processPendingDeposits.d.ts.map +1 -1
- package/lib/epoch/processPendingDeposits.js +8 -4
- package/lib/epoch/processPendingDeposits.js.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/rewards/attestationsRewards.d.ts.map +1 -1
- package/lib/rewards/attestationsRewards.js +8 -1
- package/lib/rewards/attestationsRewards.js.map +1 -1
- package/lib/signatureSets/index.d.ts.map +1 -1
- package/lib/signatureSets/index.js +2 -2
- package/lib/signatureSets/index.js.map +1 -1
- package/lib/signatureSets/voluntaryExits.d.ts +2 -6
- package/lib/signatureSets/voluntaryExits.d.ts.map +1 -1
- package/lib/signatureSets/voluntaryExits.js +2 -32
- package/lib/signatureSets/voluntaryExits.js.map +1 -1
- package/lib/slot/upgradeStateToHeze.d.ts.map +1 -1
- package/lib/slot/upgradeStateToHeze.js +4 -4
- package/lib/slot/upgradeStateToHeze.js.map +1 -1
- package/lib/stateView/beaconStateView.d.ts +23 -21
- package/lib/stateView/beaconStateView.d.ts.map +1 -1
- package/lib/stateView/beaconStateView.js +77 -71
- package/lib/stateView/beaconStateView.js.map +1 -1
- package/lib/stateView/interface.d.ts +37 -21
- package/lib/stateView/interface.d.ts.map +1 -1
- package/lib/stateView/interface.js.map +1 -1
- package/lib/stateView/nativeBeaconStateView.d.ts +94 -100
- package/lib/stateView/nativeBeaconStateView.d.ts.map +1 -1
- package/lib/stateView/nativeBeaconStateView.js +353 -368
- package/lib/stateView/nativeBeaconStateView.js.map +1 -1
- package/lib/stateView/stateViewFactory.d.ts +10 -17
- package/lib/stateView/stateViewFactory.d.ts.map +1 -1
- package/lib/stateView/stateViewFactory.js +17 -13
- package/lib/stateView/stateViewFactory.js.map +1 -1
- package/lib/types.d.ts +2 -2
- package/lib/types.d.ts.map +1 -1
- package/lib/util/blindedBlock.d.ts +1 -1
- package/lib/util/blindedBlock.d.ts.map +1 -1
- package/lib/util/blindedBlock.js +5 -2
- package/lib/util/blindedBlock.js.map +1 -1
- package/lib/util/clock.d.ts +5 -0
- package/lib/util/clock.d.ts.map +1 -1
- package/lib/util/clock.js +19 -16
- package/lib/util/clock.js.map +1 -1
- package/lib/util/deposit.d.ts +2 -2
- package/lib/util/deposit.d.ts.map +1 -1
- package/lib/util/deposit.js.map +1 -1
- package/lib/util/genesis.d.ts.map +1 -1
- package/lib/util/genesis.js +46 -23
- package/lib/util/genesis.js.map +1 -1
- package/lib/util/gloas.d.ts +11 -14
- package/lib/util/gloas.d.ts.map +1 -1
- package/lib/util/gloas.js +2 -42
- 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/slot.d.ts +3 -1
- package/lib/util/slot.d.ts.map +1 -1
- package/lib/util/slot.js +4 -0
- package/lib/util/slot.js.map +1 -1
- package/lib/util/sszBytes.d.ts +16 -17
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +93 -20
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/weakSubjectivity.d.ts +11 -6
- package/lib/util/weakSubjectivity.d.ts.map +1 -1
- package/lib/util/weakSubjectivity.js +22 -28
- package/lib/util/weakSubjectivity.js.map +1 -1
- package/package.json +8 -8
- package/src/block/index.ts +4 -3
- package/src/block/indexedBuilderState.ts +65 -0
- package/src/block/processBuilderDepositRequest.ts +6 -17
- package/src/block/processBuilderExitRequest.ts +5 -9
- package/src/block/processDeposit.ts +7 -2
- package/src/block/processEth1Data.ts +3 -3
- package/src/block/processOperations.ts +14 -11
- package/src/block/processParentExecutionPayload.ts +27 -23
- package/src/block/processProposerSlashing.ts +2 -28
- package/src/block/slashValidator.ts +13 -2
- package/src/cache/stateCache.ts +2 -0
- package/src/cache/types.ts +2 -1
- package/src/epoch/index.ts +4 -1
- package/src/epoch/processEth1DataReset.ts +2 -2
- package/src/epoch/processPendingDeposits.ts +14 -3
- package/src/index.ts +6 -1
- package/src/rewards/attestationsRewards.ts +8 -1
- package/src/signatureSets/index.ts +4 -2
- package/src/signatureSets/voluntaryExits.ts +3 -55
- package/src/slot/upgradeStateToHeze.ts +6 -4
- package/src/stateView/beaconStateView.ts +84 -77
- package/src/stateView/interface.ts +65 -21
- package/src/stateView/nativeBeaconStateView.ts +368 -375
- package/src/stateView/stateViewFactory.ts +29 -27
- package/src/types.ts +2 -0
- package/src/util/blindedBlock.ts +8 -3
- package/src/util/clock.ts +25 -16
- package/src/util/deposit.ts +2 -2
- package/src/util/genesis.ts +56 -30
- package/src/util/gloas.ts +2 -53
- package/src/util/index.ts +6 -0
- package/src/util/slot.ts +6 -1
- package/src/util/sszBytes.ts +129 -22
- package/src/util/weakSubjectivity.ts +43 -40
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
import {ValidatorIndex, rewards} from "@lodestar/types";
|
|
19
19
|
import {fromHex} from "@lodestar/utils";
|
|
20
20
|
import {EpochTransitionCache, beforeProcessEpoch} from "../cache/epochTransitionCache.js";
|
|
21
|
+
import {processInactivityUpdates} from "../epoch/processInactivityUpdates.js";
|
|
22
|
+
import {processJustificationAndFinalization} from "../epoch/processJustificationAndFinalization.js";
|
|
21
23
|
import {CachedBeaconStateAllForks, CachedBeaconStateAltair} from "../types.js";
|
|
22
24
|
import {
|
|
23
25
|
FLAG_ELIGIBLE_ATTESTER,
|
|
@@ -45,8 +47,13 @@ export async function computeAttestationsRewards(
|
|
|
45
47
|
throw Error("Unsupported fork. Attestations rewards calculation is not available in phase0");
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
// Rewards are computed after justification and inactivity updates in epoch processing, so apply both to a clone
|
|
51
|
+
// before reading finality and inactivity scores, see
|
|
52
|
+
// https://github.com/ethereum/consensus-specs/blob/v1.7.0-beta.2/specs/altair/beacon-chain.md#epoch-processing
|
|
53
|
+
const stateAltair = state.clone() as CachedBeaconStateAltair;
|
|
49
54
|
const transitionCache = beforeProcessEpoch(stateAltair);
|
|
55
|
+
processJustificationAndFinalization(stateAltair, transitionCache);
|
|
56
|
+
processInactivityUpdates(stateAltair, transitionCache);
|
|
50
57
|
|
|
51
58
|
const [idealRewards, penalties] = computeIdealAttestationsRewardsAndPenaltiesAltair(
|
|
52
59
|
config,
|
|
@@ -12,7 +12,7 @@ import {getPayloadAttestationDataSigningRoot} from "./indexedPayloadAttestation.
|
|
|
12
12
|
import {getBlockProposerSignatureSet} from "./proposer.js";
|
|
13
13
|
import {getProposerSlashingsSignatureSets} from "./proposerSlashings.js";
|
|
14
14
|
import {getRandaoRevealSignatureSet} from "./randao.js";
|
|
15
|
-
import {
|
|
15
|
+
import {getVoluntaryExitSignatureSet} from "./voluntaryExits.js";
|
|
16
16
|
|
|
17
17
|
export * from "./attesterSlashings.js";
|
|
18
18
|
export * from "./blsToExecutionChange.js";
|
|
@@ -49,7 +49,9 @@ export function getBlockSignatureSets(
|
|
|
49
49
|
...getProposerSlashingsSignatureSets(config, signedBlock),
|
|
50
50
|
...getAttesterSlashingsSignatureSets(config, signedBlock),
|
|
51
51
|
...getAttestationsSignatureSets(config, signedBlock, indexedAttestations),
|
|
52
|
-
...
|
|
52
|
+
...signedBlock.message.body.voluntaryExits.map((voluntaryExit) =>
|
|
53
|
+
getVoluntaryExitSignatureSet(config, state, voluntaryExit)
|
|
54
|
+
),
|
|
53
55
|
];
|
|
54
56
|
|
|
55
57
|
if (!opts?.skipProposerSignature) {
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {IBeaconStateView, IBeaconStateViewGloas, isStatePostGloas} from "../stateView/interface.js";
|
|
2
|
+
import {phase0, ssz} from "@lodestar/types";
|
|
3
|
+
import {IBeaconStateView} from "../stateView/interface.js";
|
|
5
4
|
import {
|
|
6
5
|
ISignatureSet,
|
|
7
6
|
SignatureSetType,
|
|
8
7
|
computeSigningRoot,
|
|
9
8
|
computeStartSlotAtEpoch,
|
|
10
|
-
convertValidatorIndexToBuilderIndex,
|
|
11
|
-
isBuilderIndex,
|
|
12
9
|
verifySignatureSet,
|
|
13
10
|
} from "../util/index.js";
|
|
14
11
|
|
|
@@ -27,36 +24,9 @@ export function getVoluntaryExitSignatureSet(
|
|
|
27
24
|
config: BeaconConfig,
|
|
28
25
|
state: IBeaconStateView,
|
|
29
26
|
signedVoluntaryExit: phase0.SignedVoluntaryExit
|
|
30
|
-
): ISignatureSet {
|
|
31
|
-
const fork = config.getForkSeq(state.slot);
|
|
32
|
-
|
|
33
|
-
if (fork >= ForkSeq.gloas && isBuilderVoluntaryExit(signedVoluntaryExit)) {
|
|
34
|
-
if (!isStatePostGloas(state)) {
|
|
35
|
-
throw new Error(`Expected gloas+ state for builder voluntary exit signature, got fork=${state.forkName}`);
|
|
36
|
-
}
|
|
37
|
-
return getBuilderVoluntaryExitSignatureSet(config, state, signedVoluntaryExit);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return getValidatorVoluntaryExitSignatureSet(config, state.slot, signedVoluntaryExit);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function getVoluntaryExitsSignatureSets(
|
|
44
|
-
config: BeaconConfig,
|
|
45
|
-
state: IBeaconStateView,
|
|
46
|
-
signedBlock: SignedBeaconBlock
|
|
47
|
-
): ISignatureSet[] {
|
|
48
|
-
return signedBlock.message.body.voluntaryExits.map((voluntaryExit) =>
|
|
49
|
-
getVoluntaryExitSignatureSet(config, state, voluntaryExit)
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export function getValidatorVoluntaryExitSignatureSet(
|
|
54
|
-
config: BeaconConfig,
|
|
55
|
-
stateSlot: Slot,
|
|
56
|
-
signedVoluntaryExit: phase0.SignedVoluntaryExit
|
|
57
27
|
): ISignatureSet {
|
|
58
28
|
const messageSlot = computeStartSlotAtEpoch(signedVoluntaryExit.message.epoch);
|
|
59
|
-
const domain = config.getDomainForVoluntaryExit(
|
|
29
|
+
const domain = config.getDomainForVoluntaryExit(state.slot, messageSlot);
|
|
60
30
|
|
|
61
31
|
return {
|
|
62
32
|
type: SignatureSetType.indexed,
|
|
@@ -65,25 +35,3 @@ export function getValidatorVoluntaryExitSignatureSet(
|
|
|
65
35
|
signature: signedVoluntaryExit.signature,
|
|
66
36
|
};
|
|
67
37
|
}
|
|
68
|
-
|
|
69
|
-
export function getBuilderVoluntaryExitSignatureSet(
|
|
70
|
-
config: BeaconConfig,
|
|
71
|
-
state: IBeaconStateViewGloas,
|
|
72
|
-
signedVoluntaryExit: phase0.SignedVoluntaryExit
|
|
73
|
-
): ISignatureSet {
|
|
74
|
-
const messageSlot = computeStartSlotAtEpoch(signedVoluntaryExit.message.epoch);
|
|
75
|
-
const domain = config.getDomainForVoluntaryExit(state.slot, messageSlot);
|
|
76
|
-
const builderIndex = convertValidatorIndexToBuilderIndex(signedVoluntaryExit.message.validatorIndex);
|
|
77
|
-
const builder = state.getBuilder(builderIndex);
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
type: SignatureSetType.single,
|
|
81
|
-
pubkey: builder.pubkey,
|
|
82
|
-
signingRoot: computeSigningRoot(ssz.phase0.VoluntaryExit, signedVoluntaryExit.message, domain),
|
|
83
|
-
signature: signedVoluntaryExit.signature,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function isBuilderVoluntaryExit(signedVoluntaryExit: phase0.SignedVoluntaryExit): boolean {
|
|
88
|
-
return isBuilderIndex(signedVoluntaryExit.message.validatorIndex);
|
|
89
|
-
}
|
|
@@ -7,6 +7,12 @@ import {CachedBeaconStateGloas, CachedBeaconStateHeze} from "../types.js";
|
|
|
7
7
|
* Spec: heze/fork.md `upgrade_to_heze`.
|
|
8
8
|
*/
|
|
9
9
|
export function upgradeStateToHeze(stateGloas: CachedBeaconStateGloas): CachedBeaconStateHeze {
|
|
10
|
+
// In Heze, the old deposit mechanism must be fully drained before the fork
|
|
11
|
+
if (BigInt(stateGloas.eth1DepositIndex) !== stateGloas.depositRequestsStartIndex) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
`Cannot upgrade to Heze: legacy deposit mechanism still active eth1DepositIndex=${stateGloas.eth1DepositIndex} depositRequestsStartIndex=${stateGloas.depositRequestsStartIndex}`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
10
16
|
const {config} = stateGloas;
|
|
11
17
|
|
|
12
18
|
ssz.gloas.BeaconState.commitViewDU(stateGloas);
|
|
@@ -26,9 +32,6 @@ export function upgradeStateToHeze(stateGloas: CachedBeaconStateGloas): CachedBe
|
|
|
26
32
|
stateHezeView.blockRoots = stateHezeCloned.blockRoots;
|
|
27
33
|
stateHezeView.stateRoots = stateHezeCloned.stateRoots;
|
|
28
34
|
stateHezeView.historicalRoots = stateHezeCloned.historicalRoots;
|
|
29
|
-
stateHezeView.eth1Data = stateHezeCloned.eth1Data;
|
|
30
|
-
stateHezeView.eth1DataVotes = stateHezeCloned.eth1DataVotes;
|
|
31
|
-
stateHezeView.eth1DepositIndex = stateHezeCloned.eth1DepositIndex;
|
|
32
35
|
stateHezeView.validators = stateHezeCloned.validators;
|
|
33
36
|
stateHezeView.balances = stateHezeCloned.balances;
|
|
34
37
|
stateHezeView.randaoMixes = stateHezeCloned.randaoMixes;
|
|
@@ -46,7 +49,6 @@ export function upgradeStateToHeze(stateGloas: CachedBeaconStateGloas): CachedBe
|
|
|
46
49
|
stateHezeView.nextWithdrawalIndex = stateHezeCloned.nextWithdrawalIndex;
|
|
47
50
|
stateHezeView.nextWithdrawalValidatorIndex = stateHezeCloned.nextWithdrawalValidatorIndex;
|
|
48
51
|
stateHezeView.historicalSummaries = stateHezeCloned.historicalSummaries;
|
|
49
|
-
stateHezeView.depositRequestsStartIndex = stateHezeCloned.depositRequestsStartIndex;
|
|
50
52
|
stateHezeView.depositBalanceToConsume = stateHezeCloned.depositBalanceToConsume;
|
|
51
53
|
stateHezeView.exitBalanceToConsume = stateHezeCloned.exitBalanceToConsume;
|
|
52
54
|
stateHezeView.earliestExitEpoch = stateHezeCloned.earliestExitEpoch;
|
|
@@ -14,8 +14,6 @@ import {
|
|
|
14
14
|
ExecutionPayloadHeader,
|
|
15
15
|
Root,
|
|
16
16
|
RootHex,
|
|
17
|
-
SignedBeaconBlock,
|
|
18
|
-
SignedBlindedBeaconBlock,
|
|
19
17
|
Slot,
|
|
20
18
|
SyncCommittee,
|
|
21
19
|
ValidatorIndex,
|
|
@@ -42,6 +40,7 @@ import {
|
|
|
42
40
|
CachedBeaconStateExecutions,
|
|
43
41
|
CachedBeaconStateFulu,
|
|
44
42
|
CachedBeaconStateGloas,
|
|
43
|
+
CachedBeaconStatePreHeze,
|
|
45
44
|
createCachedBeaconState,
|
|
46
45
|
isStateValidatorsNodesPopulated,
|
|
47
46
|
} from "../cache/stateCache.js";
|
|
@@ -71,7 +70,7 @@ import {getRandaoMix} from "../util/seed.js";
|
|
|
71
70
|
import {getLatestWeakSubjectivityCheckpointEpoch} from "../util/weakSubjectivity.js";
|
|
72
71
|
import {computeNewStateRootStateTransitionOpts, getComputeNewStateRootResult} from "./computeNewStateRoot.js";
|
|
73
72
|
import {
|
|
74
|
-
|
|
73
|
+
BlockSTFInput,
|
|
75
74
|
ComputeNewStateRootResult,
|
|
76
75
|
IBeaconStateView,
|
|
77
76
|
IBeaconStateViewGloas,
|
|
@@ -83,34 +82,36 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
83
82
|
private readonly config: BeaconConfig;
|
|
84
83
|
// Cached values extracted from the tree
|
|
85
84
|
// phase0
|
|
86
|
-
private
|
|
87
|
-
private
|
|
85
|
+
private cachedFork: Fork | null = null;
|
|
86
|
+
private cachedLatestBlockHeader: phase0.BeaconBlockHeader | null = null;
|
|
88
87
|
// altair
|
|
89
|
-
private
|
|
90
|
-
private
|
|
91
|
-
private
|
|
92
|
-
private
|
|
88
|
+
private cachedCurrentSyncCommittee: SyncCommittee | null = null;
|
|
89
|
+
private cachedNextSyncCommittee: SyncCommittee | null = null;
|
|
90
|
+
private cachedPreviousEpochParticipation: Uint8Array | null = null;
|
|
91
|
+
private cachedCurrentEpochParticipation: Uint8Array | null = null;
|
|
93
92
|
// bellatrix
|
|
94
|
-
private
|
|
93
|
+
private cachedLatestExecutionPayloadHeader: ExecutionPayloadHeader | null = null;
|
|
95
94
|
// capella
|
|
96
|
-
private
|
|
95
|
+
private cachedHistoricalSummaries: capella.HistoricalSummaries | null = null;
|
|
97
96
|
// electra
|
|
98
|
-
private
|
|
99
|
-
private
|
|
100
|
-
private
|
|
97
|
+
private cachedPendingPartialWithdrawals: electra.PendingPartialWithdrawals | null = null;
|
|
98
|
+
private cachedPendingConsolidations: electra.PendingConsolidations | null = null;
|
|
99
|
+
private cachedPendingDeposits: electra.PendingDeposits | null = null;
|
|
101
100
|
// fulu
|
|
102
|
-
private
|
|
101
|
+
private cachedProposerLookahead: fulu.ProposerLookahead | null = null;
|
|
103
102
|
// gloas
|
|
104
|
-
private
|
|
105
|
-
private
|
|
106
|
-
private
|
|
107
|
-
private
|
|
108
|
-
private
|
|
103
|
+
private cachedExecutionPayloadAvailability: BitArray | null = null;
|
|
104
|
+
private cachedLatestExecutionPayloadBid: ExecutionPayloadBid | null = null;
|
|
105
|
+
private cachedPayloadExpectedWithdrawals: capella.Withdrawal[] | null = null;
|
|
106
|
+
private cachedBuilderPendingPayments: gloas.BuilderPendingPayments | null = null;
|
|
107
|
+
private cachedBuilderPendingWithdrawals: gloas.BuilderPendingWithdrawals | null = null;
|
|
109
108
|
|
|
110
109
|
constructor(readonly cachedState: CachedBeaconStateAllForks) {
|
|
111
110
|
this.config = cachedState.config;
|
|
112
111
|
}
|
|
113
112
|
|
|
113
|
+
release(): void {}
|
|
114
|
+
|
|
114
115
|
// phase0
|
|
115
116
|
|
|
116
117
|
get forkName(): ForkName {
|
|
@@ -126,10 +127,10 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
126
127
|
}
|
|
127
128
|
|
|
128
129
|
get fork(): Fork {
|
|
129
|
-
if (this.
|
|
130
|
-
this.
|
|
130
|
+
if (this.cachedFork === null) {
|
|
131
|
+
this.cachedFork = this.cachedState.fork.toValue();
|
|
131
132
|
}
|
|
132
|
-
return this.
|
|
133
|
+
return this.cachedFork;
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
get epoch(): number {
|
|
@@ -145,14 +146,17 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
get eth1Data(): phase0.Eth1Data {
|
|
148
|
-
|
|
149
|
+
if (this.forkSeq >= ForkSeq.heze) {
|
|
150
|
+
throw new Error("eth1Data was removed from the beacon state in Heze");
|
|
151
|
+
}
|
|
152
|
+
return (this.cachedState as CachedBeaconStatePreHeze).eth1Data;
|
|
149
153
|
}
|
|
150
154
|
|
|
151
155
|
get latestBlockHeader(): phase0.BeaconBlockHeader {
|
|
152
|
-
if (this.
|
|
153
|
-
this.
|
|
156
|
+
if (this.cachedLatestBlockHeader === null) {
|
|
157
|
+
this.cachedLatestBlockHeader = this.cachedState.latestBlockHeader.toValue();
|
|
154
158
|
}
|
|
155
|
-
return this.
|
|
159
|
+
return this.cachedLatestBlockHeader;
|
|
156
160
|
}
|
|
157
161
|
|
|
158
162
|
get previousJustifiedCheckpoint(): Checkpoint {
|
|
@@ -188,13 +192,13 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
188
192
|
throw new Error("previousEpochParticipation is not available before Altair");
|
|
189
193
|
}
|
|
190
194
|
|
|
191
|
-
if (this.
|
|
192
|
-
this.
|
|
195
|
+
if (this.cachedPreviousEpochParticipation === null) {
|
|
196
|
+
this.cachedPreviousEpochParticipation = (
|
|
193
197
|
this.cachedState as CachedBeaconStateAltair
|
|
194
198
|
).previousEpochParticipation.serialize();
|
|
195
199
|
}
|
|
196
200
|
|
|
197
|
-
return this.
|
|
201
|
+
return this.cachedPreviousEpochParticipation;
|
|
198
202
|
}
|
|
199
203
|
|
|
200
204
|
// altair
|
|
@@ -204,13 +208,13 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
204
208
|
throw new Error("currentEpochParticipation is not available before Altair");
|
|
205
209
|
}
|
|
206
210
|
|
|
207
|
-
if (this.
|
|
208
|
-
this.
|
|
211
|
+
if (this.cachedCurrentEpochParticipation === null) {
|
|
212
|
+
this.cachedCurrentEpochParticipation = (
|
|
209
213
|
this.cachedState as CachedBeaconStateAltair
|
|
210
214
|
).currentEpochParticipation.serialize();
|
|
211
215
|
}
|
|
212
216
|
|
|
213
|
-
return this.
|
|
217
|
+
return this.cachedCurrentEpochParticipation;
|
|
214
218
|
}
|
|
215
219
|
|
|
216
220
|
getPreviousEpochParticipation(validatorIndex: ValidatorIndex): number {
|
|
@@ -238,13 +242,13 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
238
242
|
throw new Error("latestExecutionPayloadHeader is not available after Gloas");
|
|
239
243
|
}
|
|
240
244
|
|
|
241
|
-
if (this.
|
|
242
|
-
this.
|
|
245
|
+
if (this.cachedLatestExecutionPayloadHeader === null) {
|
|
246
|
+
this.cachedLatestExecutionPayloadHeader = (
|
|
243
247
|
this.cachedState as CachedBeaconStateExecutions
|
|
244
248
|
).latestExecutionPayloadHeader.toValue();
|
|
245
249
|
}
|
|
246
250
|
|
|
247
|
-
return this.
|
|
251
|
+
return this.cachedLatestExecutionPayloadHeader;
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
/**
|
|
@@ -270,11 +274,11 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
270
274
|
throw new Error("Historical summaries are not supported before Capella");
|
|
271
275
|
}
|
|
272
276
|
|
|
273
|
-
if (this.
|
|
274
|
-
this.
|
|
277
|
+
if (this.cachedHistoricalSummaries === null) {
|
|
278
|
+
this.cachedHistoricalSummaries = (this.cachedState as CachedBeaconStateCapella).historicalSummaries.toValue();
|
|
275
279
|
}
|
|
276
280
|
|
|
277
|
-
return this.
|
|
281
|
+
return this.cachedHistoricalSummaries;
|
|
278
282
|
}
|
|
279
283
|
|
|
280
284
|
// electra
|
|
@@ -284,11 +288,11 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
284
288
|
throw new Error("Pending deposits are not supported before Electra");
|
|
285
289
|
}
|
|
286
290
|
|
|
287
|
-
if (this.
|
|
288
|
-
this.
|
|
291
|
+
if (this.cachedPendingDeposits === null) {
|
|
292
|
+
this.cachedPendingDeposits = (this.cachedState as CachedBeaconStateElectra).pendingDeposits.toValue();
|
|
289
293
|
}
|
|
290
294
|
|
|
291
|
-
return this.
|
|
295
|
+
return this.cachedPendingDeposits;
|
|
292
296
|
}
|
|
293
297
|
|
|
294
298
|
get pendingDepositsCount(): number {
|
|
@@ -304,13 +308,13 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
304
308
|
throw new Error("Pending partial withdrawals are not supported before Electra");
|
|
305
309
|
}
|
|
306
310
|
|
|
307
|
-
if (this.
|
|
308
|
-
this.
|
|
311
|
+
if (this.cachedPendingPartialWithdrawals === null) {
|
|
312
|
+
this.cachedPendingPartialWithdrawals = (
|
|
309
313
|
this.cachedState as CachedBeaconStateElectra
|
|
310
314
|
).pendingPartialWithdrawals.toValue();
|
|
311
315
|
}
|
|
312
316
|
|
|
313
|
-
return this.
|
|
317
|
+
return this.cachedPendingPartialWithdrawals;
|
|
314
318
|
}
|
|
315
319
|
|
|
316
320
|
get pendingPartialWithdrawalsCount(): number {
|
|
@@ -326,11 +330,11 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
326
330
|
throw new Error("Pending consolidations are not supported before Electra");
|
|
327
331
|
}
|
|
328
332
|
|
|
329
|
-
if (this.
|
|
330
|
-
this.
|
|
333
|
+
if (this.cachedPendingConsolidations === null) {
|
|
334
|
+
this.cachedPendingConsolidations = (this.cachedState as CachedBeaconStateElectra).pendingConsolidations.toValue();
|
|
331
335
|
}
|
|
332
336
|
|
|
333
|
-
return this.
|
|
337
|
+
return this.cachedPendingConsolidations;
|
|
334
338
|
}
|
|
335
339
|
|
|
336
340
|
get pendingConsolidationsCount(): number {
|
|
@@ -348,11 +352,11 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
348
352
|
throw new Error("Proposer lookahead is not supported before Fulu");
|
|
349
353
|
}
|
|
350
354
|
|
|
351
|
-
if (this.
|
|
352
|
-
this.
|
|
355
|
+
if (this.cachedProposerLookahead === null) {
|
|
356
|
+
this.cachedProposerLookahead = (this.cachedState as CachedBeaconStateFulu).proposerLookahead.toValue();
|
|
353
357
|
}
|
|
354
358
|
|
|
355
|
-
return this.
|
|
359
|
+
return this.cachedProposerLookahead;
|
|
356
360
|
}
|
|
357
361
|
|
|
358
362
|
preVerifyBuilderDepositsPreGloas(maxBuilderDeposits: number, maxDurationMs: number): PreVerifyBuilderDepositsResult {
|
|
@@ -381,13 +385,13 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
381
385
|
throw new Error("executionPayloadAvailability is not available before Gloas");
|
|
382
386
|
}
|
|
383
387
|
|
|
384
|
-
if (this.
|
|
385
|
-
this.
|
|
388
|
+
if (this.cachedExecutionPayloadAvailability === null) {
|
|
389
|
+
this.cachedExecutionPayloadAvailability = (
|
|
386
390
|
this.cachedState as CachedBeaconStateGloas
|
|
387
391
|
).executionPayloadAvailability.toValue();
|
|
388
392
|
}
|
|
389
393
|
|
|
390
|
-
return this.
|
|
394
|
+
return this.cachedExecutionPayloadAvailability;
|
|
391
395
|
}
|
|
392
396
|
|
|
393
397
|
get latestExecutionPayloadBid(): ExecutionPayloadBid {
|
|
@@ -395,12 +399,12 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
395
399
|
throw new Error("latestExecutionPayloadBid is not available before Gloas");
|
|
396
400
|
}
|
|
397
401
|
|
|
398
|
-
if (this.
|
|
399
|
-
this.
|
|
402
|
+
if (this.cachedLatestExecutionPayloadBid === null) {
|
|
403
|
+
this.cachedLatestExecutionPayloadBid = (
|
|
400
404
|
this.cachedState as CachedBeaconStateGloas
|
|
401
405
|
).latestExecutionPayloadBid.toValue();
|
|
402
406
|
}
|
|
403
|
-
return this.
|
|
407
|
+
return this.cachedLatestExecutionPayloadBid;
|
|
404
408
|
}
|
|
405
409
|
|
|
406
410
|
get payloadExpectedWithdrawals(): capella.Withdrawal[] {
|
|
@@ -408,12 +412,12 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
408
412
|
throw new Error("payloadExpectedWithdrawals is not available before Gloas");
|
|
409
413
|
}
|
|
410
414
|
|
|
411
|
-
if (this.
|
|
412
|
-
this.
|
|
415
|
+
if (this.cachedPayloadExpectedWithdrawals === null) {
|
|
416
|
+
this.cachedPayloadExpectedWithdrawals = (
|
|
413
417
|
this.cachedState as CachedBeaconStateGloas
|
|
414
418
|
).payloadExpectedWithdrawals.toValue();
|
|
415
419
|
}
|
|
416
|
-
return this.
|
|
420
|
+
return this.cachedPayloadExpectedWithdrawals;
|
|
417
421
|
}
|
|
418
422
|
|
|
419
423
|
get builderPendingPayments(): gloas.BuilderPendingPayments {
|
|
@@ -421,10 +425,10 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
421
425
|
throw new Error("Pending builder payments are not supported before Gloas");
|
|
422
426
|
}
|
|
423
427
|
|
|
424
|
-
if (this.
|
|
425
|
-
this.
|
|
428
|
+
if (this.cachedBuilderPendingPayments === null) {
|
|
429
|
+
this.cachedBuilderPendingPayments = (this.cachedState as CachedBeaconStateGloas).builderPendingPayments.toValue();
|
|
426
430
|
}
|
|
427
|
-
return this.
|
|
431
|
+
return this.cachedBuilderPendingPayments;
|
|
428
432
|
}
|
|
429
433
|
|
|
430
434
|
get builderPendingWithdrawals(): gloas.BuilderPendingWithdrawals {
|
|
@@ -432,12 +436,12 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
432
436
|
throw new Error("Pending builder withdrawals are not supported before Gloas");
|
|
433
437
|
}
|
|
434
438
|
|
|
435
|
-
if (this.
|
|
436
|
-
this.
|
|
439
|
+
if (this.cachedBuilderPendingWithdrawals === null) {
|
|
440
|
+
this.cachedBuilderPendingWithdrawals = (
|
|
437
441
|
this.cachedState as CachedBeaconStateGloas
|
|
438
442
|
).builderPendingWithdrawals.toValue();
|
|
439
443
|
}
|
|
440
|
-
return this.
|
|
444
|
+
return this.cachedBuilderPendingWithdrawals;
|
|
441
445
|
}
|
|
442
446
|
|
|
443
447
|
getBuilder(index: BuilderIndex): gloas.Builder {
|
|
@@ -588,11 +592,11 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
588
592
|
throw new Error("currentSyncCommittee is not available before Altair");
|
|
589
593
|
}
|
|
590
594
|
|
|
591
|
-
if (this.
|
|
592
|
-
this.
|
|
595
|
+
if (this.cachedCurrentSyncCommittee === null) {
|
|
596
|
+
this.cachedCurrentSyncCommittee = (this.cachedState as CachedBeaconStateAltair).currentSyncCommittee.toValue();
|
|
593
597
|
}
|
|
594
598
|
|
|
595
|
-
return this.
|
|
599
|
+
return this.cachedCurrentSyncCommittee;
|
|
596
600
|
}
|
|
597
601
|
|
|
598
602
|
get nextSyncCommittee(): SyncCommittee {
|
|
@@ -600,17 +604,21 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
600
604
|
throw new Error("nextSyncCommittee is not available before Altair");
|
|
601
605
|
}
|
|
602
606
|
|
|
603
|
-
if (this.
|
|
604
|
-
this.
|
|
607
|
+
if (this.cachedNextSyncCommittee === null) {
|
|
608
|
+
this.cachedNextSyncCommittee = (this.cachedState as CachedBeaconStateAltair).nextSyncCommittee.toValue();
|
|
605
609
|
}
|
|
606
610
|
|
|
607
|
-
return this.
|
|
611
|
+
return this.cachedNextSyncCommittee;
|
|
608
612
|
}
|
|
609
613
|
|
|
610
614
|
get currentSyncCommitteeIndexed(): SyncCommitteeCache {
|
|
611
615
|
return this.cachedState.epochCtx.currentSyncCommitteeIndexed;
|
|
612
616
|
}
|
|
613
617
|
|
|
618
|
+
get currentSyncCommitteeValidatorIndices(): Uint32Array {
|
|
619
|
+
return this.cachedState.epochCtx.currentSyncCommitteeIndexed.validatorIndices;
|
|
620
|
+
}
|
|
621
|
+
|
|
614
622
|
get syncProposerReward(): number {
|
|
615
623
|
return this.cachedState.epochCtx.syncProposerReward;
|
|
616
624
|
}
|
|
@@ -872,7 +880,7 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
872
880
|
|
|
873
881
|
// State transition
|
|
874
882
|
|
|
875
|
-
computeNewStateRoot({block}:
|
|
883
|
+
computeNewStateRoot({block}: BlockSTFInput, modules: StateTransitionModules): ComputeNewStateRootResult {
|
|
876
884
|
const postState = new BeaconStateView(
|
|
877
885
|
stateTransition(this.cachedState, block, computeNewStateRootStateTransitionOpts, modules)
|
|
878
886
|
);
|
|
@@ -880,12 +888,11 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
880
888
|
}
|
|
881
889
|
|
|
882
890
|
stateTransition(
|
|
883
|
-
|
|
891
|
+
{block}: BlockSTFInput,
|
|
884
892
|
options: StateTransitionOpts,
|
|
885
|
-
|
|
893
|
+
modules: StateTransitionModules
|
|
886
894
|
): IBeaconStateView {
|
|
887
|
-
|
|
888
|
-
return new BeaconStateView(newState);
|
|
895
|
+
return new BeaconStateView(stateTransition(this.cachedState, block, options, modules));
|
|
889
896
|
}
|
|
890
897
|
|
|
891
898
|
processSlots(slot: Slot, opts?: {dontTransferCache?: boolean}, modules?: StateTransitionModules): IBeaconStateView {
|
|
@@ -55,10 +55,13 @@ import {StateTransitionModules, StateTransitionOpts} from "../stateTransition.js
|
|
|
55
55
|
import {EpochShuffling} from "../util/epochShuffling.js";
|
|
56
56
|
import {PreVerifyBuilderDepositsResult} from "../util/preVerifyBuilderDeposits.js";
|
|
57
57
|
|
|
58
|
-
/**
|
|
59
|
-
export type
|
|
58
|
+
/** Signed block to apply in a state transition. */
|
|
59
|
+
export type BlockSTFInput = {
|
|
60
60
|
block: SignedBeaconBlock | SignedBlindedBeaconBlock;
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Fork-specific SSZ serialization of `block`, using the matching full or blinded block type. Native
|
|
63
|
+
* implementations serialize `block` when omitted.
|
|
64
|
+
*/
|
|
62
65
|
ssz?: Uint8Array;
|
|
63
66
|
};
|
|
64
67
|
|
|
@@ -159,6 +162,13 @@ export interface IBeaconStateView {
|
|
|
159
162
|
// TODO is there a better name that is less implementation specific but still conveys the meaning?
|
|
160
163
|
isStateValidatorsNodesPopulated(): boolean;
|
|
161
164
|
|
|
165
|
+
// Lifecycle
|
|
166
|
+
/**
|
|
167
|
+
* Release resources owned by this view.
|
|
168
|
+
* Do not use the view after calling this method.
|
|
169
|
+
*/
|
|
170
|
+
release(): void;
|
|
171
|
+
|
|
162
172
|
// Serialization
|
|
163
173
|
/** Set `preloadValidatorsAndBalances` only when the whole state will be consumed
|
|
164
174
|
* immediately (e.g. CP reload before block replay). */
|
|
@@ -178,9 +188,9 @@ export interface IBeaconStateView {
|
|
|
178
188
|
hashTreeRoot(): Uint8Array;
|
|
179
189
|
|
|
180
190
|
// State transition
|
|
181
|
-
computeNewStateRoot(input:
|
|
191
|
+
computeNewStateRoot(input: BlockSTFInput, modules: StateTransitionModules): ComputeNewStateRootResult;
|
|
182
192
|
stateTransition(
|
|
183
|
-
|
|
193
|
+
input: BlockSTFInput,
|
|
184
194
|
options: StateTransitionOpts,
|
|
185
195
|
modules: StateTransitionModules
|
|
186
196
|
): IBeaconStateView;
|
|
@@ -197,6 +207,7 @@ export interface IBeaconStateViewAltair extends IBeaconStateView {
|
|
|
197
207
|
currentSyncCommittee: altair.SyncCommittee;
|
|
198
208
|
nextSyncCommittee: altair.SyncCommittee;
|
|
199
209
|
currentSyncCommitteeIndexed: SyncCommitteeCache;
|
|
210
|
+
readonly currentSyncCommitteeValidatorIndices: Uint32Array;
|
|
200
211
|
syncProposerReward: number;
|
|
201
212
|
getIndexedSyncCommitteeAtEpoch(epoch: Epoch): SyncCommitteeCache;
|
|
202
213
|
/** Get indexed sync committee with slot+1 offset for duty lookups */
|
|
@@ -317,33 +328,66 @@ export type IBeaconStateViewLatestFork = Omit<
|
|
|
317
328
|
/**
|
|
318
329
|
* Contract a BeaconStateView backing implementation must satisfy.
|
|
319
330
|
*
|
|
320
|
-
* Differs from `IBeaconStateViewLatestFork` in
|
|
321
|
-
* -
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
* -
|
|
325
|
-
* `loadOtherState`, `withParentPayloadApplied`) return `IBeaconStateViewNative`
|
|
326
|
-
* so callers can re-wrap without an `as unknown` cast. Param lists are reused
|
|
327
|
-
* via `Parameters<...>` to avoid duplicating signatures.
|
|
328
|
-
* - `computeNewStateRoot` is implemented by the wrapper because its inputs differ
|
|
329
|
-
* between the TypeScript and Zig implementations.
|
|
330
|
-
*
|
|
331
|
-
* The TS-side `BeaconStateView` also structurally satisfies this contract since
|
|
332
|
-
* `BitArray` exposes `uint8Array` and `bitLen`.
|
|
331
|
+
* Differs from `IBeaconStateViewLatestFork` in these ways:
|
|
332
|
+
* - SSZ-backed lists use serialized bytes or native typed arrays at the FFI boundary.
|
|
333
|
+
* - Methods that produce another view return `IBeaconStateViewNative` so callers can re-wrap them.
|
|
334
|
+
* - `stateTransition` accepts the native block inputs and omits JS-only modules.
|
|
335
|
+
* - `computeNewStateRoot` is implemented by the wrapper because its inputs differ between implementations.
|
|
333
336
|
*/
|
|
334
337
|
export type IBeaconStateViewNative = Omit<
|
|
335
338
|
IBeaconStateViewLatestFork,
|
|
339
|
+
| "builderPendingPayments"
|
|
340
|
+
| "builderPendingWithdrawals"
|
|
341
|
+
| "computeAttestationsRewards"
|
|
342
|
+
| "computeBlockRewards"
|
|
336
343
|
| "computeNewStateRoot"
|
|
344
|
+
| "computeSyncCommitteeRewards"
|
|
345
|
+
| "currentSyncCommitteeValidatorIndices"
|
|
346
|
+
| "eth1Data"
|
|
337
347
|
| "executionPayloadAvailability"
|
|
348
|
+
| "getBeaconCommittee"
|
|
349
|
+
| "getIndicesInPayloadTimelinessCommittee"
|
|
350
|
+
| "getPayloadTimelinessCommittee"
|
|
338
351
|
| "loadOtherState"
|
|
339
|
-
| "
|
|
352
|
+
| "pendingConsolidations"
|
|
353
|
+
| "pendingDeposits"
|
|
354
|
+
| "pendingPartialWithdrawals"
|
|
355
|
+
| "preVerifyBuilderDepositsPreGloas"
|
|
356
|
+
| "clearPreGloasBuilderDepositCache"
|
|
340
357
|
| "processSlots"
|
|
358
|
+
| "proposerLookahead"
|
|
359
|
+
| "stateTransition"
|
|
341
360
|
| "withParentPayloadApplied"
|
|
342
361
|
> & {
|
|
362
|
+
pendingDeposits: Uint8Array;
|
|
363
|
+
/** Older native addons expose indices only through currentSyncCommitteeIndexed. */
|
|
364
|
+
readonly currentSyncCommitteeValidatorIndices?: Uint32Array;
|
|
365
|
+
pendingPartialWithdrawals: Uint8Array;
|
|
366
|
+
pendingConsolidations: Uint8Array;
|
|
367
|
+
proposerLookahead: Uint32Array;
|
|
368
|
+
// UintBn64 lowers to number across the FFI boundary; the wrapper lifts it back to bigint
|
|
369
|
+
eth1Data: phase0.Eth1Data;
|
|
343
370
|
executionPayloadAvailability: {uint8Array: Uint8Array; bitLen: number};
|
|
371
|
+
computeBlockRewards(
|
|
372
|
+
signedBlockBytes: Uint8Array,
|
|
373
|
+
isBlinded: boolean,
|
|
374
|
+
proposerRewards?: RewardCache
|
|
375
|
+
): rewards.BlockRewards;
|
|
376
|
+
computeAttestationsRewards(validatorIds?: (ValidatorIndex | string)[]): rewards.AttestationsRewards;
|
|
377
|
+
computeSyncCommitteeRewards(
|
|
378
|
+
block: BeaconBlock,
|
|
379
|
+
validatorIds: (ValidatorIndex | string)[]
|
|
380
|
+
): rewards.SyncCommitteeRewards;
|
|
381
|
+
getBeaconCommittee(slot: Slot, index: CommitteeIndex): Uint32Array;
|
|
382
|
+
getIndexInPayloadTimelinessCommittee?(validatorIndex: ValidatorIndex, slot: Slot): number;
|
|
383
|
+
getIndicesInPayloadTimelinessCommittee?(validatorIndex: ValidatorIndex, slot: Slot): number[];
|
|
344
384
|
loadOtherState(...args: Parameters<IBeaconStateViewLatestFork["loadOtherState"]>): IBeaconStateViewNative;
|
|
345
|
-
stateTransition(
|
|
346
|
-
|
|
385
|
+
stateTransition(
|
|
386
|
+
signedBlockBytes: Uint8Array,
|
|
387
|
+
isBlinded: boolean,
|
|
388
|
+
options?: StateTransitionOpts
|
|
389
|
+
): IBeaconStateViewNative;
|
|
390
|
+
processSlots(slot: Slot, opts?: {dontTransferCache?: boolean}): IBeaconStateViewNative;
|
|
347
391
|
withParentPayloadApplied(
|
|
348
392
|
...args: Parameters<IBeaconStateViewLatestFork["withParentPayloadApplied"]>
|
|
349
393
|
): IBeaconStateViewNative;
|