Log which peer sent us a header (first) #27744

issue Sjors openend this issue on May 24, 2023
  1. Sjors commented at 7:21 pm on May 24, 2023: member

    Discussed in #27278 (comment)

    0Saw new header hash=... height=...
    

    It would be useful to add the node id to this message. The validation code doesn’t know which peer the header came from, so we’d have to move the log entry to net_processing.

    One way is to add a helper function LogBlockHeader and call it right after both ProcessNewBlockHeaders(header, peer, compact_blk) calls in net_processing, only if they return true. Since we process headers in batches, it’s perhaps easiest to only log the last header.

    Doing so would also make the log less noisy when the header is received via a compact block, because this is the same site that produces the Saw new cmpctblock header hash message.

  2. Harshil-Jani commented at 3:11 pm on June 2, 2023: none
    Hey !! I am new into bitcoin developement and if no one is already working to do this change, I am willing to do this.
  3. Sjors commented at 10:24 am on June 5, 2023: member
    @Harshil-Jani no need to ask permission. That said, validation and net_processing are usually not the best place to start if you’re new to this code. It’s easy to make mistakes here, even with something as simple as adding a log entry (e.g. #27673).
  4. Harshil-Jani commented at 10:42 am on June 5, 2023: none
    I see. Thanks for this, I will try to look towards something else.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-07-01 19:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me