Bit numbering scheme in pubkey/service features #769
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. Another spec quirk.
Service features bitfield uses LSB 0:
https://github.com/Bitmessage/PyBitmessage/blob/master/src/shared.py#L149
https://bitmessage.org/wiki/Protocol_specification#version
At the same time pubkey behavior bitfield uses MSB 0:
https://github.com/Bitmessage/PyBitmessage/blob/master/src/class_singleWorker.py#L272
https://bitmessage.org/wiki/Protocol_specification#Pubkey_bitfield_features
https://github.com/Bitmessage/PyBitmessage/blob/master/src/class_singleWorker.py#L747
https://github.com/Bitmessage/PyBitmessage/blob/master/src/shared.py#L469
Should we be more consistent or at least mention this contradiction in the wiki?
It appears to me that shared.py#L149 is MSB 0.
Hm, you are right. I misread value 1 in
as a bit number.
But it's still not very clear because pubkey bitfield uses bits and services bitfield uses BE values.
You are right that that is strange. The services bitfield I copied from Bitcoin because it seemed like a good idea but we don't make use of it yet and it appears that neither does Bitcoin.
I know one very good use case for services bitfield: it will allow to find WebSocket gateway nodes for web clients because they can't create normal TCP connections. (Similar idea was proposed here.)
Also you was proposed to take one bit for TLS-enabled nodes.