Skip to content
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

pyln.client gossmap support #4582

Merged
merged 23 commits into from
Sep 8, 2021

Commits on Sep 7, 2021

  1. pyln-spec: update to latest version of the spec.

    Changelog-Changed: pyln-spec: updated to latest BOLT versions.
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    11f0634 View commit details
    Browse the repository at this point in the history
  2. pyln.client: don't try to use module inside setup.py.

    This fails once it has dependencies (next patch): instead extract version
    manually.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    83e3480 View commit details
    Browse the repository at this point in the history
  3. pyln.client: new functionality to access Gossmap.

    It doesn't do much work, but it does parse the gossmap file and extract
    nodes and channels.
    
    [ Fixup by Michael Schmoock <michael@schmoock.net> ]
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    6ab1fe7 View commit details
    Browse the repository at this point in the history
  4. pyln-client/gossmap: save deconstructed fields instead of raw msg bytes.

    We have to parse them anyway, so why not make them accessible.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    3ae4068 View commit details
    Browse the repository at this point in the history
  5. pyln-client/gossmap: add a little documentation.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    6bf59b4 View commit details
    Browse the repository at this point in the history
  6. pyln-proto: expose ShortChannelId and PublicKey.

    They're generally useful.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    ee5d3ba View commit details
    Browse the repository at this point in the history
  7. pyln-client/gossmap: use ShortChannelId class from pyln.proto, if ava…

    …ilable.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    5fc88a5 View commit details
    Browse the repository at this point in the history
  8. pyln-client/gossmap: add NodeId class.

    This is more efficient than converting them all to Pubkeys: about 3.8
    seconds vs 5.4 seconds.  Usually treating them as raw bytes is what we
    want anyway.
    
    [ Fixup by Michael Schmoock <michael@schmoock.net> ]
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    8100d9d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a871262 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f19c43f View commit details
    Browse the repository at this point in the history
  11. pyln-client/gossmap: adds channel satoshi capacity

    This reads the `gossip_store_channel_amount` that always follows the
    `channel_announcement` messages. Therefore it uses an internal variable
    _last_scid to know what channel has been added last time.
    m-schmoock authored and rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    fb56404 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d0d101e View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    4547158 View commit details
    Browse the repository at this point in the history
  14. pyln-client/gossmap: Don't mix bytes and GossmapNodeId

    Do not mix bytes and GossmapNodeId when accessing Gossmap.nodes dicts.
    
    Therefore the definion got GossmapNodeId also needed to be pulled to the
    beginning of the file.
    m-schmoock authored and rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    f562e51 View commit details
    Browse the repository at this point in the history
  15. pyln-client/gossmap: more fixes, make mypy happier.

    Mainly fixing type annotations, but some real fixes:
    
    1. GossmapHalfchannel.from_str() should be a classmethod.
    2. update_channel had weird, unusable default values (fields can't be NULL,
       since we use it below).
    
    [ There was one more occurence where isinstance should be used above
    type() == xyz comparison. -- MS ]
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    bd6346c View commit details
    Browse the repository at this point in the history
  16. pyln-client/gossmap: make test gossip_store include channel_updates, …

    …deletions.
    
    Suggested-by: @mschmook
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    e715302 View commit details
    Browse the repository at this point in the history
  17. pyln-client/gossmap: have channels link to their nodes instead of id

    This is likely easier for programmers and does not use more mem as we
    already load all this.
    m-schmoock authored and rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    6cbdc5a View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    56babd2 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    67e62fc View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    54a9796 View commit details
    Browse the repository at this point in the history
  21. pyln-client/gossmap: init GossmapNode and Id also with hexstring

    also improves test coverage
    Changelog-Added: pyln-client: routines for direct access to the gossip store as Gossmap
    m-schmoock authored and rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    5187a1e View commit details
    Browse the repository at this point in the history
  22. pyln-client: fix mypy warnings, fix and test deletion of a channel.

    This only happens when a deletion is added by a running gossipd, so
    we put a deletion at the end of the store to test it.
    
    mypy noticed that this code was nonsensical, so clearly untested.
    
    The testing noticed that making a nodeid from a string was also buggy.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    b4a8cbf View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    56cac76 View commit details
    Browse the repository at this point in the history