@lodestar/state-transition 1.41.0-dev.eb7efb2b90 → 1.41.0-dev.ef310100c0
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/isValidIndexedAttestation.d.ts +3 -3
- package/lib/block/isValidIndexedAttestation.d.ts.map +1 -1
- package/lib/block/isValidIndexedAttestation.js +4 -4
- package/lib/block/isValidIndexedAttestation.js.map +1 -1
- package/lib/block/isValidIndexedPayloadAttestation.js +1 -1
- package/lib/block/isValidIndexedPayloadAttestation.js.map +1 -1
- package/lib/block/processAttestationPhase0.js +1 -1
- package/lib/block/processAttestationPhase0.js.map +1 -1
- package/lib/block/processAttestationsAltair.js +1 -1
- package/lib/block/processAttestationsAltair.js.map +1 -1
- package/lib/block/processAttesterSlashing.d.ts +2 -2
- package/lib/block/processAttesterSlashing.d.ts.map +1 -1
- package/lib/block/processAttesterSlashing.js +3 -3
- package/lib/block/processAttesterSlashing.js.map +1 -1
- package/lib/block/processExecutionPayloadEnvelope.js +5 -1
- package/lib/block/processExecutionPayloadEnvelope.js.map +1 -1
- package/lib/block/processProposerSlashing.d.ts +2 -2
- package/lib/block/processProposerSlashing.d.ts.map +1 -1
- package/lib/block/processProposerSlashing.js +3 -3
- package/lib/block/processProposerSlashing.js.map +1 -1
- package/lib/block/processRandao.js +1 -1
- package/lib/block/processRandao.js.map +1 -1
- package/lib/block/processSyncCommittee.js +1 -1
- package/lib/block/processSyncCommittee.js.map +1 -1
- package/lib/block/processVoluntaryExit.js +1 -1
- package/lib/block/processVoluntaryExit.js.map +1 -1
- package/lib/block/processWithdrawalRequest.js +2 -2
- package/lib/block/processWithdrawalRequest.js.map +1 -1
- package/lib/cache/epochCache.d.ts +6 -15
- package/lib/cache/epochCache.d.ts.map +1 -1
- package/lib/cache/epochCache.js +15 -28
- package/lib/cache/epochCache.js.map +1 -1
- package/lib/cache/pubkeyCache.d.ts +21 -6
- package/lib/cache/pubkeyCache.d.ts.map +1 -1
- package/lib/cache/pubkeyCache.js +39 -14
- package/lib/cache/pubkeyCache.js.map +1 -1
- package/lib/cache/stateCache.d.ts +1 -1
- package/lib/cache/stateCache.d.ts.map +1 -1
- package/lib/cache/stateCache.js +3 -7
- package/lib/cache/stateCache.js.map +1 -1
- package/lib/cache/syncCommitteeCache.d.ts +3 -2
- package/lib/cache/syncCommitteeCache.d.ts.map +1 -1
- package/lib/cache/syncCommitteeCache.js +4 -4
- package/lib/cache/syncCommitteeCache.js.map +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/lightClient/proofs.d.ts +10 -0
- package/lib/lightClient/proofs.d.ts.map +1 -0
- package/lib/lightClient/proofs.js +63 -0
- package/lib/lightClient/proofs.js.map +1 -0
- package/lib/lightClient/types.d.ts +34 -0
- package/lib/lightClient/types.d.ts.map +1 -0
- package/lib/lightClient/types.js +2 -0
- package/lib/lightClient/types.js.map +1 -0
- package/lib/rewards/attestationsRewards.d.ts +2 -2
- package/lib/rewards/attestationsRewards.d.ts.map +1 -1
- package/lib/rewards/attestationsRewards.js +4 -4
- package/lib/rewards/attestationsRewards.js.map +1 -1
- package/lib/rewards/syncCommitteeRewards.d.ts +2 -2
- package/lib/rewards/syncCommitteeRewards.d.ts.map +1 -1
- package/lib/rewards/syncCommitteeRewards.js +5 -2
- package/lib/rewards/syncCommitteeRewards.js.map +1 -1
- package/lib/signatureSets/proposer.d.ts +2 -2
- package/lib/signatureSets/proposer.d.ts.map +1 -1
- package/lib/signatureSets/proposer.js +2 -2
- package/lib/signatureSets/proposer.js.map +1 -1
- package/lib/signatureSets/randao.d.ts +2 -2
- package/lib/signatureSets/randao.d.ts.map +1 -1
- package/lib/signatureSets/randao.js +2 -2
- package/lib/signatureSets/randao.js.map +1 -1
- package/lib/signatureSets/voluntaryExits.d.ts +2 -2
- package/lib/signatureSets/voluntaryExits.d.ts.map +1 -1
- package/lib/signatureSets/voluntaryExits.js +2 -2
- package/lib/signatureSets/voluntaryExits.js.map +1 -1
- package/lib/stateTransition.d.ts +2 -1
- package/lib/stateTransition.d.ts.map +1 -1
- package/lib/stateTransition.js +2 -1
- package/lib/stateTransition.js.map +1 -1
- package/lib/stateView/beaconStateView.d.ts +144 -0
- package/lib/stateView/beaconStateView.d.ts.map +1 -0
- package/lib/stateView/beaconStateView.js +496 -0
- package/lib/stateView/beaconStateView.js.map +1 -0
- package/lib/stateView/index.d.ts +3 -0
- package/lib/stateView/index.d.ts.map +1 -0
- package/lib/stateView/index.js +3 -0
- package/lib/stateView/index.js.map +1 -0
- package/lib/stateView/interface.d.ts +118 -0
- package/lib/stateView/interface.d.ts.map +1 -0
- package/lib/stateView/interface.js +2 -0
- package/lib/stateView/interface.js.map +1 -0
- package/lib/util/signatureSets.d.ts +7 -7
- package/lib/util/signatureSets.d.ts.map +1 -1
- package/lib/util/signatureSets.js +18 -12
- package/lib/util/signatureSets.js.map +1 -1
- package/lib/util/weakSubjectivity.js +1 -1
- package/lib/util/weakSubjectivity.js.map +1 -1
- package/package.json +7 -7
- package/src/block/isValidIndexedAttestation.ts +5 -5
- package/src/block/isValidIndexedPayloadAttestation.ts +1 -1
- package/src/block/processAttestationPhase0.ts +1 -1
- package/src/block/processAttestationsAltair.ts +1 -1
- package/src/block/processAttesterSlashing.ts +4 -4
- package/src/block/processExecutionPayloadEnvelope.ts +5 -1
- package/src/block/processProposerSlashing.ts +4 -4
- package/src/block/processRandao.ts +1 -1
- package/src/block/processSyncCommittee.ts +1 -1
- package/src/block/processVoluntaryExit.ts +1 -1
- package/src/block/processWithdrawalRequest.ts +2 -2
- package/src/cache/epochCache.ts +17 -31
- package/src/cache/pubkeyCache.ts +62 -21
- package/src/cache/stateCache.ts +4 -8
- package/src/cache/syncCommitteeCache.ts +4 -5
- package/src/index.ts +3 -1
- package/src/lightClient/proofs.ts +83 -0
- package/src/lightClient/types.ts +33 -0
- package/src/rewards/attestationsRewards.ts +5 -5
- package/src/rewards/syncCommitteeRewards.ts +6 -5
- package/src/signatureSets/proposer.ts +3 -3
- package/src/signatureSets/randao.ts +3 -7
- package/src/signatureSets/voluntaryExits.ts +3 -3
- package/src/stateTransition.ts +2 -1
- package/src/stateView/beaconStateView.ts +744 -0
- package/src/stateView/index.ts +2 -0
- package/src/stateView/interface.ts +196 -0
- package/src/util/signatureSets.ts +23 -17
- package/src/util/weakSubjectivity.ts +1 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import {CompactMultiProof} from "@chainsafe/persistent-merkle-tree";
|
|
2
|
+
import {ByteViews} from "@chainsafe/ssz";
|
|
3
|
+
import {
|
|
4
|
+
BeaconBlock,
|
|
5
|
+
BlindedBeaconBlock,
|
|
6
|
+
BuilderIndex,
|
|
7
|
+
Bytes32,
|
|
8
|
+
Epoch,
|
|
9
|
+
ExecutionPayloadBid,
|
|
10
|
+
ExecutionPayloadHeader,
|
|
11
|
+
Root,
|
|
12
|
+
RootHex,
|
|
13
|
+
SignedBeaconBlock,
|
|
14
|
+
SignedBlindedBeaconBlock,
|
|
15
|
+
Slot,
|
|
16
|
+
ValidatorIndex,
|
|
17
|
+
altair,
|
|
18
|
+
capella,
|
|
19
|
+
electra,
|
|
20
|
+
fulu,
|
|
21
|
+
gloas,
|
|
22
|
+
phase0,
|
|
23
|
+
rewards,
|
|
24
|
+
} from "@lodestar/types";
|
|
25
|
+
import {Checkpoint, Fork} from "@lodestar/types/phase0";
|
|
26
|
+
import {VoluntaryExitValidity} from "../block/processVoluntaryExit.js";
|
|
27
|
+
import {EffectiveBalanceIncrements} from "../cache/effectiveBalanceIncrements.js";
|
|
28
|
+
import {EpochTransitionCacheOpts} from "../cache/epochTransitionCache.js";
|
|
29
|
+
import {RewardCache} from "../cache/rewardCache.js";
|
|
30
|
+
import {SyncCommitteeCache} from "../cache/syncCommitteeCache.js";
|
|
31
|
+
import {SyncCommitteeWitness} from "../lightClient/types.js";
|
|
32
|
+
import {StateTransitionModules, StateTransitionOpts} from "../stateTransition.js";
|
|
33
|
+
import {EpochShuffling} from "../util/epochShuffling.js";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A read-only view of the BeaconState.
|
|
37
|
+
*/
|
|
38
|
+
export interface IBeaconStateView {
|
|
39
|
+
// State access
|
|
40
|
+
|
|
41
|
+
// phase0
|
|
42
|
+
slot: Slot;
|
|
43
|
+
fork: Fork;
|
|
44
|
+
epoch: Epoch;
|
|
45
|
+
genesisTime: number;
|
|
46
|
+
genesisValidatorsRoot: Root;
|
|
47
|
+
eth1Data: phase0.Eth1Data;
|
|
48
|
+
latestBlockHeader: phase0.BeaconBlockHeader;
|
|
49
|
+
previousJustifiedCheckpoint: Checkpoint;
|
|
50
|
+
currentJustifiedCheckpoint: Checkpoint;
|
|
51
|
+
finalizedCheckpoint: Checkpoint;
|
|
52
|
+
getBlockRootAtSlot(slot: Slot): Root;
|
|
53
|
+
getBlockRootAtEpoch(epoch: Epoch): Root;
|
|
54
|
+
getStateRootAtSlot(slot: Slot): Root;
|
|
55
|
+
getRandaoMix(epoch: Epoch): Bytes32;
|
|
56
|
+
|
|
57
|
+
// altair
|
|
58
|
+
previousEpochParticipation: number[];
|
|
59
|
+
currentEpochParticipation: number[];
|
|
60
|
+
|
|
61
|
+
// bellatrix
|
|
62
|
+
latestExecutionPayloadHeader: ExecutionPayloadHeader;
|
|
63
|
+
|
|
64
|
+
// capella
|
|
65
|
+
historicalSummaries: capella.HistoricalSummaries;
|
|
66
|
+
|
|
67
|
+
// electra
|
|
68
|
+
pendingDeposits: electra.PendingDeposits;
|
|
69
|
+
pendingDepositsCount: number;
|
|
70
|
+
pendingPartialWithdrawals: electra.PendingPartialWithdrawals;
|
|
71
|
+
pendingPartialWithdrawalsCount: number;
|
|
72
|
+
pendingConsolidations: electra.PendingConsolidations;
|
|
73
|
+
pendingConsolidationsCount: number;
|
|
74
|
+
|
|
75
|
+
// fulu
|
|
76
|
+
proposerLookahead: fulu.ProposerLookahead;
|
|
77
|
+
|
|
78
|
+
// gloas
|
|
79
|
+
executionPayloadAvailability: boolean[];
|
|
80
|
+
latestExecutionPayloadBid: ExecutionPayloadBid;
|
|
81
|
+
getBuilder(index: BuilderIndex): gloas.Builder;
|
|
82
|
+
canBuilderCoverBid(builderIndex: BuilderIndex, bidAmount: number): boolean;
|
|
83
|
+
validatorPTCCommitteeIndex(validatorIndex: ValidatorIndex, slot: Slot): number;
|
|
84
|
+
|
|
85
|
+
// Shuffling and committees
|
|
86
|
+
getShufflingAtEpoch(epoch: Epoch): EpochShuffling;
|
|
87
|
+
// Decision roots
|
|
88
|
+
previousDecisionRoot: RootHex;
|
|
89
|
+
currentDecisionRoot: RootHex;
|
|
90
|
+
nextDecisionRoot: RootHex;
|
|
91
|
+
getShufflingDecisionRoot(epoch: Epoch): RootHex;
|
|
92
|
+
getPreviousShuffling(): EpochShuffling;
|
|
93
|
+
getCurrentShuffling(): EpochShuffling;
|
|
94
|
+
getNextShuffling(): EpochShuffling;
|
|
95
|
+
|
|
96
|
+
// utils: proposers, anchor checkpoint
|
|
97
|
+
previousProposers: ValidatorIndex[] | null;
|
|
98
|
+
currentProposers: ValidatorIndex[];
|
|
99
|
+
nextProposers: ValidatorIndex[];
|
|
100
|
+
getBeaconProposer(slot: Slot): ValidatorIndex;
|
|
101
|
+
computeAnchorCheckpoint(): {checkpoint: phase0.Checkpoint; blockHeader: phase0.BeaconBlockHeader};
|
|
102
|
+
|
|
103
|
+
// Sync committees
|
|
104
|
+
currentSyncCommittee: altair.SyncCommittee;
|
|
105
|
+
nextSyncCommittee: altair.SyncCommittee;
|
|
106
|
+
currentSyncCommitteeIndexed: SyncCommitteeCache;
|
|
107
|
+
syncProposerReward: number;
|
|
108
|
+
getIndexedSyncCommitteeAtEpoch(epoch: Epoch): SyncCommitteeCache;
|
|
109
|
+
|
|
110
|
+
// Validators and balances
|
|
111
|
+
effectiveBalanceIncrements: EffectiveBalanceIncrements;
|
|
112
|
+
getEffectiveBalanceIncrementsZeroInactive(): EffectiveBalanceIncrements;
|
|
113
|
+
getBalance(index: number): number;
|
|
114
|
+
// readonly
|
|
115
|
+
getValidator(index: ValidatorIndex): phase0.Validator;
|
|
116
|
+
getValidatorsByStatus(statuses: Set<string>, currentEpoch: Epoch): phase0.Validator[];
|
|
117
|
+
validatorCount: number;
|
|
118
|
+
// this get number of active validators in the current shuffling
|
|
119
|
+
activeValidatorCount: number;
|
|
120
|
+
// this is needed for apis only
|
|
121
|
+
getAllValidators(): phase0.Validator[];
|
|
122
|
+
getAllBalances(): number[];
|
|
123
|
+
|
|
124
|
+
// Merge
|
|
125
|
+
isExecutionStateType: boolean;
|
|
126
|
+
isMergeTransitionComplete: boolean;
|
|
127
|
+
// TODO this should go away (or rather only need block)
|
|
128
|
+
isExecutionEnabled(block: BeaconBlock | BlindedBeaconBlock): boolean;
|
|
129
|
+
|
|
130
|
+
// Block production
|
|
131
|
+
getExpectedWithdrawals(): {
|
|
132
|
+
expectedWithdrawals: capella.Withdrawal[];
|
|
133
|
+
processedBuilderWithdrawalsCount: number;
|
|
134
|
+
processedPartialWithdrawalsCount: number;
|
|
135
|
+
processedValidatorSweepCount: number;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// API
|
|
139
|
+
proposerRewards: RewardCache;
|
|
140
|
+
computeBlockRewards(block: BeaconBlock, proposerRewards?: RewardCache): Promise<rewards.BlockRewards>;
|
|
141
|
+
computeAttestationsRewards(validatorIds?: (ValidatorIndex | string)[]): Promise<rewards.AttestationsRewards>;
|
|
142
|
+
computeSyncCommitteeRewards(
|
|
143
|
+
block: BeaconBlock,
|
|
144
|
+
validatorIds: (ValidatorIndex | string)[]
|
|
145
|
+
): Promise<rewards.SyncCommitteeRewards>;
|
|
146
|
+
getLatestWeakSubjectivityCheckpointEpoch(): Epoch;
|
|
147
|
+
|
|
148
|
+
// Validation
|
|
149
|
+
getVoluntaryExitValidity(
|
|
150
|
+
signedVoluntaryExit: phase0.SignedVoluntaryExit,
|
|
151
|
+
verifySignature: boolean
|
|
152
|
+
): VoluntaryExitValidity;
|
|
153
|
+
isValidVoluntaryExit(signedVoluntaryExit: phase0.SignedVoluntaryExit, verifySignature: boolean): boolean;
|
|
154
|
+
|
|
155
|
+
// Proofs
|
|
156
|
+
getFinalizedRootProof(): Uint8Array[];
|
|
157
|
+
getSyncCommitteesWitness(): SyncCommitteeWitness;
|
|
158
|
+
getSingleProof(gindex: bigint): Uint8Array[];
|
|
159
|
+
createMultiProof(descriptor: Uint8Array): CompactMultiProof;
|
|
160
|
+
|
|
161
|
+
// Fork choice
|
|
162
|
+
computeUnrealizedCheckpoints(): {
|
|
163
|
+
justifiedCheckpoint: phase0.Checkpoint;
|
|
164
|
+
finalizedCheckpoint: phase0.Checkpoint;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// this is for backward compatible
|
|
168
|
+
clonedCount: number;
|
|
169
|
+
clonedCountWithTransferCache: number;
|
|
170
|
+
createdWithTransferCache: boolean;
|
|
171
|
+
// TODO is there a better name that is less implementation specific but still conveys the meaning?
|
|
172
|
+
isStateValidatorsNodesPopulated(): boolean;
|
|
173
|
+
|
|
174
|
+
// Serialization
|
|
175
|
+
loadOtherState(stateBytes: Uint8Array, seedValidatorsBytes?: Uint8Array): IBeaconStateView;
|
|
176
|
+
serialize(): Uint8Array;
|
|
177
|
+
serializedSize(): number;
|
|
178
|
+
serializeToBytes(output: ByteViews, offset: number): number;
|
|
179
|
+
serializeValidators(): Uint8Array;
|
|
180
|
+
serializedValidatorsSize(): number;
|
|
181
|
+
serializeValidatorsToBytes(output: ByteViews, offset: number): number;
|
|
182
|
+
|
|
183
|
+
hashTreeRoot(): Uint8Array;
|
|
184
|
+
|
|
185
|
+
// State transition
|
|
186
|
+
stateTransition(
|
|
187
|
+
signedBlock: SignedBeaconBlock | SignedBlindedBeaconBlock,
|
|
188
|
+
options: StateTransitionOpts,
|
|
189
|
+
modules: StateTransitionModules
|
|
190
|
+
): IBeaconStateView;
|
|
191
|
+
processSlots(
|
|
192
|
+
slot: Slot,
|
|
193
|
+
epochTransitionCacheOpts?: EpochTransitionCacheOpts & {dontTransferCache?: boolean},
|
|
194
|
+
modules?: StateTransitionModules
|
|
195
|
+
): IBeaconStateView;
|
|
196
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {PublicKey, Signature, aggregatePublicKeys, fastAggregateVerify, verify} from "@chainsafe/blst";
|
|
2
2
|
import {Root} from "@lodestar/types";
|
|
3
|
-
import {
|
|
3
|
+
import {PubkeyCache} from "../cache/pubkeyCache.js";
|
|
4
4
|
|
|
5
5
|
export enum SignatureSetType {
|
|
6
6
|
single = "single",
|
|
@@ -49,18 +49,21 @@ export type ISignatureSet = SingleSignatureSet | IndexedSignatureSet | Aggregate
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Get the pubkey for a signature set, performing aggregation if necessary.
|
|
52
|
-
* Requires
|
|
52
|
+
* Requires pubkeyCache for indexed and aggregate sets.
|
|
53
53
|
*/
|
|
54
|
-
export function getSignatureSetPubkey(signatureSet: ISignatureSet,
|
|
54
|
+
export function getSignatureSetPubkey(signatureSet: ISignatureSet, pubkeyCache: PubkeyCache): PublicKey {
|
|
55
55
|
switch (signatureSet.type) {
|
|
56
56
|
case SignatureSetType.single:
|
|
57
57
|
return signatureSet.pubkey;
|
|
58
58
|
|
|
59
|
-
case SignatureSetType.indexed:
|
|
60
|
-
return
|
|
59
|
+
case SignatureSetType.indexed: {
|
|
60
|
+
return pubkeyCache.getOrThrow(signatureSet.index);
|
|
61
|
+
}
|
|
61
62
|
|
|
62
63
|
case SignatureSetType.aggregate: {
|
|
63
|
-
const pubkeys = signatureSet.indices.map((i) =>
|
|
64
|
+
const pubkeys = signatureSet.indices.map((i) => {
|
|
65
|
+
return pubkeyCache.getOrThrow(i);
|
|
66
|
+
});
|
|
64
67
|
return aggregatePublicKeys(pubkeys);
|
|
65
68
|
}
|
|
66
69
|
|
|
@@ -69,11 +72,11 @@ export function getSignatureSetPubkey(signatureSet: ISignatureSet, index2pubkey:
|
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
|
|
72
|
-
export function verifySignatureSet(signatureSet: SingleSignatureSet,
|
|
73
|
-
export function verifySignatureSet(signatureSet: IndexedSignatureSet,
|
|
74
|
-
export function verifySignatureSet(signatureSet: AggregatedSignatureSet,
|
|
75
|
-
export function verifySignatureSet(signatureSet: ISignatureSet,
|
|
76
|
-
export function verifySignatureSet(signatureSet: ISignatureSet,
|
|
75
|
+
export function verifySignatureSet(signatureSet: SingleSignatureSet, pubkeyCache?: PubkeyCache): boolean;
|
|
76
|
+
export function verifySignatureSet(signatureSet: IndexedSignatureSet, pubkeyCache: PubkeyCache): boolean;
|
|
77
|
+
export function verifySignatureSet(signatureSet: AggregatedSignatureSet, pubkeyCache: PubkeyCache): boolean;
|
|
78
|
+
export function verifySignatureSet(signatureSet: ISignatureSet, pubkeyCache: PubkeyCache): boolean;
|
|
79
|
+
export function verifySignatureSet(signatureSet: ISignatureSet, pubkeyCache?: PubkeyCache): boolean {
|
|
77
80
|
// All signatures are not trusted and must be group checked (p2.subgroup_check)
|
|
78
81
|
const signature = Signature.fromBytes(signatureSet.signature, true);
|
|
79
82
|
|
|
@@ -82,17 +85,20 @@ export function verifySignatureSet(signatureSet: ISignatureSet, index2pubkey?: I
|
|
|
82
85
|
return verify(signatureSet.signingRoot, signatureSet.pubkey, signature);
|
|
83
86
|
|
|
84
87
|
case SignatureSetType.indexed: {
|
|
85
|
-
if (!
|
|
86
|
-
throw Error("
|
|
88
|
+
if (!pubkeyCache) {
|
|
89
|
+
throw Error("pubkeyCache required for indexed signature set");
|
|
87
90
|
}
|
|
88
|
-
|
|
91
|
+
const pubkey = pubkeyCache.getOrThrow(signatureSet.index);
|
|
92
|
+
return verify(signatureSet.signingRoot, pubkey, signature);
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
case SignatureSetType.aggregate: {
|
|
92
|
-
if (!
|
|
93
|
-
throw Error("
|
|
96
|
+
if (!pubkeyCache) {
|
|
97
|
+
throw Error("pubkeyCache required for aggregate signature set");
|
|
94
98
|
}
|
|
95
|
-
const pubkeys = signatureSet.indices.map((i) =>
|
|
99
|
+
const pubkeys = signatureSet.indices.map((i) => {
|
|
100
|
+
return pubkeyCache.getOrThrow(i);
|
|
101
|
+
});
|
|
96
102
|
return fastAggregateVerify(signatureSet.signingRoot, pubkeys, signature);
|
|
97
103
|
}
|
|
98
104
|
|
|
@@ -47,7 +47,7 @@ export function computeWeakSubjectivityPeriodCachedState(
|
|
|
47
47
|
state: CachedBeaconStateAllForks
|
|
48
48
|
): number {
|
|
49
49
|
const activeValidatorCount = state.epochCtx.currentShuffling.activeIndices.length;
|
|
50
|
-
const fork =
|
|
50
|
+
const fork = config.getForkName(state.slot);
|
|
51
51
|
|
|
52
52
|
return isForkPostElectra(fork)
|
|
53
53
|
? computeWeakSubjectivityPeriodFromConstituentsElectra(
|