Skip to content
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

feat(consensus): add consensus height metric #4497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

guy-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@guy-starkware guy-starkware marked this pull request as ready for review February 26, 2025 13:35
Copy link
Contributor Author

guy-starkware commented Feb 26, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@guy-starkware guy-starkware force-pushed the guyn/metrics/consensus_height branch from 7726f1c to 0081300 Compare February 27, 2025 14:17
@guy-starkware guy-starkware changed the title feat(starknet_consensus): add consensus height metric feat(consensus): add consensus height metric Feb 27, 2025
@guy-starkware guy-starkware force-pushed the guyn/metrics/consensus_height branch 3 times, most recently from ecaa3b6 to e03ba65 Compare March 3, 2025 08:59
Copy link
Contributor

@matan-starkware matan-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 11 files at r2, all commit messages.
Reviewable status: 4 of 12 files reviewed, 3 unresolved discussions


crates/starknet_consensus/src/manager.rs line 177 at r2 (raw file):

        );

        register_metrics();

Why are we doing this every height? I would expect this to be done either by the component starter (consensus_manager.rs) or from the run_consensus function

Code quote:

        register_metrics();

crates/starknet_consensus/src/metrics.rs line 6 at r2 (raw file):

define_metrics!(
    Consensus => {
        MetricGauge { CONSENSUS_HEIGHT, "consensus_height", "The height of the state machine" },

Suggestion:

The block number consensus is working to decide

config/sequencer/default_config.json line 86 at r2 (raw file):

    "pointer_target": "versioned_constants_overrides.max_n_events",
    "privacy": "Public"
  },

Why does this diff show up here? Do you need to rebase on main?

Code quote:

  "batcher_config.block_builder_config.versioned_constants_overrides.max_n_events": {
    "description": "Maximum number of events that can be emitted from the transation.",
    "pointer_target": "versioned_constants_overrides.max_n_events",
    "privacy": "Public"
  },

Copy link
Contributor Author

@guy-starkware guy-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 12 files reviewed, 3 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @matan-starkware)


config/sequencer/default_config.json line 86 at r2 (raw file):

Previously, matan-starkware wrote…

Why does this diff show up here? Do you need to rebase on main?

I think it may have something to do with formatting changes. I'll try to rebase and see if it goes away.


crates/starknet_consensus/src/manager.rs line 177 at r2 (raw file):

Previously, matan-starkware wrote…

Why are we doing this every height? I would expect this to be done either by the component starter (consensus_manager.rs) or from the run_consensus function

Right!


crates/starknet_consensus/src/metrics.rs line 6 at r2 (raw file):

define_metrics!(
    Consensus => {
        MetricGauge { CONSENSUS_HEIGHT, "consensus_height", "The height of the state machine" },

Done.

@guy-starkware guy-starkware force-pushed the guyn/metrics/consensus_height branch from e03ba65 to 3672c43 Compare March 4, 2025 08:20
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 12 files reviewed, 4 unresolved discussions (waiting on @matan-starkware)


crates/starknet_consensus/src/manager.rs line 176 at r3 (raw file):

             {validators:?}"
        );
        #[allow(clippy::as_conversions)] // FIXME: use int metrics so `as f64` may be removed.

Named todos please.

Code quote:

// FIXME: use int metrics so `as f64` may be removed.

Copy link
Contributor Author

@guy-starkware guy-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 2 of 12 files reviewed, 4 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @matan-starkware)


crates/starknet_consensus/src/manager.rs line 176 at r3 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Named todos please.

a) I copied this comment from elsewhere, so don't blame me!
b) I think using FIXME to avoid the CI failure due to unnamed TODOs is genius (I wish I could say I invented it myself).
c) I will fix it but honestly I don't know who should be responsible for this.
d) If I look around the room and I don't see anyone who should be responsible for this it means... oh no, it means its me!
e) Do you have any thoughts on how to collect integer metrics instead of floating point? I've seen this FIXME in many places.

@guy-starkware guy-starkware force-pushed the guyn/metrics/consensus_height branch from 3672c43 to 8c88b23 Compare March 4, 2025 08:49
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 6 files at r1, 5 of 11 files at r2, 2 of 3 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: 9 of 12 files reviewed, 3 unresolved discussions (waiting on @matan-starkware)

@guy-starkware guy-starkware force-pushed the guyn/metrics/consensus_height branch 2 times, most recently from 1e86ff0 to 9f259e8 Compare March 4, 2025 11:52
@guy-starkware guy-starkware force-pushed the guyn/metrics/consensus_height branch from 9f259e8 to 5e0c80d Compare March 4, 2025 14:52
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.

4 participants