lnrpc: rename proportional fee rate on lnrpc

This field is incorrectly suffixed as "msat", when it is actually
interpreted as the proportional fee rate. This is the value that we
should be using because the sender will calculate proportional fees
accordingly. This is a breaking change to the RPC, but on an
experimental and unreleased API.
This commit is contained in:
Carla Kirk-Cohen committed 2024-03-27 09:39:01 -04:00
1 parent 0aeb7c4ba2
commit 421433039b
5 files changed
+26 -24

No files matched your search

+2 -2
View File
@@ -1250,9 +1250,9 @@ func parseBlindedPaymentParameters(ctx *cli.Context) (
BaseFeeMsat: ctx.Uint64(
blindedBaseFlag.Name,
),
ProportionalFeeMsat: ctx.Uint64(
ProportionalFeeRate: uint32(ctx.Uint64(
blindedPPMFlag.Name,
),
)),
TotalCltvDelta: uint32(ctx.Uint64(
blindedCLTVFlag.Name,
)),
+8 -7
View File
@@ -11992,8 +11992,9 @@ type BlindedPaymentPath struct {
BlindedPath *BlindedPath `protobuf:"bytes,1,opt,name=blinded_path,json=blindedPath,proto3" json:"blinded_path,omitempty"`
// The base fee for the blinded path provided, expressed in msat.
BaseFeeMsat uint64 `protobuf:"varint,2,opt,name=base_fee_msat,json=baseFeeMsat,proto3" json:"base_fee_msat,omitempty"`
// The proportional fee for the blinded path provided, expressed in msat.
ProportionalFeeMsat uint64 `protobuf:"varint,3,opt,name=proportional_fee_msat,json=proportionalFeeMsat,proto3" json:"proportional_fee_msat,omitempty"`
// The proportional fee for the blinded path provided, expressed in parts
// per million.
ProportionalFeeRate uint32 `protobuf:"varint,3,opt,name=proportional_fee_rate,json=proportionalFeeRate,proto3" json:"proportional_fee_rate,omitempty"`
// The total CLTV delta for the blinded path provided, including the
// final CLTV delta for the receiving node.
TotalCltvDelta uint32 `protobuf:"varint,4,opt,name=total_cltv_delta,json=totalCltvDelta,proto3" json:"total_cltv_delta,omitempty"`
@@ -12053,9 +12054,9 @@ func (x *BlindedPaymentPath) GetBaseFeeMsat() uint64 {
return 0
}
func (x *BlindedPaymentPath) GetProportionalFeeMsat() uint64 {
func (x *BlindedPaymentPath) GetProportionalFeeRate() uint32 {
if x != nil {
return x.ProportionalFeeMsat
return x.ProportionalFeeRate
}
return 0
}
@@ -19611,9 +19612,9 @@ var file_lightning_proto_rawDesc = []byte{
0x74, 0x68, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x6d,
0x73, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x61, 0x73, 0x65, 0x46,
0x65, 0x65, 0x4d, 0x73, 0x61, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x72,
0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x6d, 0x73, 0x61, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f,
0x6e, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x4d, 0x73, 0x61, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x6f,
0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6f,
0x6e, 0x61, 0x6c, 0x46, 0x65, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x6f,
0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6c, 0x74, 0x76, 0x5f, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x04,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6c, 0x74, 0x76, 0x44,
0x65, 0x6c, 0x74, 0x61, 0x12, 0x22, 0x0a, 0x0d, 0x68, 0x74, 0x6c, 0x63, 0x5f, 0x6d, 0x69, 0x6e,
+5 -2
View File
@@ -3545,8 +3545,11 @@ message BlindedPaymentPath {
// The base fee for the blinded path provided, expressed in msat.
uint64 base_fee_msat = 2;
// The proportional fee for the blinded path provided, expressed in msat.
uint64 proportional_fee_msat = 3;
/*
The proportional fee for the blinded path provided, expressed in parts
per million.
*/
uint32 proportional_fee_rate = 3;
/*
The total CLTV delta for the blinded path provided, including the
+4 -4
View File
@@ -3523,10 +3523,10 @@
"format": "uint64",
"description": "The base fee for the blinded path provided, expressed in msat."
},
"proportional_fee_msat": {
"type": "string",
"format": "uint64",
"description": "The proportional fee for the blinded path provided, expressed in msat."
"proportional_fee_rate": {
"type": "integer",
"format": "int64",
"description": "The proportional fee for the blinded path provided, expressed in parts\nper million."
},
"total_cltv_delta": {
"type": "integer",
+7 -9
View File
@@ -487,15 +487,13 @@ func unmarshalBlindedPayment(rpcPayment *lnrpc.BlindedPaymentPath) (
}
return &routing.BlindedPayment{
BlindedPath: path,
CltvExpiryDelta: uint16(rpcPayment.TotalCltvDelta),
BaseFee: uint32(rpcPayment.BaseFeeMsat),
ProportionalFeeRate: uint32(
rpcPayment.ProportionalFeeMsat,
),
HtlcMinimum: rpcPayment.HtlcMinMsat,
HtlcMaximum: rpcPayment.HtlcMaxMsat,
Features: features,
BlindedPath: path,
CltvExpiryDelta: uint16(rpcPayment.TotalCltvDelta),
BaseFee: uint32(rpcPayment.BaseFeeMsat),
ProportionalFeeRate: rpcPayment.ProportionalFeeRate,
HtlcMinimum: rpcPayment.HtlcMinMsat,
HtlcMaximum: rpcPayment.HtlcMaxMsat,
Features: features,
}, nil
}