Additional services #772
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi.
I'd like to introduce several new node types compatible with the Bitmessage protocol:
NODE_MOBILE
andNODE_GATEWAY
. They are almost identical to the nodes described here: https://bitmessage.org/wiki/Mobile_Protocol_specificationBut several
PyBitmessage
quirks stop me:PyBitmessage
doesn't checkservices
bitfield at all. This means that if I advertise node which uses non-TCP transport withservices = 4
(BE value),PyBitmessage
will constantly try to connect to it despite the fact the node hasn'tNODE_NETWORK
bit.I can't advertiseOops, I missed the factNODE_NETWORK
andNODE_GATEWAY
node as two differentaddr
entries with the same IP becauseknownNodes
structure is a host-ip/host-details map.knownNodes
is a host+port/host-details map now.NODE_GATEWAY
as a separateaddr
entry, PyBitmessage won't be able to connect to it anyway soNODE_GATEWAY
addresses will propogate badly through the network because of the node alive checkings: https://github.com/Bitmessage/PyBitmessage/blob/master/src/class_receiveDataThread.py#L666PyBitmessage
currently doesn't take into accountservices
field when it packs theaddr
message: https://github.com/Bitmessage/PyBitmessage/blob/master/src/class_receiveDataThread.py#L672, https://github.com/Bitmessage/PyBitmessage/blob/master/src/class_receiveDataThread.py#L275So far I know one rather awkward solution: advertise
NODE_NETWORK
andNODE_GATEWAY
fields (i.e.services = 5
) as singleaddr
entry and use hardcoded port for non-TCP transports (e.g. 18444) but this is rather tricky.Sorry, I've updated the issue with several details.
Also, node services data isn't saved to the disk. It was saved before inside the
knownnodes
[1] table records but not anymore withknownnodes.dat
.So, I have two variants how it can be fixed:
Each variant has it's own disadvantages:
So this is the plan how the second variant can be implemented:
@Atheros1, do you have any objections/suggestions? I think I can make PR for this in 1-2 months.
Though, the sad part is: nodes with special services still won't be propogated fast because PyBitmessage won't give advantage to them when sending big addr message. So the alternative approaches are:
Also, the interesting question: what if some node will lie about net_addr's services and constantly rebroadcast wrong values? How are we going to detect and ban such node?