Skip to content

Engine getblobs v2 metrics#31834

Closed
SunnysidedJ wants to merge 58 commits into
ethereum:peerdas-devnet-7from
SunnysidedJ:engine-getblobs-v2-metrics
Closed

Engine getblobs v2 metrics#31834
SunnysidedJ wants to merge 58 commits into
ethereum:peerdas-devnet-7from
SunnysidedJ:engine-getblobs-v2-metrics

Conversation

@SunnysidedJ
Copy link
Copy Markdown

Re-opening from MariusVanDerWijden#66

mininny and others added 9 commits May 9, 2025 12:22
While running kurtosis and spamoor, I noticed occasional `null` entries
coming back from `getBlobsV2`. After investigating, I found that spamoor
can use the same blob data across multiple transactions, so with larger
blob counts, there's an increased chance that a blob is included in a
block more than once. As a result, previous indexes in the hash-to-index
map in `getBlobsV2` would get overwritten.

I changed the map from `map[common.Hash]int` to `map[common.Hash][]int`
to handle this case. I decided to go this route because it's the
smallest-possible fix, but it could also make sense to update
`blobpool.GetBlobs` to de-duplicate the hashes.
Comment thread eth/catalyst/api.go
Comment on lines +166 to +172
getBlobsV2BlobsRequestedTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_total", nil)
// Number of blobs requested via getBlobsV2 that are present in the blobpool
getBlobsV2BlobsInPoolTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_in_blobpool_total", nil)
// Number of times getBlobsV2 responded with “hit”
getBlobsV2RequestHit = metrics.NewRegisteredCounter("get_blobs_requests_success_total", nil)
// Number of times getBlobsV2 responded with “miss”
getBlobsV2RequestMiss = metrics.NewRegisteredCounter("get_blobs_requests_failure_total", nil)
Copy link
Copy Markdown
Member

@MariusVanDerWijden MariusVanDerWijden May 15, 2025

Choose a reason for hiding this comment

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

What do you think about something like this?

Suggested change
getBlobsV2BlobsRequestedTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_total", nil)
// Number of blobs requested via getBlobsV2 that are present in the blobpool
getBlobsV2BlobsInPoolTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_in_blobpool_total", nil)
// Number of times getBlobsV2 responded with “hit”
getBlobsV2RequestHit = metrics.NewRegisteredCounter("get_blobs_requests_success_total", nil)
// Number of times getBlobsV2 responded with “miss”
getBlobsV2RequestMiss = metrics.NewRegisteredCounter("get_blobs_requests_failure_total", nil)
getBlobsRequestedCounter = metrics.NewRegisteredCounter("engine/getblobs/requested", nil)
// Number of blobs requested via getBlobsV2 that are present in the blobpool
getBlobsAvailableCounter = metrics.NewRegisteredCounter("engine/getblobs/available", nil)
// Number of times getBlobsV2 responded with “hit”
getBlobsV2RequestHit = metrics.NewRegisteredCounter("engine/getblobs/hit, nil)
// Number of times getBlobsV2 responded with “miss”
getBlobsV2RequestMiss = metrics.NewRegisteredCounter("engine/getblobs/miss", nil)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This naming convention is also reasonable approach. Unfortunately, we are trying to follow the convention recommended by Prometheus, and some clients already have them merged. Would you mind these names? The documentation is here (mentioned in the original PR): https://testinprod.notion.site/Proposal-for-Unified-EL-metrics-for-PeerDAS-1d28fc57f54680f2a3cbfe408d7db4b8?pvs=4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the prometheus exporter, we replace / by _. So our names are aligned with the Prometheus convention. We can discuss the names, but I feel that they should at least contain the engine prefix. We have a lot of metrics and they are all categorized nicely. Don't want to break this.

Comment thread eth/catalyst/api.go Outdated

for i, hash := range hashes {
for i, hash := range hashes {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems wrong whitespacing imo, please go format -ed your files

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Sorry, it seems like I made typo while merging conflicts on the web.

Comment thread core/txpool/validation.go
@MariusVanDerWijden
Copy link
Copy Markdown
Member

Looks like they want to standardize metric names across clients. We should discuss on triage if we want that

@MariusVanDerWijden
Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants