@lodestar/state-transition 1.50.0-dev.cddd01a6c6 → 1.50.0-dev.ce0e732118
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/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.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/stateView/beaconStateView.d.ts +22 -21
- package/lib/stateView/beaconStateView.d.ts.map +1 -1
- package/lib/stateView/beaconStateView.js +71 -71
- package/lib/stateView/beaconStateView.js.map +1 -1
- package/lib/stateView/interface.d.ts +34 -21
- package/lib/stateView/interface.d.ts.map +1 -1
- package/lib/stateView/interface.js.map +1 -1
- package/lib/stateView/nativeBeaconStateView.d.ts +92 -100
- package/lib/stateView/nativeBeaconStateView.d.ts.map +1 -1
- package/lib/stateView/nativeBeaconStateView.js +339 -368
- package/lib/stateView/nativeBeaconStateView.js.map +1 -1
- package/lib/stateView/stateViewFactory.d.ts +6 -5
- package/lib/stateView/stateViewFactory.d.ts.map +1 -1
- package/lib/stateView/stateViewFactory.js +12 -8
- package/lib/stateView/stateViewFactory.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +3 -1
- package/src/signatureSets/index.ts +4 -2
- package/src/signatureSets/voluntaryExits.ts +3 -55
- package/src/stateView/beaconStateView.ts +75 -76
- package/src/stateView/interface.ts +61 -21
- package/src/stateView/nativeBeaconStateView.ts +354 -375
- package/src/stateView/stateViewFactory.ts +21 -12
package/lib/index.d.ts
CHANGED
|
@@ -20,7 +20,8 @@ export * from "./rewards/index.js";
|
|
|
20
20
|
export * from "./signatureSets/index.js";
|
|
21
21
|
export * from "./stateTransition.js";
|
|
22
22
|
export { BeaconStateView } from "./stateView/beaconStateView.js";
|
|
23
|
-
export { type
|
|
23
|
+
export { type BlockSTFInput, type ComputeNewStateRootResult, type IBeaconStateView, type IBeaconStateViewAltair, type IBeaconStateViewBellatrix, type IBeaconStateViewCapella, type IBeaconStateViewDeneb, type IBeaconStateViewElectra, type IBeaconStateViewFulu, type IBeaconStateViewGloas, type IBeaconStateViewHeze, type IBeaconStateViewNative, isStatePostAltair, isStatePostBellatrix, isStatePostCapella, isStatePostDeneb, isStatePostElectra, isStatePostFulu, isStatePostGloas, isStatePostHeze, } from "./stateView/interface.js";
|
|
24
|
+
export { NativeBeaconStateView } from "./stateView/nativeBeaconStateView.js";
|
|
24
25
|
export { createBeaconStateView, createBeaconStateViewForHistoricalRegen } from "./stateView/stateViewFactory.js";
|
|
25
26
|
export type { BeaconStateAllForks, BeaconStateAltair, BeaconStateBellatrix, BeaconStateCapella, BeaconStateDeneb, BeaconStateElectra, BeaconStateExecutions, BeaconStateFulu, BeaconStateGloas, BeaconStateHeze, BeaconStatePhase0, CachedBeaconStateAllForks, CachedBeaconStateAltair, CachedBeaconStateBellatrix, CachedBeaconStateCapella, CachedBeaconStateDeneb, CachedBeaconStateElectra, CachedBeaconStateExecutions, CachedBeaconStateFulu, CachedBeaconStateGloas, CachedBeaconStateHeze, CachedBeaconStatePhase0, } from "./types.js";
|
|
26
27
|
export * from "./util/index.js";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,iCAAiC,EAAE,yBAAyB,EAAC,MAAM,sCAAsC,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AAO,EAAC,KAAK,4BAA4B,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;AAC3E,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAC,qBAAqB,EAAC,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAC,qBAAqB,EAAE,uCAAuC,EAAC,MAAM,iCAAiC,CAAC;AAC/G,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,gBAAgB,EAChB,eAAe,EAEf,iBAAiB,EACjB,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AACpB,cAAc,iBAAiB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export * from "./signatureSets/index.js";
|
|
|
24
24
|
export * from "./stateTransition.js";
|
|
25
25
|
export { BeaconStateView } from "./stateView/beaconStateView.js";
|
|
26
26
|
export { isStatePostAltair, isStatePostBellatrix, isStatePostCapella, isStatePostDeneb, isStatePostElectra, isStatePostFulu, isStatePostGloas, isStatePostHeze, } from "./stateView/interface.js";
|
|
27
|
+
export { NativeBeaconStateView } from "./stateView/nativeBeaconStateView.js";
|
|
27
28
|
export { createBeaconStateView, createBeaconStateViewForHistoricalRegen } from "./stateView/stateViewFactory.js";
|
|
28
29
|
export * from "./util/index.js";
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,sBAAsB,EAAE,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAC,iCAAiC,EAAE,yBAAyB,EAAC,MAAM,sCAAsC,CAAC;AAClH,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAC,2BAA2B,EAAC,MAAM,wCAAwC,CAAC;AACnF,qCAAqC;AACrC,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAC,2BAA2B,EAAC,MAAM,oCAAoC,CAAC;AAC/E,yBAAyB;AACzB,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,iCAAiC,CAAC;AACzC,6BAA6B;AAC7B,OAAO,EAAC,sBAAsB,EAAC,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAE,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAEL,oCAAoC,EACpC,mCAAmC,GACpC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,UAAU,EAEV,kCAAkC,GACnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAA4B,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B,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,2BAA2B,EAAE,kBAAkB,EAC/C,KAAK,EAAE,gBAAgB,EACvB,WAAW,EAAE,iBAAiB,EAC9B,mBAAmB,EAAE,kBAAkB,EAAE,EACzC,IAAI,CAAC,EAAE;IACL,wFAAwF;IACxF,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GACA,aAAa,EAAE,CAwDjB"}
|
|
@@ -8,7 +8,7 @@ import { getPayloadAttestationDataSigningRoot } from "./indexedPayloadAttestatio
|
|
|
8
8
|
import { getBlockProposerSignatureSet } from "./proposer.js";
|
|
9
9
|
import { getProposerSlashingsSignatureSets } from "./proposerSlashings.js";
|
|
10
10
|
import { getRandaoRevealSignatureSet } from "./randao.js";
|
|
11
|
-
import {
|
|
11
|
+
import { getVoluntaryExitSignatureSet } from "./voluntaryExits.js";
|
|
12
12
|
export * from "./attesterSlashings.js";
|
|
13
13
|
export * from "./blsToExecutionChange.js";
|
|
14
14
|
export * from "./executionPayloadBid.js";
|
|
@@ -32,7 +32,7 @@ export function getBlockSignatureSets(config, currentSyncCommitteeIndexed, state
|
|
|
32
32
|
...getProposerSlashingsSignatureSets(config, signedBlock),
|
|
33
33
|
...getAttesterSlashingsSignatureSets(config, signedBlock),
|
|
34
34
|
...getAttestationsSignatureSets(config, signedBlock, indexedAttestations),
|
|
35
|
-
...
|
|
35
|
+
...signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(config, state, voluntaryExit)),
|
|
36
36
|
];
|
|
37
37
|
if (!opts?.skipProposerSignature) {
|
|
38
38
|
signatureSets.push(getBlockProposerSignatureSet(config, signedBlock));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/signatureSets/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAC,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAC,4BAA4B,EAAC,MAAM,kCAAkC,CAA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AAC;IACH,CAAC;IAED,0BAA0B;IAC1B,IAAI,IAAI,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QAC5B,MAAM,iCAAiC,GAAG,oCAAoC,CAC5E,MAAM,EACN,WAAwC,CACzC,CAAC;QACF,IAAI,iCAAiC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjD,aAAa,CAAC,IAAI,CAAC,GAAG,iCAAiC,CAAC,CAAC;QAC3D,CAAC;IACH,CAAC;IAED,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAC1B,KAAK,MAAM,kBAAkB,IAAK,WAAuC,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC3G,MAAM,GAAG,GAAI,KAA+B,CAAC,6BAA6B,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzG,aAAa,CAAC,IAAI,CAChB,yCAAyC,CACvC,kBAAkB,CAAC,eAAe,CAAC,eAAe,CAAC,GAAG,CAAC,EACvD,oCAAoC,CAAC,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,EACrE,kBAAkB,CAAC,SAAS,CAC7B,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { BeaconConfig } from "@lodestar/config";
|
|
2
|
-
import {
|
|
3
|
-
import { IBeaconStateView
|
|
2
|
+
import { phase0 } from "@lodestar/types";
|
|
3
|
+
import { IBeaconStateView } from "../stateView/interface.js";
|
|
4
4
|
import { ISignatureSet } from "../util/index.js";
|
|
5
5
|
export declare function verifyVoluntaryExitSignature(config: BeaconConfig, state: IBeaconStateView, signedVoluntaryExit: phase0.SignedVoluntaryExit): boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Extract signatures to allow validating all block signatures at once
|
|
8
8
|
*/
|
|
9
9
|
export declare function getVoluntaryExitSignatureSet(config: BeaconConfig, state: IBeaconStateView, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
|
|
10
|
-
export declare function getVoluntaryExitsSignatureSets(config: BeaconConfig, state: IBeaconStateView, signedBlock: SignedBeaconBlock): ISignatureSet[];
|
|
11
|
-
export declare function getValidatorVoluntaryExitSignatureSet(config: BeaconConfig, stateSlot: Slot, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
|
|
12
|
-
export declare function getBuilderVoluntaryExitSignatureSet(config: BeaconConfig, state: IBeaconStateViewGloas, signedVoluntaryExit: phase0.SignedVoluntaryExit): ISignatureSet;
|
|
13
|
-
export declare function isBuilderVoluntaryExit(signedVoluntaryExit: phase0.SignedVoluntaryExit): boolean;
|
|
14
10
|
//# sourceMappingURL=voluntaryExits.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voluntaryExits.d.ts","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"voluntaryExits.d.ts","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAM,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACL,aAAa,EAKd,MAAM,kBAAkB,CAAC;AAE1B,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,gBAAgB,EACvB,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,gBAAgB,EACvB,mBAAmB,EAAE,MAAM,CAAC,mBAAmB,GAC9C,aAAa,CAUf"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { ForkSeq } from "@lodestar/params";
|
|
2
1
|
import { ssz } from "@lodestar/types";
|
|
3
|
-
import {
|
|
4
|
-
import { SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch, convertValidatorIndexToBuilderIndex, isBuilderIndex, verifySignatureSet, } from "../util/index.js";
|
|
2
|
+
import { SignatureSetType, computeSigningRoot, computeStartSlotAtEpoch, verifySignatureSet, } from "../util/index.js";
|
|
5
3
|
export function verifyVoluntaryExitSignature(config, state, signedVoluntaryExit) {
|
|
6
4
|
return verifySignatureSet(getVoluntaryExitSignatureSet(config, state, signedVoluntaryExit));
|
|
7
5
|
}
|
|
@@ -9,21 +7,8 @@ export function verifyVoluntaryExitSignature(config, state, signedVoluntaryExit)
|
|
|
9
7
|
* Extract signatures to allow validating all block signatures at once
|
|
10
8
|
*/
|
|
11
9
|
export function getVoluntaryExitSignatureSet(config, state, signedVoluntaryExit) {
|
|
12
|
-
const fork = config.getForkSeq(state.slot);
|
|
13
|
-
if (fork >= ForkSeq.gloas && isBuilderVoluntaryExit(signedVoluntaryExit)) {
|
|
14
|
-
if (!isStatePostGloas(state)) {
|
|
15
|
-
throw new Error(`Expected gloas+ state for builder voluntary exit signature, got fork=${state.forkName}`);
|
|
16
|
-
}
|
|
17
|
-
return getBuilderVoluntaryExitSignatureSet(config, state, signedVoluntaryExit);
|
|
18
|
-
}
|
|
19
|
-
return getValidatorVoluntaryExitSignatureSet(config, state.slot, signedVoluntaryExit);
|
|
20
|
-
}
|
|
21
|
-
export function getVoluntaryExitsSignatureSets(config, state, signedBlock) {
|
|
22
|
-
return signedBlock.message.body.voluntaryExits.map((voluntaryExit) => getVoluntaryExitSignatureSet(config, state, voluntaryExit));
|
|
23
|
-
}
|
|
24
|
-
export function getValidatorVoluntaryExitSignatureSet(config, stateSlot, signedVoluntaryExit) {
|
|
25
10
|
const messageSlot = computeStartSlotAtEpoch(signedVoluntaryExit.message.epoch);
|
|
26
|
-
const domain = config.getDomainForVoluntaryExit(
|
|
11
|
+
const domain = config.getDomainForVoluntaryExit(state.slot, messageSlot);
|
|
27
12
|
return {
|
|
28
13
|
type: SignatureSetType.indexed,
|
|
29
14
|
index: signedVoluntaryExit.message.validatorIndex,
|
|
@@ -31,19 +16,4 @@ export function getValidatorVoluntaryExitSignatureSet(config, stateSlot, signedV
|
|
|
31
16
|
signature: signedVoluntaryExit.signature,
|
|
32
17
|
};
|
|
33
18
|
}
|
|
34
|
-
export function getBuilderVoluntaryExitSignatureSet(config, state, signedVoluntaryExit) {
|
|
35
|
-
const messageSlot = computeStartSlotAtEpoch(signedVoluntaryExit.message.epoch);
|
|
36
|
-
const domain = config.getDomainForVoluntaryExit(state.slot, messageSlot);
|
|
37
|
-
const builderIndex = convertValidatorIndexToBuilderIndex(signedVoluntaryExit.message.validatorIndex);
|
|
38
|
-
const builder = state.getBuilder(builderIndex);
|
|
39
|
-
return {
|
|
40
|
-
type: SignatureSetType.single,
|
|
41
|
-
pubkey: builder.pubkey,
|
|
42
|
-
signingRoot: computeSigningRoot(ssz.phase0.VoluntaryExit, signedVoluntaryExit.message, domain),
|
|
43
|
-
signature: signedVoluntaryExit.signature,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export function isBuilderVoluntaryExit(signedVoluntaryExit) {
|
|
47
|
-
return isBuilderIndex(signedVoluntaryExit.message.validatorIndex);
|
|
48
|
-
}
|
|
49
19
|
//# sourceMappingURL=voluntaryExits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voluntaryExits.js","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"voluntaryExits.js","sourceRoot":"","sources":["../../src/signatureSets/voluntaryExits.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,KAAuB,EACvB,mBAA+C;IAE/C,OAAO,kBAAkB,CAAC,4BAA4B,CAAC,MAAM,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAC9F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,MAAoB,EACpB,KAAuB,EACvB,mBAA+C;IAE/C,MAAM,WAAW,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/E,MAAM,MAAM,GAAG,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAEzE,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,OAAO;QAC9B,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,cAAc;QACjD,WAAW,EAAE,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,EAAE,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC;QAC9F,SAAS,EAAE,mBAAmB,CAAC,SAAS;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CompactMultiProof } from "@chainsafe/persistent-merkle-tree";
|
|
2
2
|
import { BitArray, ByteViews } from "@chainsafe/ssz";
|
|
3
3
|
import { ForkName, ForkSeq } from "@lodestar/params";
|
|
4
|
-
import { BeaconBlock, BeaconState, BlindedBeaconBlock, BuilderIndex, Bytes32, CommitteeIndex, Epoch, ExecutionPayloadBid, ExecutionPayloadHeader, Root, RootHex,
|
|
4
|
+
import { BeaconBlock, BeaconState, BlindedBeaconBlock, BuilderIndex, Bytes32, CommitteeIndex, Epoch, ExecutionPayloadBid, ExecutionPayloadHeader, Root, RootHex, Slot, SyncCommittee, ValidatorIndex, capella, electra, fulu, gloas, phase0, rewards } from "@lodestar/types";
|
|
5
5
|
import { Checkpoint, Fork } from "@lodestar/types/phase0";
|
|
6
6
|
import { VoluntaryExitValidity } from "../block/processVoluntaryExit.js";
|
|
7
7
|
import { EffectiveBalanceIncrements } from "../cache/effectiveBalanceIncrements.js";
|
|
@@ -12,28 +12,29 @@ import { SyncCommitteeWitness } from "../lightClient/types.js";
|
|
|
12
12
|
import { StateTransitionModules, StateTransitionOpts } from "../stateTransition.js";
|
|
13
13
|
import { EpochShuffling } from "../util/epochShuffling.js";
|
|
14
14
|
import { PreVerifyBuilderDepositsResult } from "../util/preVerifyBuilderDeposits.js";
|
|
15
|
-
import {
|
|
15
|
+
import { BlockSTFInput, ComputeNewStateRootResult, IBeaconStateView, IBeaconStateViewGloas, IBeaconStateViewLatestFork } from "./interface.js";
|
|
16
16
|
export declare class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
17
17
|
readonly cachedState: CachedBeaconStateAllForks;
|
|
18
18
|
private readonly config;
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
private
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
private
|
|
34
|
-
private
|
|
35
|
-
private
|
|
19
|
+
private cachedFork;
|
|
20
|
+
private cachedLatestBlockHeader;
|
|
21
|
+
private cachedCurrentSyncCommittee;
|
|
22
|
+
private cachedNextSyncCommittee;
|
|
23
|
+
private cachedPreviousEpochParticipation;
|
|
24
|
+
private cachedCurrentEpochParticipation;
|
|
25
|
+
private cachedLatestExecutionPayloadHeader;
|
|
26
|
+
private cachedHistoricalSummaries;
|
|
27
|
+
private cachedPendingPartialWithdrawals;
|
|
28
|
+
private cachedPendingConsolidations;
|
|
29
|
+
private cachedPendingDeposits;
|
|
30
|
+
private cachedProposerLookahead;
|
|
31
|
+
private cachedExecutionPayloadAvailability;
|
|
32
|
+
private cachedLatestExecutionPayloadBid;
|
|
33
|
+
private cachedPayloadExpectedWithdrawals;
|
|
34
|
+
private cachedBuilderPendingPayments;
|
|
35
|
+
private cachedBuilderPendingWithdrawals;
|
|
36
36
|
constructor(cachedState: CachedBeaconStateAllForks);
|
|
37
|
+
release(): void;
|
|
37
38
|
get forkName(): ForkName;
|
|
38
39
|
get forkSeq(): ForkSeq;
|
|
39
40
|
get slot(): number;
|
|
@@ -171,8 +172,8 @@ export declare class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
171
172
|
serializedValidatorsSize(): number;
|
|
172
173
|
serializeValidatorsToBytes(output: ByteViews, offset: number): number;
|
|
173
174
|
hashTreeRoot(): Uint8Array;
|
|
174
|
-
computeNewStateRoot({ block }:
|
|
175
|
-
stateTransition(
|
|
175
|
+
computeNewStateRoot({ block }: BlockSTFInput, modules: StateTransitionModules): ComputeNewStateRootResult;
|
|
176
|
+
stateTransition({ block }: BlockSTFInput, options: StateTransitionOpts, modules: StateTransitionModules): IBeaconStateView;
|
|
176
177
|
processSlots(slot: Slot, opts?: {
|
|
177
178
|
dontTransferCache?: boolean;
|
|
178
179
|
}, modules?: StateTransitionModules): IBeaconStateView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beaconStateView.d.ts","sourceRoot":"","sources":["../../src/stateView/beaconStateView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAA+B,MAAM,mCAAmC,CAAC;AAClG,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAC,QAAQ,EAAE,OAAO,EAA4B,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EACL,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,cAAc,EACd,KAAK,EACL,mBAAmB,EACnB,sBAAsB,EACtB,IAAI,EACJ,OAAO,EACP,
|
|
1
|
+
{"version":3,"file":"beaconStateView.d.ts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MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE1D;IAED,mBAAmB,IAAI,UAAU,CAEhC;IAED,wBAAwB,IAAI,MAAM,CAGjC;IAED,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpE;IAED,YAAY,IAAI,UAAU,CAEzB;IAID,mBAAmB,CAAC,EAAC,KAAK,EAAC,EAAE,aAAa,EAAE,OAAO,EAAE,sBAAsB,GAAG,yBAAyB,CAKtG;IAED,eAAe,CACb,EAAC,KAAK,EAAC,EAAE,aAAa,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,sBAAsB,GAC9B,gBAAgB,CAElB;IAED,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE;QAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAC,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,gBAAgB,CAGjH;IAED;;OAEG;IACH,wBAAwB,CAAC,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,GAAG,qBAAqB,CAc1F;CACF"}
|
|
@@ -28,33 +28,34 @@ export class BeaconStateView {
|
|
|
28
28
|
config;
|
|
29
29
|
// Cached values extracted from the tree
|
|
30
30
|
// phase0
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
cachedFork = null;
|
|
32
|
+
cachedLatestBlockHeader = null;
|
|
33
33
|
// altair
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
cachedCurrentSyncCommittee = null;
|
|
35
|
+
cachedNextSyncCommittee = null;
|
|
36
|
+
cachedPreviousEpochParticipation = null;
|
|
37
|
+
cachedCurrentEpochParticipation = null;
|
|
38
38
|
// bellatrix
|
|
39
|
-
|
|
39
|
+
cachedLatestExecutionPayloadHeader = null;
|
|
40
40
|
// capella
|
|
41
|
-
|
|
41
|
+
cachedHistoricalSummaries = null;
|
|
42
42
|
// electra
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
cachedPendingPartialWithdrawals = null;
|
|
44
|
+
cachedPendingConsolidations = null;
|
|
45
|
+
cachedPendingDeposits = null;
|
|
46
46
|
// fulu
|
|
47
|
-
|
|
47
|
+
cachedProposerLookahead = null;
|
|
48
48
|
// gloas
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
cachedExecutionPayloadAvailability = null;
|
|
50
|
+
cachedLatestExecutionPayloadBid = null;
|
|
51
|
+
cachedPayloadExpectedWithdrawals = null;
|
|
52
|
+
cachedBuilderPendingPayments = null;
|
|
53
|
+
cachedBuilderPendingWithdrawals = null;
|
|
54
54
|
constructor(cachedState) {
|
|
55
55
|
this.cachedState = cachedState;
|
|
56
56
|
this.config = cachedState.config;
|
|
57
57
|
}
|
|
58
|
+
release() { }
|
|
58
59
|
// phase0
|
|
59
60
|
get forkName() {
|
|
60
61
|
return this.config.getForkName(this.cachedState.slot);
|
|
@@ -66,10 +67,10 @@ export class BeaconStateView {
|
|
|
66
67
|
return this.cachedState.slot;
|
|
67
68
|
}
|
|
68
69
|
get fork() {
|
|
69
|
-
if (this.
|
|
70
|
-
this.
|
|
70
|
+
if (this.cachedFork === null) {
|
|
71
|
+
this.cachedFork = this.cachedState.fork.toValue();
|
|
71
72
|
}
|
|
72
|
-
return this.
|
|
73
|
+
return this.cachedFork;
|
|
73
74
|
}
|
|
74
75
|
get epoch() {
|
|
75
76
|
return computeEpochAtSlot(this.slot);
|
|
@@ -84,10 +85,10 @@ export class BeaconStateView {
|
|
|
84
85
|
return this.cachedState.eth1Data;
|
|
85
86
|
}
|
|
86
87
|
get latestBlockHeader() {
|
|
87
|
-
if (this.
|
|
88
|
-
this.
|
|
88
|
+
if (this.cachedLatestBlockHeader === null) {
|
|
89
|
+
this.cachedLatestBlockHeader = this.cachedState.latestBlockHeader.toValue();
|
|
89
90
|
}
|
|
90
|
-
return this.
|
|
91
|
+
return this.cachedLatestBlockHeader;
|
|
91
92
|
}
|
|
92
93
|
get previousJustifiedCheckpoint() {
|
|
93
94
|
return this.cachedState.previousJustifiedCheckpoint;
|
|
@@ -114,20 +115,20 @@ export class BeaconStateView {
|
|
|
114
115
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.altair) {
|
|
115
116
|
throw new Error("previousEpochParticipation is not available before Altair");
|
|
116
117
|
}
|
|
117
|
-
if (this.
|
|
118
|
-
this.
|
|
118
|
+
if (this.cachedPreviousEpochParticipation === null) {
|
|
119
|
+
this.cachedPreviousEpochParticipation = this.cachedState.previousEpochParticipation.serialize();
|
|
119
120
|
}
|
|
120
|
-
return this.
|
|
121
|
+
return this.cachedPreviousEpochParticipation;
|
|
121
122
|
}
|
|
122
123
|
// altair
|
|
123
124
|
get currentEpochParticipation() {
|
|
124
125
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.altair) {
|
|
125
126
|
throw new Error("currentEpochParticipation is not available before Altair");
|
|
126
127
|
}
|
|
127
|
-
if (this.
|
|
128
|
-
this.
|
|
128
|
+
if (this.cachedCurrentEpochParticipation === null) {
|
|
129
|
+
this.cachedCurrentEpochParticipation = this.cachedState.currentEpochParticipation.serialize();
|
|
129
130
|
}
|
|
130
|
-
return this.
|
|
131
|
+
return this.cachedCurrentEpochParticipation;
|
|
131
132
|
}
|
|
132
133
|
getPreviousEpochParticipation(validatorIndex) {
|
|
133
134
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.altair) {
|
|
@@ -150,10 +151,10 @@ export class BeaconStateView {
|
|
|
150
151
|
if (forkSeq >= ForkSeq.gloas) {
|
|
151
152
|
throw new Error("latestExecutionPayloadHeader is not available after Gloas");
|
|
152
153
|
}
|
|
153
|
-
if (this.
|
|
154
|
-
this.
|
|
154
|
+
if (this.cachedLatestExecutionPayloadHeader === null) {
|
|
155
|
+
this.cachedLatestExecutionPayloadHeader = this.cachedState.latestExecutionPayloadHeader.toValue();
|
|
155
156
|
}
|
|
156
|
-
return this.
|
|
157
|
+
return this.cachedLatestExecutionPayloadHeader;
|
|
157
158
|
}
|
|
158
159
|
/**
|
|
159
160
|
* The execution block number of the most recently included payload.
|
|
@@ -175,20 +176,20 @@ export class BeaconStateView {
|
|
|
175
176
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.capella) {
|
|
176
177
|
throw new Error("Historical summaries are not supported before Capella");
|
|
177
178
|
}
|
|
178
|
-
if (this.
|
|
179
|
-
this.
|
|
179
|
+
if (this.cachedHistoricalSummaries === null) {
|
|
180
|
+
this.cachedHistoricalSummaries = this.cachedState.historicalSummaries.toValue();
|
|
180
181
|
}
|
|
181
|
-
return this.
|
|
182
|
+
return this.cachedHistoricalSummaries;
|
|
182
183
|
}
|
|
183
184
|
// electra
|
|
184
185
|
get pendingDeposits() {
|
|
185
186
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.electra) {
|
|
186
187
|
throw new Error("Pending deposits are not supported before Electra");
|
|
187
188
|
}
|
|
188
|
-
if (this.
|
|
189
|
-
this.
|
|
189
|
+
if (this.cachedPendingDeposits === null) {
|
|
190
|
+
this.cachedPendingDeposits = this.cachedState.pendingDeposits.toValue();
|
|
190
191
|
}
|
|
191
|
-
return this.
|
|
192
|
+
return this.cachedPendingDeposits;
|
|
192
193
|
}
|
|
193
194
|
get pendingDepositsCount() {
|
|
194
195
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.electra) {
|
|
@@ -200,10 +201,10 @@ export class BeaconStateView {
|
|
|
200
201
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.electra) {
|
|
201
202
|
throw new Error("Pending partial withdrawals are not supported before Electra");
|
|
202
203
|
}
|
|
203
|
-
if (this.
|
|
204
|
-
this.
|
|
204
|
+
if (this.cachedPendingPartialWithdrawals === null) {
|
|
205
|
+
this.cachedPendingPartialWithdrawals = this.cachedState.pendingPartialWithdrawals.toValue();
|
|
205
206
|
}
|
|
206
|
-
return this.
|
|
207
|
+
return this.cachedPendingPartialWithdrawals;
|
|
207
208
|
}
|
|
208
209
|
get pendingPartialWithdrawalsCount() {
|
|
209
210
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.electra) {
|
|
@@ -215,10 +216,10 @@ export class BeaconStateView {
|
|
|
215
216
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.electra) {
|
|
216
217
|
throw new Error("Pending consolidations are not supported before Electra");
|
|
217
218
|
}
|
|
218
|
-
if (this.
|
|
219
|
-
this.
|
|
219
|
+
if (this.cachedPendingConsolidations === null) {
|
|
220
|
+
this.cachedPendingConsolidations = this.cachedState.pendingConsolidations.toValue();
|
|
220
221
|
}
|
|
221
|
-
return this.
|
|
222
|
+
return this.cachedPendingConsolidations;
|
|
222
223
|
}
|
|
223
224
|
get pendingConsolidationsCount() {
|
|
224
225
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.electra) {
|
|
@@ -231,10 +232,10 @@ export class BeaconStateView {
|
|
|
231
232
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.fulu) {
|
|
232
233
|
throw new Error("Proposer lookahead is not supported before Fulu");
|
|
233
234
|
}
|
|
234
|
-
if (this.
|
|
235
|
-
this.
|
|
235
|
+
if (this.cachedProposerLookahead === null) {
|
|
236
|
+
this.cachedProposerLookahead = this.cachedState.proposerLookahead.toValue();
|
|
236
237
|
}
|
|
237
|
-
return this.
|
|
238
|
+
return this.cachedProposerLookahead;
|
|
238
239
|
}
|
|
239
240
|
preVerifyBuilderDepositsPreGloas(maxBuilderDeposits, maxDurationMs) {
|
|
240
241
|
return preVerifyBuilderDepositsPreGloas(this.cachedState, maxBuilderDeposits, maxDurationMs);
|
|
@@ -253,46 +254,46 @@ export class BeaconStateView {
|
|
|
253
254
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.gloas) {
|
|
254
255
|
throw new Error("executionPayloadAvailability is not available before Gloas");
|
|
255
256
|
}
|
|
256
|
-
if (this.
|
|
257
|
-
this.
|
|
257
|
+
if (this.cachedExecutionPayloadAvailability === null) {
|
|
258
|
+
this.cachedExecutionPayloadAvailability = this.cachedState.executionPayloadAvailability.toValue();
|
|
258
259
|
}
|
|
259
|
-
return this.
|
|
260
|
+
return this.cachedExecutionPayloadAvailability;
|
|
260
261
|
}
|
|
261
262
|
get latestExecutionPayloadBid() {
|
|
262
263
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.gloas) {
|
|
263
264
|
throw new Error("latestExecutionPayloadBid is not available before Gloas");
|
|
264
265
|
}
|
|
265
|
-
if (this.
|
|
266
|
-
this.
|
|
266
|
+
if (this.cachedLatestExecutionPayloadBid === null) {
|
|
267
|
+
this.cachedLatestExecutionPayloadBid = this.cachedState.latestExecutionPayloadBid.toValue();
|
|
267
268
|
}
|
|
268
|
-
return this.
|
|
269
|
+
return this.cachedLatestExecutionPayloadBid;
|
|
269
270
|
}
|
|
270
271
|
get payloadExpectedWithdrawals() {
|
|
271
272
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.gloas) {
|
|
272
273
|
throw new Error("payloadExpectedWithdrawals is not available before Gloas");
|
|
273
274
|
}
|
|
274
|
-
if (this.
|
|
275
|
-
this.
|
|
275
|
+
if (this.cachedPayloadExpectedWithdrawals === null) {
|
|
276
|
+
this.cachedPayloadExpectedWithdrawals = this.cachedState.payloadExpectedWithdrawals.toValue();
|
|
276
277
|
}
|
|
277
|
-
return this.
|
|
278
|
+
return this.cachedPayloadExpectedWithdrawals;
|
|
278
279
|
}
|
|
279
280
|
get builderPendingPayments() {
|
|
280
281
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.gloas) {
|
|
281
282
|
throw new Error("Pending builder payments are not supported before Gloas");
|
|
282
283
|
}
|
|
283
|
-
if (this.
|
|
284
|
-
this.
|
|
284
|
+
if (this.cachedBuilderPendingPayments === null) {
|
|
285
|
+
this.cachedBuilderPendingPayments = this.cachedState.builderPendingPayments.toValue();
|
|
285
286
|
}
|
|
286
|
-
return this.
|
|
287
|
+
return this.cachedBuilderPendingPayments;
|
|
287
288
|
}
|
|
288
289
|
get builderPendingWithdrawals() {
|
|
289
290
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.gloas) {
|
|
290
291
|
throw new Error("Pending builder withdrawals are not supported before Gloas");
|
|
291
292
|
}
|
|
292
|
-
if (this.
|
|
293
|
-
this.
|
|
293
|
+
if (this.cachedBuilderPendingWithdrawals === null) {
|
|
294
|
+
this.cachedBuilderPendingWithdrawals = this.cachedState.builderPendingWithdrawals.toValue();
|
|
294
295
|
}
|
|
295
|
-
return this.
|
|
296
|
+
return this.cachedBuilderPendingWithdrawals;
|
|
296
297
|
}
|
|
297
298
|
getBuilder(index) {
|
|
298
299
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.gloas) {
|
|
@@ -411,19 +412,19 @@ export class BeaconStateView {
|
|
|
411
412
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.altair) {
|
|
412
413
|
throw new Error("currentSyncCommittee is not available before Altair");
|
|
413
414
|
}
|
|
414
|
-
if (this.
|
|
415
|
-
this.
|
|
415
|
+
if (this.cachedCurrentSyncCommittee === null) {
|
|
416
|
+
this.cachedCurrentSyncCommittee = this.cachedState.currentSyncCommittee.toValue();
|
|
416
417
|
}
|
|
417
|
-
return this.
|
|
418
|
+
return this.cachedCurrentSyncCommittee;
|
|
418
419
|
}
|
|
419
420
|
get nextSyncCommittee() {
|
|
420
421
|
if (this.config.getForkSeq(this.cachedState.slot) < ForkSeq.altair) {
|
|
421
422
|
throw new Error("nextSyncCommittee is not available before Altair");
|
|
422
423
|
}
|
|
423
|
-
if (this.
|
|
424
|
-
this.
|
|
424
|
+
if (this.cachedNextSyncCommittee === null) {
|
|
425
|
+
this.cachedNextSyncCommittee = this.cachedState.nextSyncCommittee.toValue();
|
|
425
426
|
}
|
|
426
|
-
return this.
|
|
427
|
+
return this.cachedNextSyncCommittee;
|
|
427
428
|
}
|
|
428
429
|
get currentSyncCommitteeIndexed() {
|
|
429
430
|
return this.cachedState.epochCtx.currentSyncCommitteeIndexed;
|
|
@@ -597,9 +598,8 @@ export class BeaconStateView {
|
|
|
597
598
|
const postState = new BeaconStateView(stateTransition(this.cachedState, block, computeNewStateRootStateTransitionOpts, modules));
|
|
598
599
|
return getComputeNewStateRootResult(postState);
|
|
599
600
|
}
|
|
600
|
-
stateTransition(
|
|
601
|
-
|
|
602
|
-
return new BeaconStateView(newState);
|
|
601
|
+
stateTransition({ block }, options, modules) {
|
|
602
|
+
return new BeaconStateView(stateTransition(this.cachedState, block, options, modules));
|
|
603
603
|
}
|
|
604
604
|
processSlots(slot, opts, modules) {
|
|
605
605
|
const newState = processSlots(this.cachedState, slot, opts, modules);
|