@lodestar/beacon-node 1.42.0-dev.7b5ce3932d → 1.42.0-dev.83dedda569
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/api/impl/beacon/blocks/index.js +1 -1
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +27 -32
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +4 -4
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +7 -10
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +4 -6
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/proof/index.d.ts.map +1 -1
- package/lib/api/impl/proof/index.js +2 -6
- package/lib/api/impl/proof/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +27 -27
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/impl/validator/utils.d.ts +2 -2
- package/lib/api/impl/validator/utils.d.ts.map +1 -1
- package/lib/api/impl/validator/utils.js +3 -3
- package/lib/api/impl/validator/utils.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +2 -6
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +3 -23
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -0
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/balancesCache.d.ts +2 -2
- package/lib/chain/balancesCache.d.ts.map +1 -1
- package/lib/chain/balancesCache.js +4 -4
- package/lib/chain/balancesCache.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +1 -0
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +1 -0
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +3 -3
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +9 -9
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +4 -5
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.js +1 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +2 -2
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.d.ts +2 -2
- package/lib/chain/blocks/utils/checkpoint.d.ts.map +1 -1
- package/lib/chain/blocks/utils/checkpoint.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts +2 -2
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +4 -4
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +3 -3
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +3 -3
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +12 -12
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +47 -39
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +2 -2
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/errors/blockError.d.ts +4 -4
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +4 -4
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +27 -23
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/initState.d.ts +2 -2
- package/lib/chain/initState.d.ts.map +1 -1
- package/lib/chain/initState.js +1 -1
- package/lib/chain/initState.js.map +1 -1
- package/lib/chain/interface.d.ts +11 -12
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +4 -4
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +6 -6
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +10 -13
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +3 -3
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +7 -7
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +2 -2
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +2 -2
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +3 -3
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +4 -4
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +3 -4
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +12 -16
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +13 -13
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +14 -14
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +6 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +6 -6
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/serializeState.d.ts +2 -2
- package/lib/chain/serializeState.d.ts.map +1 -1
- package/lib/chain/serializeState.js +1 -1
- package/lib/chain/serializeState.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +2 -2
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +3 -4
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +6 -6
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +11 -11
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +12 -16
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +14 -14
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -3
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/blobSidecar.js +1 -1
- 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.js +2 -2
- package/lib/chain/validation/blsToExecutionChange.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +1 -1
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +4 -4
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +2 -3
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +1 -2
- package/lib/chain/validation/payloadAttestationMessage.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/contributionAndProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/contributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js +1 -1
- package/lib/chain/validation/signatureSets/contributionAndProof.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommittee.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeContribution.js.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.d.ts.map +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js +1 -1
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +4 -4
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +13 -12
- 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 +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +3 -3
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +3 -3
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +9 -7
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +12 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +19 -15
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +15 -0
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +2 -729
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/interface.d.ts +4 -2
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +5 -0
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +4 -2
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +9 -3
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.js +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +9 -7
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +12 -7
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +99 -78
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +9 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +8 -2
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +7 -1
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -2
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +1 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +3 -3
- package/lib/node/notifier.js.map +1 -1
- package/lib/sync/backfill/backfill.d.ts +2 -2
- package/lib/sync/backfill/backfill.d.ts.map +1 -1
- package/lib/sync/backfill/backfill.js +2 -2
- package/lib/sync/backfill/backfill.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +3 -9
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +8 -41
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +1 -1
- package/src/api/impl/beacon/pool/index.ts +1 -1
- package/src/api/impl/beacon/state/index.ts +29 -41
- package/src/api/impl/beacon/state/utils.ts +11 -25
- package/src/api/impl/lodestar/index.ts +4 -8
- package/src/api/impl/proof/index.ts +2 -9
- package/src/api/impl/validator/index.ts +29 -41
- package/src/api/impl/validator/utils.ts +4 -7
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +6 -36
- package/src/chain/archiveStore/historicalState/worker.ts +1 -0
- package/src/chain/balancesCache.ts +5 -11
- package/src/chain/blocks/blockInput/types.ts +1 -0
- package/src/chain/blocks/importBlock.ts +11 -14
- package/src/chain/blocks/importExecutionPayload.ts +6 -11
- package/src/chain/blocks/index.ts +1 -1
- package/src/chain/blocks/types.ts +2 -2
- package/src/chain/blocks/utils/checkpoint.ts +2 -2
- package/src/chain/blocks/verifyBlock.ts +5 -10
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +5 -10
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -3
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -8
- package/src/chain/chain.ts +75 -67
- package/src/chain/emitter.ts +2 -2
- package/src/chain/errors/blockError.ts +4 -4
- package/src/chain/forkChoice/index.ts +33 -42
- package/src/chain/initState.ts +7 -2
- package/src/chain/interface.ts +12 -13
- package/src/chain/lightClient/index.ts +9 -22
- package/src/chain/opPools/aggregatedAttestationPool.ts +15 -21
- package/src/chain/opPools/opPool.ts +13 -14
- package/src/chain/opPools/utils.ts +3 -3
- package/src/chain/prepareNextSlot.ts +6 -8
- package/src/chain/produceBlock/computeNewStateRoot.ts +6 -10
- package/src/chain/produceBlock/produceBlockBody.ts +22 -49
- package/src/chain/regen/interface.ts +13 -17
- package/src/chain/regen/queued.ts +16 -20
- package/src/chain/regen/regen.ts +16 -17
- package/src/chain/serializeState.ts +3 -3
- package/src/chain/shufflingCache.ts +5 -7
- package/src/chain/stateCache/fifoBlockStateCache.ts +7 -7
- package/src/chain/stateCache/persistentCheckpointsCache.ts +27 -42
- package/src/chain/stateCache/types.ts +14 -18
- package/src/chain/validation/attesterSlashing.ts +3 -3
- package/src/chain/validation/blobSidecar.ts +1 -1
- package/src/chain/validation/block.ts +2 -4
- package/src/chain/validation/blsToExecutionChange.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +1 -1
- package/src/chain/validation/executionPayloadBid.ts +3 -7
- package/src/chain/validation/executionPayloadEnvelope.ts +2 -8
- package/src/chain/validation/payloadAttestationMessage.ts +2 -4
- package/src/chain/validation/proposerSlashing.ts +1 -1
- package/src/chain/validation/signatureSets/contributionAndProof.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -7
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -2
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -7
- package/src/chain/validation/syncCommittee.ts +21 -20
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -10
- package/src/chain/validation/voluntaryExit.ts +3 -8
- package/src/chain/validatorMonitor.ts +12 -11
- package/src/metrics/metrics/lodestar.ts +23 -19
- package/src/network/gossip/encoding.ts +16 -0
- package/src/network/interface.ts +15 -2
- package/src/network/libp2p/index.ts +5 -0
- package/src/network/network.ts +32 -4
- package/src/network/processor/extractSlotRootFns.ts +1 -1
- package/src/network/processor/gossipHandlers.ts +9 -8
- package/src/network/processor/index.ts +110 -89
- package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +13 -0
- package/src/node/nodejs.ts +3 -5
- package/src/node/notifier.ts +4 -10
- package/src/sync/backfill/backfill.ts +3 -3
- package/src/sync/unknownBlock.ts +10 -50
- package/src/util/types.ts +6 -0
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import {CheckpointWithHex} from "@lodestar/fork-choice";
|
|
2
|
-
import {
|
|
3
|
-
CachedBeaconStateAllForks,
|
|
4
|
-
EffectiveBalanceIncrements,
|
|
5
|
-
computeStartSlotAtEpoch,
|
|
6
|
-
getBlockRootAtSlot,
|
|
7
|
-
getEffectiveBalanceIncrementsZeroInactive,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
2
|
+
import {EffectiveBalanceIncrements, IBeaconStateView, computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
9
3
|
import {Epoch, RootHex} from "@lodestar/types";
|
|
10
4
|
import {toRootHex} from "@lodestar/utils";
|
|
11
5
|
|
|
@@ -29,11 +23,11 @@ export class CheckpointBalancesCache {
|
|
|
29
23
|
* `state.current_epoch`. If there is not already some entry for the given block root, then
|
|
30
24
|
* add the effective balances from the `state` to the cache.
|
|
31
25
|
*/
|
|
32
|
-
processState(blockRootHex: RootHex, state:
|
|
33
|
-
const epoch = state.
|
|
26
|
+
processState(blockRootHex: RootHex, state: IBeaconStateView): void {
|
|
27
|
+
const epoch = state.epoch;
|
|
34
28
|
const epochBoundarySlot = computeStartSlotAtEpoch(epoch);
|
|
35
29
|
const epochBoundaryRoot =
|
|
36
|
-
epochBoundarySlot === state.slot ? blockRootHex : toRootHex(getBlockRootAtSlot(
|
|
30
|
+
epochBoundarySlot === state.slot ? blockRootHex : toRootHex(state.getBlockRootAtSlot(epochBoundarySlot));
|
|
37
31
|
|
|
38
32
|
const index = this.items.findIndex((item) => item.epoch === epoch && item.rootHex === epochBoundaryRoot);
|
|
39
33
|
if (index === -1) {
|
|
@@ -41,7 +35,7 @@ export class CheckpointBalancesCache {
|
|
|
41
35
|
this.items.shift();
|
|
42
36
|
}
|
|
43
37
|
// expect to reach this once per epoch
|
|
44
|
-
this.items.push({epoch, rootHex: epochBoundaryRoot, balances: getEffectiveBalanceIncrementsZeroInactive(
|
|
38
|
+
this.items.push({epoch, rootHex: epochBoundaryRoot, balances: state.getEffectiveBalanceIncrementsZeroInactive()});
|
|
45
39
|
}
|
|
46
40
|
}
|
|
47
41
|
|
|
@@ -16,6 +16,7 @@ export type DAData = null | deneb.BlobSidecars | fulu.DataColumnSidecars;
|
|
|
16
16
|
* sources so each should be labelled individually.
|
|
17
17
|
*/
|
|
18
18
|
export enum BlockInputSource {
|
|
19
|
+
network_processor = "network_processor",
|
|
19
20
|
gossip = "gossip",
|
|
20
21
|
api = "api",
|
|
21
22
|
engine = "engine",
|
|
@@ -18,15 +18,12 @@ import {
|
|
|
18
18
|
SLOTS_PER_EPOCH,
|
|
19
19
|
} from "@lodestar/params";
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
EpochCache,
|
|
21
|
+
IBeaconStateView,
|
|
23
22
|
RootCache,
|
|
24
23
|
computeEpochAtSlot,
|
|
25
24
|
computeStartSlotAtEpoch,
|
|
26
25
|
computeTimeAtSlot,
|
|
27
|
-
isExecutionStateType,
|
|
28
26
|
isStartSlotOfEpoch,
|
|
29
|
-
isStateValidatorsNodesPopulated,
|
|
30
27
|
} from "@lodestar/state-transition";
|
|
31
28
|
import {
|
|
32
29
|
Attestation,
|
|
@@ -188,7 +185,7 @@ export async function importBlock(
|
|
|
188
185
|
const attDataRoot = toRootHex(ssz.phase0.AttestationData.hashTreeRoot(indexedAttestation.data));
|
|
189
186
|
addAttestation.call(
|
|
190
187
|
this,
|
|
191
|
-
postState
|
|
188
|
+
postState,
|
|
192
189
|
target,
|
|
193
190
|
attDataRoot,
|
|
194
191
|
attestation as Attestation<ForkPostElectra>,
|
|
@@ -375,7 +372,7 @@ export async function importBlock(
|
|
|
375
372
|
try {
|
|
376
373
|
this.lightClientServer?.onImportBlockHead(
|
|
377
374
|
block.message as BeaconBlock<ForkPostAltair>,
|
|
378
|
-
postState
|
|
375
|
+
postState,
|
|
379
376
|
parentBlockSlot
|
|
380
377
|
);
|
|
381
378
|
} catch (e) {
|
|
@@ -396,11 +393,11 @@ export async function importBlock(
|
|
|
396
393
|
// and the block is weak and can potentially be reorged out.
|
|
397
394
|
let shouldOverrideFcu = false;
|
|
398
395
|
|
|
399
|
-
if (blockSlot >= currentSlot && isExecutionStateType
|
|
396
|
+
if (blockSlot >= currentSlot && postState.isExecutionStateType) {
|
|
400
397
|
let notOverrideFcuReason = NotReorgedReason.Unknown;
|
|
401
398
|
const proposalSlot = blockSlot + 1;
|
|
402
399
|
try {
|
|
403
|
-
const proposerIndex = postState.
|
|
400
|
+
const proposerIndex = postState.getBeaconProposer(proposalSlot);
|
|
404
401
|
const feeRecipient = this.beaconProposerCache.get(proposerIndex);
|
|
405
402
|
|
|
406
403
|
if (feeRecipient) {
|
|
@@ -480,7 +477,7 @@ export async function importBlock(
|
|
|
480
477
|
}
|
|
481
478
|
}
|
|
482
479
|
|
|
483
|
-
if (!isStateValidatorsNodesPopulated(
|
|
480
|
+
if (!postState.isStateValidatorsNodesPopulated()) {
|
|
484
481
|
this.logger.verbose("After importBlock caching postState without SSZ cache", {slot: postState.slot});
|
|
485
482
|
}
|
|
486
483
|
|
|
@@ -502,7 +499,7 @@ export async function importBlock(
|
|
|
502
499
|
// Note: in-lined code from previos handler of ChainEvent.checkpoint
|
|
503
500
|
this.logger.verbose("Checkpoint processed", toCheckpointHexPayload(cp, payloadPresent));
|
|
504
501
|
|
|
505
|
-
const activeValidatorsCount = checkpointState.
|
|
502
|
+
const activeValidatorsCount = checkpointState.activeValidatorCount;
|
|
506
503
|
this.metrics?.currentActiveValidators.set(activeValidatorsCount);
|
|
507
504
|
this.metrics?.currentValidators.set({status: "active"}, activeValidatorsCount);
|
|
508
505
|
|
|
@@ -587,7 +584,7 @@ export async function importBlock(
|
|
|
587
584
|
this.validatorMonitor?.registerSyncAggregateInBlock(
|
|
588
585
|
blockEpoch,
|
|
589
586
|
(block as altair.SignedBeaconBlock).message.body.syncAggregate,
|
|
590
|
-
fullyVerifiedBlock.postState.
|
|
587
|
+
fullyVerifiedBlock.postState.currentSyncCommitteeIndexed.validatorIndices
|
|
591
588
|
);
|
|
592
589
|
}
|
|
593
590
|
|
|
@@ -629,7 +626,7 @@ export async function importBlock(
|
|
|
629
626
|
export function addAttestationPreElectra(
|
|
630
627
|
this: BeaconChain,
|
|
631
628
|
// added to have the same signature as addAttestationPostElectra
|
|
632
|
-
_:
|
|
629
|
+
_: IBeaconStateView,
|
|
633
630
|
target: phase0.Checkpoint,
|
|
634
631
|
attDataRoot: string,
|
|
635
632
|
attestation: Attestation,
|
|
@@ -646,7 +643,7 @@ export function addAttestationPreElectra(
|
|
|
646
643
|
|
|
647
644
|
export function addAttestationPostElectra(
|
|
648
645
|
this: BeaconChain,
|
|
649
|
-
|
|
646
|
+
state: IBeaconStateView,
|
|
650
647
|
target: phase0.Checkpoint,
|
|
651
648
|
attDataRoot: string,
|
|
652
649
|
attestation: Attestation<ForkPostElectra>,
|
|
@@ -664,7 +661,7 @@ export function addAttestationPostElectra(
|
|
|
664
661
|
} else {
|
|
665
662
|
const attSlot = attestation.data.slot;
|
|
666
663
|
const attEpoch = computeEpochAtSlot(attSlot);
|
|
667
|
-
const decisionRoot =
|
|
664
|
+
const decisionRoot = state.getShufflingDecisionRoot(attEpoch);
|
|
668
665
|
const committees = this.shufflingCache.getBeaconCommittees(attEpoch, decisionRoot, attSlot, committeeIndices);
|
|
669
666
|
const aggregationBools = attestation.aggregationBits.toBoolArray();
|
|
670
667
|
let offset = 0;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ForkName} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
BeaconStateView,
|
|
5
|
-
CachedBeaconStateGloas,
|
|
6
|
-
getExecutionPayloadEnvelopeSignatureSet,
|
|
7
|
-
} from "@lodestar/state-transition";
|
|
8
|
-
import {processExecutionPayloadEnvelope} from "@lodestar/state-transition/block";
|
|
3
|
+
import {getExecutionPayloadEnvelopeSignatureSet} from "@lodestar/state-transition";
|
|
9
4
|
import {byteArrayEquals, fromHex, toRootHex} from "@lodestar/utils";
|
|
10
5
|
import {ExecutionPayloadStatus} from "../../execution/index.js";
|
|
11
6
|
import {isQueueErrorAborted} from "../../util/queue/index.js";
|
|
@@ -93,12 +88,12 @@ export async function importExecutionPayload(
|
|
|
93
88
|
|
|
94
89
|
// 3. Get pre-state for processExecutionPayloadEnvelope
|
|
95
90
|
// We need the block state (post-block, pre-payload) to process the envelope
|
|
96
|
-
const blockState =
|
|
91
|
+
const blockState = await this.regen.getBlockSlotState(
|
|
97
92
|
protoBlock,
|
|
98
93
|
protoBlock.slot,
|
|
99
94
|
{dontTransferCache: true},
|
|
100
95
|
RegenCaller.processBlock
|
|
101
|
-
)
|
|
96
|
+
);
|
|
102
97
|
|
|
103
98
|
// 4. Run verification steps in parallel
|
|
104
99
|
// Note: No data availability check needed here - importExecutionPayload is only
|
|
@@ -117,8 +112,8 @@ export async function importExecutionPayload(
|
|
|
117
112
|
: (async () => {
|
|
118
113
|
const signatureSet = getExecutionPayloadEnvelopeSignatureSet(
|
|
119
114
|
this.config,
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
this.pubkeyCache,
|
|
116
|
+
blockState,
|
|
122
117
|
envelope,
|
|
123
118
|
payloadInput.proposerIndex
|
|
124
119
|
);
|
|
@@ -130,7 +125,7 @@ export async function importExecutionPayload(
|
|
|
130
125
|
(async () => {
|
|
131
126
|
try {
|
|
132
127
|
return {
|
|
133
|
-
postPayloadState: processExecutionPayloadEnvelope(
|
|
128
|
+
postPayloadState: blockState.processExecutionPayloadEnvelope(envelope, {
|
|
134
129
|
verifySignature: false,
|
|
135
130
|
verifyStateRoot: false,
|
|
136
131
|
}),
|
|
@@ -126,7 +126,7 @@ export async function processBlocks(
|
|
|
126
126
|
const {state} = err.type;
|
|
127
127
|
const forkTypes = this.config.getForkTypes(blockSlot);
|
|
128
128
|
this.persistInvalidSszValue(forkTypes.SignedBeaconBlock, signedBlock, `${blockSlot}_invalid_signature`);
|
|
129
|
-
this.
|
|
129
|
+
this.persistInvalidSszBytes("BeaconState", state.serialize(), `${state.slot}_invalid_signature`);
|
|
130
130
|
} else if (err.type.code === BlockErrorCode.INVALID_STATE_ROOT) {
|
|
131
131
|
const {signedBlock} = err;
|
|
132
132
|
const blockSlot = signedBlock.message.slot;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {MaybeValidExecutionStatus} from "@lodestar/fork-choice";
|
|
3
3
|
import {ForkSeq} from "@lodestar/params";
|
|
4
|
-
import {
|
|
4
|
+
import {DataAvailabilityStatus, IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
5
5
|
import type {IndexedAttestation, Slot, fulu} from "@lodestar/types";
|
|
6
6
|
import {IBlockInput} from "./blockInput/types.js";
|
|
7
7
|
|
|
@@ -93,7 +93,7 @@ export type ImportBlockOpts = {
|
|
|
93
93
|
*/
|
|
94
94
|
export type FullyVerifiedBlock = {
|
|
95
95
|
blockInput: IBlockInput;
|
|
96
|
-
postState:
|
|
96
|
+
postState: IBeaconStateView;
|
|
97
97
|
parentBlockSlot: Slot;
|
|
98
98
|
proposerBalanceDelta: number;
|
|
99
99
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
3
3
|
import {phase0, ssz} from "@lodestar/types";
|
|
4
4
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Compute a Checkpoint type from `state.latestBlockHeader`
|
|
8
8
|
*/
|
|
9
|
-
export function getCheckpointFromState(checkpointState:
|
|
9
|
+
export function getCheckpointFromState(checkpointState: IBeaconStateView): phase0.Checkpoint {
|
|
10
10
|
const slot = checkpointState.slot;
|
|
11
11
|
|
|
12
12
|
if (slot % SLOTS_PER_EPOCH !== 0) {
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
2
2
|
import {ForkName, isForkPostFulu} from "@lodestar/params";
|
|
3
|
-
import {
|
|
4
|
-
CachedBeaconStateAllForks,
|
|
5
|
-
DataAvailabilityStatus,
|
|
6
|
-
computeEpochAtSlot,
|
|
7
|
-
isStateValidatorsNodesPopulated,
|
|
8
|
-
} from "@lodestar/state-transition";
|
|
3
|
+
import {DataAvailabilityStatus, IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
9
4
|
import {IndexedAttestation, deneb} from "@lodestar/types";
|
|
10
5
|
import type {BeaconChain} from "../chain.js";
|
|
11
6
|
import {BlockError, BlockErrorCode} from "../errors/index.js";
|
|
@@ -39,7 +34,7 @@ export async function verifyBlocksInEpoch(
|
|
|
39
34
|
blockInputs: IBlockInput[],
|
|
40
35
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
41
36
|
): Promise<{
|
|
42
|
-
postStates:
|
|
37
|
+
postStates: IBeaconStateView[];
|
|
43
38
|
proposerBalanceDeltas: number[];
|
|
44
39
|
segmentExecStatus: SegmentExecStatus;
|
|
45
40
|
dataAvailabilityStatuses: DataAvailabilityStatus[];
|
|
@@ -78,10 +73,10 @@ export async function verifyBlocksInEpoch(
|
|
|
78
73
|
// otherwise it may fail to get indexed attestations from shuffling cache later
|
|
79
74
|
this.shufflingCache.processState(preState0);
|
|
80
75
|
|
|
81
|
-
if (!isStateValidatorsNodesPopulated(
|
|
76
|
+
if (!preState0.isStateValidatorsNodesPopulated()) {
|
|
82
77
|
this.logger.verbose("verifyBlocksInEpoch preState0 SSZ cache stats", {
|
|
83
78
|
slot: preState0.slot,
|
|
84
|
-
cache: isStateValidatorsNodesPopulated(
|
|
79
|
+
cache: preState0.isStateValidatorsNodesPopulated(),
|
|
85
80
|
clonedCount: preState0.clonedCount,
|
|
86
81
|
clonedCountWithTransferCache: preState0.clonedCountWithTransferCache,
|
|
87
82
|
createdWithTransferCache: preState0.createdWithTransferCache,
|
|
@@ -110,7 +105,7 @@ export async function verifyBlocksInEpoch(
|
|
|
110
105
|
for (const [i, block] of blocks.entries()) {
|
|
111
106
|
indexedAttestationsByBlock[i] = block.message.body.attestations.map((attestation) => {
|
|
112
107
|
const attEpoch = computeEpochAtSlot(attestation.data.slot);
|
|
113
|
-
const decisionRoot = preState0.
|
|
108
|
+
const decisionRoot = preState0.getShufflingDecisionRoot(attEpoch);
|
|
114
109
|
return this.shufflingCache.getIndexedAttestation(attEpoch, decisionRoot, fork, attestation);
|
|
115
110
|
});
|
|
116
111
|
}
|
|
@@ -8,12 +8,7 @@ import {
|
|
|
8
8
|
ProtoBlock,
|
|
9
9
|
} from "@lodestar/fork-choice";
|
|
10
10
|
import {ForkSeq} from "@lodestar/params";
|
|
11
|
-
import {
|
|
12
|
-
CachedBeaconStateAllForks,
|
|
13
|
-
isExecutionBlockBodyType,
|
|
14
|
-
isExecutionEnabled,
|
|
15
|
-
isExecutionStateType,
|
|
16
|
-
} from "@lodestar/state-transition";
|
|
11
|
+
import {IBeaconStateView, isExecutionBlockBodyType} from "@lodestar/state-transition";
|
|
17
12
|
import {bellatrix, electra} from "@lodestar/types";
|
|
18
13
|
import {ErrorAborted, Logger, toRootHex} from "@lodestar/utils";
|
|
19
14
|
import {ExecutionPayloadStatus, IExecutionEngine} from "../../execution/engine/interface.js";
|
|
@@ -63,7 +58,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
63
58
|
chain: VerifyBlockExecutionPayloadModules,
|
|
64
59
|
parentBlock: ProtoBlock,
|
|
65
60
|
blockInputs: IBlockInput[],
|
|
66
|
-
preState0:
|
|
61
|
+
preState0: IBeaconStateView,
|
|
67
62
|
signal: AbortSignal,
|
|
68
63
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
69
64
|
): Promise<SegmentExecStatus> {
|
|
@@ -146,7 +141,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
146
141
|
export async function verifyBlockExecutionPayload(
|
|
147
142
|
chain: VerifyBlockExecutionPayloadModules,
|
|
148
143
|
blockInput: IBlockInput,
|
|
149
|
-
preState0:
|
|
144
|
+
preState0: IBeaconStateView
|
|
150
145
|
): Promise<VerifyBlockExecutionResponse> {
|
|
151
146
|
const block = blockInput.getBlock();
|
|
152
147
|
|
|
@@ -157,9 +152,9 @@ export async function verifyBlockExecutionPayload(
|
|
|
157
152
|
|
|
158
153
|
/** Not null if execution is enabled */
|
|
159
154
|
const executionPayloadEnabled =
|
|
160
|
-
isExecutionStateType
|
|
155
|
+
preState0.isExecutionStateType &&
|
|
161
156
|
isExecutionBlockBodyType(block.message.body) &&
|
|
162
|
-
isExecutionEnabled(
|
|
157
|
+
preState0.isExecutionEnabled(block.message)
|
|
163
158
|
? block.message.body.executionPayload
|
|
164
159
|
: null;
|
|
165
160
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {IBeaconStateView, getBlockSignatureSets} from "@lodestar/state-transition";
|
|
3
3
|
import {IndexedAttestation, SignedBeaconBlock} from "@lodestar/types";
|
|
4
4
|
import {Logger} from "@lodestar/utils";
|
|
5
5
|
import {Metrics} from "../../metrics/metrics.js";
|
|
@@ -20,14 +20,14 @@ export async function verifyBlocksSignatures(
|
|
|
20
20
|
bls: IBlsVerifier,
|
|
21
21
|
logger: Logger,
|
|
22
22
|
metrics: Metrics | null,
|
|
23
|
-
preState0:
|
|
23
|
+
preState0: IBeaconStateView,
|
|
24
24
|
blocks: SignedBeaconBlock[],
|
|
25
25
|
indexedAttestationsByBlock: IndexedAttestation[][],
|
|
26
26
|
opts: ImportBlockOpts
|
|
27
27
|
): Promise<{verifySignaturesTime: number}> {
|
|
28
28
|
const isValidPromises: Promise<boolean>[] = [];
|
|
29
29
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
30
|
-
const currentSyncCommitteeIndexed = preState0.
|
|
30
|
+
const currentSyncCommitteeIndexed = preState0.currentSyncCommitteeIndexed;
|
|
31
31
|
|
|
32
32
|
// Verifies signatures after running state transition, so all SyncCommittee signed roots are known at this point.
|
|
33
33
|
// We must ensure block.slot <= state.slot before running getAllBlockSignatureSets().
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CachedBeaconStateAllForks,
|
|
3
2
|
DataAvailabilityStatus,
|
|
4
3
|
ExecutionPayloadStatus,
|
|
4
|
+
IBeaconStateView,
|
|
5
5
|
StateHashTreeRootSource,
|
|
6
|
-
stateTransition,
|
|
7
6
|
} from "@lodestar/state-transition";
|
|
8
7
|
import {ErrorAborted, Logger, byteArrayEquals} from "@lodestar/utils";
|
|
9
8
|
import {Metrics} from "../../metrics/index.js";
|
|
@@ -23,7 +22,7 @@ import {ImportBlockOpts} from "./types.js";
|
|
|
23
22
|
* - Check state root matches
|
|
24
23
|
*/
|
|
25
24
|
export async function verifyBlocksStateTransitionOnly(
|
|
26
|
-
preState0:
|
|
25
|
+
preState0: IBeaconStateView,
|
|
27
26
|
blocks: IBlockInput[],
|
|
28
27
|
dataAvailabilityStatuses: DataAvailabilityStatus[],
|
|
29
28
|
logger: Logger,
|
|
@@ -31,8 +30,8 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
31
30
|
validatorMonitor: ValidatorMonitor | null,
|
|
32
31
|
signal: AbortSignal,
|
|
33
32
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
34
|
-
): Promise<{postStates:
|
|
35
|
-
const postStates:
|
|
33
|
+
): Promise<{postStates: IBeaconStateView[]; proposerBalanceDeltas: number[]; verifyStateTime: number}> {
|
|
34
|
+
const postStates: IBeaconStateView[] = [];
|
|
36
35
|
const proposerBalanceDeltas: number[] = [];
|
|
37
36
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
38
37
|
|
|
@@ -45,8 +44,7 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
45
44
|
// STFN - per_slot_processing() + per_block_processing()
|
|
46
45
|
// NOTE: `regen.getPreState()` should have dialed forward the state already caching checkpoint states
|
|
47
46
|
const useBlsBatchVerify = !opts?.disableBlsBatchVerify;
|
|
48
|
-
const postState = stateTransition(
|
|
49
|
-
preState,
|
|
47
|
+
const postState = preState.stateTransition(
|
|
50
48
|
block,
|
|
51
49
|
{
|
|
52
50
|
// NOTE: Assume valid for now while sending payload to execution engine in parallel
|
|
@@ -84,7 +82,7 @@ export async function verifyBlocksStateTransitionOnly(
|
|
|
84
82
|
|
|
85
83
|
// For metric block profitability
|
|
86
84
|
const proposerIndex = block.message.proposerIndex;
|
|
87
|
-
proposerBalanceDeltas[i] = postState.
|
|
85
|
+
proposerBalanceDeltas[i] = postState.getBalance(proposerIndex) - preState.getBalance(proposerIndex);
|
|
88
86
|
|
|
89
87
|
// If blocks are invalid in execution the main promise could resolve before this loop ends.
|
|
90
88
|
// In that case stop processing blocks and return early.
|