Peer storage enable#8140
Merged
rustyrussell merged 15 commits intoElementsProject:masterfrom May 16, 2025
Merged
Conversation
e89b21c to
36b6df1
Compare
Collaborator
|
I’m currently reviewing it and will share my full feedback soon. In the meantime, I have one major suggestion to discuss: Should we send a bogus ChannelReestablish message during recovery? LND does not respond to errors with a force close. |
36b6df1 to
607aa40
Compare
This is the only way to track spec changes in future. Signed-off-by: Rusty Russell <[email protected]>
after_listpeers() doesn't use the argument, so we don't need to allocate anything. Signed-off-by: Rusty Russell <[email protected]>
We should not send a message on unknown custom message receipt (we expect this!). Signed-off-by: Rusty Russell <[email protected]>
This avoids globals, which is a bit neater. Signed-off-by: Rusty Russell <[email protected]>
97365e4 to
537561c
Compare
537561c to
f5be46e
Compare
This seems fair. Signed-off-by: Rusty Russell <[email protected]>
…ing with NULL cb. This should complete the command, otherwise we get an assertion on line 1090. Signed-off-by: Rusty Russell <[email protected]>
By keeping a local hash table, we won't have to look up every time. We still write to the datastore when it changes, and we need to initialize it at plugin start. Signed-off-by: Rusty Russell <[email protected]>
Now actually use our cache. Signed-off-by: Rusty Russell <[email protected]>
We already get the connected hook, so in there we can add to a hash table of suitable peers. Rather than subscribe to disconnection, we simply remove the peer if a sendcustommsg fails. This does make after_send_scb_single() a bit more complex, since it needs this specific node_id: we use a `struct info` per node and a pointer to a shared "idx" reference counter. Signed-off-by: Rusty Russell <[email protected]>
This is much better for very large nodes with lots of channel activity. Signed-off-by: Rusty Russell <[email protected]>
This, too, is vital for large nodes, which don't want a significant traffic increase. Signed-off-by: Rusty Russell <[email protected]>
They will in fact get truncated, and never restore. Large nodes should be using some real backup strategy! For this reason, we split "peer_backup" support into send vs store support, so we can turn off send of our own without disabling storing/sending theirs. Signed-off-by: Rusty Russell <[email protected]>
…tore users. When peer backup is enabled by default, it puts things in the datastore, breaking this assumption. Narrow the test to examine the specific funder directory. Signed-off-by: Rusty Russell <[email protected]>
Now we've make it only on existing channels, and not have to call listdatastore every time, that means we can safely turn it on by default. Changelog-Added: Protocol: we now offer peer storage to any peers who create a channel. Changelog-Deprecated: Config: `--experimental-peer-storage` (it's now the default). Signed-off-by: Rusty Russell <[email protected]>
We picked one node and iterated. This means we would only sent to 1, not 2 nodes if we picked the last (common if there were only a few peers). But it also means we would generally send to the same pair of nodes, which isn't great for redundancy. Rework to be more random. Signed-off-by: Rusty Russell <[email protected]>
50b8321 to
7bc26c4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #8136
This gets chanbackup to the point that we can enable it by default. If we did that now it would have too much penalty for large nodes with many channels, so we fix that up, and finally enable it!