Skip to content

Additional services #772

Open
Open

Description

@Kagami

Hi.

I'd like to introduce several new node types compatible with the Bitmessage protocol: NODE_MOBILE and NODE_GATEWAY. They are almost identical to the nodes described here: https://bitmessage.org/wiki/Mobile_Protocol_specification

But several PyBitmessage quirks stop me:

So far I know one rather awkward solution: advertise NODE_NETWORK and NODE_GATEWAY fields (i.e. services = 5) as single addr entry and use hardcoded port for non-TCP transports (e.g. 18444) but this is rather tricky.

Activity

  1. Kagami commented on Feb 1, 2015

    @Kagami
    Author

    Sorry, I've updated the issue with several details.

  2. changed the title [-]Additional services and knownNodes limitation[/-] [+]Additional services[/+] on Feb 1, 2015
  3. Kagami commented on Feb 18, 2015

    @Kagami
    Author

    Also, node services data isn't saved to the disk. It was saved before inside the knownnodes[1] table records but not anymore with knownnodes.dat.

      CREATE TABLE knownnodes (
        timelastseen int,
        stream int,
        services blob,
        host blob,
        port blob,
        UNIQUE(host, stream, port) ON CONFLICT REPLACE
    )
  4. Kagami commented on Feb 23, 2015

    @Kagami
    Author

    So, I have two variants how it can be fixed:

    • PyBitmessage should store net_addr even if it hasn't NODE_NETWORK bit. And it shouldn't connect to the nodes without NODE_NETWORK bit.
    • PyBitmessage shouldn't store net_addrs without NODE_NETWORK bit.

    Each variant has it's own disadvantages:

    • In the second case, we need to hardcode NODE_GATEWAY port because there is no other place where it can be stored (except the higher bits of the services bitfield itself but it's too hackish).
    • But in the first case it's very easy to spam knownnodes because common node cannot verify availability of the node without NODE_NETWORK bit.

    So this is the plan how the second variant can be implemented:

    • PyBitmessage should store services field of the net_addr (it would require to change knownnodes format, but it's not too hard)
    • PyBitmessage should also properly advertise services field loaded from knownnodes.dat
    • PyBitmessage should discard net_addrs without NODE_NETWORK bit

    @Atheros1, do you have any objections/suggestions? I think I can make PR for this in 1-2 months.

  5. Kagami commented on Feb 23, 2015

    @Kagami
    Author

    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:

    • Use own set of bootstrap nodes which would propogate only nodes with NODE_GATEWAY services (equivalent to forking the Bitmessage network)
    • Broadcast objects encrypted with well-known keys which contain NODE_GATEWAY net_addrs (even more hackish)
    • Somehow say to the PyBitmessage via version exchange that we are only interested in NODE_GATEWAY nodes
  6. Kagami commented on Mar 3, 2015

    @Kagami
    Author

    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?

  7. added this to the v0.8.0 milestone on Nov 11, 2015
  8. self-assigned this
    on Nov 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions