@lodestar/beacon-node 1.52.0-dev.b1d1e990d9 → 1.52.0-dev.b6f233b964
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.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +4 -3
- 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/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +87 -49
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +4 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +4 -0
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +7 -0
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +8 -4
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +9 -3
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.js +0 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/chain.d.ts +4 -3
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +39 -23
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +15 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +8 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +6 -1
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +55 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +8 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +13 -6
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +95 -115
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +45 -0
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +265 -69
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +6 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +54 -64
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts +1 -0
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js +1 -1
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.d.ts +8 -2
- package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.js +43 -6
- package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +24 -7
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +32 -16
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +4 -2
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +9 -1
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +17 -2
- 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 +100 -9
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +4 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/lib/chain/validation/signatureSets/syncCommitteeSelectionProof.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts +1 -1
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +5 -5
- package/lib/chain/validation/syncCommittee.js.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.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +39 -6
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/execution/engine/blockHash.d.ts +12 -0
- package/lib/execution/engine/blockHash.d.ts.map +1 -0
- package/lib/execution/engine/blockHash.js +17 -0
- package/lib/execution/engine/blockHash.js.map +1 -0
- package/lib/execution/engine/http.d.ts +2 -2
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +13 -7
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +16 -3
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js +11 -0
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.d.ts +2 -0
- package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.js +14 -6
- package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -2
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +4 -4
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -6
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +6 -1
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js +7 -2
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/restHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/restHttpClient.js +9 -5
- package/lib/execution/engine/restHttpClient.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -2
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +4 -4
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/signal.d.ts +6 -0
- package/lib/execution/engine/signal.d.ts.map +1 -0
- package/lib/execution/engine/signal.js +24 -0
- package/lib/execution/engine/signal.js.map +1 -0
- package/lib/execution/engine/transport.d.ts +2 -2
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +5 -0
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +5 -0
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +1 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +5 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/core/events.d.ts +6 -2
- package/lib/network/core/events.d.ts.map +1 -1
- package/lib/network/core/events.js +9 -0
- package/lib/network/core/events.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +3 -2
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +1 -0
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +5 -2
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +6 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +22 -2
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +2 -0
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +11 -2
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +15 -6
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +4 -2
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/sync/range/batch.d.ts +10 -0
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +29 -0
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +17 -2
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +60 -20
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +44 -3
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/range/utils/batches.d.ts +20 -4
- package/lib/sync/range/utils/batches.d.ts.map +1 -1
- package/lib/sync/range/utils/batches.js +31 -13
- package/lib/sync/range/utils/batches.js.map +1 -1
- package/lib/sync/range/utils/peerBalancer.d.ts +1 -1
- package/lib/sync/range/utils/peerBalancer.d.ts.map +1 -1
- package/lib/sync/range/utils/peerBalancer.js +5 -2
- package/lib/sync/range/utils/peerBalancer.js.map +1 -1
- package/lib/sync/types.d.ts +14 -1
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +2 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +28 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +338 -26
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +22 -1
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +55 -25
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +24 -2
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +48 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/asyncIterableToEvents.d.ts +20 -3
- package/lib/util/asyncIterableToEvents.d.ts.map +1 -1
- package/lib/util/asyncIterableToEvents.js +76 -20
- package/lib/util/asyncIterableToEvents.js.map +1 -1
- package/lib/util/dataColumns.d.ts +1 -1
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +4 -1
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/eventLoop.d.ts +3 -3
- package/lib/util/eventLoop.d.ts.map +1 -1
- package/lib/util/eventLoop.js +3 -3
- package/lib/util/eventLoop.js.map +1 -1
- package/package.json +27 -27
- package/src/api/impl/beacon/blocks/index.ts +4 -3
- package/src/api/impl/beacon/pool/index.ts +1 -1
- package/src/api/impl/validator/index.ts +122 -67
- package/src/chain/ColumnReconstructionTracker.ts +5 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +9 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +1 -1
- package/src/chain/archiveStore/utils/pruneHistory.ts +9 -4
- package/src/chain/blocks/importExecutionPayload.ts +9 -2
- package/src/chain/blocks/index.ts +0 -1
- package/src/chain/chain.ts +43 -44
- package/src/chain/errors/attestationError.ts +11 -1
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +58 -0
- package/src/chain/lightClient/index.ts +108 -142
- package/src/chain/prepareNextSlot.ts +347 -89
- package/src/chain/produceBlock/produceBlockBody.ts +69 -80
- package/src/chain/seenCache/seenAttesters.ts +1 -1
- package/src/chain/seenCache/seenBlockAttesters.ts +48 -6
- package/src/chain/validation/aggregateAndProof.ts +24 -9
- package/src/chain/validation/attestation.ts +31 -20
- package/src/chain/validation/attesterSlashing.ts +4 -2
- package/src/chain/validation/block.ts +9 -1
- package/src/chain/validation/executionPayloadBid.ts +20 -2
- package/src/chain/validation/executionPayloadEnvelope.ts +115 -8
- package/src/chain/validation/proposerSlashing.ts +4 -2
- package/src/chain/validation/signatureSets/contributionAndProof.ts +4 -6
- package/src/chain/validation/signatureSets/syncCommittee.ts +2 -3
- package/src/chain/validation/signatureSets/syncCommitteeContribution.ts +2 -3
- package/src/chain/validation/signatureSets/syncCommitteeSelectionProof.ts +2 -3
- package/src/chain/validation/syncCommittee.ts +3 -5
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +3 -3
- package/src/chain/validation/voluntaryExit.ts +44 -6
- package/src/execution/engine/blockHash.ts +27 -0
- package/src/execution/engine/http.ts +18 -10
- package/src/execution/engine/interface.ts +18 -3
- package/src/execution/engine/jsonRpcHttpClient.ts +26 -14
- package/src/execution/engine/jsonRpcTransport.ts +8 -4
- package/src/execution/engine/mock.ts +13 -8
- package/src/execution/engine/payloadIdCache.ts +12 -4
- package/src/execution/engine/restHttpClient.ts +17 -11
- package/src/execution/engine/restTransport.ts +5 -4
- package/src/execution/engine/signal.ts +28 -0
- package/src/execution/engine/transport.ts +3 -2
- package/src/index.ts +6 -1
- package/src/metrics/metrics/beacon.ts +9 -0
- package/src/metrics/metrics/lodestar.ts +5 -0
- package/src/network/core/events.ts +12 -0
- package/src/network/core/networkCoreWorkerHandler.ts +6 -2
- package/src/network/gossip/gossipsub.ts +6 -2
- package/src/network/network.ts +6 -2
- package/src/network/peers/peerManager.ts +26 -2
- package/src/network/peers/utils/prioritizePeers.ts +14 -1
- package/src/network/processor/gossipHandlers.ts +15 -7
- package/src/network/processor/index.ts +7 -2
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +1 -1
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +1 -1
- package/src/sync/range/batch.ts +33 -0
- package/src/sync/range/chain.ts +72 -17
- package/src/sync/range/range.ts +57 -3
- package/src/sync/range/utils/batches.ts +38 -13
- package/src/sync/range/utils/peerBalancer.ts +4 -1
- package/src/sync/types.ts +13 -0
- package/src/sync/unknownBlock.ts +387 -28
- package/src/sync/utils/downloadByRange.ts +89 -29
- package/src/sync/utils/downloadByRoot.ts +75 -7
- package/src/util/asyncIterableToEvents.ts +100 -21
- package/src/util/dataColumns.ts +4 -1
- package/src/util/eventLoop.ts +3 -3
|
@@ -50,6 +50,15 @@ export async function getHistoricalState(
|
|
|
50
50
|
const transitionTimer = metrics?.stateTransitionTime.startTimer();
|
|
51
51
|
let blockCount = 0;
|
|
52
52
|
for await (const block of db.blockArchive.valuesStream({gt: state.slot, lte: slot})) {
|
|
53
|
+
// Pruned history keeps the genesis state but not the blocks after it, without this check the
|
|
54
|
+
// first block would only be rejected after processing every slot in between
|
|
55
|
+
if (
|
|
56
|
+
blockCount === 0 &&
|
|
57
|
+
!byteArrayEquals(block.message.parentRoot, state.computeAnchorCheckpoint().checkpoint.root)
|
|
58
|
+
) {
|
|
59
|
+
metrics?.regenErrorCount.inc({reason: RegenErrorType.blockProcessing});
|
|
60
|
+
throw Error(`Archived blocks do not extend nearest state slot=${state.slot} blockSlot=${block.message.slot}`);
|
|
61
|
+
}
|
|
53
62
|
try {
|
|
54
63
|
state = state.stateTransition(
|
|
55
64
|
{block},
|
|
@@ -284,7 +284,7 @@ export async function archiveBlocks(
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
// Delete expired data column sidecars
|
|
287
|
-
// Keep only `[
|
|
287
|
+
// Keep only `[current_epoch - max(MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS, archiveDataEpochs)]`
|
|
288
288
|
if (finalizedPostFulu) {
|
|
289
289
|
if (archiveDataEpochs !== Infinity) {
|
|
290
290
|
const dataColumnSidecarsMinEpoch = getDataColumnSidecarsMinEpoch(config, currentEpoch, archiveDataEpochs);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
+
import {GENESIS_SLOT} from "@lodestar/params";
|
|
2
3
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
3
4
|
import {Epoch, Slot} from "@lodestar/types";
|
|
4
5
|
import {Logger, prettyPrintIndices} from "@lodestar/utils";
|
|
@@ -13,6 +14,9 @@ import {Metrics} from "../../../metrics/index.js";
|
|
|
13
14
|
*/
|
|
14
15
|
export const MAX_PRUNE_BLOCK_SLOTS_PER_RUN = 4096;
|
|
15
16
|
|
|
17
|
+
// Genesis is kept so the block and state stay available via the API, e.g. for checkpoint providers
|
|
18
|
+
const FIRST_PRUNABLE_SLOT = GENESIS_SLOT + 1;
|
|
19
|
+
|
|
16
20
|
export async function pruneHistory(
|
|
17
21
|
config: ChainForkConfig,
|
|
18
22
|
db: IBeaconDb,
|
|
@@ -30,11 +34,12 @@ export async function pruneHistory(
|
|
|
30
34
|
// ensure that during (extremely lol) long periods of non-finality we don't delete unfinalized epoch data
|
|
31
35
|
finalizedEpoch
|
|
32
36
|
);
|
|
33
|
-
const firstBlockSlot =
|
|
37
|
+
const [firstBlockSlot = FIRST_PRUNABLE_SLOT] = await db.blockArchive.keys({gte: FIRST_PRUNABLE_SLOT, limit: 1});
|
|
34
38
|
const blockCutoffSlot = Math.min(computeStartSlotAtEpoch(blockCutoffEpoch), firstBlockSlot + maxBlockSlots);
|
|
35
39
|
// The latest archived state is the anchor on restart and can trail finalization by a few epochs
|
|
36
40
|
const lastArchivedStateSlot = (await db.stateArchive.lastKey()) ?? 0;
|
|
37
41
|
const stateCutoffSlot = Math.min(computeStartSlotAtEpoch(finalizedEpoch), lastArchivedStateSlot);
|
|
42
|
+
const stateStartSlot = Math.max(statePruneFromSlot, FIRST_PRUNABLE_SLOT);
|
|
38
43
|
|
|
39
44
|
logger.debug("Preparing to prune history", {
|
|
40
45
|
currentEpoch,
|
|
@@ -46,9 +51,9 @@ export async function pruneHistory(
|
|
|
46
51
|
|
|
47
52
|
const step0 = metrics?.pruneHistory.fetchKeys.startTimer();
|
|
48
53
|
const [blocks, envelopes, states] = await Promise.all([
|
|
49
|
-
db.blockArchive.keys({gte:
|
|
50
|
-
db.executionPayloadEnvelopeArchive.keys({gte:
|
|
51
|
-
stateCutoffSlot >
|
|
54
|
+
db.blockArchive.keys({gte: FIRST_PRUNABLE_SLOT, lt: blockCutoffSlot}),
|
|
55
|
+
db.executionPayloadEnvelopeArchive.keys({gte: FIRST_PRUNABLE_SLOT, lt: blockCutoffSlot}),
|
|
56
|
+
stateCutoffSlot > stateStartSlot ? db.stateArchive.keys({gte: stateStartSlot, lt: stateCutoffSlot}) : [],
|
|
52
57
|
]);
|
|
53
58
|
step0?.();
|
|
54
59
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
InvalidBlockCode,
|
|
8
8
|
LVHInvalidJudged,
|
|
9
9
|
PayloadExecutionStatus,
|
|
10
|
+
PayloadStatus,
|
|
10
11
|
getFinalizedExecutionBlockHash,
|
|
11
12
|
getSafeExecutionBlockHash,
|
|
12
13
|
} from "@lodestar/fork-choice";
|
|
@@ -117,7 +118,7 @@ function toForkChoiceExecutionStatus(status: ExecutionPayloadStatus): PayloadExe
|
|
|
117
118
|
* 3. Regenerate state for envelope verification
|
|
118
119
|
* 4. Verify envelope (fields against state, signature, and EL in parallel where possible)
|
|
119
120
|
* 5. Persist verified payload envelope to hot DB (waits for write-queue space for backpressure)
|
|
120
|
-
* 6. Update fork choice (transitions the block's PENDING variant to FULL)
|
|
121
|
+
* 6. Update fork choice (transitions the block's PENDING variant to FULL) and emit head events if the head changed
|
|
121
122
|
* 7. Queue notifyForkchoiceUpdate to engine api
|
|
122
123
|
* 8. Record metrics for payload envelope and column sources
|
|
123
124
|
* 9. Emit `execution_payload` event
|
|
@@ -356,6 +357,7 @@ export async function importExecutionPayload(
|
|
|
356
357
|
|
|
357
358
|
// 6. Update fork choice, transitions the block's PENDING variant to FULL
|
|
358
359
|
const execStatus = toForkChoiceExecutionStatus(execResult.status);
|
|
360
|
+
const prevHead = this.forkChoice.getHead();
|
|
359
361
|
try {
|
|
360
362
|
this.forkChoice.onExecutionPayload(
|
|
361
363
|
blockRootHex,
|
|
@@ -376,12 +378,17 @@ export async function importExecutionPayload(
|
|
|
376
378
|
}
|
|
377
379
|
throw e;
|
|
378
380
|
}
|
|
381
|
+
const head = this.forkChoice.getHead();
|
|
382
|
+
this.emitHeadEvents(prevHead, head);
|
|
383
|
+
if (head.blockRoot !== prevHead.blockRoot) {
|
|
384
|
+
this.onHeadChanged(prevHead, head);
|
|
385
|
+
}
|
|
379
386
|
|
|
380
387
|
// 7. Queue notifyForkchoiceUpdate to engine api
|
|
381
|
-
const head = this.forkChoice.getHead();
|
|
382
388
|
if (
|
|
383
389
|
!this.opts.disableImportExecutionFcU &&
|
|
384
390
|
blockRootHex === head.blockRoot &&
|
|
391
|
+
head.payloadStatus === PayloadStatus.FULL &&
|
|
385
392
|
// Skip a payload that does not satisfy the inclusion list constraints, fork choice keeps the EMPTY
|
|
386
393
|
// variant as head and the next prepare fcU keeps the engine on the parent payload
|
|
387
394
|
this.forkChoice.isPayloadInclusionListSatisfied(blockRootHex)
|
|
@@ -280,7 +280,6 @@ async function importPayloadEnvelopesOfKnownBlocks(
|
|
|
280
280
|
});
|
|
281
281
|
await importExecutionPayload.call(this, payloadInputs[i], dataAvailabilityStatuses[i], {validSignature: false});
|
|
282
282
|
}
|
|
283
|
-
// the new FULL variants are not seen by the head cached from the last block import
|
|
284
283
|
this.recomputeForkChoiceHead(ForkchoiceCaller.importBlock);
|
|
285
284
|
|
|
286
285
|
return result;
|
package/src/chain/chain.ts
CHANGED
|
@@ -93,7 +93,7 @@ import {persistBlockInput} from "./blocks/writeBlockInputToDb.js";
|
|
|
93
93
|
import {persistPayloadEnvelopeInput} from "./blocks/writePayloadEnvelopeInputToDb.js";
|
|
94
94
|
import {BlsMultiThreadWorkerPool, BlsSingleThreadVerifier, IBlsVerifier} from "./bls/index.js";
|
|
95
95
|
import {BuilderCircuitBreaker} from "./builderCircuitBreaker.js";
|
|
96
|
-
import {ColumnReconstructionTracker} from "./ColumnReconstructionTracker.js";
|
|
96
|
+
import {ColumnReconstructionTracker, RECONSTRUCTED_COLUMNS_WAIT_BPS} from "./ColumnReconstructionTracker.js";
|
|
97
97
|
import {ChainEvent, ChainEventEmitter, ReorgEventData} from "./emitter.js";
|
|
98
98
|
import {ForkchoiceCaller, initializeForkChoice} from "./forkChoice/index.js";
|
|
99
99
|
import {ForkChoiceExecutionEngine} from "./forkChoiceExecutionEngine.js";
|
|
@@ -896,16 +896,18 @@ export class BeaconChain implements IBeaconChain {
|
|
|
896
896
|
): Promise<{block: SignedBeaconBlock; executionOptimistic: boolean; finalized: boolean} | null> {
|
|
897
897
|
const block = this.forkChoice.getBlockHexDefaultStatus(root);
|
|
898
898
|
if (block) {
|
|
899
|
+
// The finalized block stays in fork-choice and the hot db until the archiver has migrated it
|
|
900
|
+
const finalized = block.slot <= this.forkChoice.getFinalizedBlock().slot;
|
|
899
901
|
// Block found in fork-choice.
|
|
900
902
|
// It may be in the block input cache, awaiting full DA reconstruction, check there first
|
|
901
903
|
// Otherwise (most likely), check the hot db
|
|
902
904
|
const blockInput = this.seenBlockInputCache.get(block.blockRoot);
|
|
903
905
|
if (blockInput?.hasBlock()) {
|
|
904
|
-
return {block: blockInput.getBlock(), executionOptimistic: isOptimisticBlock(block), finalized
|
|
906
|
+
return {block: blockInput.getBlock(), executionOptimistic: isOptimisticBlock(block), finalized};
|
|
905
907
|
}
|
|
906
908
|
const data = await this.db.block.get(fromHex(root));
|
|
907
909
|
if (data) {
|
|
908
|
-
return {block: data, executionOptimistic: isOptimisticBlock(block), finalized
|
|
910
|
+
return {block: data, executionOptimistic: isOptimisticBlock(block), finalized};
|
|
909
911
|
}
|
|
910
912
|
// If block is not found in hot db, try cold db since there could be an archive cycle happening
|
|
911
913
|
// TODO: Add a lock to the archiver to have deterministic behavior on where are blocks
|
|
@@ -920,6 +922,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
920
922
|
): Promise<{block: Uint8Array; executionOptimistic: boolean; finalized: boolean; slot: Slot} | null> {
|
|
921
923
|
const block = this.forkChoice.getBlockHexDefaultStatus(root);
|
|
922
924
|
if (block) {
|
|
925
|
+
// The finalized block stays in fork-choice and the hot db until the archiver has migrated it
|
|
926
|
+
const finalized = block.slot <= this.forkChoice.getFinalizedBlock().slot;
|
|
923
927
|
// Block found in fork-choice.
|
|
924
928
|
// It may be in the block input cache, awaiting full DA reconstruction, check there first
|
|
925
929
|
// Otherwise (most likely), check the hot db
|
|
@@ -931,14 +935,14 @@ export class BeaconChain implements IBeaconChain {
|
|
|
931
935
|
return {
|
|
932
936
|
block: serialized,
|
|
933
937
|
executionOptimistic: isOptimisticBlock(block),
|
|
934
|
-
finalized
|
|
938
|
+
finalized,
|
|
935
939
|
slot: blockInput.slot,
|
|
936
940
|
};
|
|
937
941
|
}
|
|
938
942
|
return {
|
|
939
943
|
block: sszTypesFor(blockInput.forkName).SignedBeaconBlock.serialize(signedBlock),
|
|
940
944
|
executionOptimistic: isOptimisticBlock(block),
|
|
941
|
-
finalized
|
|
945
|
+
finalized,
|
|
942
946
|
slot: blockInput.slot,
|
|
943
947
|
};
|
|
944
948
|
}
|
|
@@ -946,7 +950,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
946
950
|
if (data) {
|
|
947
951
|
const slot = getSlotFromSignedBeaconBlockSerialized(data);
|
|
948
952
|
if (slot === null) throw new Error(`Invalid block data stored in DB for root: ${root}`);
|
|
949
|
-
return {block: data, executionOptimistic: isOptimisticBlock(block), finalized
|
|
953
|
+
return {block: data, executionOptimistic: isOptimisticBlock(block), finalized, slot};
|
|
950
954
|
}
|
|
951
955
|
// If block is not found in hot db, try cold db since there could be an archive cycle happening
|
|
952
956
|
// TODO: Add a lock to the archiver to have deterministic behavior on where are blocks
|
|
@@ -1129,6 +1133,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1129
1133
|
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
1130
1134
|
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
1131
1135
|
if (payloadInput) {
|
|
1136
|
+
// Available with half the columns, peers that saw it attested expect the reconstructed rest
|
|
1137
|
+
if (
|
|
1138
|
+
!payloadInput.hasComputedAllData() &&
|
|
1139
|
+
payloadInput.hasAllData() &&
|
|
1140
|
+
indices.some((index) => !payloadInput.hasColumn(index))
|
|
1141
|
+
) {
|
|
1142
|
+
this.columnReconstructionTracker.triggerColumnReconstruction(payloadInput);
|
|
1143
|
+
await payloadInput
|
|
1144
|
+
.waitForComputedAllData(this.config.getSlotComponentDurationMs(fork, RECONSTRUCTED_COLUMNS_WAIT_BPS))
|
|
1145
|
+
.catch(() => this.logger.debug("Columns not reconstructed in time", {slot: blockSlot, root: blockRootHex}));
|
|
1146
|
+
}
|
|
1132
1147
|
for (let i = 0; i < indices.length; i++) {
|
|
1133
1148
|
const index = indices[i];
|
|
1134
1149
|
const sidecar = payloadInput.getColumn(index);
|
|
@@ -1150,6 +1165,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1150
1165
|
if (!isBlockInputColumns(blockInput)) {
|
|
1151
1166
|
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
1152
1167
|
}
|
|
1168
|
+
// Available with half the columns, peers that saw it attested expect the reconstructed rest
|
|
1169
|
+
if (
|
|
1170
|
+
!blockInput.hasComputedAllData() &&
|
|
1171
|
+
blockInput.hasAllData() &&
|
|
1172
|
+
indices.some((index) => !blockInput.hasColumn(index))
|
|
1173
|
+
) {
|
|
1174
|
+
this.columnReconstructionTracker.triggerColumnReconstruction(blockInput);
|
|
1175
|
+
await blockInput
|
|
1176
|
+
.waitForComputedAllData(this.config.getSlotComponentDurationMs(fork, RECONSTRUCTED_COLUMNS_WAIT_BPS))
|
|
1177
|
+
.catch(() => this.logger.debug("Columns not reconstructed in time", {slot: blockSlot, root: blockRootHex}));
|
|
1178
|
+
}
|
|
1153
1179
|
for (let i = 0; i < indices.length; i++) {
|
|
1154
1180
|
const index = indices[i];
|
|
1155
1181
|
const sidecar = blockInput.getColumn(index);
|
|
@@ -1189,18 +1215,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1189
1215
|
}
|
|
1190
1216
|
|
|
1191
1217
|
async produceCommonBlockBody(blockAttributes: BlockAttributes): Promise<CommonBlockBody> {
|
|
1192
|
-
const {slot, parentBlock} = blockAttributes;
|
|
1193
|
-
const state = await this.regen.getBlockSlotState(
|
|
1194
|
-
parentBlock,
|
|
1195
|
-
slot,
|
|
1196
|
-
{dontTransferCache: true},
|
|
1197
|
-
RegenCaller.produceBlock
|
|
1198
|
-
);
|
|
1199
|
-
|
|
1200
1218
|
// TODO: To avoid breaking changes for metric define this attribute
|
|
1201
1219
|
const blockType = BlockType.Full;
|
|
1202
1220
|
|
|
1203
|
-
return produceCommonBlockBody.call(this, blockType,
|
|
1221
|
+
return produceCommonBlockBody.call(this, blockType, blockAttributes);
|
|
1204
1222
|
}
|
|
1205
1223
|
|
|
1206
1224
|
produceBlock(blockAttributes: BlockAttributes & {commonBlockBodyPromise: Promise<CommonBlockBody>}): Promise<{
|
|
@@ -1222,46 +1240,24 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1222
1240
|
|
|
1223
1241
|
async produceBlockWrapper<T extends BlockType>(
|
|
1224
1242
|
blockType: T,
|
|
1225
|
-
{
|
|
1226
|
-
randaoReveal,
|
|
1227
|
-
graffiti,
|
|
1228
|
-
slot,
|
|
1229
|
-
feeRecipient,
|
|
1230
|
-
strictFeeRecipientCheck,
|
|
1231
|
-
commonBlockBodyPromise,
|
|
1232
|
-
parentBlock,
|
|
1233
|
-
builderBid,
|
|
1234
|
-
}: BlockAttributes & {commonBlockBodyPromise: Promise<CommonBlockBody>}
|
|
1243
|
+
blockAttributes: BlockAttributes & {commonBlockBodyPromise: Promise<CommonBlockBody>}
|
|
1235
1244
|
): Promise<{
|
|
1236
1245
|
block: AssembledBlockType<T>;
|
|
1237
1246
|
executionPayloadValue: Wei;
|
|
1238
1247
|
consensusBlockValue: Wei;
|
|
1239
1248
|
shouldOverrideBuilder?: boolean;
|
|
1240
1249
|
}> {
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
slot,
|
|
1244
|
-
{dontTransferCache: true},
|
|
1245
|
-
RegenCaller.produceBlock
|
|
1246
|
-
);
|
|
1247
|
-
const proposerIndex = state.getBeaconProposer(slot);
|
|
1250
|
+
const {slot, parentBlock, parentState} = blockAttributes;
|
|
1251
|
+
const proposerIndex = parentState.getBeaconProposer(slot);
|
|
1248
1252
|
const proposerPubKey = this.pubkeyCache.getPubkeyBytesOrThrow(proposerIndex);
|
|
1249
1253
|
|
|
1250
1254
|
const {body, produceResult, executionPayloadValue, shouldOverrideBuilder} = await produceBlockBody.call(
|
|
1251
1255
|
this,
|
|
1252
1256
|
blockType,
|
|
1253
|
-
state,
|
|
1254
1257
|
{
|
|
1255
|
-
|
|
1256
|
-
graffiti,
|
|
1257
|
-
slot,
|
|
1258
|
-
feeRecipient,
|
|
1259
|
-
strictFeeRecipientCheck,
|
|
1260
|
-
parentBlock,
|
|
1258
|
+
...blockAttributes,
|
|
1261
1259
|
proposerIndex,
|
|
1262
1260
|
proposerPubKey,
|
|
1263
|
-
commonBlockBodyPromise,
|
|
1264
|
-
builderBid,
|
|
1265
1261
|
}
|
|
1266
1262
|
);
|
|
1267
1263
|
|
|
@@ -1286,7 +1282,9 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1286
1282
|
body,
|
|
1287
1283
|
} as AssembledBlockType<T>;
|
|
1288
1284
|
|
|
1289
|
-
|
|
1285
|
+
// `parentState` is the un-applied production state; `computeNewStateRoot` re-applies the parent
|
|
1286
|
+
// payload during state transition, so it must not receive the already-applied state
|
|
1287
|
+
const {newStateRoot, proposerReward} = computeNewStateRoot(this.metrics, parentState, block);
|
|
1290
1288
|
block.stateRoot = newStateRoot;
|
|
1291
1289
|
const blockRoot =
|
|
1292
1290
|
produceResult.type === BlockType.Full
|
|
@@ -1476,9 +1474,10 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1476
1474
|
|
|
1477
1475
|
/**
|
|
1478
1476
|
* Emit `head` and `head_v2` when the fork choice head differs between two observations. Every caller that
|
|
1479
|
-
* can move the head, `updateAndGetHead()` and `
|
|
1477
|
+
* can move the head, `updateAndGetHead()`, `updateTime()` and `onExecutionPayload()`, must capture the head before
|
|
1478
|
+
* and pass both.
|
|
1480
1479
|
*/
|
|
1481
|
-
|
|
1480
|
+
emitHeadEvents(prevHead: ProtoBlock, head: ProtoBlock): void {
|
|
1482
1481
|
const headRootChanged = head.blockRoot !== prevHead.blockRoot;
|
|
1483
1482
|
|
|
1484
1483
|
if (!headRootChanged && prevHead.payloadStatus === head.payloadStatus) {
|
|
@@ -151,6 +151,14 @@ export enum AttestationErrorCode {
|
|
|
151
151
|
* Gloas: index-1 attestation but the execution payload has not been seen yet
|
|
152
152
|
*/
|
|
153
153
|
EXECUTION_PAYLOAD_NOT_SEEN = "ATTESTATION_ERROR_EXECUTION_PAYLOAD_NOT_SEEN",
|
|
154
|
+
/**
|
|
155
|
+
* Gloas: index-1 attestation to a block whose execution payload is not yet validated by the execution engine
|
|
156
|
+
*/
|
|
157
|
+
EXECUTION_PAYLOAD_OPTIMISTIC = "ATTESTATION_ERROR_EXECUTION_PAYLOAD_OPTIMISTIC",
|
|
158
|
+
/**
|
|
159
|
+
* Gloas: index-1 attestation to a block whose execution payload was invalidated
|
|
160
|
+
*/
|
|
161
|
+
EXECUTION_PAYLOAD_INVALID = "ATTESTATION_ERROR_EXECUTION_PAYLOAD_INVALID",
|
|
154
162
|
}
|
|
155
163
|
|
|
156
164
|
export type AttestationErrorType =
|
|
@@ -190,7 +198,9 @@ export type AttestationErrorType =
|
|
|
190
198
|
| {code: AttestationErrorCode.ATTESTER_NOT_IN_COMMITTEE}
|
|
191
199
|
| {code: AttestationErrorCode.INVALID_PAYLOAD_STATUS_VALUE; attDataIndex: number}
|
|
192
200
|
| {code: AttestationErrorCode.PREMATURELY_INDICATED_PAYLOAD_PRESENT}
|
|
193
|
-
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_NOT_SEEN; beaconBlockRoot: RootHex}
|
|
201
|
+
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_NOT_SEEN; beaconBlockRoot: RootHex}
|
|
202
|
+
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_OPTIMISTIC; beaconBlockRoot: RootHex}
|
|
203
|
+
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_INVALID; beaconBlockRoot: RootHex};
|
|
194
204
|
|
|
195
205
|
export class AttestationError extends GossipActionError<AttestationErrorType> {
|
|
196
206
|
getMetadata(): Record<string, string | number | null> {
|
|
@@ -23,6 +23,7 @@ export enum ExecutionPayloadBidErrorCode {
|
|
|
23
23
|
PROPOSER_PREFERENCES_GAS_LIMIT_MISMATCH = "EXECUTION_PAYLOAD_BID_ERROR_PROPOSER_PREFERENCES_GAS_LIMIT_MISMATCH",
|
|
24
24
|
INCLUSION_LIST_BITS_NOT_INCLUSIVE = "EXECUTION_PAYLOAD_BID_ERROR_INCLUSION_LIST_BITS_NOT_INCLUSIVE",
|
|
25
25
|
BEFORE_INCLUSION_LIST_DEADLINE = "EXECUTION_PAYLOAD_BID_ERROR_BEFORE_INCLUSION_LIST_DEADLINE",
|
|
26
|
+
BEFORE_PAYLOAD_ATTESTATION_DEADLINE = "EXECUTION_PAYLOAD_BID_ERROR_BEFORE_PAYLOAD_ATTESTATION_DEADLINE",
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export type ExecutionPayloadBidErrorType =
|
|
@@ -99,6 +100,11 @@ export type ExecutionPayloadBidErrorType =
|
|
|
99
100
|
builderIndex: BuilderIndex;
|
|
100
101
|
slot: Slot;
|
|
101
102
|
}
|
|
103
|
+
| {
|
|
104
|
+
code: ExecutionPayloadBidErrorCode.BEFORE_PAYLOAD_ATTESTATION_DEADLINE;
|
|
105
|
+
builderIndex: BuilderIndex;
|
|
106
|
+
slot: Slot;
|
|
107
|
+
}
|
|
102
108
|
| {
|
|
103
109
|
code: ExecutionPayloadBidErrorCode.PROPOSER_PREFERENCES_GAS_LIMIT_MISMATCH;
|
|
104
110
|
builderIndex: BuilderIndex;
|
|
@@ -9,10 +9,18 @@ export enum ExecutionPayloadEnvelopeErrorCode {
|
|
|
9
9
|
ENVELOPE_ALREADY_KNOWN = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_ALREADY_KNOWN",
|
|
10
10
|
INVALID_BLOCK = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_BLOCK",
|
|
11
11
|
SLOT_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_SLOT_MISMATCH",
|
|
12
|
+
PARENT_BEACON_BLOCK_ROOT_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PARENT_BEACON_BLOCK_ROOT_MISMATCH",
|
|
12
13
|
BUILDER_INDEX_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BUILDER_INDEX_MISMATCH",
|
|
14
|
+
PREV_RANDAO_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PREV_RANDAO_MISMATCH",
|
|
15
|
+
GAS_LIMIT_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_GAS_LIMIT_MISMATCH",
|
|
13
16
|
BLOCK_HASH_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_BLOCK_HASH_MISMATCH",
|
|
14
17
|
EXECUTION_REQUESTS_ROOT_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_EXECUTION_REQUESTS_ROOT_MISMATCH",
|
|
15
18
|
TOO_MANY_TRANSACTIONS = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_TOO_MANY_TRANSACTIONS",
|
|
19
|
+
PARENT_HASH_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PARENT_HASH_MISMATCH",
|
|
20
|
+
INCORRECT_TIMESTAMP = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INCORRECT_TIMESTAMP",
|
|
21
|
+
EMPTY_TRANSACTION = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_EMPTY_TRANSACTION",
|
|
22
|
+
WITHDRAWALS_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_WITHDRAWALS_MISMATCH",
|
|
23
|
+
INVALID_BLOCK_HASH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_BLOCK_HASH",
|
|
16
24
|
INVALID_SIGNATURE = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_SIGNATURE",
|
|
17
25
|
PAYLOAD_ENVELOPE_INPUT_MISSING = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PAYLOAD_ENVELOPE_INPUT_MISSING",
|
|
18
26
|
}
|
|
@@ -34,6 +42,13 @@ export type ExecutionPayloadEnvelopeErrorType =
|
|
|
34
42
|
envelopeSlot: Slot;
|
|
35
43
|
blockSlot: Slot;
|
|
36
44
|
}
|
|
45
|
+
| {
|
|
46
|
+
code: ExecutionPayloadEnvelopeErrorCode.PARENT_BEACON_BLOCK_ROOT_MISMATCH;
|
|
47
|
+
slot: Slot;
|
|
48
|
+
root: RootHex;
|
|
49
|
+
envelopeParentBeaconBlockRoot: RootHex;
|
|
50
|
+
blockParentRoot: RootHex;
|
|
51
|
+
}
|
|
37
52
|
| {
|
|
38
53
|
code: ExecutionPayloadEnvelopeErrorCode.BUILDER_INDEX_MISMATCH;
|
|
39
54
|
slot: Slot;
|
|
@@ -41,6 +56,20 @@ export type ExecutionPayloadEnvelopeErrorType =
|
|
|
41
56
|
envelopeBuilderIndex: BuilderIndex;
|
|
42
57
|
bidBuilderIndex: BuilderIndex | null;
|
|
43
58
|
}
|
|
59
|
+
| {
|
|
60
|
+
code: ExecutionPayloadEnvelopeErrorCode.PREV_RANDAO_MISMATCH;
|
|
61
|
+
slot: Slot;
|
|
62
|
+
root: RootHex;
|
|
63
|
+
envelopePrevRandao: RootHex;
|
|
64
|
+
bidPrevRandao: RootHex;
|
|
65
|
+
}
|
|
66
|
+
| {
|
|
67
|
+
code: ExecutionPayloadEnvelopeErrorCode.GAS_LIMIT_MISMATCH;
|
|
68
|
+
slot: Slot;
|
|
69
|
+
root: RootHex;
|
|
70
|
+
envelopeGasLimit: number;
|
|
71
|
+
bidGasLimit: bigint;
|
|
72
|
+
}
|
|
44
73
|
| {
|
|
45
74
|
code: ExecutionPayloadEnvelopeErrorCode.BLOCK_HASH_MISMATCH;
|
|
46
75
|
slot: Slot;
|
|
@@ -62,6 +91,35 @@ export type ExecutionPayloadEnvelopeErrorType =
|
|
|
62
91
|
transactionCount: number;
|
|
63
92
|
maxTransactionCount: number;
|
|
64
93
|
}
|
|
94
|
+
| {
|
|
95
|
+
code: ExecutionPayloadEnvelopeErrorCode.PARENT_HASH_MISMATCH;
|
|
96
|
+
slot: Slot;
|
|
97
|
+
root: RootHex;
|
|
98
|
+
envelopeParentHash: RootHex;
|
|
99
|
+
latestBlockHash: RootHex;
|
|
100
|
+
}
|
|
101
|
+
| {
|
|
102
|
+
code: ExecutionPayloadEnvelopeErrorCode.INCORRECT_TIMESTAMP;
|
|
103
|
+
slot: Slot;
|
|
104
|
+
root: RootHex;
|
|
105
|
+
envelopeTimestamp: number;
|
|
106
|
+
expectedTimestamp: number;
|
|
107
|
+
}
|
|
108
|
+
| {code: ExecutionPayloadEnvelopeErrorCode.EMPTY_TRANSACTION; slot: Slot; root: RootHex; transactionIndex: number}
|
|
109
|
+
| {
|
|
110
|
+
code: ExecutionPayloadEnvelopeErrorCode.WITHDRAWALS_MISMATCH;
|
|
111
|
+
slot: Slot;
|
|
112
|
+
root: RootHex;
|
|
113
|
+
envelopeWithdrawalsRoot: RootHex;
|
|
114
|
+
expectedWithdrawalsRoot: RootHex;
|
|
115
|
+
}
|
|
116
|
+
| {
|
|
117
|
+
code: ExecutionPayloadEnvelopeErrorCode.INVALID_BLOCK_HASH;
|
|
118
|
+
slot: Slot;
|
|
119
|
+
root: RootHex;
|
|
120
|
+
blockHash: RootHex;
|
|
121
|
+
computedBlockHash: RootHex;
|
|
122
|
+
}
|
|
65
123
|
| {code: ExecutionPayloadEnvelopeErrorCode.INVALID_SIGNATURE; slot: Slot; root: RootHex}
|
|
66
124
|
| {code: ExecutionPayloadEnvelopeErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING; blockRoot: RootHex};
|
|
67
125
|
|