@lodestar/state-transition 1.51.0-dev.4157a0dec4 → 1.51.0-dev.4671dbfa39
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 +1 -1
- package/lib/block/index.d.ts.map +1 -1
- package/lib/block/index.js +2 -2
- package/lib/block/index.js.map +1 -1
- package/lib/block/processOperations.d.ts +1 -1
- package/lib/block/processOperations.d.ts.map +1 -1
- package/lib/block/processOperations.js +1 -1
- package/lib/block/processOperations.js.map +1 -1
- package/lib/epoch/index.d.ts +2 -2
- package/lib/epoch/index.d.ts.map +1 -1
- package/lib/epoch/index.js +2 -2
- package/lib/epoch/index.js.map +1 -1
- package/lib/metrics.d.ts +1 -1
- package/lib/metrics.d.ts.map +1 -1
- package/lib/metrics.js +4 -4
- package/lib/metrics.js.map +1 -1
- package/lib/signatureSets/inclusionList.d.ts +5 -0
- package/lib/signatureSets/inclusionList.d.ts.map +1 -0
- package/lib/signatureSets/inclusionList.js +14 -0
- package/lib/signatureSets/inclusionList.js.map +1 -0
- package/lib/signatureSets/index.d.ts +1 -0
- package/lib/signatureSets/index.d.ts.map +1 -1
- package/lib/signatureSets/index.js +1 -0
- package/lib/signatureSets/index.js.map +1 -1
- package/lib/stateTransition.js +2 -2
- package/lib/stateTransition.js.map +1 -1
- package/lib/stateView/beaconStateView.d.ts +1 -0
- package/lib/stateView/beaconStateView.d.ts.map +1 -1
- package/lib/stateView/beaconStateView.js +5 -1
- package/lib/stateView/beaconStateView.js.map +1 -1
- package/lib/stateView/interface.d.ts +2 -4
- package/lib/stateView/interface.d.ts.map +1 -1
- package/lib/stateView/interface.js.map +1 -1
- package/lib/stateView/nativeBeaconStateView.d.ts +14 -6
- package/lib/stateView/nativeBeaconStateView.d.ts.map +1 -1
- package/lib/stateView/nativeBeaconStateView.js +85 -25
- package/lib/stateView/nativeBeaconStateView.js.map +1 -1
- package/lib/stateView/stateViewFactory.js +3 -2
- package/lib/stateView/stateViewFactory.js.map +1 -1
- package/lib/util/blindedBlock.d.ts.map +1 -1
- package/lib/util/blindedBlock.js +4 -12
- package/lib/util/blindedBlock.js.map +1 -1
- package/lib/util/inclusionListCommittee.d.ts +9 -0
- package/lib/util/inclusionListCommittee.d.ts.map +1 -0
- package/lib/util/inclusionListCommittee.js +18 -0
- package/lib/util/inclusionListCommittee.js.map +1 -0
- 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/shuffling.d.ts +3 -0
- package/lib/util/shuffling.d.ts.map +1 -1
- package/lib/util/shuffling.js +41 -1
- package/lib/util/shuffling.js.map +1 -1
- package/package.json +8 -8
- package/src/block/index.ts +11 -12
- package/src/block/processOperations.ts +5 -5
- package/src/epoch/index.ts +14 -15
- package/src/metrics.ts +5 -4
- package/src/signatureSets/inclusionList.ts +20 -0
- package/src/signatureSets/index.ts +1 -0
- package/src/stateTransition.ts +2 -2
- package/src/stateView/beaconStateView.ts +5 -1
- package/src/stateView/interface.ts +1 -10
- package/src/stateView/nativeBeaconStateView.ts +86 -29
- package/src/stateView/stateViewFactory.ts +3 -2
- package/src/util/blindedBlock.ts +4 -12
- package/src/util/inclusionListCommittee.ts +17 -0
- package/src/util/index.ts +1 -0
- package/src/util/shuffling.ts +46 -1
package/lib/util/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./execution.js";
|
|
|
17
17
|
export * from "./finality.js";
|
|
18
18
|
export * from "./genesis.js";
|
|
19
19
|
export * from "./gloas.js";
|
|
20
|
+
export * from "./inclusionListCommittee.js";
|
|
20
21
|
export * from "./interop.js";
|
|
21
22
|
export * from "./loadState/index.js";
|
|
22
23
|
export * from "./pendingDepositsLookup.js";
|
package/lib/util/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAA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Ac,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EACvB,+BAA+B,EAC/B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/lib/util/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from "./execution.js";
|
|
|
17
17
|
export * from "./finality.js";
|
|
18
18
|
export * from "./genesis.js";
|
|
19
19
|
export * from "./gloas.js";
|
|
20
|
+
export * from "./inclusionListCommittee.js";
|
|
20
21
|
export * from "./interop.js";
|
|
21
22
|
export * from "./loadState/index.js";
|
|
22
23
|
export * from "./pendingDepositsLookup.js";
|
package/lib/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;A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C7C,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,OAAO,EAEL,+BAA+B,EAC/B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,eAAe,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/lib/util/shuffling.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { LodestarError } from "@lodestar/utils";
|
|
|
4
4
|
import { CachedBeaconStateAllForks } from "../cache/stateCache.js";
|
|
5
5
|
import { IBeaconStateView } from "../stateView/interface.js";
|
|
6
6
|
import { EpochShuffling } from "./epochShuffling.js";
|
|
7
|
+
import { InclusionListCommittee } from "./inclusionListCommittee.js";
|
|
7
8
|
/**
|
|
8
9
|
* Block root that decided the proposer shuffling for `proposalEpoch` (keys that shuffling).
|
|
9
10
|
* Computed for the requested epoch, not `state.epoch`, so it is correct when `state` is one
|
|
@@ -42,6 +43,8 @@ export declare function getAttestingIndices(epochShuffling: EpochShuffling, fork
|
|
|
42
43
|
* Return the beacon committee at slot for index.
|
|
43
44
|
*/
|
|
44
45
|
export declare function getBeaconCommittee(epochShuffling: EpochShuffling, slot: Slot, index: CommitteeIndex): Uint32Array;
|
|
46
|
+
/** Spec get_inclusion_list_committee: cycle over the slot's concatenated beacon committees */
|
|
47
|
+
export declare function getInclusionListCommittee(epochShuffling: EpochShuffling, slot: Slot): InclusionListCommittee;
|
|
45
48
|
/**
|
|
46
49
|
* Return a Uint32Array[] representing committees validator indices
|
|
47
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shuffling.d.ts","sourceRoot":"","sources":["../../src/util/shuffling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"shuffling.d.ts","sourceRoot":"","sources":["../../src/util/shuffling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAiE,MAAM,kBAAkB,CAAC;AACnH,OAAO,EACL,WAAW,EACX,cAAc,EACd,KAAK,EACL,kBAAkB,EAClB,IAAI,EACJ,IAAI,EACJ,cAAc,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAC;AAG3D,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAEnE;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,gBAAgB,EACvB,aAAa,EAAE,KAAK,GACnB,IAAI,GAAG,IAAI,CAOb;AAUD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,yBAAyB,EAAE,cAAc,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,CAMlH;AAsCD,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,cAAc,C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,8 @@
|
|
|
1
|
-
import { ForkSeq, SLOTS_PER_EPOCH, isForkPostFulu } from "@lodestar/params";
|
|
1
|
+
import { ForkSeq, INCLUSION_LIST_COMMITTEE_SIZE, SLOTS_PER_EPOCH, isForkPostFulu } from "@lodestar/params";
|
|
2
2
|
import { LodestarError } from "@lodestar/utils";
|
|
3
3
|
import { getBlockRootAtSlot } from "./blockRoot.js";
|
|
4
4
|
import { computeStartSlotAtEpoch } from "./epoch.js";
|
|
5
|
+
import { InclusionListCommittee } from "./inclusionListCommittee.js";
|
|
5
6
|
/**
|
|
6
7
|
* Block root that decided the proposer shuffling for `proposalEpoch` (keys that shuffling).
|
|
7
8
|
* Computed for the requested epoch, not `state.epoch`, so it is correct when `state` is one
|
|
@@ -144,6 +145,45 @@ export function getAttestingIndices(epochShuffling, fork, attestation) {
|
|
|
144
145
|
export function getBeaconCommittee(epochShuffling, slot, index) {
|
|
145
146
|
return getBeaconCommittees(epochShuffling, slot, [index])[0];
|
|
146
147
|
}
|
|
148
|
+
/** Inclusion list committees of a shuffling by slot index, computed on first use and freed with the shuffling */
|
|
149
|
+
// TODO HEZE: replace this module-level map with an extended EpochShuffling tracked by the beacon-node ShufflingCache
|
|
150
|
+
const inclusionListCommitteesByShuffling = new WeakMap();
|
|
151
|
+
/** Spec get_inclusion_list_committee: cycle over the slot's concatenated beacon committees */
|
|
152
|
+
export function getInclusionListCommittee(epochShuffling, slot) {
|
|
153
|
+
let committees = inclusionListCommitteesByShuffling.get(epochShuffling);
|
|
154
|
+
if (committees === undefined) {
|
|
155
|
+
committees = [];
|
|
156
|
+
inclusionListCommitteesByShuffling.set(epochShuffling, committees);
|
|
157
|
+
}
|
|
158
|
+
const slotIndex = slot % SLOTS_PER_EPOCH;
|
|
159
|
+
let committee = committees[slotIndex];
|
|
160
|
+
if (committee === undefined) {
|
|
161
|
+
committee = new InclusionListCommittee(computeInclusionListCommittee(epochShuffling.committees[slotIndex]));
|
|
162
|
+
committees[slotIndex] = committee;
|
|
163
|
+
}
|
|
164
|
+
return committee;
|
|
165
|
+
}
|
|
166
|
+
function computeInclusionListCommittee(slotCommittees) {
|
|
167
|
+
let totalLen = 0;
|
|
168
|
+
for (const committee of slotCommittees) {
|
|
169
|
+
totalLen += committee.length;
|
|
170
|
+
}
|
|
171
|
+
const result = new Uint32Array(INCLUSION_LIST_COMMITTEE_SIZE);
|
|
172
|
+
if (totalLen === 0) {
|
|
173
|
+
return result;
|
|
174
|
+
}
|
|
175
|
+
for (let i = 0; i < INCLUSION_LIST_COMMITTEE_SIZE; i++) {
|
|
176
|
+
let offset = i % totalLen;
|
|
177
|
+
for (const committee of slotCommittees) {
|
|
178
|
+
if (offset < committee.length) {
|
|
179
|
+
result[i] = committee[offset];
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
offset -= committee.length;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return result;
|
|
186
|
+
}
|
|
147
187
|
/**
|
|
148
188
|
* Return a Uint32Array[] representing committees validator indices
|
|
149
189
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shuffling.js","sourceRoot":"","sources":["../../src/util/shuffling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,eAAe,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"shuffling.js","sourceRoot":"","sources":["../../src/util/shuffling.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAE,6BAA6B,EAAE,eAAe,EAAE,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAWnH,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAC,uBAAuB,EAAC,MAAM,YAAY,CAAC;AAEnD,OAAO,EAAC,sBAAsB,EAAC,MAAM,6BAA6B,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,UAAU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ACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,cAA8B,EAC9B,IAAU,EACV,OAAyB;IAEzB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;IAED,MAAM,cAAc,GAAG,cAAc,CAAC,UAAU,CAAC,IAAI,GAAG,eAAe,CAAC,CAAC;IACzE,MAAM,UAAU,GAAG,EAAE,CAAC;IAEtB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,IAAI,cAAc,CAAC,MAAM,EAAE,CAAC;YACnC,MAAM,IAAI,cAAc,CAAC;gBACvB,IAAI,EAAE,kBAAkB,CAAC,4BAA4B;gBACrD,KAAK;gBACL,QAAQ,EAAE,cAAc,CAAC,MAAM;aAChC,CAAC,CAAC;QACL,CAAC;QACD,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAN,IAAY,kBAEX;AAFD,WAAY,kBAAkB;IAC5B,mGAA6E,CAAA;AAC/E,CAAC,EAFW,kBAAkB,KAAlB,kBAAkB,QAE7B;AAQD,MAAM,OAAO,cAAe,SAAQ,aAAiC;CAAG"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.51.0-dev.
|
|
14
|
+
"version": "1.51.0-dev.4671dbfa39",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
"@chainsafe/as-sha256": "^1.2.5",
|
|
69
69
|
"@chainsafe/lodestar-z": "catalog:",
|
|
70
70
|
"@chainsafe/persistent-merkle-tree": "^1.3.1",
|
|
71
|
-
"@chainsafe/ssz": "^1.
|
|
72
|
-
"@lodestar/config": "^1.51.0-dev.
|
|
73
|
-
"@lodestar/params": "^1.51.0-dev.
|
|
74
|
-
"@lodestar/types": "^1.51.0-dev.
|
|
75
|
-
"@lodestar/utils": "^1.51.0-dev.
|
|
71
|
+
"@chainsafe/ssz": "^1.9.0",
|
|
72
|
+
"@lodestar/config": "^1.51.0-dev.4671dbfa39",
|
|
73
|
+
"@lodestar/params": "^1.51.0-dev.4671dbfa39",
|
|
74
|
+
"@lodestar/types": "^1.51.0-dev.4671dbfa39",
|
|
75
|
+
"@lodestar/utils": "^1.51.0-dev.4671dbfa39",
|
|
76
76
|
"@vekexasia/bigint-buffer2": "^1.1.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@lodestar/test-utils": "^1.51.0-dev.
|
|
79
|
+
"@lodestar/test-utils": "^1.51.0-dev.4671dbfa39"
|
|
80
80
|
},
|
|
81
81
|
"keywords": [
|
|
82
82
|
"ethereum",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"beacon",
|
|
85
85
|
"blockchain"
|
|
86
86
|
],
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "694b0d36e0292b84da764fb2124d7d80effc3c46"
|
|
88
88
|
}
|
package/src/block/index.ts
CHANGED
|
@@ -23,27 +23,26 @@ import {processSyncAggregate} from "./processSyncCommittee.js";
|
|
|
23
23
|
import {processWithdrawals} from "./processWithdrawals.js";
|
|
24
24
|
import {BlockProcessStep, ProcessBlockOpts, ProposerRewardType} from "./types.js";
|
|
25
25
|
|
|
26
|
+
export * from "./externalData.js";
|
|
27
|
+
export * from "./initiateValidatorExit.js";
|
|
28
|
+
export * from "./isValidIndexedAttestation.js";
|
|
29
|
+
export * from "./processBuilderDepositRequest.js";
|
|
30
|
+
export * from "./processBuilderExitRequest.js";
|
|
31
|
+
export * from "./processDepositRequest.js";
|
|
32
|
+
export * from "./processOperations.js";
|
|
26
33
|
// Spec tests
|
|
27
34
|
export {
|
|
28
35
|
processBlockHeader,
|
|
36
|
+
processEth1Data,
|
|
29
37
|
processExecutionPayload,
|
|
38
|
+
processExecutionPayloadBid,
|
|
39
|
+
processParentExecutionPayload,
|
|
40
|
+
processPayloadAttestation,
|
|
30
41
|
processRandao,
|
|
31
|
-
processEth1Data,
|
|
32
42
|
processSyncAggregate,
|
|
33
43
|
processWithdrawals,
|
|
34
|
-
processExecutionPayloadBid,
|
|
35
|
-
processPayloadAttestation,
|
|
36
|
-
processParentExecutionPayload,
|
|
37
44
|
};
|
|
38
45
|
|
|
39
|
-
export * from "./externalData.js";
|
|
40
|
-
export * from "./initiateValidatorExit.js";
|
|
41
|
-
export * from "./isValidIndexedAttestation.js";
|
|
42
|
-
export * from "./processBuilderDepositRequest.js";
|
|
43
|
-
export * from "./processBuilderExitRequest.js";
|
|
44
|
-
export * from "./processDepositRequest.js";
|
|
45
|
-
export * from "./processOperations.js";
|
|
46
|
-
|
|
47
46
|
export function processBlock(
|
|
48
47
|
fork: ForkSeq,
|
|
49
48
|
state: CachedBeaconStateAllForks,
|
|
@@ -22,15 +22,15 @@ import {processWithdrawalRequest} from "./processWithdrawalRequest.js";
|
|
|
22
22
|
import {ProcessBlockOpts, ProcessOperationsStep} from "./types.js";
|
|
23
23
|
|
|
24
24
|
export {
|
|
25
|
-
processProposerSlashing,
|
|
26
|
-
processAttesterSlashing,
|
|
27
25
|
processAttestations,
|
|
26
|
+
processAttesterSlashing,
|
|
27
|
+
processBlsToExecutionChange,
|
|
28
|
+
processConsolidationRequest,
|
|
28
29
|
processDeposit,
|
|
30
|
+
processDepositRequest,
|
|
31
|
+
processProposerSlashing,
|
|
29
32
|
processVoluntaryExit,
|
|
30
33
|
processWithdrawalRequest,
|
|
31
|
-
processBlsToExecutionChange,
|
|
32
|
-
processDepositRequest,
|
|
33
|
-
processConsolidationRequest,
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export function processOperations(
|
package/src/epoch/index.ts
CHANGED
|
@@ -37,32 +37,31 @@ import {processSlashings} from "./processSlashings.js";
|
|
|
37
37
|
import {processSlashingsReset} from "./processSlashingsReset.js";
|
|
38
38
|
import {processSyncCommitteeUpdates} from "./processSyncCommitteeUpdates.js";
|
|
39
39
|
|
|
40
|
+
export {computeUnrealizedCheckpoints} from "./computeUnrealizedCheckpoints.js";
|
|
40
41
|
// For spec tests
|
|
41
42
|
export {getRewardsAndPenalties} from "./processRewardsAndPenalties.js";
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
-
processInactivityUpdates,
|
|
45
|
-
processRewardsAndPenalties,
|
|
46
|
-
processRegistryUpdates,
|
|
47
|
-
processSlashings,
|
|
48
|
-
processEth1DataReset,
|
|
44
|
+
processBuilderPendingPayments,
|
|
49
45
|
processEffectiveBalanceUpdates,
|
|
50
|
-
|
|
51
|
-
processRandaoMixesReset,
|
|
46
|
+
processEth1DataReset,
|
|
52
47
|
processHistoricalRootsUpdate,
|
|
53
|
-
processParticipationRecordUpdates,
|
|
54
|
-
processParticipationFlagUpdates,
|
|
55
|
-
processSyncCommitteeUpdates,
|
|
56
48
|
processHistoricalSummariesUpdate,
|
|
57
|
-
|
|
49
|
+
processInactivityUpdates,
|
|
50
|
+
processJustificationAndFinalization,
|
|
51
|
+
processParticipationFlagUpdates,
|
|
52
|
+
processParticipationRecordUpdates,
|
|
58
53
|
processPendingConsolidations,
|
|
54
|
+
processPendingDeposits,
|
|
59
55
|
processProposerLookahead,
|
|
60
56
|
processPtcWindow,
|
|
61
|
-
|
|
57
|
+
processRandaoMixesReset,
|
|
58
|
+
processRegistryUpdates,
|
|
59
|
+
processRewardsAndPenalties,
|
|
60
|
+
processSlashings,
|
|
61
|
+
processSlashingsReset,
|
|
62
|
+
processSyncCommitteeUpdates,
|
|
62
63
|
};
|
|
63
64
|
|
|
64
|
-
export {computeUnrealizedCheckpoints} from "./computeUnrealizedCheckpoints.js";
|
|
65
|
-
|
|
66
65
|
const maxValidatorsPerStateSlashing = SLOTS_PER_EPOCH * MAX_ATTESTER_SLASHINGS * MAX_VALIDATORS_PER_COMMITTEE;
|
|
67
66
|
const maxSafeValidators = Math.floor(Number.MAX_SAFE_INTEGER / MAX_EFFECTIVE_BALANCE);
|
|
68
67
|
|
package/src/metrics.ts
CHANGED
|
@@ -156,19 +156,20 @@ export function getMetrics(register: MetricsRegister) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
export function onStateCloneMetrics(
|
|
159
|
-
|
|
159
|
+
clonedState: CachedBeaconStateAllForks,
|
|
160
|
+
clonedCount: number,
|
|
160
161
|
metrics: BeaconStateTransitionMetrics,
|
|
161
162
|
source: StateCloneSource
|
|
162
163
|
): void {
|
|
163
|
-
metrics.preStateClonedCount.observe(
|
|
164
|
+
metrics.preStateClonedCount.observe(clonedCount);
|
|
164
165
|
|
|
165
|
-
if (isBalancesNodesPopulated(
|
|
166
|
+
if (isBalancesNodesPopulated(clonedState)) {
|
|
166
167
|
metrics.preStateBalancesNodesPopulatedHit.inc({source});
|
|
167
168
|
} else {
|
|
168
169
|
metrics.preStateBalancesNodesPopulatedMiss.inc({source});
|
|
169
170
|
}
|
|
170
171
|
|
|
171
|
-
if (isValidatorsNodesPopulated(
|
|
172
|
+
if (isValidatorsNodesPopulated(clonedState)) {
|
|
172
173
|
metrics.preStateValidatorsNodesPopulatedHit.inc({source});
|
|
173
174
|
} else {
|
|
174
175
|
metrics.preStateValidatorsNodesPopulatedMiss.inc({source});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
+
import {DOMAIN_INCLUSION_LIST_COMMITTEE} from "@lodestar/params";
|
|
3
|
+
import {Slot, heze, ssz} from "@lodestar/types";
|
|
4
|
+
import {ISignatureSet, SignatureSetType, computeSigningRoot} from "../util/index.js";
|
|
5
|
+
|
|
6
|
+
export function getInclusionListSignatureSet(
|
|
7
|
+
config: BeaconConfig,
|
|
8
|
+
stateSlot: Slot,
|
|
9
|
+
signedInclusionList: heze.SignedInclusionList
|
|
10
|
+
): ISignatureSet {
|
|
11
|
+
const message = signedInclusionList.message;
|
|
12
|
+
const domain = config.getDomain(stateSlot, DOMAIN_INCLUSION_LIST_COMMITTEE, message.slot);
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
type: SignatureSetType.indexed,
|
|
16
|
+
index: message.validatorIndex,
|
|
17
|
+
signingRoot: computeSigningRoot(ssz.heze.InclusionList, message, domain),
|
|
18
|
+
signature: signedInclusionList.signature,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -18,6 +18,7 @@ export * from "./attesterSlashings.js";
|
|
|
18
18
|
export * from "./blsToExecutionChange.js";
|
|
19
19
|
export * from "./executionPayloadBid.js";
|
|
20
20
|
export * from "./executionPayloadEnvelope.js";
|
|
21
|
+
export * from "./inclusionList.js";
|
|
21
22
|
export * from "./indexedAttestation.js";
|
|
22
23
|
export * from "./indexedPayloadAttestation.js";
|
|
23
24
|
export * from "./proposer.js";
|
package/src/stateTransition.ts
CHANGED
|
@@ -101,7 +101,7 @@ export function stateTransition(
|
|
|
101
101
|
let postState = state.clone(options.dontTransferCache);
|
|
102
102
|
|
|
103
103
|
if (metrics) {
|
|
104
|
-
onStateCloneMetrics(postState, metrics, StateCloneSource.stateTransition);
|
|
104
|
+
onStateCloneMetrics(postState, state.clonedCount, metrics, StateCloneSource.stateTransition);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// State is already a ViewDU, which won't commit changes. Equivalent to .setStateCachesAsTransient()
|
|
@@ -168,7 +168,7 @@ export function processSlots(
|
|
|
168
168
|
let postState = state.clone(opts?.dontTransferCache);
|
|
169
169
|
|
|
170
170
|
if (metrics) {
|
|
171
|
-
onStateCloneMetrics(postState, metrics, StateCloneSource.processSlots);
|
|
171
|
+
onStateCloneMetrics(postState, state.clonedCount, metrics, StateCloneSource.processSlots);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
// State is already a ViewDU, which won't commit changes. Equivalent to .setStateCachesAsTransient()
|
|
@@ -84,6 +84,7 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
84
84
|
// phase0
|
|
85
85
|
private cachedFork: Fork | null = null;
|
|
86
86
|
private cachedLatestBlockHeader: phase0.BeaconBlockHeader | null = null;
|
|
87
|
+
private cachedEffectiveBalanceIncrementsZeroInactive: EffectiveBalanceIncrements | null = null;
|
|
87
88
|
// altair
|
|
88
89
|
private cachedCurrentSyncCommittee: SyncCommittee | null = null;
|
|
89
90
|
private cachedNextSyncCommittee: SyncCommittee | null = null;
|
|
@@ -638,7 +639,10 @@ export class BeaconStateView implements IBeaconStateViewLatestFork {
|
|
|
638
639
|
}
|
|
639
640
|
|
|
640
641
|
getEffectiveBalanceIncrementsZeroInactive(): EffectiveBalanceIncrements {
|
|
641
|
-
|
|
642
|
+
if (this.cachedEffectiveBalanceIncrementsZeroInactive === null) {
|
|
643
|
+
this.cachedEffectiveBalanceIncrementsZeroInactive = getEffectiveBalanceIncrementsZeroInactive(this.cachedState);
|
|
644
|
+
}
|
|
645
|
+
return this.cachedEffectiveBalanceIncrementsZeroInactive;
|
|
642
646
|
}
|
|
643
647
|
|
|
644
648
|
getBalance(index: number): number {
|
|
@@ -336,8 +336,6 @@ export type IBeaconStateViewLatestFork = Omit<
|
|
|
336
336
|
*/
|
|
337
337
|
export type IBeaconStateViewNative = Omit<
|
|
338
338
|
IBeaconStateViewLatestFork,
|
|
339
|
-
| "builderPendingPayments"
|
|
340
|
-
| "builderPendingWithdrawals"
|
|
341
339
|
| "computeAttestationsRewards"
|
|
342
340
|
| "computeBlockRewards"
|
|
343
341
|
| "computeNewStateRoot"
|
|
@@ -346,8 +344,6 @@ export type IBeaconStateViewNative = Omit<
|
|
|
346
344
|
| "eth1Data"
|
|
347
345
|
| "executionPayloadAvailability"
|
|
348
346
|
| "getBeaconCommittee"
|
|
349
|
-
| "getIndicesInPayloadTimelinessCommittee"
|
|
350
|
-
| "getPayloadTimelinessCommittee"
|
|
351
347
|
| "loadOtherState"
|
|
352
348
|
| "pendingConsolidations"
|
|
353
349
|
| "pendingDeposits"
|
|
@@ -365,7 +361,6 @@ export type IBeaconStateViewNative = Omit<
|
|
|
365
361
|
pendingPartialWithdrawals: Uint8Array;
|
|
366
362
|
pendingConsolidations: Uint8Array;
|
|
367
363
|
proposerLookahead: Uint32Array;
|
|
368
|
-
// UintBn64 lowers to number across the FFI boundary; the wrapper lifts it back to bigint
|
|
369
364
|
eth1Data: phase0.Eth1Data;
|
|
370
365
|
executionPayloadAvailability: {uint8Array: Uint8Array; bitLen: number};
|
|
371
366
|
computeBlockRewards(
|
|
@@ -379,8 +374,6 @@ export type IBeaconStateViewNative = Omit<
|
|
|
379
374
|
validatorIds: (ValidatorIndex | string)[]
|
|
380
375
|
): rewards.SyncCommitteeRewards;
|
|
381
376
|
getBeaconCommittee(slot: Slot, index: CommitteeIndex): Uint32Array;
|
|
382
|
-
getIndexInPayloadTimelinessCommittee?(validatorIndex: ValidatorIndex, slot: Slot): number;
|
|
383
|
-
getIndicesInPayloadTimelinessCommittee?(validatorIndex: ValidatorIndex, slot: Slot): number[];
|
|
384
377
|
loadOtherState(...args: Parameters<IBeaconStateViewLatestFork["loadOtherState"]>): IBeaconStateViewNative;
|
|
385
378
|
stateTransition(
|
|
386
379
|
signedBlockBytes: Uint8Array,
|
|
@@ -388,9 +381,7 @@ export type IBeaconStateViewNative = Omit<
|
|
|
388
381
|
options?: StateTransitionOpts
|
|
389
382
|
): IBeaconStateViewNative;
|
|
390
383
|
processSlots(slot: Slot, opts?: {dontTransferCache?: boolean}): IBeaconStateViewNative;
|
|
391
|
-
withParentPayloadApplied(
|
|
392
|
-
...args: Parameters<IBeaconStateViewLatestFork["withParentPayloadApplied"]>
|
|
393
|
-
): IBeaconStateViewNative;
|
|
384
|
+
withParentPayloadApplied(executionRequestsBytes: Uint8Array): IBeaconStateViewNative;
|
|
394
385
|
};
|
|
395
386
|
|
|
396
387
|
export function isStatePostAltair(state: IBeaconStateView): state is IBeaconStateViewAltair {
|