Gossip query extensions (EXPERIMENTAL_FEATURES)#2900
Gossip query extensions (EXPERIMENTAL_FEATURES)#2900rustyrussell merged 9 commits intoElementsProject:masterfrom
Conversation
747be01 to
c196772
Compare
cdecker
left a comment
There was a problem hiding this comment.
Two minor things, other than that all good to go :-)
| msgdata,reply_channel_range,chain_hash,chain_hash, | ||
| msgdata,reply_channel_range,first_blocknum,u32, | ||
| @@ -168,6 +189,20 @@ | ||
| @@ -168,6 +189,19 @@ |
There was a problem hiding this comment.
This doesn't look like it belongs here. Is this a diff-fragment?
There was a problem hiding this comment.
This file is a diff file; since the size of the diff patch has been updated the range to which the diff applies updates also.
| { | ||
| } | ||
|
|
||
| static const char *test_vectors[] = { |
There was a problem hiding this comment.
Loading the test vectors from file would have allowed us to update them more easily in the future, but for now that's ok.
There was a problem hiding this comment.
There'll be a rework of test vectors in the spec sometime, and we can clean up how we treat them then.
CHANGELOG.md
Outdated
| - JSON API: `listfunds` now returns also `funding_output` for `channels` | ||
| - plugins: plugins can now suggest `lightning-cli` default to -H for responses. | ||
| - Plugin: new notification `forward_event` offered/settled/failed/local_failed. | ||
| - Protocol: --enable-experimental-features support gossip query extensions proposal aka https://github.com/lightningnetwork/lightning-rfc/pull/557 |
There was a problem hiding this comment.
| - Protocol: --enable-experimental-features support gossip query extensions proposal aka https://github.com/lightningnetwork/lightning-rfc/pull/557 | |
| - Protocol: `--enable-experimental-features` support gossip query extensions proposal aka https://github.com/lightningnetwork/lightning-rfc/pull/557 |
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…XPERIMENTAL) These indicate what fields we are to return. If there's now TLV, or we haven't got --enable-experimental-features, it's set to all 1s so behaviour is unchanged. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We're about to use the for gossip extended info too, which *don't* put the encoding byte at the beginning of the data stream. So this removes some "scids" from function names and separates out the "prepend a byte" case from the "external encoding_type" case. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
…d (EXPERIMENTAL) In fact, we always generate them, we only send them if asked. And we set the flags to 0 if not --enable-experimental-features, so we never send in that case. Generating checksums involves pulling the channel_update from the gossip_store, which is suboptimal: there's a FIXME to store the checksum in memory. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Make the TLV element a simple array. This is a bit neater, in fact, and makes the test vectors in that 557 PR work. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
These both allow us to reproduce the test vectors in the next patch. But using Z_DEFAULT_COMPRESSION is a reasonable idea anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
niftynei
left a comment
There was a problem hiding this comment.
nice to see the EXPERIMENTAL_FEATURES and tlv's getting a workout :)
| if (encoding_end_prepend_type(&encoded_scids, max_encoded_bytes)) { | ||
| if (extension_bytes <= max_encoded_bytes | ||
| && encoding_end_prepend_type(&encoded_scids, | ||
| max_encoded_bytes - extension_bytes)) { |
There was a problem hiding this comment.
why is the type the unused space? max_encoded_bytes - extension_bytes
There was a problem hiding this comment.
I don't understand the question?
| msgdata,reply_channel_range,chain_hash,chain_hash, | ||
| msgdata,reply_channel_range,first_blocknum,u32, | ||
| @@ -168,6 +189,20 @@ | ||
| @@ -168,6 +189,19 @@ |
There was a problem hiding this comment.
This file is a diff file; since the size of the diff patch has been updated the range to which the diff applies updates also.
| opt = json_get_member(test_vector, obj, "extensions"); | ||
| json_for_each_arr(i, t, opt) { | ||
| assert(json_tok_streq(test_vector, t, | ||
| "WANT_TIMESTAMPS | WANT_CHECKSUMS")); |
There was a problem hiding this comment.
would it be worthwhile to also test these separately?
There was a problem hiding this comment.
Yes, but the test vectors are grossly insufficient. We need behavoural tests
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
14b663c to
c5ac1fe
Compare
DO NOT MERGE UNTIL RFC FINALIZED (it's EXPERIMENTAL_FEATURES, so we could, but might as well wait until tomorrow's meeting).This was the agreed final form, w00t!This brings is close to in line with lightning/bolts#557
At least, we reproduce the test vectors. We still need behavoural tests (ie. protocol tests), but the code itself is fairly straightforward.