diff --git a/src/Nethermind/Nethermind.Merge.Plugin/Handlers/GetBlobsHandler.cs b/src/Nethermind/Nethermind.Merge.Plugin/Handlers/GetBlobsHandler.cs index 27fbdad96a3..02dda654a23 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin/Handlers/GetBlobsHandler.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin/Handlers/GetBlobsHandler.cs @@ -26,11 +26,17 @@ public Task> HandleAsync(byte[][] request) private IEnumerable GetBlobsAndProofs(byte[][] request) { + Metrics.NumberOfRequestedBlobs += request.Length; + foreach (byte[] requestedBlobVersionedHash in request) { - yield return txPool.TryGetBlobAndProof(requestedBlobVersionedHash, out byte[]? blob, out byte[]? proof) - ? new BlobAndProofV1(blob, proof) - : null; + if (txPool.TryGetBlobAndProof(requestedBlobVersionedHash, out byte[]? blob, out byte[]? proof)) + { + Metrics.NumberOfSentBlobs++; + yield return new BlobAndProofV1(blob, proof); + } + + yield return null; } } } diff --git a/src/Nethermind/Nethermind.Merge.Plugin/Metrics.cs b/src/Nethermind/Nethermind.Merge.Plugin/Metrics.cs index fcaf7335942..f4e192fa7fb 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin/Metrics.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin/Metrics.cs @@ -23,5 +23,13 @@ public static class Metrics [GaugeMetric] [Description("Number of Transactions included in the Last GetPayload Request")] public static int NumberOfTransactionsInGetPayload { get; set; } + + [GaugeMetric] + [Description("Number of Blobs requested by engine_getBlobsV1")] + public static int NumberOfRequestedBlobs { get; set; } + + [GaugeMetric] + [Description("Number of Blobs sent by engine_getBlobsV1")] + public static int NumberOfSentBlobs { get; set; } } }