Skip to content

Conversation

@feelancer21
Copy link
Owner

This PR is for personal tracking of the imputed cost implementation.

Change Description

Description of change / link to associated issue.

Steps to Test

Steps for reviewers to follow to test the change.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

Copilot AI review requested due to automatic review settings July 15, 2025 18:44
@github-actions
Copy link

Pull reviewers stats

Stats of the last 30 days for lnd:

User Total reviews Time to review Total comments

This comment was marked as outdated.

@feelancer21 feelancer21 marked this pull request as draft July 15, 2025 18:46
@feelancer21 feelancer21 changed the base branch from feelancer-0-19-2-branch to feelancer-0-19-2-dev-branch July 15, 2025 22:19
@feelancer21 feelancer21 requested a review from Copilot July 15, 2025 22:23
Copy link

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

This PR implements imputed costs functionality for the Lightning Network Daemon (LND) router service. Imputed costs allow users to apply additional virtual costs to specific node pairs to influence routing decisions, enabling more sophisticated payment routing strategies.

Key changes include:

  • Addition of three new experimental RPC methods for managing imputed costs (import, query, delete)
  • New protobuf message definitions for imputed cost configurations, policies, and restrictions
  • Integration of imputed cost restrictions into existing payment request structures

Reviewed Changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lnrpc/routerrpc/router.proto Defines new RPC methods and message structures for imputed cost management
lnrpc/routerrpc/router_grpc.pb.go Generated gRPC client and server interfaces for imputed cost operations
lnrpc/routerrpc/router.yaml HTTP endpoint mappings for the new imputed cost APIs
lnrpc/routerrpc/router.swagger.json OpenAPI documentation for the new imputed cost endpoints
lnrpc/routerrpc/router.pb.json.go JSON callback registrations for the new RPC methods
lnrpc/routerrpc/router.pb.gw.go HTTP gateway handlers for the new imputed cost endpoints
lnrpc/lightning.proto Integration of imputed cost restrictions into core payment structures
lnrpc/lightning.swagger.json OpenAPI documentation updates for imputed cost restrictions in payments

@feelancer21 feelancer21 force-pushed the feelancer-0-19-2-dev-branch branch from 629c804 to 32bfbba Compare July 16, 2025 14:19
@feelancer21 feelancer21 force-pushed the imputed-costs branch 12 times, most recently from 5e57a74 to 0c256b5 Compare July 21, 2025 14:06
- Add experimental imputed costs API to router service with three new
  RPCs: XImportImputedCosts, XQueryImputedCosts, XDeleteImputedCosts.
- Introduces messages for ImputedCostNamespace, ImputedCostPair and
  ImputedCostParameters with support for success-based and attempt-based
  cost calculations.
- Adds imputed_cost_restrictions field to SendPaymentRequest and
  QueryRoutesRequest for total routing cost limits.
- Compiling of the protos
- Update of router.yaml
We added callbacks in SessionSource and paymentSession and fixed the
existing utests.
We pass getHTLCs from resumePayment to RequestRoute.
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.

2 participants