Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 101 additions & 18 deletions dashboards/lodestar_peerdas.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "rate(lodestar_data_columns_by_source[$rate_interval]) * 12",
"expr": "rate(lodestar_data_columns_by_source_total[$rate_interval]) * 12",
"instant": false,
"legendFormat": "__auto",
"range": true,
Expand Down Expand Up @@ -595,13 +595,96 @@
"title": "Runtime of data column sidecars gossip verification",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"description": "Time elapsed between data column received and data column validated",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisBorderShow": false,
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 12,
"x": 0,
"y": 20
},
"id": 69,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"editorMode": "code",
"expr": "rate(lodestar_gossip_data_column_received_to_gossip_validate_seconds_bucket[$rate_interval])",
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Data column recv to gossip validation delay",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 20
"y": 26
},
"id": 58,
"panels": [],
Expand Down Expand Up @@ -661,7 +744,7 @@
"h": 6,
"w": 12,
"x": 0,
"y": 21
"y": 27
},
"id": 50,
"interval": "30s",
Expand Down Expand Up @@ -777,7 +860,7 @@
"h": 6,
"w": 12,
"x": 12,
"y": 21
"y": 27
},
"id": 56,
"interval": "30s",
Expand Down Expand Up @@ -868,7 +951,7 @@
"h": 6,
"w": 12,
"x": 0,
"y": 27
"y": 33
},
"id": 57,
"interval": "30s",
Expand Down Expand Up @@ -958,7 +1041,7 @@
"h": 6,
"w": 12,
"x": 12,
"y": 27
"y": 33
},
"id": 49,
"options": {
Expand Down Expand Up @@ -998,7 +1081,7 @@
"h": 1,
"w": 24,
"x": 0,
"y": 33
"y": 39
},
"id": 60,
"panels": [],
Expand Down Expand Up @@ -1057,7 +1140,7 @@
"h": 6,
"w": 12,
"x": 0,
"y": 34
"y": 40
},
"id": 21,
"options": {
Expand Down Expand Up @@ -1142,7 +1225,7 @@
"h": 6,
"w": 12,
"x": 12,
"y": 34
"y": 40
},
"id": 22,
"options": {
Expand Down Expand Up @@ -1226,7 +1309,7 @@
"h": 6,
"w": 12,
"x": 0,
"y": 40
"y": 46
},
"id": 24,
"options": {
Expand Down Expand Up @@ -1280,7 +1363,7 @@
"h": 6,
"w": 6,
"x": 12,
"y": 40
"y": 46
},
"id": 36,
"options": {
Expand Down Expand Up @@ -1337,7 +1420,7 @@
"h": 6,
"w": 6,
"x": 18,
"y": 40
"y": 46
},
"id": 53,
"options": {
Expand Down Expand Up @@ -1380,7 +1463,7 @@
"h": 1,
"w": 24,
"x": 0,
"y": 46
"y": 52
},
"id": 59,
"panels": [],
Expand Down Expand Up @@ -1438,7 +1521,7 @@
"h": 6,
"w": 12,
"x": 0,
"y": 47
"y": 53
},
"id": 14,
"interval": "30s",
Expand Down Expand Up @@ -1526,7 +1609,7 @@
"h": 6,
"w": 12,
"x": 12,
"y": 47
"y": 53
},
"id": 25,
"interval": "30s",
Expand Down Expand Up @@ -1611,7 +1694,7 @@
"h": 6,
"w": 12,
"x": 0,
"y": 53
"y": 59
},
"id": 64,
"options": {
Expand Down Expand Up @@ -1694,7 +1777,7 @@
"h": 6,
"w": 12,
"x": 12,
"y": 53
"y": 59
},
"id": 67,
"options": {
Expand Down Expand Up @@ -1777,7 +1860,7 @@
"h": 6,
"w": 12,
"x": 0,
"y": 59
"y": 65
},
"id": 68,
"options": {
Expand Down
28 changes: 14 additions & 14 deletions packages/beacon-node/src/api/impl/beacon/blocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export function getBeaconBlockApi({
// Send the block, regardless of whether or not it is valid. The API
// specification is very clear that this is the desired behavior.
//
// - Publish blobs and block before importing so that network can see them asap
// - Publish blobs or data columns and block before importing so that network can see them asap
// - Publish block first because
// a) as soon as node sees block they can start processing it while data is in transit
// b) getting block first allows nodes to use getBlobs from local ELs and save
Expand Down Expand Up @@ -327,21 +327,21 @@ export function getBeaconBlockApi({
});
}
}
} else if (
isForkPostDeneb(blockForImport.blockData.fork) &&
chain.emitter.listenerCount(routes.events.EventType.blobSidecar)
) {
} else if (isForkPostDeneb(blockForImport.blockData.fork)) {
const {blobs} = blockForImport.blockData as BlockInputBlobs;
metrics?.blobs.bySource.inc({source: BlobsSource.api}, blobs.length);

for (const blobSidecar of blobs) {
const {index, kzgCommitment} = blobSidecar;
chain.emitter.emit(routes.events.EventType.blobSidecar, {
blockRoot,
slot,
index,
kzgCommitment: toHex(kzgCommitment),
versionedHash: toHex(kzgCommitmentToVersionedHash(kzgCommitment)),
});
if (chain.emitter.listenerCount(routes.events.EventType.blobSidecar)) {
for (const blobSidecar of blobs) {
const {index, kzgCommitment} = blobSidecar;
chain.emitter.emit(routes.events.EventType.blobSidecar, {
blockRoot,
slot,
index,
kzgCommitment: toHex(kzgCommitment),
versionedHash: toHex(kzgCommitmentToVersionedHash(kzgCommitment)),
});
}
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions packages/beacon-node/src/chain/blocks/importBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
NotReorgedReason,
} from "@lodestar/fork-choice";
import {
ForkName,
ForkPostAltair,
ForkPostElectra,
ForkSeq,
Expand Down Expand Up @@ -513,14 +512,6 @@ export async function importBlock(
// dataPromise will not end up here, but preDeneb could. In future we might also allow syncing
// out of data range blocks and import then in forkchoice although one would not be able to
// attest and propose with such head similar to optimistic sync
if (
blockInput.type === BlockInputType.availableData &&
(blockInput.blockData.fork === ForkName.deneb || blockInput.blockData.fork === ForkName.electra)
) {
const {blobsSource} = blockInput.blockData;
this.metrics?.importBlock.blobsBySource.inc({blobsSource});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to seenGossipBlockInput.ts.

}

const advancedSlot = this.clock.slotWithFutureTolerance(REPROCESS_MIN_TIME_TO_NEXT_SLOT_SEC);

// Gossip blocks need to be imported as soon as possible, waiting attestations could be processed
Expand Down
1 change: 1 addition & 0 deletions packages/beacon-node/src/chain/blocks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Availability<T> = {
export enum BlobsSource {
gossip = "gossip",
api = "api",
engine = "engine",
byRange = "req_resp_by_range",
byRoot = "req_resp_by_root",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,14 @@ export class SeenGossipBlockInput {
};
}

const resolveAvailabilityAndBlockInput = (source: BlockInputAvailabilitySource) => {
const resolveAvailabilityAndBlockInput = () => {
const allDataColumns = getBlockInputDataColumns(dataColumnsCache, this.custodyConfig.sampledColumns);
const blockData: BlockInputDataColumns = {
fork: cachedData.fork,
...allDataColumns,
dataColumnsSource: DataColumnsSource.gossip,
};
resolveAvailability(blockData);
// TODO(das): should not use syncUnknownBlock metrics here
metrics?.syncUnknownBlock.resolveAvailabilitySource.inc({source});
metrics?.dataColumns.bySource.inc({source: DataColumnsSource.gossip});

const blockInput = getBlockInput.availableData(config, signedBlock, BlockSource.gossip, blockData);
resolveBlockInput(blockInput);
Expand Down Expand Up @@ -362,7 +359,10 @@ export class SeenGossipBlockInput {
metrics?.recoverDataColumnSidecars.reconstructionResult.inc({result: recoverResult});
switch (recoverResult) {
case RecoverResult.SuccessResolved: {
resolveAvailabilityAndBlockInput(BlockInputAvailabilitySource.RECOVERED);
resolveAvailabilityAndBlockInput();
metrics?.syncUnknownBlock.resolveAvailabilitySource.inc({
source: BlockInputAvailabilitySource.RECOVERED,
});
// Publish columns if and only if subscribed to them
const sampledColumns = this.custodyConfig.sampledColumns.map((columnIndex) => {
const dataColumn = dataColumnsCache.get(columnIndex)?.dataColumn;
Expand Down Expand Up @@ -395,7 +395,8 @@ export class SeenGossipBlockInput {
});
}
if (hasSampledDataColumns(this.custodyConfig, dataColumnsCache)) {
const blockInput = resolveAvailabilityAndBlockInput(BlockInputAvailabilitySource.GOSSIP);
const blockInput = resolveAvailabilityAndBlockInput();
metrics?.syncUnknownBlock.resolveAvailabilitySource.inc({source: BlockInputAvailabilitySource.GOSSIP});
const allDataColumns = getBlockInputDataColumns(dataColumnsCache, this.custodyConfig.sampledColumns);
const {dataColumns} = allDataColumns;
return {
Expand Down
Loading
Loading