Minimise need to depend on rust-dlc in leaf crates#214
Closed
Minimise need to depend on rust-dlc in leaf crates#214
rust-dlc in leaf crates#214Conversation
Most notably: - We now depend on the `split-tx-experiment` branch of `p2pderivatives/rust-lightning` fork. It appears that the changes we had in our fork are no longer needed and we need to update the dependency to be able to use the new branch of `rust-dlc`. - We've had to add our own `CustomSigner` and `CustomKeysManager` since `rust-dlc` no longer exports them. For now we have just inlined the implementations used in the `rust-dlc` tests.
We no longer need to patch the dependency after version 2.0 has been published.
This dependency should ideally only be known by core crates such as `ln-dlc-node`. We define a method `get_new_address` on `Node` so that we can control how we call the underlying on-chain wallet, rather than letting consumers call the wallet through a trait that is designed for a completely different purpose. We also turn the generic `get_dlcs` API into the more specific `get_confirmed_dlcs`, as this is the only thing that is currently needed. This way we can avoid consumers needing to understand types defined by `rust-dlc`. The `get_confirmed_dlcs` API and the matching `Dlc` type should evolve (and perhaps even disappear) as we meet new requirements. We cannot remove the `dlc-manager` dependency from the `coordinator` just yet because we haven't yet defined our own type for the `ContractInput`. Once we do so, we should remove this dependency and finally ensure that `rust-dlc` is an implementation detail from the perspective of our leaf crates.
Contributor
I thought about doing so, but it is quite cumbersome because it's a quite complex type with a lot of nested other types inside. Nonetheless, it would be cleaner to create our own and map. |
2701cb6 to
09d9710
Compare
Contributor
Author
|
Merged with #213. |
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.
This dependency should ideally only be known by core crates such as
ln-dlc-node.We define a method
get_new_addressonNodeso that we can control how we call the underlying on-chain wallet, rather than letting consumers call the wallet through a trait that is designed for a completely different purpose.We also turn the generic
get_dlcsAPI into the more specificget_confirmed_dlcs, as this is the only thing that is currently needed. This way we can avoid consumers needing to understand types defined byrust-dlc. Theget_confirmed_dlcsAPI and the matchingDlctype should evolve (and perhaps even disappear) as we meet new requirements.We cannot remove the
dlc-managerdependency from thecoordinatorjust yet because we haven't yet defined our own type for theContractInput. Once we do so, we should remove this dependency and finally ensure thatrust-dlcis an implementation detail from the perspective of our leaf crates.