Skip to content
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

Feature/ln dlc channels #97

Draft
wants to merge 102 commits into
base: master
Choose a base branch
from
Draft

Feature/ln dlc channels #97

wants to merge 102 commits into from

Conversation

Tibo-lg
Copy link
Contributor

@Tibo-lg Tibo-lg commented Mar 1, 2023

No description provided.

@Tibo-lg Tibo-lg force-pushed the feature/ln-dlc-channels branch 5 times, most recently from b467ed8 to b3d3173 Compare March 1, 2023 06:25
bors bot added a commit to get10101/10101 that referenced this pull request Mar 7, 2023
213: Update to latest `rust-dlc` r=luckysori a=luckysori

The new `rust-dlc` [branch](p2pderivatives/rust-dlc#97) is still WIP, but it's good to keep this dependency up-to-date as much as possible.

Co-authored-by: Lucas Soriano del Pino <lucas_soriano@fastmail.com>
@Tibo-lg Tibo-lg force-pushed the feature/ln-dlc-channels branch 4 times, most recently from 15766af to 6cfac30 Compare March 22, 2023 07:24
@Tibo-lg Tibo-lg force-pushed the feature/ln-dlc-channels branch from 6cfac30 to 182442b Compare March 22, 2023 23:18
bors bot added a commit to get10101/10101 that referenced this pull request Mar 23, 2023
319: fix: Compute payout is greater than total collateral r=luckysori a=holzeis

Resolves #289. 
Resolves #306.

The `rust-dlc` [branch](p2pderivatives/rust-dlc#97) that we depend on has already been rebased onto `master`, so we can fix the bug like this.


Co-authored-by: Lucas Soriano del Pino <lucas_soriano@fastmail.com>
bors bot added a commit to get10101/10101 that referenced this pull request Mar 23, 2023
319: fix: Compute payout is greater than total collateral r=luckysori a=holzeis

Resolves #289. 
Resolves #306.

The `rust-dlc` [branch](p2pderivatives/rust-dlc#97) that we depend on has already been rebased onto `master`, so we can fix the bug like this.


Co-authored-by: Lucas Soriano del Pino <lucas_soriano@fastmail.com>
@Tibo-lg Tibo-lg force-pushed the feature/ln-dlc-channels branch 2 times, most recently from 1743c54 to 89f36af Compare March 27, 2023 04:41
bors bot added a commit to get10101/10101 that referenced this pull request Mar 27, 2023
319: fix: Compute payout is greater than total collateral r=luckysori a=holzeis

Resolves #289. 
Resolves #306.

The `rust-dlc` [branch](p2pderivatives/rust-dlc#97) that we depend on has already been rebased onto `master`, so we can fix the bug like this.


Co-authored-by: Lucas Soriano del Pino <lucas_soriano@fastmail.com>
@Tibo-lg Tibo-lg force-pushed the feature/ln-dlc-channels branch from 424e623 to 293b26d Compare April 19, 2023 08:06
Tibo-lg and others added 30 commits August 24, 2023 21:16
…-auto-closing

Feature/ln dlc/handle ldk auto closing
BREAKING CHANGE: The implementations of `Writeable` and `Readable` for
`ChainMonitor` have changed.

We were never reading this list, so keeping it seems unnecessary.
BREAKING CHANGE: Consumers have to call `periodic_chain_monitor`
periodically so that `dlc_manager::Manager` and `SubChannelManager`
can learn about transactions being confirmed. Furthermore, the
`Writeable` and `Readable` traits of `ChainMonitor` have changed, so
we are incompatible with `ChainMonitor`s persisted before this patch.

There are two consumers of the `ChainMonitor` API:
`dlc_manager::Manager` and `SubChannelManager`. Both of them are
interested in knowing when certain transactions reach a confirmation
target (for now a single confirmation).

Before this patch, the only way to learn about confirmed transactions
was to call `process_block`. When using both managers (when using
LN-DLC channels) this presented two options:

1. Let each manager provide their own block.

2. Have the `SubChannelManager` process the block throught the
`ChainMonitor` and reuse the same result to let the
`dlc_manager::Manager` process it.

The first option led to bugs fixed in
4636ad7.
The second option was what was implemented before this patch and it
resulted in coupling between the two managers.

With this patch we now separate the processing of new blocks from the
managers learning about confirmed transactions. This does mean that
library consumers will have to periodically call
`periodic_chain_monitor` to update the state of `ChainMonitor`. It's
less convenient, but it's not different from similar projects such as
`rust-lightning`.
By setting this we can avoid the following warning when building:

```
warning: some crates are on edition 2021 which defaults to
`resolver = "2"`, but virtual workspaces default to `resolver = "1"`
```
So that it can be compiled in isolation from the rest of the
workspace.
…ng-from-confirming

Split block processing from confirmation reporting
…sconnect

Fix/ln dlc/renew after disconnect
Use commit tx number to reject stale messages.
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
It is possible that a payout curve decreases with the amount of payout as the events increase. This lead to an overflow panic in the evaluate function

Signed-off-by: Philipp Hoenisch <philipp@coblox.tech>
…tcurve

fix: overflow bug in payout curve
Otherwise we forget about all the registered transactions on restart,
which can lead to loss of funds.
Load ChainMonitor in (DLC) Manager constructor if possible
…hannel-keys-id

Update rust-lightning dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants