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

discovery: revamp premature update map #5902

Merged
merged 3 commits into from Nov 4, 2021

Conversation

Roasbeef
Copy link
Member

Turns out we need it right now to handle some low latency race
conditions in our integration tests, so we'll opt to simply cap the size
of it to a low amount. We use a basic LRU caching mechainsm.

Fixes #5076

@Roasbeef Roasbeef added this to the v0.14.0 milestone Oct 29, 2021
@guggero
Copy link
Collaborator

guggero commented Oct 29, 2021

The linter fails, which is also the reason for the Travis failure:

 discovery/gossiper.go:1958:34: Error return value of `d.prematureChannelUpdates.Put` is not checked (errcheck)
				d.prematureChannelUpdates.Put(shortChanID, &cachedNetworkMsg{
				                             ^
discovery/gossiper.go:1967:34: Error return value of `d.prematureChannelUpdates.Put` is not checked (errcheck)
				d.prematureChannelUpdates.Put(shortChanID, &cachedNetworkMsg{

I looked at some of the itest failures:

Copy link
Collaborator

@Crypt-iQ Crypt-iQ left a comment

Choose a reason for hiding this comment

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

LGTM, left some minor nits 🍳

discovery/gossiper.go Outdated Show resolved Hide resolved
discovery/gossiper.go Outdated Show resolved Hide resolved
discovery/gossiper.go Outdated Show resolved Hide resolved
discovery/gossiper.go Show resolved Hide resolved
Turns out we need it right now to handle some low latency race
conditions in our integration tests, so we'll opt to simply cap the size
of it to a low amount. We use a basic LRU caching mechainsm.

Fixes lightningnetwork#5076
Similar to the prior commit, in this commit, we move to using a basic
LRU cache to store the set of prior rejected messages.
Copy link
Collaborator

@positiveblue positiveblue left a comment

Choose a reason for hiding this comment

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

LGTM 👌

@Roasbeef Roasbeef merged commit 7d6915d into lightningnetwork:master Nov 4, 2021
guggero added a commit to guggero/lnd that referenced this pull request Jan 3, 2022
Fixes a nil pointer dereference panic introduced by lightningnetwork#5902.
Since peer is an interface the value can actually be nil. This is
probably a symptom of another problem but I'm not really familiar with
this part of the code base, so this just adds some band aids.
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.

discovery: actually actually get rid of the prematureChannelUpdates map
4 participants