-
Notifications
You must be signed in to change notification settings - Fork 268
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
Return local channel alias in payment failures #2323
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.
Good catch!
I think I would have addressed this differently:
- always generate our
channel_update
with our local alias or real scid depending on channel params (this is the fix to the present bug) - re-sign the
channel_update
with remote alias in theonTransition
within theif (sendToPeer) {...}
so we make it clear that using remote alias is the exception not the rule
eclair-core/src/main/scala/fr/acinq/eclair/channel/fsm/Channel.scala
Outdated
Show resolved
Hide resolved
That makes sense, it feels more consistent this way, I'll try it out. |
d65dad1
to
aa3fbc7
Compare
I've updated the PR to:
|
0cb89e3
to
416efb5
Compare
Codecov Report
@@ Coverage Diff @@
## master #2323 +/- ##
==========================================
- Coverage 84.71% 84.67% -0.05%
==========================================
Files 194 194
Lines 14633 14643 +10
Branches 612 625 +13
==========================================
+ Hits 12397 12399 +2
- Misses 2236 2244 +8
|
We now use either our local alias or the real scid in the channel update that we store internally. When we send that channel update directly to our peer, we override it to use the remote alias when it makes sense.
There are multiple valid scids for public channels depending on the confirmation status of the funding tx. A payer may use either of these scids, and we must return the one they used in case of error.
416efb5
to
18ff971
Compare
eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/Helpers.scala
Outdated
Show resolved
Hide resolved
c1c25ed
to
794a287
Compare
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/ChannelRelay.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/ChannelRelay.scala
Outdated
Show resolved
Hide resolved
We shouldn't need them since we don't add the real scid to the routing table when scid_alias is negotiated.
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 router is left unchanged despite us using localAlias
instead of remoteAlias
for our own channel_update
, because we resolve based on the channelId
or the realScid
:
https://github.com/ACINQ/eclair/blob/master/eclair-core/src/main/scala/fr/acinq/eclair/router/Validation.scala#L300
eclair-core/src/main/scala/fr/acinq/eclair/router/Announcements.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/channel/states/ChannelStateTestsHelperMethods.scala
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/integration/basic/ZeroConfAliasIntegrationSpec.scala
Outdated
Show resolved
Hide resolved
* Revert change to makeChannelUpdate * Improve zero-conf tests
The release introduces a few API changes: - channelbalances retrieves information about the balances of all local channels (#2196) - channelbalances and usablebalances return a shortIds object instead of a single shortChannelId (#2323) - stop stops eclair: please note that the recommended way of stopping eclair is simply to kill its process (#2233) - rbfopen lets the initiator of a dual-funded channel RBF the funding transaction (#2275) - listinvoices and listpendinginvoices now accept --count and --skip parameters to limit the number of retrieved items (#2474)
When using
option_scid_alias
, we must be careful not to expose the real scid to remote payers. We never generate achannel_update
with the real scid so this isn't a risk, but we're incorrectly returning the remote alias instead of the returning the local one (which should match the invoice).