This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Add from field for message tracking#32725
Merged
gregcusack merged 9 commits intosolana-labs:masterfrom Aug 7, 2023
Merged
Conversation
added 6 commits
August 3, 2023 16:50
…not PULL requests
Codecov Report
@@ Coverage Diff @@
## master #32725 +/- ##
=========================================
- Coverage 82.0% 82.0% -0.1%
=========================================
Files 785 785
Lines 211084 211085 +1
=========================================
- Hits 173107 173098 -9
- Misses 37977 37987 +10 |
behzadnouri
reviewed
Aug 7, 2023
| PushMessage(/*from:*/ Pubkey), | ||
| } | ||
|
|
||
| impl std::fmt::Display for GossipRoute { |
Contributor
There was a problem hiding this comment.
I don't think we need this; instead record_insert can do something like:
let GossipRoute::PushMessage(from) = route else {
return;
}| PullRequest, | ||
| PullResponse, | ||
| PushMessage, | ||
| PushMessage(/*from:*/ Pubkey), |
Contributor
There was a problem hiding this comment.
Can this be reference so we don't copy the pubkey for each value?
something like
pub enum GossipRout<'a> {
// ...
PushMessage(&'a Pubkey),
}| } | ||
|
|
||
| if matches!(route, GossipRoute::PushMessage) | ||
| if matches!(route, GossipRoute::PushMessage(_)) |
Contributor
There was a problem hiding this comment.
I think instead of this we can do
let GossipRoute::PushMessage(from) = route else {
return;
}before the if branch.
added 2 commits
August 7, 2023 10:05
…rence in gossiproute enum
behzadnouri
approved these changes
Aug 7, 2023
Contributor
behzadnouri
left a comment
There was a problem hiding this comment.
lgtm,
please wait for the CI to come green before merging.
mergify Bot
pushed a commit
that referenced
this pull request
Aug 7, 2023
* we only want to report received message signatures on PUSH requests, not PULL requests * woops accidently had it has LocalMessage not PushMessage * switch from match to if let statement * convert if let to matches macro * add in from field in PushMessage for message tracking * update with cargo fmt * remove display for gossip route and add lifetime param to pubkey reference in gossiproute enum * forgot to run fmt (cherry picked from commit 5c86f89) # Conflicts: # gossip/src/crds.rs
gregcusack
pushed a commit
that referenced
this pull request
Aug 9, 2023
* we only want to report received message signatures on PUSH requests, not PULL requests * woops accidently had it has LocalMessage not PushMessage * switch from match to if let statement * convert if let to matches macro * add in from field in PushMessage for message tracking * update with cargo fmt * remove display for gossip route and add lifetime param to pubkey reference in gossiproute enum * forgot to run fmt
gregcusack
pushed a commit
that referenced
this pull request
Aug 9, 2023
Add from field for message tracking (#32725) * we only want to report received message signatures on PUSH requests, not PULL requests * woops accidently had it has LocalMessage not PushMessage * switch from match to if let statement * convert if let to matches macro * add in from field in PushMessage for message tracking * update with cargo fmt * remove display for gossip route and add lifetime param to pubkey reference in gossiproute enum * forgot to run fmt Co-authored-by: Greg Cusack <greg.cusack@solana.com>
This was referenced Mar 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
We want to track how push messages propagate through the network from node to node. There is currently no way to track this. This builds off of PR: #32708.
Summary of Changes
Add a
fromfield toGossipRoute::PushMessage-->GossipRoute::PushMessage(/*from:*/ Pubkey)For extracting that pubkey for reporting to metrics, an
std:: fmt::Displaywas added forGossipRoute::PushMessage(Pubkey).Fixes #