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 tracing instrumentation and logging to consensus #2138

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

matan-starkware
Copy link
Contributor

@matan-starkware matan-starkware commented Jun 24, 2024

This change is Reviewable

@matan-starkware matan-starkware marked this pull request as ready for review June 24, 2024 12:54
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 65.90%. Comparing base (8f745ec) to head (aff6ab1).
Report is 3 commits behind head on main.

Files Patch % Lines
...g/papyrus_consensus/src/single_height_consensus.rs 0.00% 3 Missing ⚠️
crates/papyrus_node/src/main.rs 0.00% 1 Missing ⚠️
crates/sequencing/papyrus_consensus/src/lib.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2138      +/-   ##
==========================================
+ Coverage   65.67%   65.90%   +0.23%     
==========================================
  Files         135      135              
  Lines       17886    17808      -78     
  Branches    17886    17808      -78     
==========================================
- Hits        11747    11737      -10     
+ Misses       4852     4784      -68     
  Partials     1287     1287              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

dan-starkware
dan-starkware previously approved these changes Jun 25, 2024
Copy link
Collaborator

@dan-starkware dan-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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @matan-starkware)


crates/papyrus_node/src/main.rs line 101 at r1 (raw file):

) -> anyhow::Result<JoinHandle<Result<(), ConsensusError>>> {
    let Ok(validator_id) = env::var("CONSENSUS_VALIDATOR_ID") else {
        debug!("CONSENSUS_VALIDATOR_ID is not set. Not running consensus.");

Can remain info IMO

Code quote:

debug!

crates/sequencing/papyrus_consensus/src/lib.rs line 23 at r1 (raw file):

// TODO(dvir): add test for this.
#[instrument(

Consider adding explicit level

Code quote:

#[instrument(

crates/sequencing/papyrus_consensus/src/lib.rs line 24 at r1 (raw file):

// TODO(dvir): add test for this.
#[instrument(
    skip(context, start_height, network_receiver),

Why skipping start height?

Code quote:

start_height

crates/sequencing/papyrus_consensus/src/single_height_consensus.rs line 40 at r1 (raw file):

    }

    #[instrument(skip(self), fields(height=self.height.0), level = "info")]

Why not debug?

Code quote:

level = "info"

crates/sequencing/papyrus_consensus/src/single_height_consensus.rs line 76 at r1 (raw file):

        skip(self, init, content_receiver, fin_receiver),
        fields(height = %self.height),
        level = "info"

Why not debug?

Code quote:

level = "info"

@matan-starkware matan-starkware force-pushed the matan/consensus_validator_id_felt branch from 688b677 to 394f4c5 Compare June 25, 2024 14:40
@matan-starkware matan-starkware force-pushed the matan/consensus_tracing branch 2 times, most recently from 3d79e30 to 1bdc597 Compare June 25, 2024 14:56
@matan-starkware matan-starkware changed the base branch from matan/consensus_validator_id_felt to main June 25, 2024 14:56
@matan-starkware matan-starkware dismissed dan-starkware’s stale review June 25, 2024 14:56

The base branch was changed.

Copy link
Contributor Author

@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.

Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @dan-starkware)


crates/sequencing/papyrus_consensus/src/lib.rs line 24 at r1 (raw file):

Previously, dan-starkware wrote…

Why skipping start height?

Because these fields are printed out with every single log within this scope. I only want to print the starting height once when I begin.

Copy link
Collaborator

@dan-starkware dan-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 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @matan-starkware)


crates/sequencing/papyrus_consensus/src/lib.rs line 24 at r1 (raw file):

Previously, matan-starkware wrote…

Because these fields are printed out with every single log within this scope. I only want to print the starting height once when I begin.

That's not necessarily a bad thing, I'm fine either way

@matan-starkware matan-starkware added this pull request to the merge queue Jun 26, 2024
Merged via the queue into main with commit f0a025b Jun 26, 2024
19 checks passed
@matan-starkware matan-starkware deleted the matan/consensus_tracing branch June 26, 2024 09:47
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants