-
Notifications
You must be signed in to change notification settings - Fork 2
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
Spy detector in Peer-observer #45
Conversation
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.
INV and GetData messages can contain e.g. blocks too and not only transactions. You currently use the msg type string from the Metadata, but it's better to match on the message payload. You can filter out block INV and GetData messages there.
Agree!! |
So basically INVs can contain blocks too, my question is:
|
See https://docs.rs/bitcoin/latest/bitcoin/p2p/message_blockdata/enum.Inventory.html We want to handle peer-observer/protobuf/proto-types/primitive.proto Lines 49 to 52 in 712a51c
Inventory::WitnessTransaction (
See also https://github.com/bitcoin/bitcoin/blob/5abb9b1af49be9024f95fa2f777285c531785d85/src/protocol.h#L473-L490 and the comments there.
I think we can ignore block invs for now. Here, we are only interested in TX / WTX invs.
Yes, that's possible, but not too common. Best would be to iterate over an INV message and increment the counter for each transaction/witness_transaction in the INV message. |
great!! Thanks for sharing! |
I think we can define primitive for Getdata too! @0xB10C ? |
We already have one! |
Okay got it!! |
Hey, are you still working on this? |
Yes, I am working!! |
Need to resolve conflicts and squash commits!! |
Continued in #57 , I'm closing this for now! |
Fixes #43
This creates a tool, Spy-Detector that: