@lodestar/beacon-node 1.39.0-dev.aceb5b7416 → 1.39.0-dev.b2437a6348

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.
Files changed (240) hide show
  1. package/README.md +1 -1
  2. package/lib/api/impl/beacon/state/utils.d.ts +2 -7
  3. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  4. package/lib/api/impl/beacon/state/utils.js +0 -12
  5. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  6. package/lib/api/impl/lodestar/index.js +1 -1
  7. package/lib/api/impl/lodestar/index.js.map +1 -1
  8. package/lib/api/impl/proof/index.d.ts.map +1 -1
  9. package/lib/api/impl/proof/index.js +1 -2
  10. package/lib/api/impl/proof/index.js.map +1 -1
  11. package/lib/api/impl/validator/index.d.ts.map +1 -1
  12. package/lib/api/impl/validator/index.js +1 -3
  13. package/lib/api/impl/validator/index.js.map +1 -1
  14. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  15. package/lib/chain/blocks/importBlock.js +8 -2
  16. package/lib/chain/blocks/importBlock.js.map +1 -1
  17. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  18. package/lib/chain/blocks/verifyBlock.js +1 -1
  19. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  20. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
  21. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +4 -2
  22. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  23. package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -1
  24. package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
  25. package/lib/chain/blocks/verifyBlocksSignatures.js +3 -2
  26. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  27. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
  28. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +1 -0
  29. package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
  30. package/lib/chain/chain.d.ts +11 -11
  31. package/lib/chain/chain.d.ts.map +1 -1
  32. package/lib/chain/chain.js +36 -40
  33. package/lib/chain/chain.js.map +1 -1
  34. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  35. package/lib/chain/forkChoice/index.js +3 -3
  36. package/lib/chain/forkChoice/index.js.map +1 -1
  37. package/lib/chain/interface.d.ts +6 -9
  38. package/lib/chain/interface.d.ts.map +1 -1
  39. package/lib/chain/interface.js.map +1 -1
  40. package/lib/chain/lightClient/proofs.d.ts.map +1 -1
  41. package/lib/chain/lightClient/proofs.js +0 -2
  42. package/lib/chain/lightClient/proofs.js.map +1 -1
  43. package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -7
  44. package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
  45. package/lib/chain/opPools/aggregatedAttestationPool.js +8 -133
  46. package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
  47. package/lib/chain/opPools/opPool.d.ts +3 -0
  48. package/lib/chain/opPools/opPool.d.ts.map +1 -1
  49. package/lib/chain/opPools/opPool.js +9 -8
  50. package/lib/chain/opPools/opPool.js.map +1 -1
  51. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  52. package/lib/chain/prepareNextSlot.js +4 -7
  53. package/lib/chain/prepareNextSlot.js.map +1 -1
  54. package/lib/chain/produceBlock/produceBlockBody.js +3 -3
  55. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  56. package/lib/chain/regen/interface.d.ts +1 -5
  57. package/lib/chain/regen/interface.d.ts.map +1 -1
  58. package/lib/chain/regen/queued.d.ts +4 -7
  59. package/lib/chain/regen/queued.d.ts.map +1 -1
  60. package/lib/chain/regen/queued.js +15 -25
  61. package/lib/chain/regen/queued.js.map +1 -1
  62. package/lib/chain/regen/regen.d.ts +1 -1
  63. package/lib/chain/regen/regen.d.ts.map +1 -1
  64. package/lib/chain/regen/regen.js +13 -17
  65. package/lib/chain/regen/regen.js.map +1 -1
  66. package/lib/chain/shufflingCache.d.ts +5 -12
  67. package/lib/chain/shufflingCache.d.ts.map +1 -1
  68. package/lib/chain/shufflingCache.js +12 -50
  69. package/lib/chain/shufflingCache.js.map +1 -1
  70. package/lib/chain/stateCache/blockStateCacheImpl.d.ts +1 -2
  71. package/lib/chain/stateCache/blockStateCacheImpl.d.ts.map +1 -1
  72. package/lib/chain/stateCache/blockStateCacheImpl.js +2 -2
  73. package/lib/chain/stateCache/blockStateCacheImpl.js.map +1 -1
  74. package/lib/chain/stateCache/fifoBlockStateCache.d.ts +1 -2
  75. package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
  76. package/lib/chain/stateCache/fifoBlockStateCache.js +4 -4
  77. package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
  78. package/lib/chain/stateCache/inMemoryCheckpointsCache.d.ts +4 -5
  79. package/lib/chain/stateCache/inMemoryCheckpointsCache.d.ts.map +1 -1
  80. package/lib/chain/stateCache/inMemoryCheckpointsCache.js +9 -10
  81. package/lib/chain/stateCache/inMemoryCheckpointsCache.js.map +1 -1
  82. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +9 -7
  83. package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
  84. package/lib/chain/stateCache/persistentCheckpointsCache.js +21 -19
  85. package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
  86. package/lib/chain/stateCache/types.d.ts +5 -6
  87. package/lib/chain/stateCache/types.d.ts.map +1 -1
  88. package/lib/chain/stateCache/types.js.map +1 -1
  89. package/lib/chain/validation/aggregateAndProof.js +9 -0
  90. package/lib/chain/validation/aggregateAndProof.js.map +1 -1
  91. package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
  92. package/lib/chain/validation/attesterSlashing.js +2 -2
  93. package/lib/chain/validation/attesterSlashing.js.map +1 -1
  94. package/lib/chain/validation/blobSidecar.d.ts.map +1 -1
  95. package/lib/chain/validation/blobSidecar.js +2 -3
  96. package/lib/chain/validation/blobSidecar.js.map +1 -1
  97. package/lib/chain/validation/block.d.ts.map +1 -1
  98. package/lib/chain/validation/block.js +3 -3
  99. package/lib/chain/validation/block.js.map +1 -1
  100. package/lib/chain/validation/blsToExecutionChange.d.ts.map +1 -1
  101. package/lib/chain/validation/blsToExecutionChange.js +10 -3
  102. package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
  103. package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
  104. package/lib/chain/validation/dataColumnSidecar.js +2 -3
  105. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  106. package/lib/chain/validation/proposerSlashing.js +3 -2
  107. package/lib/chain/validation/proposerSlashing.js.map +1 -1
  108. package/lib/chain/validation/signatureSets/aggregateAndProof.js +1 -1
  109. package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
  110. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -1
  111. package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
  112. package/lib/chain/validation/signatureSets/contributionAndProof.js +2 -2
  113. package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
  114. package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -1
  115. package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
  116. package/lib/chain/validation/signatureSets/syncCommittee.js +2 -2
  117. package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
  118. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -1
  119. package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
  120. package/lib/chain/validation/signatureSets/syncCommitteeContribution.js +2 -2
  121. package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
  122. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -1
  123. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
  124. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -2
  125. package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
  126. package/lib/chain/validation/syncCommittee.js +1 -1
  127. package/lib/chain/validation/syncCommittee.js.map +1 -1
  128. package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
  129. package/lib/chain/validation/syncCommitteeContributionAndProof.js +3 -3
  130. package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
  131. package/lib/chain/validation/voluntaryExit.js +1 -1
  132. package/lib/chain/validation/voluntaryExit.js.map +1 -1
  133. package/lib/db/beacon.d.ts +2 -0
  134. package/lib/db/beacon.d.ts.map +1 -1
  135. package/lib/db/beacon.js +32 -0
  136. package/lib/db/beacon.js.map +1 -1
  137. package/lib/db/buckets.d.ts +12 -0
  138. package/lib/db/buckets.d.ts.map +1 -1
  139. package/lib/db/buckets.js +12 -6
  140. package/lib/db/buckets.js.map +1 -1
  141. package/lib/db/interface.d.ts +1 -0
  142. package/lib/db/interface.d.ts.map +1 -1
  143. package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
  144. package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
  145. package/lib/db/repositories/stateArchive.d.ts +1 -1
  146. package/lib/db/repositories/stateArchive.d.ts.map +1 -1
  147. package/lib/db/repositories/stateArchive.js +2 -2
  148. package/lib/db/repositories/stateArchive.js.map +1 -1
  149. package/lib/execution/engine/mock.d.ts +9 -6
  150. package/lib/execution/engine/mock.d.ts.map +1 -1
  151. package/lib/execution/engine/mock.js +34 -7
  152. package/lib/execution/engine/mock.js.map +1 -1
  153. package/lib/metrics/metrics/lodestar.d.ts +1 -6
  154. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  155. package/lib/metrics/metrics/lodestar.js +3 -17
  156. package/lib/metrics/metrics/lodestar.js.map +1 -1
  157. package/lib/network/peers/discover.d.ts.map +1 -1
  158. package/lib/network/peers/discover.js.map +1 -1
  159. package/lib/node/nodejs.d.ts +6 -3
  160. package/lib/node/nodejs.d.ts.map +1 -1
  161. package/lib/node/nodejs.js +30 -3
  162. package/lib/node/nodejs.js.map +1 -1
  163. package/lib/node/notifier.d.ts.map +1 -1
  164. package/lib/node/notifier.js +9 -6
  165. package/lib/node/notifier.js.map +1 -1
  166. package/lib/sync/backfill/backfill.d.ts.map +1 -1
  167. package/lib/sync/backfill/backfill.js +2 -4
  168. package/lib/sync/backfill/backfill.js.map +1 -1
  169. package/lib/sync/backfill/verify.d.ts +2 -2
  170. package/lib/sync/backfill/verify.d.ts.map +1 -1
  171. package/lib/sync/backfill/verify.js +3 -3
  172. package/lib/sync/backfill/verify.js.map +1 -1
  173. package/package.json +28 -20
  174. package/src/api/impl/beacon/state/utils.ts +2 -22
  175. package/src/api/impl/lodestar/index.ts +1 -1
  176. package/src/api/impl/proof/index.ts +1 -2
  177. package/src/api/impl/validator/index.ts +1 -3
  178. package/src/chain/blocks/importBlock.ts +9 -2
  179. package/src/chain/blocks/verifyBlock.ts +1 -0
  180. package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -2
  181. package/src/chain/blocks/verifyBlocksSignatures.ts +13 -3
  182. package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +1 -0
  183. package/src/chain/chain.ts +50 -48
  184. package/src/chain/forkChoice/index.ts +3 -2
  185. package/src/chain/interface.ts +6 -8
  186. package/src/chain/lightClient/proofs.ts +0 -2
  187. package/src/chain/opPools/aggregatedAttestationPool.ts +12 -187
  188. package/src/chain/opPools/opPool.ts +8 -8
  189. package/src/chain/prepareNextSlot.ts +2 -6
  190. package/src/chain/produceBlock/produceBlockBody.ts +3 -3
  191. package/src/chain/regen/interface.ts +1 -5
  192. package/src/chain/regen/queued.ts +15 -34
  193. package/src/chain/regen/regen.ts +12 -18
  194. package/src/chain/shufflingCache.ts +15 -61
  195. package/src/chain/stateCache/blockStateCacheImpl.ts +2 -3
  196. package/src/chain/stateCache/fifoBlockStateCache.ts +4 -5
  197. package/src/chain/stateCache/inMemoryCheckpointsCache.ts +9 -15
  198. package/src/chain/stateCache/persistentCheckpointsCache.ts +32 -27
  199. package/src/chain/stateCache/types.ts +5 -10
  200. package/src/chain/validation/aggregateAndProof.ts +12 -0
  201. package/src/chain/validation/attesterSlashing.ts +14 -2
  202. package/src/chain/validation/blobSidecar.ts +3 -3
  203. package/src/chain/validation/block.ts +3 -2
  204. package/src/chain/validation/blsToExecutionChange.ts +10 -8
  205. package/src/chain/validation/dataColumnSidecar.ts +3 -3
  206. package/src/chain/validation/proposerSlashing.ts +8 -2
  207. package/src/chain/validation/signatureSets/aggregateAndProof.ts +1 -1
  208. package/src/chain/validation/signatureSets/contributionAndProof.ts +3 -1
  209. package/src/chain/validation/signatureSets/syncCommittee.ts +3 -1
  210. package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +3 -1
  211. package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -1
  212. package/src/chain/validation/syncCommittee.ts +1 -1
  213. package/src/chain/validation/syncCommitteeContributionAndProof.ts +8 -3
  214. package/src/chain/validation/voluntaryExit.ts +1 -1
  215. package/src/db/beacon.ts +38 -1
  216. package/src/db/buckets.ts +12 -6
  217. package/src/db/interface.ts +2 -0
  218. package/src/db/repositories/stateArchive.ts +2 -2
  219. package/src/execution/engine/mock.ts +40 -13
  220. package/src/metrics/metrics/lodestar.ts +3 -17
  221. package/src/network/peers/discover.ts +3 -3
  222. package/src/node/nodejs.ts +37 -4
  223. package/src/node/notifier.ts +13 -7
  224. package/src/sync/backfill/backfill.ts +2 -9
  225. package/src/sync/backfill/verify.ts +3 -8
  226. package/lib/chain/rewards/attestationsRewards.d.ts +0 -7
  227. package/lib/chain/rewards/attestationsRewards.d.ts.map +0 -1
  228. package/lib/chain/rewards/attestationsRewards.js +0 -112
  229. package/lib/chain/rewards/attestationsRewards.js.map +0 -1
  230. package/lib/chain/rewards/blockRewards.d.ts +0 -14
  231. package/lib/chain/rewards/blockRewards.d.ts.map +0 -1
  232. package/lib/chain/rewards/blockRewards.js +0 -94
  233. package/lib/chain/rewards/blockRewards.js.map +0 -1
  234. package/lib/chain/rewards/syncCommitteeRewards.d.ts +0 -6
  235. package/lib/chain/rewards/syncCommitteeRewards.d.ts.map +0 -1
  236. package/lib/chain/rewards/syncCommitteeRewards.js +0 -36
  237. package/lib/chain/rewards/syncCommitteeRewards.js.map +0 -1
  238. package/src/chain/rewards/attestationsRewards.ts +0 -197
  239. package/src/chain/rewards/blockRewards.ts +0 -150
  240. package/src/chain/rewards/syncCommitteeRewards.ts +0 -58
