-
Notifications
You must be signed in to change notification settings - Fork 925
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
Gossip improvements #430
Closed
rustyrussell
wants to merge
16
commits into
ElementsProject:master
from
rustyrussell:gossip-improvements
Closed
Gossip improvements #430
rustyrussell
wants to merge
16
commits into
ElementsProject:master
from
rustyrussell:gossip-improvements
Conversation
This file contains 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
Rather than using the destructor, hook up the cmd so we can close it. peers are allocated off ld, so they are only destroyed explicitly. Signed-off-by: Rusty Russell <[email protected]>
As demonstrated in the test at the end of this series, openingd dying spontaneously causes the conn to be freed which causes the subd to be destroyed, which fails the peer, which hits the db. Signed-off-by: Rusty Russell <[email protected]>
On unmarshal, we stop unmarshaling on a 0 (ADDR_TYPE_PADDING) type. So we should also stop marshaling in that case. Signed-off-by: Rusty Russell <[email protected]>
We can open other channels, if we want. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
We should not disconnect from a peer just because it fails opening; we should return it to gossipd, and give a meaningful error. Closes: ElementsProject#401 Signed-off-by: Rusty Russell <[email protected]>
We'll want this for the next change, where gossipd migrates remote peers back to local ones. Signed-off-by: Rusty Russell <[email protected]>
…elds. We should also go through and use consistent nomenclature on functions which are used with a local peer ("lpeer_xxx"?) and those with a remote peer ("rpeer_xxx"?) but this is minimal. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Otherwise we always say it died because we killed it, so we don't get the exit status. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Rather than routing via master, we send to channeld. It then creates node announcement. Closes: ElementsProject#320 Signed-off-by: Rusty Russell <[email protected]>
All peers come from gossipd, and maintain an fd to talk to it. Sometimes we hand the peer back, but to avoid a race, we always recreated it. The race was that a daemon closed the gossip_fd, which made gossipd forget the peer, then master handed the peer back to gossipd. We stop the race by never closing the gossipfd, but hand it back to gossipd for closing. Now gossipd has to accept two fds, but the handling of peers is far clearer. Signed-off-by: Rusty Russell <[email protected]>
If the peer is moved from remote to local, this may be lost; it's more secure to increment after we've sent the broadcast.
When gossipd sends a message, have a gossip_index. When it gets back a peer, the current gossip_index is included, so it can know exactly where it's up to. Most of this is mechanical plumbing through openingd, channeld and closingd, even though openingd and closingd don't (currently) read gossip, so their gossip_index will be unchanged. Signed-off-by: Rusty Russell <[email protected]>
9a30477
to
151b9ea
Compare
Seems we don't overlap too much, except for two commits, I'll try to disentangle the two :-) |
Closing in favor of #413, all non-conflicting changes have been cherry-picked. |
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.
c.f. #413
Christian, I'll let you merge the two; there's good in both, IMHO.