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(papyrus_network): add broadcast and sqmr metrics structs #4046

Merged
merged 4 commits into from
Feb 12, 2025

Conversation

AlonLStarkWare
Copy link
Contributor

  • refactor(papyrus_network): require network mamanger metrics when constructing nm
  • refactor(papyrus_network): clean up metrics tracking
  • feat(papyrus_network): add broadcast and sqmr metrics structs

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

github-actions bot commented Feb 9, 2025

@AlonLStarkWare AlonLStarkWare force-pushed the alonl/broadcast_sqmr_metrics_strucs branch from 9daba93 to b187b68 Compare February 9, 2025 19:32
Copy link

github-actions bot commented Feb 9, 2025

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.881 ms 34.910 ms 34.942 ms]
change: [-1.4348% -1.2715% -1.1066%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
8 (8.00%) high mild
1 (1.00%) high severe

@AlonLStarkWare AlonLStarkWare force-pushed the alonl/broadcast_sqmr_metrics_strucs branch from d04b599 to 7f33203 Compare February 10, 2025 12:01
Copy link
Contributor

@ShahakShama ShahakShama 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 5 files at r3, 3 of 3 files at r4, all commit messages.
Reviewable status: 7 of 17 files reviewed, 6 unresolved discussions (waiting on @eitanm-starkware and @noamsp-starkware)


crates/starknet_consensus_manager/src/consensus_manager.rs line 64 at r4 (raw file):

        }

        // TODO(alonl): consider splitting the metrics by topic

Move this TODO to papyrus_network on top of the BroadcastNetworkMetrics struct definition


crates/papyrus_network/src/network_manager/network_manager_metrics.rs line 15 at r4 (raw file):

}

pub struct SqmrNetworkMetrics {}

As discussed be-al pe, move num_active_*_sessions to here.
This means you can remove those metrics from mempool p2p and consensus


crates/papyrus_network/src/network_manager/mod.rs line 526 at r4 (raw file):

        event: gossipsub_impl::ExternalEvent,
    ) -> Result<(), NetworkError> {
        if let Some(metrics) = self.metrics.as_ref() {

use and_then to squash these two if-let into one if-let


crates/papyrus_network/src/network_manager/mod.rs line 526 at r4 (raw file):

        event: gossipsub_impl::ExternalEvent,
    ) -> Result<(), NetworkError> {
        if let Some(metrics) = self.metrics.as_ref() {

Unrelated to the PR, could you add a trace level log that we received a broadcast message and display the topic?


crates/papyrus_network/src/network_manager/mod.rs line 604 at r4 (raw file):

    fn broadcast_message(&mut self, message: Bytes, topic_hash: TopicHash) {
        if let Some(metrics) = self.metrics.as_ref() {

Same here


crates/papyrus_network/src/network_manager/mod.rs line 604 at r4 (raw file):

    fn broadcast_message(&mut self, message: Bytes, topic_hash: TopicHash) {
        if let Some(metrics) = self.metrics.as_ref() {

Unrelated to the PR, could you add a trace level log that we're sending a broadcast message and display the topic?

@AlonLStarkWare AlonLStarkWare force-pushed the alonl/broadcast_sqmr_metrics_strucs branch from 7f33203 to e75d412 Compare February 11, 2025 12:04
Copy link
Contributor Author

@AlonLStarkWare AlonLStarkWare 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: 0 of 18 files reviewed, 4 unresolved discussions (waiting on @eitanm-starkware, @noamsp-starkware, and @ShahakShama)


crates/papyrus_network/src/network_manager/mod.rs line 526 at r4 (raw file):

Previously, ShahakShama wrote…

Unrelated to the PR, could you add a trace level log that we received a broadcast message and display the topic?

Done


crates/papyrus_network/src/network_manager/mod.rs line 526 at r4 (raw file):

Previously, ShahakShama wrote…

use and_then to squash these two if-let into one if-let

Done.


crates/papyrus_network/src/network_manager/mod.rs line 604 at r4 (raw file):

Previously, ShahakShama wrote…

Same here

Done.


crates/papyrus_network/src/network_manager/mod.rs line 604 at r4 (raw file):

Previously, ShahakShama wrote…

Unrelated to the PR, could you add a trace level log that we're sending a broadcast message and display the topic?

Done


crates/starknet_consensus_manager/src/consensus_manager.rs line 64 at r4 (raw file):

Previously, ShahakShama wrote…

Move this TODO to papyrus_network on top of the BroadcastNetworkMetrics struct definition

Done.


crates/papyrus_network/src/network_manager/network_manager_metrics.rs line 15 at r4 (raw file):

Previously, ShahakShama wrote…

As discussed be-al pe, move num_active_*_sessions to here.
This means you can remove those metrics from mempool p2p and consensus

Done.

Copy link
Contributor

@ShahakShama ShahakShama 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 11 of 13 files at r6, 7 of 7 files at r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @eitanm-starkware and @noamsp-starkware)

@AlonLStarkWare AlonLStarkWare force-pushed the alonl/broadcast_sqmr_metrics_strucs branch from 2a766c7 to fa7ec6d Compare February 11, 2025 14:29
Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

Reviewed 11 of 11 files at r8, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @eitanm-starkware and @noamsp-starkware)

@AlonLStarkWare AlonLStarkWare added this pull request to the merge queue Feb 12, 2025
@AlonLStarkWare AlonLStarkWare removed this pull request from the merge queue due to a manual request Feb 12, 2025
@AlonLStarkWare AlonLStarkWare added this pull request to the merge queue Feb 12, 2025
Merged via the queue into main with commit 9ec2637 Feb 12, 2025
16 checks passed
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.

3 participants