Skip to content

Change fee settings from UI#516

Open
markettes wants to merge 24 commits into
mainfrom
feat/UI-change-channel-fees
Open

Change fee settings from UI#516
markettes wants to merge 24 commits into
mainfrom
feat/UI-change-channel-fees

Conversation

@markettes
Copy link
Copy Markdown
Contributor

Enhance the UI for changing fee settings.

Copy link
Copy Markdown
Contributor

@Jossec101 Jossec101 left a comment

Choose a reason for hiding this comment

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

Please introduce validation so:

@markettes markettes force-pushed the feat/set-channel-fee-policy branch from db6c3ba to 1859a5a Compare May 19, 2026 08:53
@Jossec101 Jossec101 self-requested a review May 19, 2026 09:02
Base automatically changed from feat/set-channel-fee-policy to main May 19, 2026 10:20
@Jossec101
Copy link
Copy Markdown
Contributor

Jossec101 commented May 21, 2026

Please introduce validation so:

@markettes I guess you are still on this

- Introduced a new column `RequestMetadata` in the `ChannelOperationRequests` table to store additional request information.
- Updated the `ApplicationDbContextModelSnapshot` to reflect the new `RequestMetadata` column.
- Enhanced the Channel Requests page to include fields for setting the initial channel base fee and fee rate.
- Implemented logic in the `LightningService` to handle the new fee policy parameters when creating open channel requests.
- Added unit tests to verify the creation of open channel requests with the initial channel fee policy.
@markettes
Copy link
Copy Markdown
Contributor Author

Please introduce validation so:

@markettes I guess you are still on this

Yep, you can check now

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds UI and backend support for configuring Lightning channel fee policy both at channel creation time (initial routing policy) and for existing channels (fee policy management), persisting new request metadata to survive approval/execution.

Changes:

  • Persist initial channel fee policy (base fee / fee rate) on ChannelOperationRequest via a new RequestMetadata column and expose it through NotMapped convenience properties.
  • Apply initial fee policy values when building LND OpenChannelRequest in LightningService, with range validation.
  • Extend the Channels UI with a “Fee Policy” management tab (incl. inbound fee policy fields) and add UI fields to Channel Requests for initial fee policy input/display.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/NodeGuard.Tests/Services/LightningServiceTests.cs Adds a test covering OpenChannelRequest creation when initial fee policy is provided.
src/Services/LightningService.cs Applies optional initial fee policy values onto LND OpenChannelRequest with validation.
src/Pages/Channels.razor Adds a tabbed channel management modal with a new Fee Policy form and save flow.
src/Pages/ChannelRequests.razor Adds UI to enter/display initial channel fee policy values on open-channel requests.
src/Data/Models/ChannelOperationRequest.cs Introduces RequestMetadata persistence and InitialChannel* accessors backed by JSON.
src/Helpers/Constants.cs Adds configurable default timelock delta constant for fee policy form defaults.
src/Migrations/20260522125854_AddRequestMetadata.cs Migration adding RequestMetadata to ChannelOperationRequests.
src/Migrations/20260522125854_AddRequestMetadata.Designer.cs EF migration designer snapshot for the added column.
src/Migrations/ApplicationDbContextModelSnapshot.cs Updates model snapshot to include RequestMetadata on ChannelOperationRequest.
Files not reviewed (1)
  • src/Migrations/20260522125854_AddRequestMetadata.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Pages/Channels.razor Outdated
Comment thread src/Pages/Channels.razor
Comment thread src/Migrations/ApplicationDbContextModelSnapshot.cs Outdated
- Created a new migration to add InitialChannelBaseFeeMsat and InitialChannelFeeRatePpm columns to the ChannelOperationRequests table.
- Updated the ApplicationDbContextModelSnapshot to reflect the new columns in the ChannelOperationRequests entity.
Comment thread src/Pages/Channels.razor
Comment on lines +446 to +455
<Validation Validator="ValidateChannelFeeRatePpm">
<FieldLabel>Fee rate (ppm)</FieldLabel>
<FieldHelp>Outbound proportional fee in parts per million.</FieldHelp>
<NumericEdit TValue="long?" Min="0L" Max="@((long)uint.MaxValue)"
@bind-Value="_channelFeePolicy.FeeRatePpm">
<Feedback>
<ValidationError />
</Feedback>
</NumericEdit>
</Validation>
Copy link
Copy Markdown
Contributor

@Jossec101 Jossec101 May 26, 2026

Choose a reason for hiding this comment

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

@markettes can we please add here the current channel fee rate? same for inbound

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done 🏁

Comment thread src/Helpers/Constants.cs
Comment on lines +358 to +359
var defaultChannelFeePolicyTimelockDeltaBlocks = Environment.GetEnvironmentVariable("DEFAULT_CHANNEL_FEE_POLICY_TIMELOCK_DELTA_BLOCKS");
if (defaultChannelFeePolicyTimelockDeltaBlocks != null) DEFAULT_CHANNEL_FEE_POLICY_TIMELOCK_DELTA_BLOCKS = int.Parse(defaultChannelFeePolicyTimelockDeltaBlocks);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could also add defaults for fee policies? so we dont rely on LND conf (harder to change)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

wdyt about setting this at node level?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done 🏁
Maybe the idea of setting the default fees at node level in NG can be implemented in the future

Comment thread src/Pages/Channels.razor
<FieldHelp>CLTV delta advertised for forwarded HTLCs on this channel.</FieldHelp>
<NumericEdit TValue="long?" Min="0L" Max="@((long)uint.MaxValue)"
@bind-Value="_channelFeePolicy.TimeLockDelta">
<Feedback>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add to this list in the datagrid also a way to see really quick PPM? both inbound and outbound but also what they charge to us (peer policy?) Perhaps peer policy is a tooltip or something, its dense info i let you figure but I think it adds value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done!

@markettes markettes requested a review from Jossec101 May 29, 2026 18:01
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.

3 participants