-
Notifications
You must be signed in to change notification settings - Fork 913
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
add max_total_htlc_out to listpeerchannels #7193
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ void gossmod_add_localchan(struct gossmap_localmods *mods, | |
struct amount_msat htlcmin, | ||
struct amount_msat htlcmax, | ||
struct amount_msat spendable, | ||
struct amount_msat total_htlcmax, | ||
struct amount_msat fee_base, | ||
u32 fee_proportional, | ||
u16 cltv_delta, | ||
|
@@ -52,6 +53,7 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, | |
struct amount_msat htlcmin, | ||
struct amount_msat htlcmax, | ||
struct amount_msat sr_able, | ||
struct amount_msat max_total_htlc, | ||
struct amount_msat fee_base, | ||
u32 fee_proportional, | ||
u16 cltv_delta, | ||
|
@@ -72,6 +74,7 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, | |
bool enabled; | ||
struct node_id dst; | ||
struct amount_msat capacity_msat, spendable, receivable, fee_base[NUM_SIDES], htlc_min[NUM_SIDES], htlc_max[NUM_SIDES]; | ||
struct amount_msat max_total_in_htlc, max_total_out_htlc; | ||
u32 fee_proportional[NUM_SIDES], cltv_delta[NUM_SIDES]; | ||
const char *state, *err; | ||
|
||
|
@@ -87,6 +90,8 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, | |
"direction?:%," | ||
"spendable_msat?:%," | ||
"receivable_msat?:%," | ||
"our_max_htlc_value_in_flight_msat?:%," | ||
"their_max_htlc_value_in_flight_msat?:%," | ||
"peer_connected:%," | ||
"state:%," | ||
"peer_id:%," | ||
|
@@ -109,6 +114,8 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, | |
JSON_SCAN(json_to_int, &scidd.dir), | ||
JSON_SCAN(json_to_msat, &spendable), | ||
JSON_SCAN(json_to_msat, &receivable), | ||
JSON_SCAN(json_to_msat, &max_total_in_htlc), | ||
JSON_SCAN(json_to_msat, &max_total_out_htlc), | ||
JSON_SCAN(json_to_bool, &enabled), | ||
JSON_SCAN_TAL(tmpctx, json_strdup, &state), | ||
JSON_SCAN(json_to_node_id, &dst), | ||
|
@@ -155,7 +162,7 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, | |
/* We add both directions */ | ||
cb(mods, self, &dst, &scidd, capacity_msat, | ||
htlc_min[LOCAL], htlc_max[LOCAL], | ||
spendable, fee_base[LOCAL], fee_proportional[LOCAL], | ||
spendable, max_total_out_htlc, fee_base[LOCAL], fee_proportional[LOCAL], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just to confirm my understanding: maybe renaming these would make this clearer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rustyrussell: help! From the spec BOLT02:
My interpretation is that |
||
cltv_delta[LOCAL], enabled, buf, channel, cbarg); | ||
|
||
/* If we didn't have a remote update, it's not usable yet */ | ||
|
@@ -166,7 +173,7 @@ gossmods_from_listpeerchannels_(const tal_t *ctx, | |
|
||
cb(mods, self, &dst, &scidd, capacity_msat, | ||
htlc_min[REMOTE], htlc_max[REMOTE], | ||
receivable, fee_base[REMOTE], fee_proportional[REMOTE], | ||
receivable, max_total_in_htlc, fee_base[REMOTE], fee_proportional[REMOTE], | ||
cltv_delta[REMOTE], enabled, buf, channel, cbarg); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23999,7 +23999,25 @@ | |
"max_total_htlc_in_msat": { | ||
"type": "msat", | ||
"description": [ | ||
"Max amount accept in a single payment." | ||
"Max amount accept in a single payment. This field is deprecated, use instead our_max_htlc_value_in_flight_msat" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: this commit should be squashed into the commit where these fields are originally introduced/added to the RPC (the first one in the series, in this case) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's complicated. These are autogenerated, if you ask me I wouldn't have these files into the source code cause no human wrote them. I add them as a separate commit to make it easier to rebase on the master branch in case someone else has also modified them. My usual rebase when changing schemas is
|
||
], | ||
"deprecated": [ | ||
"v24.11", | ||
"v25.05" | ||
] | ||
}, | ||
"their_max_htlc_value_in_flight_msat": { | ||
"type": "msat", | ||
"added": "v24.11", | ||
"description": [ | ||
"Cap on total value of outstanding HTLCs offered to the remote node. This limits the total amount in flight we can send through this channel." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion to make this more readable: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. though now that i've written these out, i feel like the we can't add more HTLCs to be sent to the peer, because they don't want to let X% of their balance be committed as HTLCs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is weird. It is like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The description is a sentence taken from BOLT02. |
||
] | ||
}, | ||
"our_max_htlc_value_in_flight_msat": { | ||
"type": "msat", | ||
"added": "v24.11", | ||
"description": [ | ||
"Cap on total value of outstanding HTLCs we accept from the remote node. This limits the total amount in flight we can receive through this channel." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion to make this more readable: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this also work? |
||
] | ||
}, | ||
"their_reserve_msat": { | ||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how often does this get updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
max_htlc_value_in_flight
pair is fixed for the entire lifetime of the channel.The
gossmod_from_listpeerchannels
is called to parse the response fromlistpeerchannels
.In
askrene
orrenepay
this is expected to happen once per rpc call.