Repository navigation
forwarding ability: change forwarding volume to msat in RPC - #251
Merged
bitromortac merged 3 commits intoAug 26, 2026
Merged
Conversation
ViktorT-11
approved these changes
Aug 26, 2026
ViktorT-11
left a comment
Contributor
There was a problem hiding this comment.
LGTM 🔥! Just leaving 2 nits leaving some consistency feedback.
The forwarding ability endpoint reported per-pair volume in satoshis while lnd hands us every forward amount in millisatoshis, so the analyzer floored each forward to a whole satoshi before summing it. A pair carrying only sub-satoshi forwards reported zero volume and had to be recognised by its forward count alone, and the CLI's fee rate needed a factor of 1000 to divide millisatoshi fees by satoshi volume. Summing at the granularity lnd reports means no forward is floored away and the fee rate falls out as a plain unitless fraction. The field is renamed forwarded_sat to forwarded_msat rather than kept, so a REST consumer that misses the change reads a missing field instead of a value that is silently 1000 times too small. int64 millisatoshis reaches 92.2 million BTC, over four times the supply, so the narrower unit costs nothing in range.
Effective uptime is a duration, and the two second-valued fields already in the schema, ChannelInsight's monitored_seconds and uptime_seconds, are both unsigned. Aligning effective_uptime_s with them puts the non-negativity in the type, and it costs nothing at the boundary: the analyzer measures uptime as a time.Duration and the server derives whole seconds from it. The msat quantities beside it stay signed. They are the operands of arithmetic a consumer actually performs, deltas between windows and volume divided by forward count, where a signed result surfaces a mistake as a negative rather than as a number near 2^64. That reasoning does not reach a duration nobody subtracts, and it matches the seven signed msat fields the schema already carries. MinQualifyingUptime returns the same unsigned count, so the comparison it feeds needs no conversion. Its "admits nothing" sentinel becomes MaxUint64. Decoding an up-but-idle pair now clamps the window before adopting it as an uptime, since a response whose end precedes its start would otherwise reconstruct a near-infinite one instead of a negative one.
bitromortac
force-pushed
the
2608-forwarding-volume-msat
branch
from
August 26, 2026 10:12
d02540c to
cb91843
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes the
ForwardingAbilityendpoint to report the volume in msat to prevent precision loss. The effective uptime is changed to a uint64 in order to be consistent in the handling of durations in the proto.