-
Notifications
You must be signed in to change notification settings - Fork 491
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
BOLT 1: add networks to init message. #682
Conversation
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.
ACK, does this supercede #678 or does it only complement it?
I think it replaces it, TBH. I'm not sure that query_channels means you should hang up. |
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.
Sounds good then, I do think it supercedes it but wanted confirmation.
We have no real support for cross-chain routing in the protocol as is today, as a result, what use is this? |
It means you can hang up if you accidentally connect to a testnet node? |
@@ -225,8 +225,16 @@ Both fields `globalfeatures` and `localfeatures` MUST be padded to bytes with 0s | |||
* [`gflen*byte`:`globalfeatures`] | |||
* [`u16`:`lflen`] | |||
* [`lflen*byte`:`localfeatures`] | |||
* [`init_tlvs`:`tlvs`] |
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.
qq on how we define this (i'm not super familiar with the parsing code): intuitively i would think that this would be
* [`tlvs`: `init_tlvs`]
where tlvs
is the type, and init_tlvs
is the name. the current way is flipped from what I would expect, maybe i'm just not thinking about it correctly?
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.
The type is actually defined below... Confusing I know, but it's a consequence of incrementally implementing parsing.
We could just imply TLV from now on, with msg foo
having a foo_tlv
implicitly?
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.
either works for me, was just curious what the guidelines are :)
@@ -243,6 +252,8 @@ The receiving node: | |||
- MUST ignore the bit. | |||
- upon receiving unknown _even_ feature bits that are non-zero: | |||
- MUST fail the connection. | |||
- upon receiving `networks` containing no common chains |
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.
what is the prescribed action if some chains intersect but not all? would think receivers should restrict all messages they send to this intersection?
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.
Hmm, like @Roasbeef I haven't thought too hard about multi-chain implementation.
Hmm, I think that addition (SHOULD) would be positive, yes.
As a person who has accidently connected to several main net nodes with his test net node, I strongly support this pull request. With the added hope that the various implementations hang up if the network is wrong. |
OK, added the "don't forward gossip they're not interested in" sentence. |
This implements lightning/bolts#682.
This implements lightning/bolts#682.
This implements lightning/bolts#682. Changelog-Added: protocol: We now signal the network we are running on at init.
FWIW, this was accidentally merged into the latest c-lightning master (ElementsProject/lightning#3300). Seems to have caused no issues on my test nodes, but explicit interop is probably desirable (i.e. someone else implement and check it works with ours): Mainnet: 024b9a1fa8e006f1e3937f65f66c408e6da8e1ca728ea43222a7381df1cc449605@128.199.202.16 Testnet: And yeah, I tested that they refuse to maintain connections to each other now :) |
This has been discussed for forever, but now we have TLVs the correct encoding seems obvious. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ef7c97c
to
35f1f47
Compare
Trivial rebase, and whitespace cleanup. |
I just tested that it doesn't cause any issue with existing eclair nodes; they simply ignore the TLV stream as expected. I'll implement this and will let you know if compatibility is ok. Simply looking at the encoded TLV stream that c-lightning sends, it looks ok to me. |
Thanks @t-bast for checking. That puts my mind at ease |
I've implemented this on Eclair and tested compatibility with c-lightning, and there's a small issue.
This isn't an issue for Eclair/c-lightning compatibility since we support a single chain, but it may be an issue with lnd if they advertize Bitcoin+Litecoin: c-lightning would reject connections from such lnd nodes. @rustyrussell @cdecker I think this is worth fixing quickly on c-lightning master branch. |
@t-bast I think ElementsProject/lightning#3371 fixes that. |
This has been implemented by c-lightning and eclair. |
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.
LGTM ⛷
This has been discussed for forever, but now we have TLVs
the correct encoding seems obvious.
Signed-off-by: Rusty Russell rusty@rustcorp.com.au