@@ -1,3 +1,4 @@
1
+ import {BeaconConfig} from "@lodestar/config";
1
2
  import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params";
2
3
  import {
3
4
  CachedBeaconStateAllForks,
@@ -9,11 +10,12 @@ import {
9
10
  import {altair, ssz} from "@lodestar/types";
10
11
 
11
12
  export function getSyncCommitteeSignatureSet(
13
+ config: BeaconConfig,
12
14
  index2pubkey: Index2PubkeyCache,
13
15
  state: CachedBeaconStateAllForks,
14
16
  syncCommittee: altair.SyncCommitteeMessage
15
17
  ): ISignatureSet {
16
- const domain = state.config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE, syncCommittee.slot);
18
+ const domain = config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE, syncCommittee.slot);
17
19
 
18
20
  return {
19
21
  type: SignatureSetType.single,
@@ -1,14 +1,16 @@
1
1
  import {PublicKey} from "@chainsafe/blst";
2
+ import {BeaconConfig} from "@lodestar/config";
2
3
  import {DOMAIN_SYNC_COMMITTEE} from "@lodestar/params";
3
4
  import {CachedBeaconStateAltair, ISignatureSet, SignatureSetType, computeSigningRoot} from "@lodestar/state-transition";
4
5
  import {altair, ssz} from "@lodestar/types";
5
6
 
6
7
  export function getSyncCommitteeContributionSignatureSet(
8
+ config: BeaconConfig,
7
9
  state: CachedBeaconStateAltair,
8
10
  contribution: altair.SyncCommitteeContribution,
9
11
  pubkeys: PublicKey[]
10
12
  ): ISignatureSet {
11
- const domain = state.config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE, contribution.slot);
13
+ const domain = config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE, contribution.slot);
12
14
  return {
13
15
  type: SignatureSetType.aggregate,
14
16
  pubkeys,
@@ -1,3 +1,4 @@
1
+ import {BeaconConfig} from "@lodestar/config";
1
2
  import {DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF} from "@lodestar/params";
2
3
  import {
3
4
  CachedBeaconStateAllForks,
@@ -9,11 +10,11 @@ import {
9
10
  import {altair, ssz} from "@lodestar/types";
10
11
 
11
12
  export function getSyncCommitteeSelectionProofSignatureSet(
13
+ config: BeaconConfig,
12
14
  index2pubkey: Index2PubkeyCache,
13
15
  state: CachedBeaconStateAllForks,
14
16
  contributionAndProof: altair.ContributionAndProof
15
17
  ): ISignatureSet {
16
- const {config} = state;
17
18
  const slot = contributionAndProof.contribution.slot;
18
19
  const domain = config.getDomain(state.slot, DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF, slot);
19
20
  const signingData: altair.SyncAggregatorSelectionData = {
@@ -89,7 +89,7 @@ async function validateSyncCommitteeSigOnly(
89
89
  syncCommittee: altair.SyncCommitteeMessage,
90
90
  prioritizeBls = false
91
91
  ): Promise<void> {
92
- const signatureSet = getSyncCommitteeSignatureSet(chain.index2pubkey, headState, syncCommittee);
92
+ const signatureSet = getSyncCommitteeSignatureSet(chain.config, chain.index2pubkey, headState, syncCommittee);
93
93
  if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
94
94
  throw new SyncCommitteeError(GossipAction.REJECT, {
95
95
  code: SyncCommitteeErrorCode.INVALID_SIGNATURE,
@@ -78,14 +78,19 @@ export async function validateSyncCommitteeGossipContributionAndProof(
78
78
  const signatureSets = [
79
79
  // [REJECT] The contribution_and_proof.selection_proof is a valid signature of the SyncAggregatorSelectionData
80
80
  // derived from the contribution by the validator with index contribution_and_proof.aggregator_index.
81
- getSyncCommitteeSelectionProofSignatureSet(index2pubkey, headState, contributionAndProof),
81
+ getSyncCommitteeSelectionProofSignatureSet(chain.config, index2pubkey, headState, contributionAndProof),
82
82
 
83
83
  // [REJECT] The aggregator signature, signed_contribution_and_proof.signature, is valid.
84
- getContributionAndProofSignatureSet(index2pubkey, headState, signedContributionAndProof),
84
+ getContributionAndProofSignatureSet(chain.config, index2pubkey, headState, signedContributionAndProof),
85
85
 
86
86
  // [REJECT] The aggregate signature is valid for the message beacon_block_root and aggregate pubkey derived from
87
87
  // the participation info in aggregation_bits for the subcommittee specified by the contribution.subcommittee_index.
88
- getSyncCommitteeContributionSignatureSet(headState as CachedBeaconStateAltair, contribution, participantPubkeys),
88
+ getSyncCommitteeContributionSignatureSet(
89
+ chain.config,
90
+ headState as CachedBeaconStateAltair,
91
+ contribution,
92
+ participantPubkeys
93
+ ),
89
94
  ];
90
95
 
91
96
  if (!(await chain.bls.verifySignatureSets(signatureSets, {batchable: true}))) {
@@ -59,7 +59,7 @@ async function validateVoluntaryExit(
59
59
  });
60
60
  }
61
61
 
62
- const signatureSet = getVoluntaryExitSignatureSet(chain.index2pubkey, state, voluntaryExit);
62
+ const signatureSet = getVoluntaryExitSignatureSet(chain.config, chain.index2pubkey, state.slot, voluntaryExit);
63
63
  if (!(await chain.bls.verifySignatureSets([signatureSet], {batchable: true, priority: prioritizeBls}))) {
64
64
  throw new VoluntaryExitError(GossipAction.REJECT, {
65
65
  code: VoluntaryExitErrorCode.INVALID_SIGNATURE,
package/src/db/beacon.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import {ChainForkConfig} from "@lodestar/config";
2
- import {Db, LevelDbControllerMetrics} from "@lodestar/db";
2
+ import {Db, LevelDbControllerMetrics, encodeKey} from "@lodestar/db";
3
+ import {Bucket} from "./buckets.js";
3
4
  import {IBeaconDb} from "./interface.js";
4
5
  import {CheckpointStateRepository} from "./repositories/checkpointState.js";
5
6
  import {
@@ -95,4 +96,40 @@ export class BeaconDb implements IBeaconDb {
95
96
  // TODO: Enable once it's deemed safe
96
97
  // await this.block.batchDelete(await this.block.keys());
97
98
  }
99
+
100
+ async deleteDeprecatedEth1Data(): Promise<void> {
101
+ const deprecatedBuckets = [
102
+ Bucket.phase0_eth1Data,
103
+ Bucket.index_depositDataRoot,
104
+ Bucket.phase0_depositData,
105
+ Bucket.phase0_depositEvent,
106
+ Bucket.phase0_preGenesisState,
107
+ Bucket.phase0_preGenesisStateLastProcessedBlock,
108
+ ];
109
+
110
+ for (const bucket of deprecatedBuckets) {
111
+ await this.deleteBucketData(bucket);
112
+ }
113
+ }
114
+
115
+ private async deleteBucketData(bucket: Bucket): Promise<void> {
116
+ const minKey = encodeKey(bucket, Buffer.alloc(0));
117
+ const maxKey = encodeKey(bucket + 1, Buffer.alloc(0));
118
+
119
+ // Batch delete to avoid loading all keys into memory at once
120
+ const BATCH_DELETE_SIZE = 1000;
121
+ let keysBatch: Uint8Array[] = [];
122
+
123
+ for await (const key of this.db.keysStream({gte: minKey, lt: maxKey})) {
124
+ keysBatch.push(key);
125
+ if (keysBatch.length >= BATCH_DELETE_SIZE) {
126
+ await this.db.batchDelete(keysBatch);
127
+ keysBatch = [];
128
+ }
129
+ }
130
+
131
+ if (keysBatch.length > 0) {
132
+ await this.db.batchDelete(keysBatch);
133
+ }
134
+ }
98
135
  }
package/src/db/buckets.ts CHANGED
@@ -16,13 +16,16 @@ export enum Bucket {
16
16
  index_mainChain = 6, // Slot -> Root<BeaconBlock>
17
17
  // justified, finalized state and block hashes
18
18
  index_chainInfo = 7, // Key -> Number64 | stateHash | blockHash
19
- // phase0_eth1Data = 8, // DEPRECATED - eth1 deposit tracking is not required since electra
20
- // index_depositDataRoot = 9, // DEPRECATED - eth1 deposit tracking is not required since electra
19
+ /** @deprecated Eth1 deposit tracking is not required since electra, only kept around to delete data from existing databases */
20
+ phase0_eth1Data = 8,
21
+ /** @deprecated Eth1 deposit tracking is not required since electra, only kept around to delete data from existing databases */
22
+ index_depositDataRoot = 9,
21
23
 
22
24
  // op pool
23
25
  // phase0_attestation = 10, // DEPRECATED on v0.25.0
24
26
  // phase0_aggregateAndProof = 11, // Root -> AggregateAndProof, DEPRECATED on v.27.0
25
- // phase0_depositData = 12, // DEPRECATED - eth1 deposit tracking is not required since electra
27
+ /** @deprecated Eth1 deposit tracking is not required since electra, only kept around to delete data from existing databases */
28
+ phase0_depositData = 12,
26
29
  phase0_exit = 13, // ValidatorIndex -> VoluntaryExit
27
30
  phase0_proposerSlashing = 14, // ValidatorIndex -> ProposerSlashing
28
31
  allForks_attesterSlashing = 15, // Root -> AttesterSlashing
@@ -31,15 +34,18 @@ export enum Bucket {
31
34
  allForks_checkpointState = 17, // Root -> BeaconState
32
35
 
33
36
  // allForks_pendingBlock = 25, // Root -> SignedBeaconBlock // DEPRECATED on v0.30.0
34
- // phase0_depositEvent = 19, // DEPRECATED - eth1 deposit tracking is not required since electra
37
+ /** @deprecated Eth1 deposit tracking is not required since electra, only kept around to delete data from existing databases */
38
+ phase0_depositEvent = 19,
35
39
 
36
40
  index_stateArchiveRootIndex = 26, // State Root -> slot
37
41
 
38
42
  deneb_blobSidecars = 27, // DENEB BeaconBlockRoot -> BlobSidecars
39
43
  deneb_blobSidecarsArchive = 28, // DENEB BeaconBlockSlot -> BlobSidecars
40
44
 
41
- // phase0_preGenesisState = 30, // DEPRECATED - genesis from eth1 is no longer supported
42
- // phase0_preGenesisStateLastProcessedBlock = 31, // DEPRECATED - genesis from eth1 is no longer supported
45
+ /** @deprecated Genesis from eth1 is no longer supported, only kept around to delete data from existing databases */
46
+ phase0_preGenesisState = 30,
47
+ /** @deprecated Genesis from eth1 is no longer supported, only kept around to delete data from existing databases */
48
+ phase0_preGenesisStateLastProcessedBlock = 31,
43
49
 
44
50
  // Lightclient server
45
51
  // altair_bestUpdatePerCommitteePeriod = 30, // DEPRECATED on v0.32.0
@@ -56,6 +56,8 @@ export interface IBeaconDb {
56
56
 
57
57
  pruneHotDb(): Promise<void>;
58
58
 
59
+ deleteDeprecatedEth1Data(): Promise<void>;
60
+
59
61
  /** Close the connection to the db instance and close the db store. */
60
62
  close(): Promise<void>;
61
63
  /** To inject metrics after CLI initialization */
@@ -42,10 +42,10 @@ export class StateArchiveRepository extends Repository<Slot, BeaconStateAllForks
42
42
 
43
43
  // Index Root -> Slot
44
44
 
45
- async getByRoot(stateRoot: Root): Promise<BeaconStateAllForks | null> {
45
+ async getBinaryByRoot(stateRoot: Root): Promise<Uint8Array | null> {
46
46
  const slot = await this.getSlotByRoot(stateRoot);
47
47
  if (slot !== null && Number.isInteger(slot)) {
48
- return this.get(slot);
48
+ return this.getBinary(slot);
49
49
  }
50
50
  return null;
51
51
  }
@@ -1,4 +1,5 @@
1
1
  import crypto from "node:crypto";
2
+ import {ChainConfig} from "@lodestar/config";
2
3
  import {
3
4
  BLOB_TX_TYPE,
4
5
  BYTES_PER_FIELD_ELEMENT,
@@ -7,7 +8,9 @@ import {
7
8
  ForkPostBellatrix,
8
9
  ForkPostCapella,
9
10
  ForkSeq,
11
+ SLOTS_PER_EPOCH,
10
12
  } from "@lodestar/params";
13
+ import {computeTimeAtSlot} from "@lodestar/state-transition";
11
14
  import {ExecutionPayload, RootHex, bellatrix, deneb, ssz} from "@lodestar/types";
12
15
  import {fromHex, toRootHex} from "@lodestar/utils";
13
16
  import {ZERO_HASH_HEX} from "../../constants/index.js";
@@ -34,14 +37,11 @@ const INTEROP_GAS_LIMIT = 30e6;
34
37
  const PRUNE_PAYLOAD_ID_AFTER_MS = 5000;
35
38
 
36
39
  export type ExecutionEngineMockOpts = {
37
- genesisBlockHash: string;
40
+ genesisBlockHash?: string;
38
41
  eth1BlockHash?: string;
39
42
  onlyPredefinedResponses?: boolean;
40
- capellaForkTimestamp?: number;
41
- denebForkTimestamp?: number;
42
- electraForkTimestamp?: number;
43
- fuluForkTimestamp?: number;
44
- gloasForkTimestamp?: number;
43
+ genesisTime?: number;
44
+ config?: ChainConfig;
45
45
  };
46
46
 
47
47
  type ExecutionBlock = {
@@ -74,17 +74,21 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
74
74
  /** Preparing payloads to be retrieved via engine_getPayloadV1 */
75
75
  private readonly preparingPayloads = new Map<number, PreparedPayload>();
76
76
  private readonly payloadsForDeletion = new Map<number, number>();
77
-
78
77
  private readonly predefinedPayloadStatuses = new Map<RootHex, PayloadStatus>();
79
78
 
80
79
  private payloadId = 0;
80
+ private capellaForkTimestamp: number;
81
+ private denebForkTimestamp: number;
82
+ private electraForkTimestamp: number;
83
+ private fuluForkTimestamp: number;
84
+ private gloasForkTimestamp: number;
81
85
 
82
86
  readonly handlers: {
83
87
  [K in keyof EngineApiRpcParamTypes]: (...args: EngineApiRpcParamTypes[K]) => EngineApiRpcReturnTypes[K];
84
88
  };
85
89
 
86
90
  constructor(private readonly opts: ExecutionEngineMockOpts) {
87
- this.validBlocks.set(opts.genesisBlockHash, {
91
+ this.validBlocks.set(opts.genesisBlockHash ?? ZERO_HASH_HEX, {
88
92
  parentHash: ZERO_HASH_HEX,
89
93
  blockHash: ZERO_HASH_HEX,
90
94
  timestamp: 0,
@@ -100,6 +104,29 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
100
104
  blockNumber: 1,
101
105
  });
102
106
 
107
+ const {config} = opts;
108
+
109
+ this.capellaForkTimestamp =
110
+ opts.genesisTime && config
111
+ ? computeTimeAtSlot(config, config.CAPELLA_FORK_EPOCH * SLOTS_PER_EPOCH, opts.genesisTime)
112
+ : Infinity;
113
+ this.denebForkTimestamp =
114
+ opts.genesisTime && config
115
+ ? computeTimeAtSlot(config, config.DENEB_FORK_EPOCH * SLOTS_PER_EPOCH, opts.genesisTime)
116
+ : Infinity;
117
+ this.electraForkTimestamp =
118
+ opts.genesisTime && config
119
+ ? computeTimeAtSlot(config, config.ELECTRA_FORK_EPOCH * SLOTS_PER_EPOCH, opts.genesisTime)
120
+ : Infinity;
121
+ this.fuluForkTimestamp =
122
+ opts.genesisTime && config
123
+ ? computeTimeAtSlot(config, config.FULU_FORK_EPOCH * SLOTS_PER_EPOCH, opts.genesisTime)
124
+ : Infinity;
125
+ this.gloasForkTimestamp =
126
+ opts.genesisTime && config
127
+ ? computeTimeAtSlot(config, config.GLOAS_FORK_EPOCH * SLOTS_PER_EPOCH, opts.genesisTime)
128
+ : Infinity;
129
+
103
130
  this.handlers = {
104
131
  engine_newPayloadV1: this.notifyNewPayload.bind(this),
105
132
  engine_newPayloadV2: this.notifyNewPayload.bind(this),
@@ -448,11 +475,11 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
448
475
  }
449
476
 
450
477
  private timestampToFork(timestamp: number): ForkPostBellatrix {
451
- if (timestamp >= (this.opts.gloasForkTimestamp ?? Infinity)) return ForkName.gloas;
452
- if (timestamp >= (this.opts.fuluForkTimestamp ?? Infinity)) return ForkName.fulu;
453
- if (timestamp >= (this.opts.electraForkTimestamp ?? Infinity)) return ForkName.electra;
454
- if (timestamp >= (this.opts.denebForkTimestamp ?? Infinity)) return ForkName.deneb;
455
- if (timestamp >= (this.opts.capellaForkTimestamp ?? Infinity)) return ForkName.capella;
478
+ if (timestamp >= this.gloasForkTimestamp) return ForkName.gloas;
479
+ if (timestamp >= this.fuluForkTimestamp) return ForkName.fulu;
480
+ if (timestamp >= this.electraForkTimestamp) return ForkName.electra;
481
+ if (timestamp >= this.denebForkTimestamp) return ForkName.deneb;
482
+ if (timestamp >= this.capellaForkTimestamp) return ForkName.capella;
456
483
  return ForkName.bellatrix;
457
484
  }
458
485
  }
@@ -1308,33 +1308,19 @@ export function createLodestarMetrics(
1308
1308
  name: "lodestar_shuffling_cache_miss_count",
1309
1309
  help: "Count of shuffling cache miss",
1310
1310
  }),
1311
- shufflingBuiltMultipleTimes: register.gauge({
1312
- name: "lodestar_shuffling_cache_recalculated_shuffling_count",
1313
- help: "Count of shuffling that were build multiple times",
1314
- }),
1315
- shufflingPromiseNotResolvedAndThrownAway: register.gauge({
1316
- name: "lodestar_shuffling_cache_promise_not_resolved_and_thrown_away_count",
1317
- help: "Count of shuffling cache promises that were discarded and the shuffling was built synchronously",
1311
+ shufflingSetMultipleTimes: register.gauge({
1312
+ name: "lodestar_shuffling_cache_set_multiple_times_count",
1313
+ help: "Count of shuffling that were set multiple times",
1318
1314
  }),
1319
1315
  shufflingPromiseNotResolved: register.gauge({
1320
1316
  name: "lodestar_shuffling_cache_promise_not_resolved_count",
1321
1317
  help: "Count of shuffling cache promises that were requested before the promise was resolved",
1322
1318
  }),
1323
- nextShufflingNotOnEpochCache: register.gauge({
1324
- name: "lodestar_shuffling_cache_next_shuffling_not_on_epoch_cache",
1325
- help: "The next shuffling was not on the epoch cache before the epoch transition",
1326
- }),
1327
1319
  shufflingPromiseResolutionTime: register.histogram({
1328
1320
  name: "lodestar_shuffling_cache_promise_resolution_time_seconds",
1329
1321
  help: "Time from promise insertion until promise resolution when shuffling was ready in seconds",
1330
1322
  buckets: [0.5, 1, 1.5, 2],
1331
1323
  }),
1332
- shufflingCalculationTime: register.histogram<{source: "build" | "getSync"}>({
1333
- name: "lodestar_shuffling_cache_shuffling_calculation_time_seconds",
1334
- help: "Run time of shuffling calculation",
1335
- buckets: [0.5, 0.75, 1, 1.25, 1.5],
1336
- labelNames: ["source"],
1337
- }),
1338
1324
  },
1339
1325
 
1340
1326
  seenCache: {
@@ -1,4 +1,4 @@
1
- import type {PeerId, PeerInfo, PrivateKey} from "@libp2p/interface";
1
+ import type {PeerId, PeerInfo, PendingDial, PrivateKey} from "@libp2p/interface";
2
2
  import {Multiaddr} from "@multiformats/multiaddr";
3
3
  import {ENR} from "@chainsafe/enr";
4
4
  import {BeaconConfig} from "@lodestar/config";
@@ -217,7 +217,7 @@ export class PeerDiscovery {
217
217
  const pendingDials = new Set(
218
218
  this.libp2p.services.components.connectionManager
219
219
  .getDialQueue()
220
- .map((pendingDial) => pendingDial.peerId?.toString())
220
+ .map((pendingDial: PendingDial) => pendingDial.peerId?.toString())
221
221
  );
222
222
  for (const [id, cachedENR] of this.cachedENRs.entries()) {
223
223
  if (
@@ -458,7 +458,7 @@ export class PeerDiscovery {
458
458
  if (
459
459
  this.libp2p.services.components.connectionManager
460
460
  .getDialQueue()
461
- .find((pendingDial) => pendingDial.peerId?.equals(peerId))
461
+ .find((pendingDial: PendingDial) => pendingDial.peerId?.equals(peerId))
462
462
  ) {
463
463
  return DiscoveredPeerStatus.already_dialing;
464
464
  }
@@ -2,12 +2,14 @@ import {setMaxListeners} from "node:events";
2
2
  import {PrivateKey} from "@libp2p/interface";
3
3
  import {Registry} from "prom-client";
4
4
  import {hasher} from "@chainsafe/persistent-merkle-tree";
5
+ import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
5
6
  import {BeaconApiMethods} from "@lodestar/api/beacon/server";
6
7
  import {BeaconConfig} from "@lodestar/config";
7
8
  import type {LoggerNode} from "@lodestar/logger/node";
8
- import {BeaconStateAllForks} from "@lodestar/state-transition";
9
+ import {ZERO_HASH_HEX} from "@lodestar/params";
10
+ import {CachedBeaconStateAllForks, Index2PubkeyCache, isExecutionCachedStateType} from "@lodestar/state-transition";
9
11
  import {phase0} from "@lodestar/types";
10
- import {sleep} from "@lodestar/utils";
12
+ import {sleep, toRootHex} from "@lodestar/utils";
11
13
  import {ProcessShutdownCallback} from "@lodestar/validator";
12
14
  import {BeaconRestApiServer, getApi} from "../api/index.js";
13
15
  import {BeaconChain, IBeaconChain, initBeaconMetrics} from "../chain/index.js";
@@ -45,13 +47,15 @@ export type BeaconNodeModules = {
45
47
  export type BeaconNodeInitModules = {
46
48
  opts: IBeaconNodeOptions;
47
49
  config: BeaconConfig;
50
+ pubkey2index: PubkeyIndexMap;
51
+ index2pubkey: Index2PubkeyCache;
48
52
  db: IBeaconDb;
49
53
  logger: LoggerNode;
50
54
  processShutdownCallback: ProcessShutdownCallback;
51
55
  privateKey: PrivateKey;
52
56
  dataDir: string;
53
57
  peerStoreDir?: string;
54
- anchorState: BeaconStateAllForks;
58
+ anchorState: CachedBeaconStateAllForks;
55
59
  isAnchorStateFinalized: boolean;
56
60
  wsCheckpoint?: phase0.Checkpoint;
57
61
  metricsRegistries?: Registry[];
@@ -146,6 +150,8 @@ export class BeaconNode {
146
150
  static async init<T extends BeaconNode = BeaconNode>({
147
151
  opts,
148
152
  config,
153
+ pubkey2index,
154
+ index2pubkey,
149
155
  db,
150
156
  logger,
151
157
  processShutdownCallback,
@@ -197,6 +203,17 @@ export class BeaconNode {
197
203
  // TODO: Should this call be awaited?
198
204
  await db.pruneHotDb();
199
205
 
206
+ // Delete deprecated eth1 data to free up disk space for users
207
+ logger.debug("Deleting deprecated eth1 data from database");
208
+ const startTime = Date.now();
209
+ db.deleteDeprecatedEth1Data()
210
+ .then(() => {
211
+ logger.debug("Deleted deprecated eth1 data", {durationMs: Date.now() - startTime});
212
+ })
213
+ .catch((e) => {
214
+ logger.error("Failed to delete deprecated eth1 data", {}, e);
215
+ });
216
+
200
217
  const monitoring = opts.monitoring.endpoint
201
218
  ? new MonitoringService(
202
219
  "beacon",
@@ -205,10 +222,26 @@ export class BeaconNode {
205
222
  )
206
223
  : null;
207
224
 
225
+ let executionEngineOpts = opts.executionEngine;
226
+ if (opts.executionEngine.mode === "mock") {
227
+ const eth1BlockHash = isExecutionCachedStateType(anchorState)
228
+ ? toRootHex(anchorState.latestExecutionPayloadHeader.blockHash)
229
+ : undefined;
230
+ executionEngineOpts = {
231
+ ...opts.executionEngine,
232
+ genesisBlockHash: ZERO_HASH_HEX,
233
+ eth1BlockHash,
234
+ genesisTime: anchorState.genesisTime,
235
+ config,
236
+ };
237
+ }
238
+
208
239
  const chain = new BeaconChain(opts.chain, {
209
240
  privateKey,
210
241
  config,
211
242
  clock,
243
+ pubkey2index,
244
+ index2pubkey,
212
245
  dataDir,
213
246
  db,
214
247
  dbName: opts.db.name,
@@ -218,7 +251,7 @@ export class BeaconNode {
218
251
  validatorMonitor,
219
252
  anchorState,
220
253
  isAnchorStateFinalized,
221
- executionEngine: initializeExecutionEngine(opts.executionEngine, {
254
+ executionEngine: initializeExecutionEngine(executionEngineOpts, {
222
255
  metrics,
223
256
  signal,
224
257
  logger: logger.child({module: LoggerModule.execution}),
@@ -6,6 +6,7 @@ import {
6
6
  computeEpochAtSlot,
7
7
  computeStartSlotAtEpoch,
8
8
  isExecutionCachedStateType,
9
+ isMergeTransitionComplete,
9
10
  } from "@lodestar/state-transition";
10
11
  import {Epoch} from "@lodestar/types";
11
12
  import {ErrorAborted, Logger, prettyBytes, prettyBytesShort, sleep} from "@lodestar/utils";
@@ -171,13 +172,18 @@ function getHeadExecutionInfo(
171
172
 
172
173
  // Add execution status to notifier only if head is on/post bellatrix
173
174
  if (isExecutionCachedStateType(headState)) {
174
- const executionPayloadHashInfo =
175
- headInfo.executionStatus !== ExecutionStatus.PreMerge ? headInfo.executionPayloadBlockHash : "empty";
176
- const executionPayloadNumberInfo =
177
- headInfo.executionStatus !== ExecutionStatus.PreMerge ? headInfo.executionPayloadNumber : NaN;
178
- return [
179
- `exec-block: ${executionStatusStr}(${executionPayloadNumberInfo} ${prettyBytesShort(executionPayloadHashInfo)})`,
180
- ];
175
+ if (isMergeTransitionComplete(headState)) {
176
+ const executionPayloadHashInfo =
177
+ headInfo.executionStatus !== ExecutionStatus.PreMerge ? headInfo.executionPayloadBlockHash : "empty";
178
+ const executionPayloadNumberInfo =
179
+ headInfo.executionStatus !== ExecutionStatus.PreMerge ? headInfo.executionPayloadNumber : NaN;
180
+ return [
181
+ `exec-block: ${executionStatusStr}(${executionPayloadNumberInfo} ${prettyBytesShort(
182
+ executionPayloadHashInfo
183
+ )})`,
184
+ ];
185
+ }
186
+ return [`exec-block: ${executionStatusStr}`];
181
187
  }
182
188
 
183
189
  return [];
@@ -750,9 +750,7 @@ export class BackfillSync extends (EventEmitter as {new (): BackfillSyncEmitter}
750
750
 
751
751
  // GENESIS_SLOT doesn't has valid signature
752
752
  if (anchorBlock.message.slot === GENESIS_SLOT) return;
753
- await verifyBlockProposerSignature(this.chain.index2pubkey, this.chain.bls, this.chain.getHeadState(), [
754
- anchorBlock,
755
- ]);
753
+ await verifyBlockProposerSignature(this.chain.config, this.chain.index2pubkey, this.chain.bls, [anchorBlock]);
756
754
 
757
755
  // We can write to the disk if this is ahead of prevFinalizedCheckpointBlock otherwise
758
756
  // we will need to go make checks on the top of sync loop before writing as it might
@@ -817,12 +815,7 @@ export class BackfillSync extends (EventEmitter as {new (): BackfillSyncEmitter}
817
815
 
818
816
  // If any of the block's proposer signature fail, we can't trust this peer at all
819
817
  if (verifiedBlocks.length > 0) {
820
- await verifyBlockProposerSignature(
821
- this.chain.index2pubkey,
822
- this.chain.bls,
823
- this.chain.getHeadState(),
824
- verifiedBlocks
825
- );
818
+ await verifyBlockProposerSignature(this.chain.config, this.chain.index2pubkey, this.chain.bls, verifiedBlocks);
826
819
 
827
820
  // This is bad, like super bad. Abort the backfill
828
821
  if (!nextAnchor)
@@ -1,11 +1,6 @@
1
1
  import {BeaconConfig} from "@lodestar/config";
2
2
  import {GENESIS_SLOT} from "@lodestar/params";
3
- import {
4
- CachedBeaconStateAllForks,
5
- ISignatureSet,
6
- Index2PubkeyCache,
7
- getBlockProposerSignatureSet,
8
- } from "@lodestar/state-transition";
3
+ import {ISignatureSet, Index2PubkeyCache, getBlockProposerSignatureSet} from "@lodestar/state-transition";
9
4
  import {Root, SignedBeaconBlock, Slot, ssz} from "@lodestar/types";
10
5
  import {IBlsVerifier} from "../../chain/bls/index.js";
11
6
  import {BackfillSyncError, BackfillSyncErrorCode} from "./errors.js";
@@ -46,15 +41,15 @@ export function verifyBlockSequence(
46
41
  }
47
42
 
48
43
  export async function verifyBlockProposerSignature(
44
+ config: BeaconConfig,
49
45
  index2pubkey: Index2PubkeyCache,
50
46
  bls: IBlsVerifier,
51
- state: CachedBeaconStateAllForks,
52
47
  blocks: SignedBeaconBlock[]
53
48
  ): Promise<void> {
54
49
  if (blocks.length === 1 && blocks[0].message.slot === GENESIS_SLOT) return;
55
50
  const signatures = blocks.reduce((sigs: ISignatureSet[], block) => {
56
51
  // genesis block doesn't have valid signature
57
- if (block.message.slot !== GENESIS_SLOT) sigs.push(getBlockProposerSignatureSet(index2pubkey, state, block));
52
+ if (block.message.slot !== GENESIS_SLOT) sigs.push(getBlockProposerSignatureSet(config, index2pubkey, block));
58
53
  return sigs;
59
54
  }, []);
60
55
 
@@ -1,7 +0,0 @@
1
- import { PubkeyIndexMap } from "@chainsafe/pubkey-index-map";
2
- import { routes } from "@lodestar/api";
3
- import { CachedBeaconStateAllForks } from "@lodestar/state-transition";
4
- import { ValidatorIndex } from "@lodestar/types";
5
- export type AttestationsRewards = routes.beacon.AttestationsRewards;
6
- export declare function computeAttestationsRewards(pubkey2index: PubkeyIndexMap, state: CachedBeaconStateAllForks, validatorIds?: (ValidatorIndex | string)[]): Promise<AttestationsRewards>;
7
- //# sourceMappingURL=attestationsRewards.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attestationsRewards.d.ts","sourceRoot":"","sources":["../../../src/chain/rewards/attestationsRewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAcrC,OAAO,EACL,yBAAyB,EAU1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAC;AAG/C,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC;AASpE,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,cAAc,EAC5B,KAAK,EAAE,yBAAyB,EAChC,YAAY,CAAC,EAAE,CAAC,cAAc,GAAG,MAAM,CAAC,EAAE,GACzC,OAAO,CAAC,mBAAmB,CAAC,CAoB9B"}