-
Notifications
You must be signed in to change notification settings - Fork 272
Attributable failures #3065
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
Attributable failures #3065
Conversation
336a993
to
1d57546
Compare
Thanks, will take a look at this next week! Meanwhile, could you take a look at the interactions with trampoline and answer Joost here: lightning/bolts#836 (comment) |
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.
I haven't reviewed the code yet, but before doing so I'm not seeing important tests:
- Apart from the tests in
SphinxSpec
, I don't see any test:- are there official spec test vectors? If not, we must create some, and if there are already some, it should be a dedicated unit test to make it obvious
- can you add unit tests where this is used during payments (maybe in
PaymentPacketSpec
) to verify the complete encryption/decryption from failure messages?
- Have you done cross-compatibility tests? We must verify cross-compatibility before merging any of this. The PR description should detail what has been tested, against what implementation, and what works and what doesn't work
eclair-core/src/main/scala/fr/acinq/eclair/channel/ChannelData.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/channel/fsm/Channel.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/LightningMessageTypes.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/FailureMessage.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/relay/PostRestartHtlcCleaner.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartPaymentFSM.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala
Outdated
Show resolved
Hide resolved
2da9b91
to
3f6ba7f
Compare
3f6ba7f
to
34db493
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.
Looks mostly good to me, but I think we're missing tests for the scenarios where one of the intermediate nodes drops the attribution data, or where part of the route does not support attributable failures. That's what makes attributable failures useful, allowing us to detect that at least a subset of the route is honest!
I think some of those tests should be in the official test vectors, can you discuss that with Joost to see how they could be included?
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartPaymentFSM.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/wire/internal/CommandCodecs.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/wire/protocol/FailureMessage.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/db/PendingCommandsDbSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/payment/MultiPartHandlerSpec.scala
Outdated
Show resolved
Hide resolved
I've added tests checking that we are able to attribute failures even if the failing node is hiding. I'll suggest to add it to the spec. |
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.
Can you add release notes since this is a new spec feature?
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/payment/receive/MultiPartHandler.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/wire/internal/CommandCodecsSpec.scala
Outdated
Show resolved
Hide resolved
06cca9a
to
992939b
Compare
992939b
to
1d6a225
Compare
Implements lightning/bolts#1044
For cross compatibility, the following scenarios have been successfully tested:
It is disabled by default since the spec may not be final, and will be enabled once the spec PR has been merged to the BOLTs.