-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 inbound fees channel updates to notifications #8723
add inbound fees channel updates to notifications #8723
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
I got it working, and noticed that here inbound fees are also not added, is this needed? |
b851804
to
aacb4b6
Compare
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.
Thank you a lot for working on this 🔥! I think it may not be necessary to add the inbound fees to ChannelUpdate
and ChannelEdgeUpdate
because that data is already in the extra tlv data. If we pass through the tlv data instead, we can also make that info available to the stream (see my comment).
@@ -60,6 +60,15 @@ type ChannelEdgePolicy struct { | |||
// HTLCs for each millionth of a satoshi forwarded. | |||
FeeProportionalMillionths lnwire.MilliSatoshi | |||
|
|||
// InboundFeeBaseMSat is the base HTLC fee that will be subtracted for |
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.
Could you instead add ExtraOpaqueData lnwire.ExtraOpaqueData
on this struct and set it in addToTopologyChange
? That way we don't have to add redundant data to ChannelUpdate
and ChannelEdgeUpdate
because the inbound fees are in the opaque tlv blob. We can then use this to pass that blob through to marshalTopologyChange
and extract inbound fees using extractInboundFeeSafe
. We can then as well set CustomRecords
on the proto message preparing it with marshalExtraOpaqueData
, similar to the approach that was taken in marshalDBRoutingPolicy
.
Tests don't build:
The linter is also failing:
|
Those tests cases should be resolved in my latest commit. |
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.
I am not super familiar with Go, what's the best way to resolve these long lines? Which causes the linter to fail
Yes, it takes a bit to get familiar with how some code formatting is done on this repo, I'd recommend to read https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md and https://github.com/lightningnetwork/lnd/blob/master/docs/code_formatting_rules.md specifically, it's described there.
Code wise this looks good to me except for the linter issues. Could you also squash your commits?
4034205
to
4e75f30
Compare
Lint issues resolved and release notes updated. Some integration tests are failing, but are not related to my changes it seems 🤔 |
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.
A couple of additional nits, otherwise looks good, thanks.
4ab7641
to
af9858c
Compare
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.
utACK, LGTM 🎉
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.
tACK, LGTM ⚡
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.
LGTM
Adds inbound fees to notifications, used in the
SubscribeChannelGraph