@lodestar/beacon-node 1.42.0-dev.83dedda569 → 1.42.0-dev.a5906cd323
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/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -3
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +6 -4
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -4
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +17 -17
- 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 +21 -12
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +2 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +20 -14
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/options.d.ts +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/package.json +15 -15
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +6 -5
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -5
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/blocks/importBlock.ts +18 -17
- package/src/chain/blocks/importExecutionPayload.ts +23 -12
- package/src/chain/blocks/index.ts +2 -1
- package/src/chain/blocks/types.ts +25 -14
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +4 -4
- package/src/chain/options.ts +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
2
|
+
import {BlockExecutionStatus, PayloadExecutionStatus} from "@lodestar/fork-choice";
|
|
3
3
|
import {ForkSeq} from "@lodestar/params";
|
|
4
4
|
import {DataAvailabilityStatus, IBeaconStateView, computeEpochAtSlot} from "@lodestar/state-transition";
|
|
5
5
|
import type {IndexedAttestation, Slot, fulu} from "@lodestar/types";
|
|
@@ -88,24 +88,35 @@ export type ImportBlockOpts = {
|
|
|
88
88
|
seenTimestampSec?: number;
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
* A wrapper around a `SignedBeaconBlock` that indicates that this block is fully verified and ready to import
|
|
93
|
-
*/
|
|
94
|
-
export type FullyVerifiedBlock = {
|
|
91
|
+
type FullyVerifiedBlockBase = {
|
|
95
92
|
blockInput: IBlockInput;
|
|
96
|
-
|
|
93
|
+
postBlockState: IBeaconStateView;
|
|
97
94
|
parentBlockSlot: Slot;
|
|
98
95
|
proposerBalanceDelta: number;
|
|
99
|
-
/**
|
|
100
|
-
* If the execution payload couldnt be verified because of EL syncing status,
|
|
101
|
-
* used in optimistic sync or for merge block
|
|
102
|
-
*/
|
|
103
|
-
executionStatus: MaybeValidExecutionStatus;
|
|
104
96
|
dataAvailabilityStatus: DataAvailabilityStatus;
|
|
105
|
-
/**
|
|
106
|
-
* Pre-computed indexed attestations from signature verification to avoid duplicate work
|
|
107
|
-
*/
|
|
97
|
+
/** Pre-computed indexed attestations from signature verification to avoid duplicate work */
|
|
108
98
|
indexedAttestations: IndexedAttestation[];
|
|
109
99
|
/** Seen timestamp seconds */
|
|
110
100
|
seenTimestampSec: number;
|
|
111
101
|
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* A wrapper around a `SignedBeaconBlock` that indicates that this block is fully verified and ready to import.
|
|
105
|
+
*
|
|
106
|
+
* Discriminated union on `postEnvelopeState`:
|
|
107
|
+
* - `null` → block has no pre-verified envelope; `executionStatus` is any `BlockExecutionStatus`
|
|
108
|
+
* - non-null → envelope was pre-verified during state transition; `executionStatus` is narrowed to
|
|
109
|
+
* `Valid | Syncing` (matching what `forkChoice.onExecutionPayload` expects)
|
|
110
|
+
*/
|
|
111
|
+
export type FullyVerifiedBlock = FullyVerifiedBlockBase &
|
|
112
|
+
(
|
|
113
|
+
| {
|
|
114
|
+
postEnvelopeState: null;
|
|
115
|
+
/** If the execution payload couldn't be verified because of EL syncing status, used in optimistic sync or for merge block */
|
|
116
|
+
executionStatus: BlockExecutionStatus;
|
|
117
|
+
}
|
|
118
|
+
| {
|
|
119
|
+
postEnvelopeState: IBeaconStateView;
|
|
120
|
+
executionStatus: PayloadExecutionStatus;
|
|
121
|
+
}
|
|
122
|
+
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {
|
|
3
|
+
BlockExecutionStatus,
|
|
3
4
|
ExecutionStatus,
|
|
4
5
|
IForkChoice,
|
|
5
6
|
LVHInvalidResponse,
|
|
6
7
|
LVHValidResponse,
|
|
7
|
-
MaybeValidExecutionStatus,
|
|
8
8
|
ProtoBlock,
|
|
9
9
|
} from "@lodestar/fork-choice";
|
|
10
10
|
import {ForkSeq} from "@lodestar/params";
|
|
@@ -33,7 +33,7 @@ type ExecAbortType = {blockIndex: number; execError: BlockError};
|
|
|
33
33
|
export type SegmentExecStatus =
|
|
34
34
|
| {
|
|
35
35
|
execAborted: null;
|
|
36
|
-
executionStatuses:
|
|
36
|
+
executionStatuses: BlockExecutionStatus[];
|
|
37
37
|
executionTime: number;
|
|
38
38
|
}
|
|
39
39
|
| {execAborted: ExecAbortType; invalidSegmentLVH?: LVHInvalidResponse};
|
|
@@ -62,7 +62,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
62
62
|
signal: AbortSignal,
|
|
63
63
|
opts: BlockProcessOpts & ImportBlockOpts
|
|
64
64
|
): Promise<SegmentExecStatus> {
|
|
65
|
-
const executionStatuses:
|
|
65
|
+
const executionStatuses: BlockExecutionStatus[] = [];
|
|
66
66
|
const recvToValLatency = Date.now() / 1000 - (opts.seenTimestampSec ?? Date.now() / 1000);
|
|
67
67
|
const lastBlock = blockInputs.at(-1);
|
|
68
68
|
|
|
@@ -103,7 +103,7 @@ export async function verifyBlocksExecutionPayload(
|
|
|
103
103
|
return getSegmentErrorResponse({verifyResponse, blockIndex}, parentBlock, blockInputs);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
// If we are here then its because executionStatus is one of
|
|
106
|
+
// If we are here then its because executionStatus is one of BlockExecutionStatus
|
|
107
107
|
const {executionStatus} = verifyResponse;
|
|
108
108
|
executionStatuses.push(executionStatus);
|
|
109
109
|
}
|
package/src/chain/options.ts
CHANGED
|
@@ -47,6 +47,7 @@ export type IChainOptions = BlockProcessOpts &
|
|
|
47
47
|
minSameMessageSignatureSetsToBatch: number;
|
|
48
48
|
archiveDateEpochs?: number;
|
|
49
49
|
nHistoricalStatesFileDataStore?: boolean;
|
|
50
|
+
nativeStateView?: boolean;
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
export type BlockProcessOpts = {
|
|
@@ -124,6 +125,7 @@ export const defaultChainOptions: IChainOptions = {
|
|
|
124
125
|
// - users can prune the persisted checkpoint state files manually to save disc space
|
|
125
126
|
// - it helps debug easier when network is unfinalized
|
|
126
127
|
nHistoricalStatesFileDataStore: true,
|
|
128
|
+
nativeStateView: false,
|
|
127
129
|
maxBlockStates: DEFAULT_MAX_BLOCK_STATES,
|
|
128
130
|
maxCPStateEpochsInMemory: DEFAULT_MAX_CP_STATE_EPOCHS_IN_MEMORY,
|
|
129
131
|
maxCPStateEpochsOnDisk: DEFAULT_MAX_CP_STATE_ON_DISK,
|