Skip to content
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

rpc: update updatechanpolicy to allow zero fees #3139

Merged
merged 1 commit into from Jun 18, 2019

Conversation

Roasbeef
Copy link
Member

Fixes #3138.

// As a sanity check, we'll ensure that the passed fee rate is below
// 1e-6, or the lowest allowed fee rate, and that the passed timelock
// is large enough.
if req.FeeRate < minFeeRate {
case req.FeeRate != 0 && req.FeeRate < minFeeRate:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment looks out of date?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kek should have been more clear that it also says "we'll ensure that the passed fee rate is below 1e-6", instead of above or equal to the minimum.

@Roasbeef
Copy link
Member Author

PTAL @cfromknecht

Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀, one non-blocking comment

// As a sanity check, we'll ensure that the passed fee rate is below
// 1e-6, or the lowest allowed fee rate, and that the passed timelock
// is large enough.
if req.FeeRate < minFeeRate {
case req.FeeRate != 0 && req.FeeRate < minFeeRate:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kek should have been more clear that it also says "we'll ensure that the passed fee rate is below 1e-6", instead of above or equal to the minimum.

@ZapUser77
Copy link

Doesn't a fee of 0, 0 break the pathfinding algo?

@cfromknecht
Copy link
Contributor

@ZapUser77 nope, fees aren’t the only consideration in determining distance. That will be even more true with #2802

@ZapUser77
Copy link

I remember running into this specific problem. The EdgeWeight can return zero if fee = zero, because INT64 is used instead of float:

func edgeWeight(lockedAmt lnwire.MilliSatoshi, fee lnwire.MilliSatoshi,
timeLockDelta uint16) int64 {
// timeLockPenalty is the penalty for the time lock delta of this channel.
// It is controlled by RiskFactorBillionths and scales proportional
// to the amount that will pass through channel. Rationale is that it if
// a twice as large amount gets locked up, it is twice as bad.
timeLockPenalty := int64(lockedAmt) * int64(timeLockDelta) *
RiskFactorBillionths / 1000000000

return int64(fee) + timeLockPenalty

}

If TimelockPenalty results in number less than one, the return would be fees only... which was almost always.
This resulted in an infinite loop between two nodes if the fees were zero/zero, regardless of the Timelock.
I suggested changing several variable types.

Though, I think that was addressed by changing:
if tempDist >= distance[fromVertex].dist {
return
}
From ">" to ">="

@LNBIG-COM
Copy link

@alexbosworth wrote to me in LN chat that: "If you set your fees to zero programmatically you need to restart your node otherwise forwarding will break"
@Roasbeef , can you confirm or deny this? I changed fees through gRPC API. Should i restart LND daemons after setting zero fees in channels? And if yes, why?

@Roasbeef
Copy link
Member Author

Roasbeef commented Aug 26, 2019 via email

@gcomte
Copy link
Contributor

gcomte commented Dec 23, 2019

Hi @Roasbeef

So I'd assume the fix is available in master as of now?

@cfromknecht
Copy link
Contributor

@gcomte given the merge dates this looks like it shipped in 0.7

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.

Fee zero - is it possible to change in LND?
5 participants