@lodestar/beacon-node 1.39.0-dev.3bf4734ba9 → 1.39.0-dev.46c9c672fd
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/README.md +1 -1
- package/lib/api/impl/beacon/blocks/utils.js +1 -1
- package/lib/api/impl/beacon/blocks/utils.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +1 -1
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +4 -2
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +3 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/chain.d.ts +8 -12
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +23 -47
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +3 -3
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +1 -14
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -62
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +4 -9
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +4 -4
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +4 -4
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -0
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +9 -8
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +0 -4
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +1 -21
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +0 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +9 -12
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +4 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +4 -2
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +9 -0
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +1 -1
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.d.ts.map +1 -1
- package/lib/chain/validation/blobSidecar.js +2 -3
- package/lib/chain/validation/blobSidecar.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +3 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.d.ts.map +1 -1
- package/lib/chain/validation/blsToExecutionChange.js +10 -3
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +2 -3
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +1 -1
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts +2 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.js +1 -1
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +3 -3
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +1 -1
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/db/beacon.d.ts +3 -7
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +33 -12
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/buckets.d.ts +12 -6
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +6 -1
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/interface.d.ts +2 -7
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/index.d.ts +0 -3
- package/lib/db/repositories/index.d.ts.map +1 -1
- package/lib/db/repositories/index.js +0 -3
- package/lib/db/repositories/index.js.map +1 -1
- package/lib/execution/engine/http.d.ts +1 -1
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +2 -3
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.d.ts.map +1 -1
- package/lib/execution/engine/index.js +1 -1
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +1 -1
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/{eth1/provider → execution/engine}/jsonRpcHttpClient.d.ts +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -0
- package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -0
- package/lib/execution/engine/jwt.d.ts.map +1 -0
- package/lib/execution/engine/jwt.js.map +1 -0
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +1 -1
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +1 -1
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +1 -1
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts +64 -2
- package/lib/execution/engine/utils.d.ts.map +1 -1
- package/lib/execution/engine/utils.js +91 -2
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +0 -35
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +0 -90
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/core/events.d.ts +1 -1
- package/lib/network/core/events.d.ts.map +1 -1
- package/lib/network/core/events.js +1 -1
- package/lib/network/core/events.js.map +1 -1
- package/lib/network/events.d.ts +6 -1
- package/lib/network/events.d.ts.map +1 -1
- package/lib/network/events.js +7 -1
- package/lib/network/events.js.map +1 -1
- package/lib/network/peers/discover.d.ts.map +1 -1
- package/lib/network/peers/discover.js.map +1 -1
- package/lib/node/nodejs.d.ts +6 -3
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +13 -10
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +9 -6
- package/lib/node/notifier.js.map +1 -1
- package/lib/node/options.d.ts +0 -2
- package/lib/node/options.d.ts.map +1 -1
- package/lib/node/options.js +0 -2
- package/lib/node/options.js.map +1 -1
- package/lib/node/utils/interop/deposits.d.ts +2 -1
- package/lib/node/utils/interop/deposits.d.ts.map +1 -1
- package/lib/node/utils/interop/deposits.js.map +1 -1
- package/lib/node/utils/interop/state.d.ts +1 -1
- package/lib/node/utils/interop/state.d.ts.map +1 -1
- package/lib/node/utils/state.d.ts +1 -7
- package/lib/node/utils/state.d.ts.map +1 -1
- package/lib/node/utils/state.js +1 -14
- package/lib/node/utils/state.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -4
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/backfill/verify.d.ts +2 -2
- package/lib/sync/backfill/verify.d.ts.map +1 -1
- package/lib/sync/backfill/verify.js +3 -3
- package/lib/sync/backfill/verify.js.map +1 -1
- package/lib/util/workerEvents.d.ts +1 -6
- package/lib/util/workerEvents.d.ts.map +1 -1
- package/lib/util/workerEvents.js +8 -8
- package/lib/util/workerEvents.js.map +1 -1
- package/package.json +28 -26
- package/src/api/impl/beacon/blocks/utils.ts +1 -1
- package/src/chain/blocks/verifyBlock.ts +1 -0
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +9 -2
- package/src/chain/blocks/verifyBlocksSignatures.ts +13 -3
- package/src/chain/chain.ts +33 -56
- package/src/chain/forkChoice/index.ts +3 -2
- package/src/chain/initState.ts +1 -97
- package/src/chain/interface.ts +4 -8
- package/src/chain/opPools/aggregatedAttestationPool.ts +7 -7
- package/src/chain/opPools/opPool.ts +8 -8
- package/src/chain/prepareNextSlot.ts +1 -28
- package/src/chain/produceBlock/produceBlockBody.ts +9 -13
- package/src/chain/stateCache/persistentCheckpointsCache.ts +15 -2
- package/src/chain/validation/aggregateAndProof.ts +12 -0
- package/src/chain/validation/attesterSlashing.ts +6 -1
- package/src/chain/validation/blobSidecar.ts +3 -3
- package/src/chain/validation/block.ts +3 -2
- package/src/chain/validation/blsToExecutionChange.ts +10 -8
- package/src/chain/validation/dataColumnSidecar.ts +3 -3
- package/src/chain/validation/proposerSlashing.ts +6 -1
- package/src/chain/validation/signatureSets/aggregateAndProof.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +3 -1
- package/src/chain/validation/signatureSets/syncCommittee.ts +3 -1
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +3 -1
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -1
- package/src/chain/validation/syncCommittee.ts +1 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +8 -3
- package/src/chain/validation/voluntaryExit.ts +1 -1
- package/src/db/beacon.ts +38 -16
- package/src/db/buckets.ts +12 -7
- package/src/db/interface.ts +2 -13
- package/src/db/repositories/index.ts +0 -3
- package/src/execution/engine/http.ts +8 -9
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +1 -1
- package/src/{eth1/provider → execution/engine}/jsonRpcHttpClient.ts +1 -1
- package/src/execution/engine/mock.ts +1 -2
- package/src/execution/engine/payloadIdCache.ts +1 -1
- package/src/execution/engine/types.ts +9 -9
- package/src/execution/engine/utils.ts +111 -5
- package/src/index.ts +1 -2
- package/src/metrics/metrics/lodestar.ts +0 -92
- package/src/network/core/events.ts +1 -1
- package/src/network/events.ts +7 -1
- package/src/network/peers/discover.ts +3 -3
- package/src/node/nodejs.ts +20 -11
- package/src/node/notifier.ts +13 -7
- package/src/node/options.ts +0 -3
- package/src/node/utils/interop/deposits.ts +3 -1
- package/src/node/utils/interop/state.ts +1 -1
- package/src/node/utils/state.ts +3 -18
- package/src/sync/backfill/backfill.ts +2 -9
- package/src/sync/backfill/verify.ts +3 -8
- package/src/util/workerEvents.ts +9 -8
- package/lib/chain/genesis/genesis.d.ts +0 -51
- package/lib/chain/genesis/genesis.d.ts.map +0 -1
- package/lib/chain/genesis/genesis.js +0 -123
- package/lib/chain/genesis/genesis.js.map +0 -1
- package/lib/chain/genesis/interface.d.ts +0 -13
- package/lib/chain/genesis/interface.d.ts.map +0 -1
- package/lib/chain/genesis/interface.js +0 -2
- package/lib/chain/genesis/interface.js.map +0 -1
- package/lib/chain/rewards/attestationsRewards.d.ts +0 -7
- package/lib/chain/rewards/attestationsRewards.d.ts.map +0 -1
- package/lib/chain/rewards/attestationsRewards.js +0 -112
- package/lib/chain/rewards/attestationsRewards.js.map +0 -1
- package/lib/chain/rewards/blockRewards.d.ts +0 -14
- package/lib/chain/rewards/blockRewards.d.ts.map +0 -1
- package/lib/chain/rewards/blockRewards.js +0 -94
- package/lib/chain/rewards/blockRewards.js.map +0 -1
- package/lib/chain/rewards/syncCommitteeRewards.d.ts +0 -6
- package/lib/chain/rewards/syncCommitteeRewards.d.ts.map +0 -1
- package/lib/chain/rewards/syncCommitteeRewards.js +0 -36
- package/lib/chain/rewards/syncCommitteeRewards.js.map +0 -1
- package/lib/db/repositories/depositDataRoot.d.ts +0 -22
- package/lib/db/repositories/depositDataRoot.d.ts.map +0 -1
- package/lib/db/repositories/depositDataRoot.js +0 -62
- package/lib/db/repositories/depositDataRoot.js.map +0 -1
- package/lib/db/repositories/depositEvent.d.ts +0 -13
- package/lib/db/repositories/depositEvent.d.ts.map +0 -1
- package/lib/db/repositories/depositEvent.js +0 -27
- package/lib/db/repositories/depositEvent.js.map +0 -1
- package/lib/db/repositories/eth1Data.d.ts +0 -13
- package/lib/db/repositories/eth1Data.d.ts.map +0 -1
- package/lib/db/repositories/eth1Data.js +0 -26
- package/lib/db/repositories/eth1Data.js.map +0 -1
- package/lib/db/single/index.d.ts +0 -3
- package/lib/db/single/index.d.ts.map +0 -1
- package/lib/db/single/index.js +0 -3
- package/lib/db/single/index.js.map +0 -1
- package/lib/db/single/preGenesisState.d.ts +0 -16
- package/lib/db/single/preGenesisState.d.ts.map +0 -1
- package/lib/db/single/preGenesisState.js +0 -29
- package/lib/db/single/preGenesisState.js.map +0 -1
- package/lib/db/single/preGenesisStateLastProcessedBlock.d.ts +0 -14
- package/lib/db/single/preGenesisStateLastProcessedBlock.d.ts.map +0 -1
- package/lib/db/single/preGenesisStateLastProcessedBlock.js +0 -27
- package/lib/db/single/preGenesisStateLastProcessedBlock.js.map +0 -1
- package/lib/eth1/errors.d.ts +0 -66
- package/lib/eth1/errors.d.ts.map +0 -1
- package/lib/eth1/errors.js +0 -27
- package/lib/eth1/errors.js.map +0 -1
- package/lib/eth1/eth1DataCache.d.ts +0 -19
- package/lib/eth1/eth1DataCache.d.ts.map +0 -1
- package/lib/eth1/eth1DataCache.js +0 -19
- package/lib/eth1/eth1DataCache.js.map +0 -1
- package/lib/eth1/eth1DepositDataTracker.d.ts +0 -80
- package/lib/eth1/eth1DepositDataTracker.d.ts.map +0 -1
- package/lib/eth1/eth1DepositDataTracker.js +0 -317
- package/lib/eth1/eth1DepositDataTracker.js.map +0 -1
- package/lib/eth1/eth1DepositsCache.d.ts +0 -42
- package/lib/eth1/eth1DepositsCache.d.ts.map +0 -1
- package/lib/eth1/eth1DepositsCache.js +0 -119
- package/lib/eth1/eth1DepositsCache.js.map +0 -1
- package/lib/eth1/index.d.ts +0 -31
- package/lib/eth1/index.d.ts.map +0 -1
- package/lib/eth1/index.js +0 -71
- package/lib/eth1/index.js.map +0 -1
- package/lib/eth1/interface.d.ts +0 -74
- package/lib/eth1/interface.d.ts.map +0 -1
- package/lib/eth1/interface.js +0 -8
- package/lib/eth1/interface.js.map +0 -1
- package/lib/eth1/options.d.ts +0 -22
- package/lib/eth1/options.d.ts.map +0 -1
- package/lib/eth1/options.js +0 -8
- package/lib/eth1/options.js.map +0 -1
- package/lib/eth1/provider/eth1Provider.d.ts +0 -39
- package/lib/eth1/provider/eth1Provider.d.ts.map +0 -1
- package/lib/eth1/provider/eth1Provider.js +0 -147
- package/lib/eth1/provider/eth1Provider.js.map +0 -1
- package/lib/eth1/provider/jsonRpcHttpClient.d.ts.map +0 -1
- package/lib/eth1/provider/jsonRpcHttpClient.js.map +0 -1
- package/lib/eth1/provider/jwt.d.ts.map +0 -1
- package/lib/eth1/provider/jwt.js.map +0 -1
- package/lib/eth1/provider/utils.d.ts +0 -65
- package/lib/eth1/provider/utils.d.ts.map +0 -1
- package/lib/eth1/provider/utils.js +0 -120
- package/lib/eth1/provider/utils.js.map +0 -1
- package/lib/eth1/stream.d.ts +0 -15
- package/lib/eth1/stream.d.ts.map +0 -1
- package/lib/eth1/stream.js +0 -54
- package/lib/eth1/stream.js.map +0 -1
- package/lib/eth1/utils/depositContract.d.ts +0 -14
- package/lib/eth1/utils/depositContract.d.ts.map +0 -1
- package/lib/eth1/utils/depositContract.js +0 -33
- package/lib/eth1/utils/depositContract.js.map +0 -1
- package/lib/eth1/utils/deposits.d.ts +0 -8
- package/lib/eth1/utils/deposits.d.ts.map +0 -1
- package/lib/eth1/utils/deposits.js +0 -47
- package/lib/eth1/utils/deposits.js.map +0 -1
- package/lib/eth1/utils/eth1Data.d.ts +0 -22
- package/lib/eth1/utils/eth1Data.d.ts.map +0 -1
- package/lib/eth1/utils/eth1Data.js +0 -77
- package/lib/eth1/utils/eth1Data.js.map +0 -1
- package/lib/eth1/utils/eth1DepositEvent.d.ts +0 -7
- package/lib/eth1/utils/eth1DepositEvent.d.ts.map +0 -1
- package/lib/eth1/utils/eth1DepositEvent.js +0 -13
- package/lib/eth1/utils/eth1DepositEvent.js.map +0 -1
- package/lib/eth1/utils/eth1Vote.d.ts +0 -17
- package/lib/eth1/utils/eth1Vote.d.ts.map +0 -1
- package/lib/eth1/utils/eth1Vote.js +0 -111
- package/lib/eth1/utils/eth1Vote.js.map +0 -1
- package/lib/eth1/utils/groupDepositEventsByBlock.d.ts +0 -9
- package/lib/eth1/utils/groupDepositEventsByBlock.d.ts.map +0 -1
- package/lib/eth1/utils/groupDepositEventsByBlock.js +0 -17
- package/lib/eth1/utils/groupDepositEventsByBlock.js.map +0 -1
- package/lib/eth1/utils/optimizeNextBlockDiffForGenesis.d.ts +0 -10
- package/lib/eth1/utils/optimizeNextBlockDiffForGenesis.d.ts.map +0 -1
- package/lib/eth1/utils/optimizeNextBlockDiffForGenesis.js +0 -14
- package/lib/eth1/utils/optimizeNextBlockDiffForGenesis.js.map +0 -1
- package/src/chain/genesis/genesis.ts +0 -190
- package/src/chain/genesis/interface.ts +0 -14
- package/src/chain/rewards/attestationsRewards.ts +0 -197
- package/src/chain/rewards/blockRewards.ts +0 -150
- package/src/chain/rewards/syncCommitteeRewards.ts +0 -58
- package/src/db/repositories/depositDataRoot.ts +0 -80
- package/src/db/repositories/depositEvent.ts +0 -32
- package/src/db/repositories/eth1Data.ts +0 -33
- package/src/db/single/index.ts +0 -2
- package/src/db/single/preGenesisState.ts +0 -37
- package/src/db/single/preGenesisStateLastProcessedBlock.ts +0 -34
- package/src/eth1/errors.ts +0 -40
- package/src/eth1/eth1DataCache.ts +0 -26
- package/src/eth1/eth1DepositDataTracker.ts +0 -410
- package/src/eth1/eth1DepositsCache.ts +0 -141
- package/src/eth1/index.ts +0 -94
- package/src/eth1/interface.ts +0 -87
- package/src/eth1/options.ts +0 -28
- package/src/eth1/provider/eth1Provider.ts +0 -229
- package/src/eth1/provider/utils.ts +0 -136
- package/src/eth1/stream.ts +0 -75
- package/src/eth1/utils/depositContract.ts +0 -37
- package/src/eth1/utils/deposits.ts +0 -70
- package/src/eth1/utils/eth1Data.ts +0 -100
- package/src/eth1/utils/eth1DepositEvent.ts +0 -12
- package/src/eth1/utils/eth1Vote.ts +0 -142
- package/src/eth1/utils/groupDepositEventsByBlock.ts +0 -19
- package/src/eth1/utils/optimizeNextBlockDiffForGenesis.ts +0 -18
- /package/lib/{eth1/provider → execution/engine}/jsonRpcHttpClient.js +0 -0
- /package/lib/{eth1/provider → execution/engine}/jwt.d.ts +0 -0
- /package/lib/{eth1/provider → execution/engine}/jwt.js +0 -0
- /package/src/{eth1/provider → execution/engine}/jwt.ts +0 -0
|
@@ -3,6 +3,7 @@ import { Thread } from "@chainsafe/threads";
|
|
|
3
3
|
import { Logger } from "@lodestar/logger";
|
|
4
4
|
import { Metrics } from "../metrics/metrics.js";
|
|
5
5
|
import { NetworkCoreWorkerMetrics } from "../network/core/metrics.js";
|
|
6
|
+
import { EventDirection } from "../network/events.js";
|
|
6
7
|
import { StrictEventEmitterSingleArg } from "./strictEvents.js";
|
|
7
8
|
export type WorkerBridgeEvent<EventData> = {
|
|
8
9
|
type: string;
|
|
@@ -10,12 +11,6 @@ export type WorkerBridgeEvent<EventData> = {
|
|
|
10
11
|
posted: [number, number];
|
|
11
12
|
data: EventData[keyof EventData];
|
|
12
13
|
};
|
|
13
|
-
export declare enum EventDirection {
|
|
14
|
-
workerToMain = 0,
|
|
15
|
-
mainToWorker = 1,
|
|
16
|
-
/** Event not emitted through worker boundary */
|
|
17
|
-
none = 2
|
|
18
|
-
}
|
|
19
14
|
/**
|
|
20
15
|
* Bridges events from worker to main thread
|
|
21
16
|
* Each event can only have one direction:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerEvents.d.ts","sourceRoot":"","sources":["../../src/util/workerEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,MAAM,EAAC,MAAM,qBAAqB,CAAC;
|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ACvD,IAAI,CAiCN;AAED,wBAAsB,qBAAqB,CAAC,EAC1C,MAAM,EACN,OAAO,EACP,UAAU,EACV,MAAM,GACP,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBhB"}
|
package/lib/util/workerEvents.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { Thread } from "@chainsafe/threads";
|
|
2
2
|
import { sleep } from "@lodestar/utils";
|
|
3
|
+
import { EventDirection, NetworkEvent } from "../network/events.js";
|
|
3
4
|
const NANO_TO_SECOND_CONVERSION = 1e9;
|
|
4
|
-
export var EventDirection;
|
|
5
|
-
(function (EventDirection) {
|
|
6
|
-
EventDirection[EventDirection["workerToMain"] = 0] = "workerToMain";
|
|
7
|
-
EventDirection[EventDirection["mainToWorker"] = 1] = "mainToWorker";
|
|
8
|
-
/** Event not emitted through worker boundary */
|
|
9
|
-
EventDirection[EventDirection["none"] = 2] = "none";
|
|
10
|
-
})(EventDirection || (EventDirection = {}));
|
|
11
5
|
/**
|
|
12
6
|
* Bridges events from worker to main thread
|
|
13
7
|
* Each event can only have one direction:
|
|
@@ -37,7 +31,13 @@ export function wireEventsOnWorkerThread(mainEventName, events, parentPort, metr
|
|
|
37
31
|
posted: process.hrtime(),
|
|
38
32
|
data,
|
|
39
33
|
};
|
|
40
|
-
|
|
34
|
+
let transferList = undefined;
|
|
35
|
+
if (eventName === NetworkEvent.pendingGossipsubMessage) {
|
|
36
|
+
const payload = data;
|
|
37
|
+
// Transfer the underlying ArrayBuffer to avoid copy for PendingGossipsubMessage
|
|
38
|
+
transferList = [payload.msg.data.buffer];
|
|
39
|
+
}
|
|
40
|
+
parentPort.postMessage(workerEvent, transferList);
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workerEvents.js","sourceRoot":"","sources":["../../src/util/workerEvents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workerEvents.js","sourceRoot":"","sources":["../../src/util/workerEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAC,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAGtC,OAAO,EAAC,cAAc,EAAE,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAGlE,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAStC;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACtC,aAAqB,EACrB,MAA8C,EAC9C,UAAuB,EACvB,OAAwC,EACxC,cAAwD;IAExD,uCAAuC;IACvC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,IAAkC,EAAE,EAAE;QAC9D,IACE,OAAO,IAAI,KAAK,QAAQ;YACxB,IAAI,CAAC,IAAI,KAAK,aAAa;YAC3B,0FAA0F;YAC1F,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,cAAc,CAAC,YAAY,EAC1D,CAAC;YACD,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACnD,MAAM,oBAAoB,GAAG,GAAG,GAAG,OAAO,GAAG,yBAAyB,CAAC;YACvE,OAAO,EAAE,4CAA4C,CAAC,OAAO,CAC3D,EAAC,SAAS,EAAE,IAAI,CAAC,KAAe,EAAC,EACjC,oBAAoB,CACrB,CAAC;YACF,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAwB,EAAE,CAAC;QAC3E,IAAI,cA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,CAAC,CAAC,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAElF,IAAI,MAAM;YAAE,OAAO;QAEnB,MAAM,EAAE,IAAI,CAAC,gDAAgD,CAAC,CAAC;IACjE,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,wCAAwC,UAAU,GAAG,OAAO,KAAK,CAAC,CAAC;AACrF,CAAC"}
|
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.39.0-dev.
|
|
14
|
+
"version": "1.39.0-dev.46c9c672fd",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -39,11 +39,6 @@
|
|
|
39
39
|
"types": "./lib/db/index.d.ts",
|
|
40
40
|
"import": "./lib/db/index.js"
|
|
41
41
|
},
|
|
42
|
-
"./eth1": {
|
|
43
|
-
"bun": "./src/eth1/index.ts",
|
|
44
|
-
"types": "./lib/eth1/index.d.ts",
|
|
45
|
-
"import": "./lib/eth1/index.js"
|
|
46
|
-
},
|
|
47
42
|
"./metrics": {
|
|
48
43
|
"bun": "./src/metrics/index.ts",
|
|
49
44
|
"types": "./lib/metrics/index.d.ts",
|
|
@@ -93,13 +88,13 @@
|
|
|
93
88
|
"scripts": {
|
|
94
89
|
"clean": "rm -rf lib && rm -f *.tsbuildinfo",
|
|
95
90
|
"build": "tsc -p tsconfig.build.json",
|
|
96
|
-
"build:watch": "
|
|
97
|
-
"build:release": "
|
|
91
|
+
"build:watch": "pnpm run build --watch",
|
|
92
|
+
"build:release": "pnpm clean && pnpm run build",
|
|
98
93
|
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\"",
|
|
99
94
|
"check-types": "tsc",
|
|
100
95
|
"lint": "biome check src/ test/",
|
|
101
|
-
"lint:fix": "
|
|
102
|
-
"test": "
|
|
96
|
+
"lint:fix": "pnpm run lint --write",
|
|
97
|
+
"test": "pnpm test:unit && pnpm test:e2e",
|
|
103
98
|
"test:unit": "vitest run --project unit --project unit-minimal",
|
|
104
99
|
"test:e2e": "vitest run --project e2e --project e2e-mainnet",
|
|
105
100
|
"test:sim": "vitest run test/sim/**/*.test.ts",
|
|
@@ -109,8 +104,8 @@
|
|
|
109
104
|
"test:spec:general": "vitest run --project spec-minimal test/spec/general/",
|
|
110
105
|
"test:spec:minimal": "vitest run --project spec-minimal test/spec/presets/",
|
|
111
106
|
"test:spec:mainnet": "vitest run --project spec-mainnet test/spec/presets/",
|
|
112
|
-
"test:spec": "
|
|
113
|
-
"check-readme": "
|
|
107
|
+
"test:spec": "pnpm test:spec:bls && pnpm test:spec:general && pnpm test:spec:minimal && pnpm test:spec:mainnet",
|
|
108
|
+
"check-readme": "pnpm exec ts-node ../../scripts/check_readme.ts"
|
|
114
109
|
},
|
|
115
110
|
"dependencies": {
|
|
116
111
|
"@chainsafe/as-sha256": "^1.2.0",
|
|
@@ -126,7 +121,6 @@
|
|
|
126
121
|
"@chainsafe/ssz": "^1.2.2",
|
|
127
122
|
"@chainsafe/threads": "^1.11.3",
|
|
128
123
|
"@crate-crypto/node-eth-kzg": "0.9.1",
|
|
129
|
-
"@ethersproject/abi": "^5.7.0",
|
|
130
124
|
"@fastify/bearer-auth": "^10.0.1",
|
|
131
125
|
"@fastify/cors": "^10.0.1",
|
|
132
126
|
"@fastify/swagger": "^9.0.0",
|
|
@@ -140,18 +134,18 @@
|
|
|
140
134
|
"@libp2p/peer-id": "^5.1.0",
|
|
141
135
|
"@libp2p/prometheus-metrics": "^4.3.15",
|
|
142
136
|
"@libp2p/tcp": "^10.1.8",
|
|
143
|
-
"@lodestar/api": "1.39.0-dev.
|
|
144
|
-
"@lodestar/config": "1.39.0-dev.
|
|
145
|
-
"@lodestar/db": "1.39.0-dev.
|
|
146
|
-
"@lodestar/fork-choice": "1.39.0-dev.
|
|
147
|
-
"@lodestar/light-client": "1.39.0-dev.
|
|
148
|
-
"@lodestar/logger": "1.39.0-dev.
|
|
149
|
-
"@lodestar/params": "1.39.0-dev.
|
|
150
|
-
"@lodestar/reqresp": "1.39.0-dev.
|
|
151
|
-
"@lodestar/state-transition": "1.39.0-dev.
|
|
152
|
-
"@lodestar/types": "1.39.0-dev.
|
|
153
|
-
"@lodestar/utils": "1.39.0-dev.
|
|
154
|
-
"@lodestar/validator": "1.39.0-dev.
|
|
137
|
+
"@lodestar/api": "^1.39.0-dev.46c9c672fd",
|
|
138
|
+
"@lodestar/config": "^1.39.0-dev.46c9c672fd",
|
|
139
|
+
"@lodestar/db": "^1.39.0-dev.46c9c672fd",
|
|
140
|
+
"@lodestar/fork-choice": "^1.39.0-dev.46c9c672fd",
|
|
141
|
+
"@lodestar/light-client": "^1.39.0-dev.46c9c672fd",
|
|
142
|
+
"@lodestar/logger": "^1.39.0-dev.46c9c672fd",
|
|
143
|
+
"@lodestar/params": "^1.39.0-dev.46c9c672fd",
|
|
144
|
+
"@lodestar/reqresp": "^1.39.0-dev.46c9c672fd",
|
|
145
|
+
"@lodestar/state-transition": "^1.39.0-dev.46c9c672fd",
|
|
146
|
+
"@lodestar/types": "^1.39.0-dev.46c9c672fd",
|
|
147
|
+
"@lodestar/utils": "^1.39.0-dev.46c9c672fd",
|
|
148
|
+
"@lodestar/validator": "^1.39.0-dev.46c9c672fd",
|
|
155
149
|
"@multiformats/multiaddr": "^12.1.3",
|
|
156
150
|
"datastore-core": "^10.0.2",
|
|
157
151
|
"datastore-fs": "^10.0.6",
|
|
@@ -172,12 +166,20 @@
|
|
|
172
166
|
"xxhash-wasm": "1.0.2"
|
|
173
167
|
},
|
|
174
168
|
"devDependencies": {
|
|
169
|
+
"@chainsafe/swap-or-not-shuffle": "^1.2.1",
|
|
170
|
+
"@libp2p/interface-internal": "^2.3.18",
|
|
171
|
+
"@libp2p/logger": "^5.1.21",
|
|
172
|
+
"@lodestar/spec-test-util": "^1.39.0-dev.46c9c672fd",
|
|
173
|
+
"@types/js-yaml": "^4.0.5",
|
|
175
174
|
"@types/qs": "^6.9.7",
|
|
176
175
|
"@types/tmp": "^0.2.3",
|
|
177
176
|
"it-drain": "^3.0.3",
|
|
178
177
|
"it-pair": "^2.0.6",
|
|
178
|
+
"js-yaml": "^4.1.0",
|
|
179
179
|
"rewiremock": "^3.14.5",
|
|
180
180
|
"rimraf": "^4.4.1",
|
|
181
|
+
"snappy": "^7.2.2",
|
|
182
|
+
"snappyjs": "^0.7.0",
|
|
181
183
|
"tmp": "^0.2.1"
|
|
182
184
|
},
|
|
183
185
|
"keywords": [
|
|
@@ -186,5 +188,5 @@
|
|
|
186
188
|
"beacon",
|
|
187
189
|
"blockchain"
|
|
188
190
|
],
|
|
189
|
-
"gitHead": "
|
|
191
|
+
"gitHead": "d4df511368453e5886067b2b0b6ec914c837f4d0"
|
|
190
192
|
}
|
|
@@ -5,7 +5,7 @@ import {blockToHeader} from "@lodestar/state-transition";
|
|
|
5
5
|
import {RootHex, SignedBeaconBlock, Slot} from "@lodestar/types";
|
|
6
6
|
import {IBeaconChain} from "../../../../chain/interface.js";
|
|
7
7
|
import {GENESIS_SLOT} from "../../../../constants/index.js";
|
|
8
|
-
import {rootHexRegex} from "../../../../
|
|
8
|
+
import {rootHexRegex} from "../../../../execution/engine/utils.js";
|
|
9
9
|
import {ApiError, ValidationError} from "../../errors.js";
|
|
10
10
|
|
|
11
11
|
export function toBeaconHeaderResponse(
|
|
@@ -8,7 +8,12 @@ import {
|
|
|
8
8
|
ProtoBlock,
|
|
9
9
|
} from "@lodestar/fork-choice";
|
|
10
10
|
import {ForkSeq} from "@lodestar/params";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
CachedBeaconStateAllForks,
|
|
13
|
+
isExecutionBlockBodyType,
|
|
14
|
+
isExecutionEnabled,
|
|
15
|
+
isExecutionStateType,
|
|
16
|
+
} from "@lodestar/state-transition";
|
|
12
17
|
import {bellatrix, electra} from "@lodestar/types";
|
|
13
18
|
import {ErrorAborted, Logger, toRootHex} from "@lodestar/utils";
|
|
14
19
|
import {ExecutionPayloadStatus, IExecutionEngine} from "../../execution/engine/interface.js";
|
|
@@ -145,7 +150,9 @@ export async function verifyBlockExecutionPayload(
|
|
|
145
150
|
const block = blockInput.getBlock();
|
|
146
151
|
/** Not null if execution is enabled */
|
|
147
152
|
const executionPayloadEnabled =
|
|
148
|
-
isExecutionStateType(preState0) &&
|
|
153
|
+
isExecutionStateType(preState0) &&
|
|
154
|
+
isExecutionBlockBodyType(block.message.body) &&
|
|
155
|
+
isExecutionEnabled(preState0, block.message)
|
|
149
156
|
? block.message.body.executionPayload
|
|
150
157
|
: null;
|
|
151
158
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {BeaconConfig} from "@lodestar/config";
|
|
1
2
|
import {CachedBeaconStateAllForks, Index2PubkeyCache, getBlockSignatureSets} from "@lodestar/state-transition";
|
|
2
3
|
import {IndexedAttestation, SignedBeaconBlock} from "@lodestar/types";
|
|
3
4
|
import {Logger} from "@lodestar/utils";
|
|
@@ -15,6 +16,7 @@ import {ImportBlockOpts} from "./types.js";
|
|
|
15
16
|
* Since all data is known in advance all signatures are verified at once in parallel.
|
|
16
17
|
*/
|
|
17
18
|
export async function verifyBlocksSignatures(
|
|
19
|
+
config: BeaconConfig,
|
|
18
20
|
index2pubkey: Index2PubkeyCache,
|
|
19
21
|
bls: IBlsVerifier,
|
|
20
22
|
logger: Logger,
|
|
@@ -26,6 +28,7 @@ export async function verifyBlocksSignatures(
|
|
|
26
28
|
): Promise<{verifySignaturesTime: number}> {
|
|
27
29
|
const isValidPromises: Promise<boolean>[] = [];
|
|
28
30
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
31
|
+
const currentSyncCommitteeIndexed = preState0.epochCtx.currentSyncCommitteeIndexed;
|
|
29
32
|
|
|
30
33
|
// Verifies signatures after running state transition, so all SyncCommittee signed roots are known at this point.
|
|
31
34
|
// We must ensure block.slot <= state.slot before running getAllBlockSignatureSets().
|
|
@@ -39,9 +42,16 @@ export async function verifyBlocksSignatures(
|
|
|
39
42
|
: //
|
|
40
43
|
// Verify signatures per block to track which block is invalid
|
|
41
44
|
bls.verifySignatureSets(
|
|
42
|
-
getBlockSignatureSets(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
getBlockSignatureSets(
|
|
46
|
+
config,
|
|
47
|
+
index2pubkey,
|
|
48
|
+
currentSyncCommitteeIndexed,
|
|
49
|
+
block,
|
|
50
|
+
indexedAttestationsByBlock[i],
|
|
51
|
+
{
|
|
52
|
+
skipProposerSignature: opts.validProposerSignature,
|
|
53
|
+
}
|
|
54
|
+
)
|
|
45
55
|
);
|
|
46
56
|
|
|
47
57
|
// getBlockSignatureSets() takes 45ms in benchmarks for 2022Q2 mainnet blocks (100 sigs). When syncing a 32 blocks
|
package/src/chain/chain.ts
CHANGED
|
@@ -14,13 +14,14 @@ import {
|
|
|
14
14
|
EpochShuffling,
|
|
15
15
|
Index2PubkeyCache,
|
|
16
16
|
computeAnchorCheckpoint,
|
|
17
|
+
computeAttestationsRewards,
|
|
18
|
+
computeBlockRewards,
|
|
17
19
|
computeEndSlotAtEpoch,
|
|
18
20
|
computeEpochAtSlot,
|
|
19
21
|
computeStartSlotAtEpoch,
|
|
20
|
-
|
|
22
|
+
computeSyncCommitteeRewards,
|
|
21
23
|
getEffectiveBalanceIncrementsZeroInactive,
|
|
22
24
|
getEffectiveBalancesFromStateBytes,
|
|
23
|
-
isCachedBeaconState,
|
|
24
25
|
processSlots,
|
|
25
26
|
} from "@lodestar/state-transition";
|
|
26
27
|
import {
|
|
@@ -38,12 +39,12 @@ import {
|
|
|
38
39
|
Wei,
|
|
39
40
|
isBlindedBeaconBlock,
|
|
40
41
|
phase0,
|
|
42
|
+
rewards,
|
|
41
43
|
} from "@lodestar/types";
|
|
42
44
|
import {Logger, fromHex, gweiToWei, isErrorAborted, pruneSetToMax, sleep, toRootHex} from "@lodestar/utils";
|
|
43
45
|
import {ProcessShutdownCallback} from "@lodestar/validator";
|
|
44
46
|
import {GENESIS_EPOCH, ZERO_HASH} from "../constants/index.js";
|
|
45
47
|
import {IBeaconDb} from "../db/index.js";
|
|
46
|
-
import {IEth1ForBlockProduction} from "../eth1/index.js";
|
|
47
48
|
import {BuilderStatus} from "../execution/builder/http.js";
|
|
48
49
|
import {IExecutionBuilder, IExecutionEngine} from "../execution/index.js";
|
|
49
50
|
import {Metrics} from "../metrics/index.js";
|
|
@@ -80,9 +81,6 @@ import {AssembledBlockType, BlockType, ProduceResult} from "./produceBlock/index
|
|
|
80
81
|
import {BlockAttributes, produceBlockBody, produceCommonBlockBody} from "./produceBlock/produceBlockBody.js";
|
|
81
82
|
import {QueuedStateRegenerator, RegenCaller} from "./regen/index.js";
|
|
82
83
|
import {ReprocessController} from "./reprocess.js";
|
|
83
|
-
import {AttestationsRewards, computeAttestationsRewards} from "./rewards/attestationsRewards.js";
|
|
84
|
-
import {BlockRewards, computeBlockRewards} from "./rewards/blockRewards.js";
|
|
85
|
-
import {SyncCommitteeRewards, computeSyncCommitteeRewards} from "./rewards/syncCommitteeRewards.js";
|
|
86
84
|
import {
|
|
87
85
|
SeenAggregators,
|
|
88
86
|
SeenAttesters,
|
|
@@ -117,7 +115,6 @@ const DEFAULT_MAX_CACHED_PRODUCED_RESULTS = 4;
|
|
|
117
115
|
export class BeaconChain implements IBeaconChain {
|
|
118
116
|
readonly genesisTime: UintNum64;
|
|
119
117
|
readonly genesisValidatorsRoot: Root;
|
|
120
|
-
readonly eth1: IEth1ForBlockProduction;
|
|
121
118
|
readonly executionEngine: IExecutionEngine;
|
|
122
119
|
readonly executionBuilder?: IExecutionBuilder;
|
|
123
120
|
// Expose config for convenience in modularized functions
|
|
@@ -144,7 +141,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
144
141
|
readonly aggregatedAttestationPool: AggregatedAttestationPool;
|
|
145
142
|
readonly syncCommitteeMessagePool: SyncCommitteeMessagePool;
|
|
146
143
|
readonly syncContributionAndProofPool;
|
|
147
|
-
readonly opPool
|
|
144
|
+
readonly opPool: OpPool;
|
|
148
145
|
|
|
149
146
|
// Gossip seen cache
|
|
150
147
|
readonly seenAttesters = new SeenAttesters();
|
|
@@ -206,6 +203,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
206
203
|
{
|
|
207
204
|
privateKey,
|
|
208
205
|
config,
|
|
206
|
+
pubkey2index,
|
|
207
|
+
index2pubkey,
|
|
209
208
|
db,
|
|
210
209
|
dbName,
|
|
211
210
|
dataDir,
|
|
@@ -216,12 +215,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
216
215
|
validatorMonitor,
|
|
217
216
|
anchorState,
|
|
218
217
|
isAnchorStateFinalized,
|
|
219
|
-
eth1,
|
|
220
218
|
executionEngine,
|
|
221
219
|
executionBuilder,
|
|
222
220
|
}: {
|
|
223
221
|
privateKey: PrivateKey;
|
|
224
222
|
config: BeaconConfig;
|
|
223
|
+
pubkey2index: PubkeyIndexMap;
|
|
224
|
+
index2pubkey: Index2PubkeyCache;
|
|
225
225
|
db: IBeaconDb;
|
|
226
226
|
dbName: string;
|
|
227
227
|
dataDir: string;
|
|
@@ -231,9 +231,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
231
231
|
clock?: IClock;
|
|
232
232
|
metrics: Metrics | null;
|
|
233
233
|
validatorMonitor: ValidatorMonitor | null;
|
|
234
|
-
anchorState:
|
|
234
|
+
anchorState: CachedBeaconStateAllForks;
|
|
235
235
|
isAnchorStateFinalized: boolean;
|
|
236
|
-
eth1: IEth1ForBlockProduction;
|
|
237
236
|
executionEngine: IExecutionEngine;
|
|
238
237
|
executionBuilder?: IExecutionBuilder;
|
|
239
238
|
}
|
|
@@ -248,7 +247,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
248
247
|
this.genesisTime = anchorState.genesisTime;
|
|
249
248
|
this.anchorStateLatestBlockSlot = anchorState.latestBlockHeader.slot;
|
|
250
249
|
this.genesisValidatorsRoot = anchorState.genesisValidatorsRoot;
|
|
251
|
-
this.eth1 = eth1;
|
|
252
250
|
this.executionEngine = executionEngine;
|
|
253
251
|
this.executionBuilder = executionBuilder;
|
|
254
252
|
const signal = this.abortController.signal;
|
|
@@ -265,6 +263,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
265
263
|
this.aggregatedAttestationPool = new AggregatedAttestationPool(this.config, metrics);
|
|
266
264
|
this.syncCommitteeMessagePool = new SyncCommitteeMessagePool(config, clock, this.opts?.preaggregateSlotDistance);
|
|
267
265
|
this.syncContributionAndProofPool = new SyncContributionAndProofPool(config, clock, metrics, logger);
|
|
266
|
+
this.opPool = new OpPool(config);
|
|
268
267
|
|
|
269
268
|
this.seenAggregatedAttestations = new SeenAggregatedAttestations(metrics);
|
|
270
269
|
this.seenContributionAndProof = new SeenContributionAndProof(metrics);
|
|
@@ -291,39 +290,25 @@ export class BeaconChain implements IBeaconChain {
|
|
|
291
290
|
logger,
|
|
292
291
|
});
|
|
293
292
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
// pubkeys takes ~30 seconds for 350k keys (mainnet 2022Q2).
|
|
297
|
-
// When the BeaconStateCache is created in eth1 genesis builder it may be incorrect. Until we can ensure that
|
|
298
|
-
// it's safe to re-use _ANY_ BeaconStateCache, this option is disabled by default and only used in tests.
|
|
299
|
-
const cachedState =
|
|
300
|
-
isCachedBeaconState(anchorState) && opts.skipCreateStateCacheIfAvailable
|
|
301
|
-
? anchorState
|
|
302
|
-
: createCachedBeaconState(anchorState, {
|
|
303
|
-
config,
|
|
304
|
-
pubkey2index: new PubkeyIndexMap(),
|
|
305
|
-
index2pubkey: [],
|
|
306
|
-
});
|
|
307
|
-
this._earliestAvailableSlot = cachedState.slot;
|
|
308
|
-
|
|
309
|
-
this.shufflingCache = cachedState.epochCtx.shufflingCache = new ShufflingCache(metrics, logger, this.opts, [
|
|
293
|
+
this._earliestAvailableSlot = anchorState.slot;
|
|
294
|
+
this.shufflingCache = anchorState.epochCtx.shufflingCache = new ShufflingCache(metrics, logger, this.opts, [
|
|
310
295
|
{
|
|
311
|
-
shuffling:
|
|
312
|
-
decisionRoot:
|
|
296
|
+
shuffling: anchorState.epochCtx.previousShuffling,
|
|
297
|
+
decisionRoot: anchorState.epochCtx.previousDecisionRoot,
|
|
313
298
|
},
|
|
314
299
|
{
|
|
315
|
-
shuffling:
|
|
316
|
-
decisionRoot:
|
|
300
|
+
shuffling: anchorState.epochCtx.currentShuffling,
|
|
301
|
+
decisionRoot: anchorState.epochCtx.currentDecisionRoot,
|
|
317
302
|
},
|
|
318
303
|
{
|
|
319
|
-
shuffling:
|
|
320
|
-
decisionRoot:
|
|
304
|
+
shuffling: anchorState.epochCtx.nextShuffling,
|
|
305
|
+
decisionRoot: anchorState.epochCtx.nextDecisionRoot,
|
|
321
306
|
},
|
|
322
307
|
]);
|
|
323
308
|
|
|
324
|
-
//
|
|
325
|
-
this.pubkey2index =
|
|
326
|
-
this.index2pubkey =
|
|
309
|
+
// Global cache of validators pubkey/index mapping
|
|
310
|
+
this.pubkey2index = pubkey2index;
|
|
311
|
+
this.index2pubkey = index2pubkey;
|
|
327
312
|
|
|
328
313
|
const fileDataStore = opts.nHistoricalStatesFileDataStore ?? true;
|
|
329
314
|
const blockStateCache = this.opts.nHistoricalStates
|
|
@@ -339,6 +324,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
339
324
|
this.cpStateDatastore = fileDataStore ? new FileCPStateDatastore(dataDir) : new DbCPStateDatastore(this.db);
|
|
340
325
|
checkpointStateCache = new PersistentCheckpointStateCache(
|
|
341
326
|
{
|
|
327
|
+
config,
|
|
342
328
|
metrics,
|
|
343
329
|
logger,
|
|
344
330
|
clock,
|
|
@@ -353,15 +339,15 @@ export class BeaconChain implements IBeaconChain {
|
|
|
353
339
|
}
|
|
354
340
|
|
|
355
341
|
const {checkpoint} = computeAnchorCheckpoint(config, anchorState);
|
|
356
|
-
blockStateCache.add(
|
|
357
|
-
blockStateCache.setHeadState(
|
|
358
|
-
checkpointStateCache.add(checkpoint,
|
|
342
|
+
blockStateCache.add(anchorState);
|
|
343
|
+
blockStateCache.setHeadState(anchorState);
|
|
344
|
+
checkpointStateCache.add(checkpoint, anchorState);
|
|
359
345
|
|
|
360
346
|
const forkChoice = initializeForkChoice(
|
|
361
347
|
config,
|
|
362
348
|
emitter,
|
|
363
349
|
clock.currentSlot,
|
|
364
|
-
|
|
350
|
+
anchorState,
|
|
365
351
|
isAnchorStateFinalized,
|
|
366
352
|
opts,
|
|
367
353
|
this.justifiedBalancesGetter.bind(this),
|
|
@@ -417,15 +403,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
417
403
|
signal
|
|
418
404
|
);
|
|
419
405
|
|
|
420
|
-
// Stop polling eth1 data if anchor state is in Electra AND deposit_requests_start_index is reached
|
|
421
|
-
const anchorStateFork = this.config.getForkName(anchorState.slot);
|
|
422
|
-
if (isForkPostElectra(anchorStateFork)) {
|
|
423
|
-
const {eth1DepositIndex, depositRequestsStartIndex} = anchorState as BeaconStateElectra;
|
|
424
|
-
if (eth1DepositIndex === Number(depositRequestsStartIndex)) {
|
|
425
|
-
this.eth1.stopPollingEth1Data();
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
406
|
// always run PrepareNextSlotScheduler except for fork_choice spec tests
|
|
430
407
|
if (!opts?.disablePrepareNextSlot) {
|
|
431
408
|
new PrepareNextSlotScheduler(this, this.config, metrics, this.logger, signal);
|
|
@@ -1309,7 +1286,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1309
1286
|
}
|
|
1310
1287
|
}
|
|
1311
1288
|
|
|
1312
|
-
async getBlockRewards(block: BeaconBlock | BlindedBeaconBlock): Promise<BlockRewards> {
|
|
1289
|
+
async getBlockRewards(block: BeaconBlock | BlindedBeaconBlock): Promise<rewards.BlockRewards> {
|
|
1313
1290
|
let preState = this.regen.getPreStateSync(block);
|
|
1314
1291
|
|
|
1315
1292
|
if (preState === null) {
|
|
@@ -1320,13 +1297,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1320
1297
|
|
|
1321
1298
|
const postState = this.regen.getStateSync(toRootHex(block.stateRoot)) ?? undefined;
|
|
1322
1299
|
|
|
1323
|
-
return computeBlockRewards(block, preState.clone(), postState?.clone());
|
|
1300
|
+
return computeBlockRewards(this.config, block, preState.clone(), postState?.clone());
|
|
1324
1301
|
}
|
|
1325
1302
|
|
|
1326
1303
|
async getAttestationsRewards(
|
|
1327
1304
|
epoch: Epoch,
|
|
1328
1305
|
validatorIds?: (ValidatorIndex | string)[]
|
|
1329
|
-
): Promise<{rewards: AttestationsRewards; executionOptimistic: boolean; finalized: boolean}> {
|
|
1306
|
+
): Promise<{rewards: rewards.AttestationsRewards; executionOptimistic: boolean; finalized: boolean}> {
|
|
1330
1307
|
// We use end slot of (epoch + 1) to ensure we have seen all attestations. On-time or late. Any late attestation beyond this slot is not considered
|
|
1331
1308
|
const slot = computeEndSlotAtEpoch(epoch + 1);
|
|
1332
1309
|
const stateResult = await this.getStateBySlot(slot, {allowRegen: false}); // No regen if state not in cache
|
|
@@ -1344,7 +1321,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1344
1321
|
throw Error(`State is not in cache for slot ${slot}`);
|
|
1345
1322
|
}
|
|
1346
1323
|
|
|
1347
|
-
const rewards = await computeAttestationsRewards(this.pubkey2index, cachedState, validatorIds);
|
|
1324
|
+
const rewards = await computeAttestationsRewards(this.config, this.pubkey2index, cachedState, validatorIds);
|
|
1348
1325
|
|
|
1349
1326
|
return {rewards, executionOptimistic, finalized};
|
|
1350
1327
|
}
|
|
@@ -1352,7 +1329,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1352
1329
|
async getSyncCommitteeRewards(
|
|
1353
1330
|
block: BeaconBlock | BlindedBeaconBlock,
|
|
1354
1331
|
validatorIds?: (ValidatorIndex | string)[]
|
|
1355
|
-
): Promise<SyncCommitteeRewards> {
|
|
1332
|
+
): Promise<rewards.SyncCommitteeRewards> {
|
|
1356
1333
|
let preState = this.regen.getPreStateSync(block);
|
|
1357
1334
|
|
|
1358
1335
|
if (preState === null) {
|
|
@@ -1361,6 +1338,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1361
1338
|
|
|
1362
1339
|
preState = processSlots(preState, block.slot); // Dial preState's slot to block.slot
|
|
1363
1340
|
|
|
1364
|
-
return computeSyncCommitteeRewards(this.index2pubkey, block, preState.clone(), validatorIds);
|
|
1341
|
+
return computeSyncCommitteeRewards(this.config, this.index2pubkey, block, preState.clone(), validatorIds);
|
|
1365
1342
|
}
|
|
1366
1343
|
}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
getBlockRootAtSlot,
|
|
19
19
|
getEffectiveBalanceIncrementsZeroInactive,
|
|
20
20
|
isExecutionStateType,
|
|
21
|
+
isMergeTransitionComplete,
|
|
21
22
|
} from "@lodestar/state-transition";
|
|
22
23
|
import {Slot, ssz} from "@lodestar/types";
|
|
23
24
|
import {Logger, toRootHex} from "@lodestar/utils";
|
|
@@ -134,7 +135,7 @@ export function initializeForkChoiceFromFinalizedState(
|
|
|
134
135
|
unrealizedFinalizedEpoch: finalizedCheckpoint.epoch,
|
|
135
136
|
unrealizedFinalizedRoot: toRootHex(finalizedCheckpoint.root),
|
|
136
137
|
|
|
137
|
-
...(isExecutionStateType(state)
|
|
138
|
+
...(isExecutionStateType(state) && isMergeTransitionComplete(state)
|
|
138
139
|
? {
|
|
139
140
|
executionPayloadBlockHash: toRootHex(state.latestExecutionPayloadHeader.blockHash),
|
|
140
141
|
executionPayloadNumber: state.latestExecutionPayloadHeader.blockNumber,
|
|
@@ -215,7 +216,7 @@ export function initializeForkChoiceFromUnfinalizedState(
|
|
|
215
216
|
unrealizedFinalizedEpoch: finalizedCheckpoint.epoch,
|
|
216
217
|
unrealizedFinalizedRoot: toRootHex(finalizedCheckpoint.root),
|
|
217
218
|
|
|
218
|
-
...(isExecutionStateType(unfinalizedState)
|
|
219
|
+
...(isExecutionStateType(unfinalizedState) && isMergeTransitionComplete(unfinalizedState)
|
|
219
220
|
? {
|
|
220
221
|
executionPayloadBlockHash: toRootHex(unfinalizedState.latestExecutionPayloadHeader.blockHash),
|
|
221
222
|
executionPayloadNumber: unfinalizedState.latestExecutionPayloadHeader.blockNumber,
|