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

feat: charge fee when opening a jit channel #864

Merged
merged 7 commits into from
Jul 3, 2023

Conversation

holzeis
Copy link
Contributor

@holzeis holzeis commented Jun 29, 2023

fixes #577

  • The payment of the fee is not yet depicted as a special payment. This will be covered in a follow up PR after aligning with Pay order-matching fee on the app #863
  • The funding transaction is only cached in memory

TODOs that will be covered in follow up tickets.

Simulator Screenshot - iPhone 14 Pro - 2023-06-30 at 11 34 28

@holzeis holzeis self-assigned this Jun 29, 2023
@holzeis holzeis force-pushed the feat/charge-fee-when-opening-a-jit-channel branch from e9597d5 to 8fd312f Compare June 30, 2023 09:31
@holzeis holzeis changed the title wip: charge fee when opening a jit channel feat: charge fee when opening a jit channel Jun 30, 2023
@holzeis holzeis requested a review from luckysori June 30, 2023 09:32
@holzeis holzeis force-pushed the feat/charge-fee-when-opening-a-jit-channel branch from 8fd312f to 15d299b Compare June 30, 2023 09:34
@holzeis holzeis marked this pull request as ready for review June 30, 2023 09:34
@holzeis holzeis force-pushed the feat/charge-fee-when-opening-a-jit-channel branch 2 times, most recently from c50b05d to 0855cdc Compare June 30, 2023 10:37
@holzeis
Copy link
Contributor Author

holzeis commented Jun 30, 2023

It looks like we don't always broadcast the funding transaction when opening a channel. That results into a failed attempt to fetch the funding transaction from esplora.

  • Locally the test fail due to that issue as no channel fee payment can be processed. see also Channel without funding transaction on chain #873
  • The tests in the CI fails for a different reason though. No Route Found which is odd as a payment can be received, maybe the payment attempt needs to be delayed to ensure that the outbound liquidity is updated.

@holzeis holzeis force-pushed the feat/charge-fee-when-opening-a-jit-channel branch from 0855cdc to 58ef2d2 Compare June 30, 2023 11:20
Copy link
Contributor

@luckysori luckysori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I've left a bunch of primarily stylistic comments.

mobile/native/src/ln_dlc/lightning_subscriber.rs Outdated Show resolved Hide resolved
coordinator/src/routes.rs Show resolved Hide resolved
mobile/native/src/ln_dlc/mod.rs Outdated Show resolved Hide resolved
mobile/native/src/ln_dlc/mod.rs Outdated Show resolved Hide resolved
mobile/native/src/channel_fee.rs Outdated Show resolved Hide resolved
mobile/native/src/ln_dlc/lightning_subscriber.rs Outdated Show resolved Hide resolved
mobile/native/src/channel_fee.rs Outdated Show resolved Hide resolved
mobile/native/src/channel_fee.rs Show resolved Hide resolved
mobile/native/src/channel_fee.rs Outdated Show resolved Hide resolved
mobile/native/src/channel_fee.rs Outdated Show resolved Hide resolved
This allows us to move app or coordinator specific code out of the crate and handle it in the layer where it should be.

This also allows us to step wise refactor the event handler.
This resulted in the invoice having additional quotes, that would have required additional handling.
@holzeis holzeis force-pushed the feat/charge-fee-when-opening-a-jit-channel branch 3 times, most recently from 2ede2c6 to 9637cf7 Compare July 3, 2023 17:50
It appears broadcasting the funding transaction fails every once in a while as the output transaction has already been spent.

This leads to the following bug #873. Once fixed it should not be required to mine blocks to make that test pass all the time.
Contrary to a local run the CI is skipping the direct route to payee for unkown reasons. That's why we are relaxing the balance assertion to cater for the fees being substracted or not.

This should be changed once #883 is fixed.
@holzeis holzeis force-pushed the feat/charge-fee-when-opening-a-jit-channel branch from 9637cf7 to c7944d5 Compare July 3, 2023 18:03
@holzeis
Copy link
Contributor Author

holzeis commented Jul 3, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 3, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 6a29ff5 into main Jul 3, 2023
7 checks passed
@bors bors bot deleted the feat/charge-fee-when-opening-a-jit-channel branch July 3, 2023 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JIT - Channel Fee
2 participants