-
Notifications
You must be signed in to change notification settings - Fork 134
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
Log detailed gossip results from bridge processes. #1010
Log detailed gossip results from bridge processes. #1010
Conversation
2016e0b
to
9ed3bbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. Having 3 trace logs for each seems like a lot, but I see were it is coming from.
portal-bridge/src/stats.rs
Outdated
let enr = Enr::from_str(enr).expect(""); | ||
// don't double count an enr if multiple clients offered the same content | ||
// to a peer | ||
if !content_stats.offered.contains(&enr) { | ||
content_stats.offered.push(enr); | ||
} | ||
} | ||
|
||
for enr in info.accepted.iter() { | ||
let enr = Enr::from_str(enr).expect(""); | ||
if !content_stats.accepted.contains(&enr) { | ||
content_stats.accepted.push(enr); | ||
} | ||
} | ||
|
||
for enr in info.transferred.iter() { | ||
let enr = Enr::from_str(enr).expect(""); | ||
if !content_stats.transferred.contains(&enr) { | ||
content_stats.transferred.push(enr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These expect("")
should never fail. But currently they are being used as if they were unwrap()
. It would be nice to put a message saying x is impossible
instead of an empty string. Just a nitpick so not a big deal if you don't want to, empty expect() just taste wrong idk. Just if the 1 in a billion chance happened we can just cntr f the text in the panic and find here quickly.
d608081
to
9834940
Compare
What was wrong?
Updated the bridge gossip stats to accurately reflect what was gossiped, using the new trace gossip result type. The idea is to make grepping through the bridge logs a feasible way to figure out whether content was successfully gossiped into the network.
How was it fixed?
To-Do