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

Log detailed gossip results from bridge processes. #1010

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

njgheorghita
Copy link
Collaborator

@njgheorghita njgheorghita commented Oct 27, 2023

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?

  • Added improved metrics and logs to beacon and history bridge processes

To-Do

@njgheorghita njgheorghita force-pushed the bridge-gossip-reporting branch from 2016e0b to 9ed3bbb Compare October 27, 2023 19:27
@njgheorghita njgheorghita marked this pull request as ready for review October 27, 2023 20:32
Copy link
Member

@KolbyML KolbyML left a comment

Choose a reason for hiding this comment

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

:shipit: looks good. Having 3 trace logs for each seems like a lot, but I see were it is coming from.

Comment on lines 302 to 323
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);
Copy link
Member

@KolbyML KolbyML Oct 27, 2023

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.

@njgheorghita njgheorghita force-pushed the bridge-gossip-reporting branch from d608081 to 9834940 Compare October 31, 2023 14:58
@njgheorghita njgheorghita merged commit a9ca045 into ethereum:master Oct 31, 2023
1 check passed
@njgheorghita njgheorghita deleted the bridge-gossip-reporting branch October 31, 2023 15:09
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.

2 participants