Page MenuHomePhabricator

[avalanche] Fix a bug in the avalanche logs
ClosedPublic

Authored by Fabien on Sep 28 2023, 15:27.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABC47810b33d3c8: [avalanche] Fix a bug in the avalanche logs
Summary

It appears that a peer id is not an inventory type.

Test Plan
ninja all check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Fabien requested review of this revision.Sep 28 2023, 15:27
bytesofman added a subscriber: bytesofman.
bytesofman added inline comments.
src/net_processing.cpp
5094 ↗(On Diff #42437)

looks like the logic applied before this diff is that inv.type could only be unknown if we get to this default block of the switch statement, the introduced bug was in supplying inv.type as the variable to be logged instead of pfrom.GetId() (guessing a bit, I don't actually know what inv.type could be).

If inv.type really is always unknown, then we could just not long the var at all, keep the hardcoded poll inv type unknown

If inv.type can be many things but always unrecognized by the switch statement if we get here, could still clarify this, say something like `"unrecognized poll inv type '%d' from peer=%d\n" as suggested

This revision now requires changes to proceed.Sep 28 2023, 22:45
Fabien requested review of this revision.Sep 29 2023, 18:38
Fabien added inline comments.
src/net_processing.cpp
5094 ↗(On Diff #42437)

The possible values for inv.type is defined at the protocol level, and the node is fully compatible with the eCash P2P protocol.
If the inv switch is reaching this point it's because the peer sent an inv.type that is not part of the protocol, hence the 'unknown'.

This revision is now accepted and ready to land.Sep 29 2023, 18:39
This revision was automatically updated to reflect the committed changes.