-
Notifications
You must be signed in to change notification settings - Fork 267
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
Add router support for batched splices #2989
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.
This was more complex than I expected, I hadn't initially thought about the fact that we cannot map a spliced channel to its parent (but it's fine we don't care about which parent we map it to).
eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
19e5538
to
69db84b
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.
Needs a rebase, almost there!
eclair-core/src/test/scala/fr/acinq/eclair/router/BaseRouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/BaseRouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/BaseRouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
A splice tx could involve more than one parent channel. The Router must track the set of channels spent by a given tx until matching channel announcements are received or the spend tx is deeply buried. If a splice tx spends more than one parent channel between the same nodes, then there's no way to know which new channel announcement corresponds to which parent channel. We simply update the first one found.
Also added a function in `BaseRouterSpec` to add a second b-c channel for the batch splice test in `Routerspec`. The alternative to adding a 2nd b-c channel in `BaseRouterSpec` for all tests requires too many other tests to need updating.
69db84b
to
790ffb5
Compare
Thanks for the review! Rebased on master. I also added some new checks in the gossip integration test to check the state of the channels set in the Router after the splice. I found it included the original parent channel when it should have only had the splice_ab and bc channels. The fix was to wait for Alice to receive both initial local channel updates before doing the splice. Otherwise the 2nd update (from Bob?) after opening the original ab channel came after the first splice update and added the original channel as a new channel in the Router. |
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 few test nits, otherwise LGTM.
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/router/RouterSpec.scala
Outdated
Show resolved
Hide resolved
...ir-core/src/test/scala/fr/acinq/eclair/integration/basic/channel/GossipIntegrationSpec.scala
Outdated
Show resolved
Hide resolved
Previous check would succeed even if one or both updates were None.
If assert fails, should call getRouterData again for the next awaitAssert loop.
A splice tx could involve more than one parent channel. The Router must track the set of channels spent by a given tx until matching channel announcements are received that splice the parent channels or the spend tx is deeply buried.
If a splice tx spends more than one parent channel between the same nodes, then there's no way to know which new channel announcement corresponds to which parent channel. We simply update the first one found.