@lodestar/beacon-node 1.47.0-dev.0bcaaaebb5 → 1.47.0-dev.1fd2d8bf0b

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.
Files changed (50) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +3 -6
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
  5. package/lib/api/impl/beacon/pool/index.js +4 -0
  6. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  7. package/lib/api/impl/validator/index.js +1 -1
  8. package/lib/api/impl/validator/index.js.map +1 -1
  9. package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
  10. package/lib/chain/archiveStore/historicalState/metrics.js +21 -0
  11. package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
  12. package/lib/chain/builderCircuitBreaker.d.ts +6 -5
  13. package/lib/chain/builderCircuitBreaker.d.ts.map +1 -1
  14. package/lib/chain/builderCircuitBreaker.js +28 -15
  15. package/lib/chain/builderCircuitBreaker.js.map +1 -1
  16. package/lib/chain/options.d.ts +1 -1
  17. package/lib/chain/options.d.ts.map +1 -1
  18. package/lib/chain/prepareNextSlot.js +1 -1
  19. package/lib/chain/prepareNextSlot.js.map +1 -1
  20. package/lib/execution/builder/http.d.ts +10 -7
  21. package/lib/execution/builder/http.d.ts.map +1 -1
  22. package/lib/execution/builder/http.js +11 -8
  23. package/lib/execution/builder/http.js.map +1 -1
  24. package/lib/metrics/metrics/beacon.d.ts +3 -3
  25. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  26. package/lib/metrics/metrics/beacon.js +9 -9
  27. package/lib/metrics/metrics/beacon.js.map +1 -1
  28. package/lib/metrics/metrics/lodestar.d.ts +10 -0
  29. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  30. package/lib/metrics/metrics/lodestar.js +16 -0
  31. package/lib/metrics/metrics/lodestar.js.map +1 -1
  32. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  33. package/lib/network/processor/gossipHandlers.js +7 -2
  34. package/lib/network/processor/gossipHandlers.js.map +1 -1
  35. package/lib/sync/unknownBlock.d.ts.map +1 -1
  36. package/lib/sync/unknownBlock.js +17 -5
  37. package/lib/sync/unknownBlock.js.map +1 -1
  38. package/package.json +14 -14
  39. package/src/api/impl/beacon/blocks/index.ts +4 -6
  40. package/src/api/impl/beacon/pool/index.ts +5 -0
  41. package/src/api/impl/validator/index.ts +1 -1
  42. package/src/chain/archiveStore/historicalState/metrics.ts +22 -0
  43. package/src/chain/builderCircuitBreaker.ts +31 -17
  44. package/src/chain/options.ts +1 -1
  45. package/src/chain/prepareNextSlot.ts +1 -1
  46. package/src/execution/builder/http.ts +11 -11
  47. package/src/metrics/metrics/beacon.ts +9 -9
  48. package/src/metrics/metrics/lodestar.ts +16 -0
  49. package/src/network/processor/gossipHandlers.ts +9 -0
  50. package/src/sync/unknownBlock.ts +18 -5
@@ -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);
@@ -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: pendingBlock.blockInput.blockRootHex,
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: pendingBlock.blockInput.blockRootHex,
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(pendingBlock.blockInput.blockRootHex);
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: pendingBlock.blockInput.blockRootHex};
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}`