Skip to content

feat: add FOCIL beacon metrics #8062

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: focil
Choose a base branch
from
Draft

Conversation

KatyaRyazantseva
Copy link
Collaborator

Motivation

Add FOCIL metrics from beacon metrics specs to observe FOCIL.

Description

This PR adds the list of FOCIL beacon metrics specs #16.

Steps to test or reproduce

Observe metrics using Kurtosis FOCIL dashboard.

@KatyaRyazantseva KatyaRyazantseva self-assigned this Jul 16, 2025
@KatyaRyazantseva KatyaRyazantseva added the scope-metrics All issues with regards to the exposed metrics. label Jul 16, 2025
@KatyaRyazantseva
Copy link
Collaborator Author

Fork-choice metrics are temporary and expected to be moved to beacon after beacon specs #4351 merge and implementation.

Comment on lines +1541 to +1549
metrics?.eip7805.inclusionListProposed.inc();

chain.emitter.emit(routes.events.EventType.inclusionList, {
version: config.getForkName(signedInclusionList.message.slot),
data: signedInclusionList,
});

await network.publishInclusionList(signedInclusionList);
metrics?.eip7805.inclusionListBroadcasted.inc();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

inclusionListProposed and inclusionListBroadcasted seem to duplicate each other. I would like to hear from FOCIL team and other clients if it makes sense to have both.

Comment on lines +80 to +89
inclusionListValid: register.counter<{source: InclusionListSource}>({
name: "beacon_valid_inclusion_lists_total",
help: "Total number of valid inclusion lists",
labelNames: ["source"],
}),
inclusionListInvalid: register.counter<{source: InclusionListSource; reason: InvalidInclusionListReason}>({
name: "beacon_invalid_inclusion_lists_total",
help: "Total number of invalid inclusion lists",
labelNames: ["source", "reason"],
}),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need these metrics per slot

*/
export function getMetrics(register: MetricsRegister) {
return {
inclusionListEquivocating: register.counter<{source: FCInclusionListSource}>({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need this metric per slot

const {slot, validatorIndex, transactions, inclusionListCommitteeRoot} = inclusionList.message;

// [REJECT] The size of message is within upperbound MAX_BYTES_PER_INCLUSION_LIST
// TODO EIP-7805: spec is outdated, we need to check total size of all transactions
const inclusionListSize = transactions.reduce((total, transaction) => total + transaction.byteLength, 0);
if (inclusionListSize > chain.config.MAX_BYTES_PER_INCLUSION_LIST) {
metrics?.eip7805.inclusionListInvalid.inc({source, reason: InvalidInclusionListReason.maxSizeExceeded});
metrics?.eip7805.invalidInclusionListByteSize.inc(inclusionListSize);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we need source and reason for invalidInclusionListByteSize as well? Question for the FOCIL team.

Comment on lines +120 to +129
getInclusionListV1Requests: register.counter({
name: "beacon_engine_getInclusionListV1_requests_total",
help: "Total number of getInclusionListV1 requests sent",
}),
getInclusionListV1ResponseTime: register.histogram({
name: "beacon_engine_getInclusionListV1_response_time_seconds",
help: "Response time of getInclusionListV1 requests",
buckets: [0.01, 0.05, 0.1, 0.5, 1, 2.5, 5, 7.5],
}),
updatePayloadWithInclusionListV1Requests: register.counter({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we need responses count here? Seems like there shouldn't be any losses for engine api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope-metrics All issues with regards to the exposed metrics.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant