Skip to content

rpc: update updatechanpolicy to allow zero fees#3139

Merged
Roasbeef merged 1 commit into
lightningnetwork:masterfrom
Roasbeef:zero-fees
Jun 18, 2019
Merged

rpc: update updatechanpolicy to allow zero fees#3139
Roasbeef merged 1 commit into
lightningnetwork:masterfrom
Roasbeef:zero-fees

Conversation

@Roasbeef
Copy link
Copy Markdown
Member

Fixes #3138.

Comment thread rpcserver.go Outdated
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@cfromknecht cfromknecht May 31, 2019

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
Copy Markdown
Member Author

PTAL @cfromknecht

Copy link
Copy Markdown
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

Comment thread rpcserver.go Outdated
Copy link
Copy Markdown
Contributor

@cfromknecht cfromknecht May 31, 2019

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
Copy Markdown

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

@cfromknecht
Copy link
Copy Markdown
Contributor

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

@ZapUser77
Copy link
Copy Markdown

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
Copy Markdown

@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
Copy Markdown
Member Author

Roasbeef commented Aug 26, 2019 via email

@gcomte
Copy link
Copy Markdown
Contributor

gcomte commented Dec 23, 2019

Hi @Roasbeef

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

@cfromknecht
Copy link
Copy Markdown
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