-
Notifications
You must be signed in to change notification settings - Fork 911
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
pyln.client gossmap support #4582
Conversation
Thanks, will have a look.. |
6462df4
to
15a4bf1
Compare
Rebased on top of |
I have absolutely no idea how changes in the pyln libs can cause |
@cdecker
|
Actually, experimental builds always regen (we don't ship the exp_ files). It's the pip install failure that causes it to abort, not installing mako, and get upset. |
Does this mean we can add new channels to the gossip map while gossipd is running and they will be picked up automatically? |
7c4665f
to
eaf5911
Compare
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.
A thing I noted...
eaf5911
to
9955a32
Compare
@rustyrussell cd contrib/pyln-spec/bolt1
python3 setup.py install --user This was only doable after upgrading to newest pip
This can be ignored as I am able to install pyln-proto also manually by source. Not nice though. What I find strange that under the quoted URL https://pypi.org/simple/pyln.proto/ there is a version 0.9.3 °_° ? When I then run the gossmap testcase it still complains about pyln.spec module missing maybe because I only have the bolts and not the pyln.spec 'parent module' ?:
|
@rustyrussell |
@rustyrussell |
9955a32
to
0d16253
Compare
626a6d3
to
ef38730
Compare
|
||
class GossmapHalfchannel(object): | ||
"""One direction of a GossmapChannel.""" | ||
def __init__(self, channel: 'GossmapChannel', direction: int, |
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.
Didn't know that forward declaration was possible. Had to look it up myself to know why you put that in quotes :D
Again I added more stuff in coop/wip/pr rustyrussell#8 Also:
@rustyrussell you thumb-upped this question. Are we really going to push back changes to gossmap back to the gossipd daemon? |
Question: |
4c761c4
to
4b6938e
Compare
No, I misread! You can use |
4b6938e
to
6f7b580
Compare
The current structure is more useful: the JSON style of listchannels makes for a lot of redundancy. |
Signed-off-by: Rusty Russell <[email protected]>
They're generally useful. Signed-off-by: Rusty Russell <[email protected]>
…ilable. Signed-off-by: Rusty Russell <[email protected]>
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 <[email protected]> ] Signed-off-by: Rusty Russell <[email protected]>
c5949b9
to
d3b0fd4
Compare
Updated on top of #4763 |
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.
only a small nit, by the way, excited to have the gossip map in here.
Fancy stuff can happens.
@@ -1 +1,2 @@ | |||
recommonmark>=0.7.* | |||
pyln-bolt7 |
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.
It is better to fix the version here with >= latest one? Maybe pip can take the decision to use the old one if in the system there is an older version?
So we are putting here some dependencies that can cause errors in production, I will preferer to have a pyln-bolt7>=1.0.2.186
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.
Hm, theres something about the pyln-spec dependency.
I put the gossip_store_channel_amount
into the bolt7 spec package, not sure if I was supposed to, see 32cb69e. but the one that will be installed with pip is still the old one which results in:
ImportError: cannot import name 'gossip_store_channel_amount' from 'pyln.spec.bolt7'
So we need to put bolt7 >= 1.0.2.187
(last digit incremented) since the 186 does not have the gossip_store_channel_amount
in its csv
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.
187 is not released yet, but it will be the one with the changes we made in this branch... not sure how we handle something like this
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.
I did the pypi upload, even though we hadn't merged, because I needed it to fix lnprototest...
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.
Oh, I missed that change, it's completely wrong!
I will fix that a different way tomorrow...
Added another testcase for the half channel stuff... no bugs detected. |
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.
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.
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 <[email protected]>
…deletions. Suggested-by: @mschmook Signed-off-by: Rusty Russell <[email protected]>
This is likely easier for programmers and does not use more mem as we already load all this.
also improves test coverage Changelog-Added: pyln-client: routines for direct access to the gossip store as Gossmap
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 <[email protected]>
3290c92
to
b4a8cbf
Compare
OK, I removed the change to the spec package, re-running CI now. |
just re-added the commit for the half channel testcase that got missed by rebasing.... |
ACK 56cac76 |
This is a minimal implementation; it probably wants some more helpers to make it less painful to use.
@m-schmoock ?