@lodestar/beacon-node 1.52.0-dev.3a9c790524 → 1.52.0-dev.3ba097203c
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/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +2 -4
- package/lib/api/impl/validator/index.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/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +9 -5
- package/lib/chain/chain.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 +7 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.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 +1 -0
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +23 -15
- package/lib/chain/produceBlock/produceBlockBody.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 +21 -5
- package/lib/chain/validation/executionPayloadEnvelope.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/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/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/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 +4 -0
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +12 -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 +52 -19
- 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 +1 -0
- 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/utils/downloadByRange.d.ts +8 -0
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +43 -23
- package/lib/sync/utils/downloadByRange.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/package.json +17 -17
- package/src/api/impl/validator/index.ts +2 -4
- package/src/chain/archiveStore/utils/archiveBlocks.ts +1 -1
- package/src/chain/chain.ts +9 -5
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +8 -0
- package/src/chain/prepareNextSlot.ts +347 -89
- package/src/chain/produceBlock/produceBlockBody.ts +25 -16
- package/src/chain/validation/executionPayloadBid.ts +20 -2
- package/src/chain/validation/executionPayloadEnvelope.ts +28 -5
- package/src/chain/validation/voluntaryExit.ts +44 -6
- package/src/execution/engine/blockHash.ts +27 -0
- package/src/execution/engine/mock.ts +13 -8
- package/src/execution/engine/payloadIdCache.ts +12 -4
- package/src/metrics/metrics/beacon.ts +9 -0
- package/src/metrics/metrics/lodestar.ts +5 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +1 -1
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +1 -1
- package/src/sync/range/batch.ts +13 -0
- package/src/sync/range/chain.ts +64 -17
- package/src/sync/range/range.ts +1 -0
- package/src/sync/range/utils/batches.ts +38 -13
- package/src/sync/range/utils/peerBalancer.ts +4 -1
- package/src/sync/utils/downloadByRange.ts +60 -26
- package/src/util/dataColumns.ts +4 -1
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.52.0-dev.
|
|
14
|
+
"version": "1.52.0-dev.3ba097203c",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -126,18 +126,18 @@
|
|
|
126
126
|
"@libp2p/prometheus-metrics": "^5.0.31",
|
|
127
127
|
"@libp2p/tcp": "^11.0.30",
|
|
128
128
|
"@libp2p/utils": "^7.4.6",
|
|
129
|
-
"@lodestar/api": "^1.52.0-dev.
|
|
130
|
-
"@lodestar/config": "^1.52.0-dev.
|
|
131
|
-
"@lodestar/db": "^1.52.0-dev.
|
|
132
|
-
"@lodestar/fork-choice": "^1.52.0-dev.
|
|
133
|
-
"@lodestar/logger": "^1.52.0-dev.
|
|
134
|
-
"@lodestar/native": "^1.52.0-dev.
|
|
135
|
-
"@lodestar/params": "^1.52.0-dev.
|
|
136
|
-
"@lodestar/reqresp": "^1.52.0-dev.
|
|
137
|
-
"@lodestar/state-transition": "^1.52.0-dev.
|
|
138
|
-
"@lodestar/types": "^1.52.0-dev.
|
|
139
|
-
"@lodestar/utils": "^1.52.0-dev.
|
|
140
|
-
"@lodestar/validator": "^1.52.0-dev.
|
|
129
|
+
"@lodestar/api": "^1.52.0-dev.3ba097203c",
|
|
130
|
+
"@lodestar/config": "^1.52.0-dev.3ba097203c",
|
|
131
|
+
"@lodestar/db": "^1.52.0-dev.3ba097203c",
|
|
132
|
+
"@lodestar/fork-choice": "^1.52.0-dev.3ba097203c",
|
|
133
|
+
"@lodestar/logger": "^1.52.0-dev.3ba097203c",
|
|
134
|
+
"@lodestar/native": "^1.52.0-dev.3ba097203c",
|
|
135
|
+
"@lodestar/params": "^1.52.0-dev.3ba097203c",
|
|
136
|
+
"@lodestar/reqresp": "^1.52.0-dev.3ba097203c",
|
|
137
|
+
"@lodestar/state-transition": "^1.52.0-dev.3ba097203c",
|
|
138
|
+
"@lodestar/types": "^1.52.0-dev.3ba097203c",
|
|
139
|
+
"@lodestar/utils": "^1.52.0-dev.3ba097203c",
|
|
140
|
+
"@lodestar/validator": "^1.52.0-dev.3ba097203c",
|
|
141
141
|
"@multiformats/multiaddr": "^13.0.1",
|
|
142
142
|
"datastore-core": "^12.0.1",
|
|
143
143
|
"datastore-level": "^13.0.1",
|
|
@@ -156,11 +156,11 @@
|
|
|
156
156
|
"xxhash-wasm": "1.0.2"
|
|
157
157
|
},
|
|
158
158
|
"devDependencies": {
|
|
159
|
-
"@ethereumjs/rlp": "^
|
|
159
|
+
"@ethereumjs/rlp": "^10.1.3",
|
|
160
160
|
"@libp2p/interface-internal": "^3.2.3",
|
|
161
161
|
"@libp2p/logger": "^6.2.16",
|
|
162
|
-
"@lodestar/spec-test-util": "^1.52.0-dev.
|
|
163
|
-
"@lodestar/test-utils": "^1.52.0-dev.
|
|
162
|
+
"@lodestar/spec-test-util": "^1.52.0-dev.3ba097203c",
|
|
163
|
+
"@lodestar/test-utils": "^1.52.0-dev.3ba097203c",
|
|
164
164
|
"@types/js-yaml": "^4.0.5",
|
|
165
165
|
"@types/qs": "^6.9.7",
|
|
166
166
|
"@types/tmp": "^0.2.3",
|
|
@@ -174,5 +174,5 @@
|
|
|
174
174
|
"beacon",
|
|
175
175
|
"blockchain"
|
|
176
176
|
],
|
|
177
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "ef0258cf3d7739fa14c18b04f56a8db0e09b2628"
|
|
178
178
|
}
|
|
@@ -132,8 +132,6 @@ const BLOCK_PRODUCTION_RACE_CUTOFF_BPS = 1667;
|
|
|
132
132
|
* TODO GLOAS: revisit, the block propagates faster as it only commits to a bid and the attestation deadline changed
|
|
133
133
|
*/
|
|
134
134
|
export const BLOCK_PRODUCTION_RACE_CUTOFF_GLOAS_BPS = 1667;
|
|
135
|
-
/** Rejection message of the bid block branch when there is no viable bid to commit to */
|
|
136
|
-
const NO_BID_AVAILABLE = "No builder bid available";
|
|
137
135
|
|
|
138
136
|
type BidCandidate = {
|
|
139
137
|
signedBid: gloas.SignedExecutionPayloadBid;
|
|
@@ -1156,7 +1154,7 @@ export function getValidatorApi(
|
|
|
1156
1154
|
});
|
|
1157
1155
|
const bidBlockPromise: ReturnType<typeof chain.produceBlock> = bestBidPromise.then((candidate) => {
|
|
1158
1156
|
if (candidate === null) {
|
|
1159
|
-
throw new
|
|
1157
|
+
throw new NoBidReceived();
|
|
1160
1158
|
}
|
|
1161
1159
|
metrics?.blockProductionRequests.inc({source: ProducedBlockSource.builder});
|
|
1162
1160
|
return timed(ProducedBlockSource.builder, () =>
|
|
@@ -1270,7 +1268,7 @@ export function getValidatorApi(
|
|
|
1270
1268
|
source = ProducedBlockSource.engine;
|
|
1271
1269
|
bestResult = engineResult;
|
|
1272
1270
|
const reason =
|
|
1273
|
-
bidBlockResult.status === "rejected" &&
|
|
1271
|
+
bidBlockResult.status === "rejected" && bidBlockResult.reason instanceof NoBidReceived
|
|
1274
1272
|
? EngineBlockSelectionReason.BuilderNoBid
|
|
1275
1273
|
: bidBlockResult.status === "pending"
|
|
1276
1274
|
? EngineBlockSelectionReason.BuilderPending
|
|
@@ -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);
|
package/src/chain/chain.ts
CHANGED
|
@@ -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
|
|
@@ -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;
|
|
@@ -20,6 +20,7 @@ export enum ExecutionPayloadEnvelopeErrorCode {
|
|
|
20
20
|
INCORRECT_TIMESTAMP = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INCORRECT_TIMESTAMP",
|
|
21
21
|
EMPTY_TRANSACTION = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_EMPTY_TRANSACTION",
|
|
22
22
|
WITHDRAWALS_MISMATCH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_WITHDRAWALS_MISMATCH",
|
|
23
|
+
INVALID_BLOCK_HASH = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_BLOCK_HASH",
|
|
23
24
|
INVALID_SIGNATURE = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_INVALID_SIGNATURE",
|
|
24
25
|
PAYLOAD_ENVELOPE_INPUT_MISSING = "EXECUTION_PAYLOAD_ENVELOPE_ERROR_PAYLOAD_ENVELOPE_INPUT_MISSING",
|
|
25
26
|
}
|
|
@@ -112,6 +113,13 @@ export type ExecutionPayloadEnvelopeErrorType =
|
|
|
112
113
|
envelopeWithdrawalsRoot: RootHex;
|
|
113
114
|
expectedWithdrawalsRoot: RootHex;
|
|
114
115
|
}
|
|
116
|
+
| {
|
|
117
|
+
code: ExecutionPayloadEnvelopeErrorCode.INVALID_BLOCK_HASH;
|
|
118
|
+
slot: Slot;
|
|
119
|
+
root: RootHex;
|
|
120
|
+
blockHash: RootHex;
|
|
121
|
+
computedBlockHash: RootHex;
|
|
122
|
+
}
|
|
115
123
|
| {code: ExecutionPayloadEnvelopeErrorCode.INVALID_SIGNATURE; slot: Slot; root: RootHex}
|
|
116
124
|
| {code: ExecutionPayloadEnvelopeErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING; blockRoot: RootHex};
|
|
117
125
|
|