@lodestar/beacon-node 1.47.0-dev.0bcaaaebb5 → 1.47.0-dev.1759dccc9c
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 +3 -6
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +4 -0
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/validator/index.js +1 -1
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.js +21 -0
- package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +2 -7
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/builderCircuitBreaker.d.ts +6 -5
- package/lib/chain/builderCircuitBreaker.d.ts.map +1 -1
- package/lib/chain/builderCircuitBreaker.js +28 -15
- package/lib/chain/builderCircuitBreaker.js.map +1 -1
- package/lib/chain/options.d.ts +1 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +1 -1
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/execution/builder/http.d.ts +10 -7
- package/lib/execution/builder/http.d.ts.map +1 -1
- package/lib/execution/builder/http.js +11 -8
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +3 -3
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +9 -9
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +10 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +16 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +7 -2
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +17 -5
- package/lib/sync/unknownBlock.js.map +1 -1
- package/package.json +14 -14
- package/src/api/impl/beacon/blocks/index.ts +4 -6
- package/src/api/impl/beacon/pool/index.ts +5 -0
- package/src/api/impl/validator/index.ts +1 -1
- package/src/chain/archiveStore/historicalState/metrics.ts +22 -0
- package/src/chain/blocks/importBlock.ts +1 -6
- package/src/chain/builderCircuitBreaker.ts +31 -17
- package/src/chain/options.ts +1 -1
- package/src/chain/prepareNextSlot.ts +1 -1
- package/src/execution/builder/http.ts +11 -11
- package/src/metrics/metrics/beacon.ts +9 -9
- package/src/metrics/metrics/lodestar.ts +16 -0
- package/src/network/processor/gossipHandlers.ts +9 -0
- package/src/sync/unknownBlock.ts +18 -5
|
@@ -143,17 +143,17 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
|
|
|
143
143
|
name: "beacon_builder_circuit_breaker_active",
|
|
144
144
|
help: "Whether the builder circuit breaker is active (1) causing builder bids to be ignored",
|
|
145
145
|
}),
|
|
146
|
-
|
|
147
|
-
name: "
|
|
148
|
-
help: "Count of
|
|
146
|
+
canonicalBlocks: register.gauge({
|
|
147
|
+
name: "beacon_builder_circuit_breaker_canonical_blocks",
|
|
148
|
+
help: "Count of canonical FULL and EMPTY blocks in the fault inspection window",
|
|
149
149
|
}),
|
|
150
|
-
|
|
151
|
-
name: "
|
|
152
|
-
help: "Count of blocks
|
|
150
|
+
fullBlocks: register.gauge({
|
|
151
|
+
name: "beacon_builder_circuit_breaker_full_blocks",
|
|
152
|
+
help: "Count of canonical FULL blocks in the fault inspection window",
|
|
153
153
|
}),
|
|
154
|
-
|
|
155
|
-
name: "
|
|
156
|
-
help: "Count of
|
|
154
|
+
emptyBlocks: register.gauge({
|
|
155
|
+
name: "beacon_builder_circuit_breaker_empty_blocks",
|
|
156
|
+
help: "Count of canonical EMPTY blocks in the fault inspection window",
|
|
157
157
|
}),
|
|
158
158
|
},
|
|
159
159
|
|
|
@@ -908,6 +908,22 @@ export function createLodestarMetrics(
|
|
|
908
908
|
labelNames: ["error"],
|
|
909
909
|
}),
|
|
910
910
|
},
|
|
911
|
+
gossipExecutionPayloadBid: {
|
|
912
|
+
elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
|
|
913
|
+
name: "lodestar_gossip_execution_payload_bid_elapsed_time_till_received_seconds",
|
|
914
|
+
help: "Time elapsed between the bid's slot start and the time the execution payload bid was received (negative = received before its slot, broadcast in the previous slot; positive = received during its own slot, late)",
|
|
915
|
+
labelNames: ["source"],
|
|
916
|
+
buckets: [-6, -3, -1, 0, 3],
|
|
917
|
+
}),
|
|
918
|
+
},
|
|
919
|
+
gossipPayloadAttestationMessage: {
|
|
920
|
+
elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
|
|
921
|
+
name: "lodestar_gossip_payload_attestation_message_elapsed_time_till_received_seconds",
|
|
922
|
+
help: "Time elapsed between slot time and the time the payload attestation message was received",
|
|
923
|
+
labelNames: ["source"],
|
|
924
|
+
buckets: [3, 6, 9, 12],
|
|
925
|
+
}),
|
|
926
|
+
},
|
|
911
927
|
// recovery in the case of specific blob rows required
|
|
912
928
|
recoverBlobSidecars: {
|
|
913
929
|
blobsReconstructed: register.counter({
|
|
@@ -1255,11 +1255,15 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1255
1255
|
[GossipType.payload_attestation_message]: async ({
|
|
1256
1256
|
gossipData,
|
|
1257
1257
|
topic,
|
|
1258
|
+
seenTimestampSec,
|
|
1258
1259
|
}: GossipHandlerParamGeneric<GossipType.payload_attestation_message>) => {
|
|
1259
1260
|
const {serializedData} = gossipData;
|
|
1260
1261
|
const payloadAttestationMessage = sszDeserialize(topic, serializedData);
|
|
1261
1262
|
const validationResult = await validateGossipPayloadAttestationMessage(chain, payloadAttestationMessage);
|
|
1262
1263
|
|
|
1264
|
+
const delaySec = chain.clock.secFromSlot(payloadAttestationMessage.data.slot, seenTimestampSec);
|
|
1265
|
+
metrics?.gossipPayloadAttestationMessage.elapsedTimeTillReceived.observe({source: OpSource.gossip}, delaySec);
|
|
1266
|
+
|
|
1263
1267
|
try {
|
|
1264
1268
|
const insertOutcome = chain.payloadAttestationPool.add(
|
|
1265
1269
|
payloadAttestationMessage,
|
|
@@ -1286,11 +1290,16 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1286
1290
|
[GossipType.execution_payload_bid]: async ({
|
|
1287
1291
|
gossipData,
|
|
1288
1292
|
topic,
|
|
1293
|
+
seenTimestampSec,
|
|
1289
1294
|
}: GossipHandlerParamGeneric<GossipType.execution_payload_bid>) => {
|
|
1290
1295
|
const {serializedData} = gossipData;
|
|
1291
1296
|
const executionPayloadBid = sszDeserialize(topic, serializedData);
|
|
1292
1297
|
const {proposerIndex} = await validateGossipExecutionPayloadBid(chain, executionPayloadBid);
|
|
1293
1298
|
|
|
1299
|
+
// this could be negative, because it's most likely the bid of next slot comes at this clock slot
|
|
1300
|
+
const elapsedSec = chain.clock.secFromSlot(executionPayloadBid.message.slot, seenTimestampSec);
|
|
1301
|
+
metrics?.gossipExecutionPayloadBid.elapsedTimeTillReceived.observe({source: OpSource.gossip}, elapsedSec);
|
|
1302
|
+
|
|
1294
1303
|
// Handle valid payload bid by storing in a bid pool
|
|
1295
1304
|
try {
|
|
1296
1305
|
const insertOutcome = chain.executionPayloadBidPool.add(executionPayloadBid);
|
package/src/sync/unknownBlock.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ChainForkConfig} from "@lodestar/config";
|
|
3
|
-
import {ForkSeq} from "@lodestar/params";
|
|
3
|
+
import {ForkSeq, isForkPostGloas} from "@lodestar/params";
|
|
4
4
|
import {RequestError, RequestErrorCode} from "@lodestar/reqresp";
|
|
5
5
|
import {computeTimeAtSlot} from "@lodestar/state-transition";
|
|
6
6
|
import {RootHex, Slot, gloas} from "@lodestar/types";
|
|
@@ -764,9 +764,10 @@ export class BlockInputSync {
|
|
|
764
764
|
// this prevents unbundling attack
|
|
765
765
|
// see https://lighthouse-blog.sigmaprime.io/mev-unbundling-rpc.html
|
|
766
766
|
const {slot: blockSlot, proposerIndex} = pendingBlock.blockInput.getBlock().message;
|
|
767
|
+
const blockRootHex = pendingBlock.blockInput.blockRootHex;
|
|
767
768
|
const logCtx = {
|
|
768
769
|
slot: blockSlot,
|
|
769
|
-
root:
|
|
770
|
+
root: blockRootHex,
|
|
770
771
|
delaySec: this.chain.clock.secFromSlot(blockSlot),
|
|
771
772
|
};
|
|
772
773
|
this.logger.verbose("Processing downloaded block", logCtx);
|
|
@@ -780,7 +781,7 @@ export class BlockInputSync {
|
|
|
780
781
|
// eligible for proposer boost to prevent unbundling attack
|
|
781
782
|
this.logger.verbose("Avoid proposer boost for this block of known proposer", {
|
|
782
783
|
slot: blockSlot,
|
|
783
|
-
root:
|
|
784
|
+
root: blockRootHex,
|
|
784
785
|
proposerIndex,
|
|
785
786
|
});
|
|
786
787
|
await sleep(proposerBoostWindowMs);
|
|
@@ -807,12 +808,24 @@ export class BlockInputSync {
|
|
|
807
808
|
if (!res.err) {
|
|
808
809
|
this.logger.verbose("Processed block from unknown sync", logCtx);
|
|
809
810
|
// no need to update status to "processed", delete anyway
|
|
810
|
-
this.pendingBlocks.delete(
|
|
811
|
+
this.pendingBlocks.delete(blockRootHex);
|
|
812
|
+
|
|
813
|
+
if (isForkPostGloas(fork)) {
|
|
814
|
+
const payloadInput = this.chain.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
815
|
+
if (!payloadInput) {
|
|
816
|
+
this.logger.warn("PayloadEnvelopeInput not seeded during unknown sync processReadyBlock()", logCtx);
|
|
817
|
+
} else {
|
|
818
|
+
// Similar to the gossip path: immediately attempt fetch of data columns from the execution engine.
|
|
819
|
+
// The bid already carries the kzg commitments, so there is no reason to wait for the payload to arrive.
|
|
820
|
+
this.chain.getBlobsTracker.triggerGetBlobs(payloadInput);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
811
824
|
// Re-enter the scheduler so descendants blocked on either parent blocks or parent payloads
|
|
812
825
|
// are advanced through the same dependency checks as every other pending item.
|
|
813
826
|
this.triggerUnknownBlockSearch();
|
|
814
827
|
} else {
|
|
815
|
-
const errorData = {slot: pendingBlock.blockInput.slot, root:
|
|
828
|
+
const errorData = {slot: pendingBlock.blockInput.slot, root: blockRootHex};
|
|
816
829
|
if (res.err instanceof BlockError) {
|
|
817
830
|
switch (res.err.type.code) {
|
|
818
831
|
// This cases are already handled with `{ignoreIfKnown: true}`
|