-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Net: Consistently log outgoing INV messages #15253
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
Conversation
|
Possible concern: verbosity of the resultant logs |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
7a7ca3d to
50d97ff
Compare
src/net_processing.cpp
Outdated
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.
It seems we can move this logging inside PushInventory for cases where inv is for block?
Then this code won't be duplicate in 2 places.
I'm also wondering whether we should put all logging (including transactions) there to have a uniform behavior, not sure though.
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.
The main reason I didn't do that was to avoid multiple log entries when relaying to all peers, as in RelayInventory. A single message in that case is a lot less noisy.
|
ACK |
9a2928a to
24e230f
Compare
|
@Empact Mind to split up the first two commits into a separate pull? |
Note the hashes passed more closely match the surrounding code.
This requires splitting CNode::PushInventory into Block and Transaction variants for the sake of the return information.
|
@sdaftuar please give your feedback here too. |
|
I have no opinion about whether we should log all the txid's in an INV or not with -debug=net is enabled. This implementation seems broken however -- in addition to the refactor being needlessly disruptive, it's incorrect logically to log a message about an inv being sent when PushInventory is called. It's not until we try to actually get to SendMessages for that peer and hit the poisson timeout before we determine whether to actually send a given txid to a peer, based on their filterInventoryKnown which may have changed from when we called PushInventory. Because there's just one place in the code we send INV messages it should be straightforward to just print them out (either in CConnMan::PushMessage, where there is already a log message, or in net_processing's SendMessages() where we construct the INV). |
|
Thanks, these are logged in PushMesaage, as you mention @sdaftuar. Just not in the CI logs. Seems some other work needs to be done, eg around publishing the full CI log artifacts or the like. |
These are logged in some cases, but not in others, which can make debugging test failures impractical in cases where the TX INVs are important.
Also fix the
sending inv peer=%d hash=%sto explicitly note that a block inv was being sent.Here's an example of where this might come in useful.
From log previously held here: https://travis-ci.org/bitcoin/bitcoin/jobs/484159397 but since overwritten. I have the full log available locally if anyone is curious to see it.