-
Notifications
You must be signed in to change notification settings - Fork 912
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
Fix undeleted private channel update gossip_store entry #5661
Fix undeleted private channel update gossip_store entry #5661
Conversation
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.
ACK 08f6b1c
This fix seems correct, but I'm reminded of Kernighan and Plauger's aphorism "Don't patch bad code, rewrite it". Could we see a third commit that cleans all this up? In particular, private updates are never spam. And deletion of old spam records if they exist should be a clearly named function. Something like:
|
It's funny how obvious this is in hindsight. Makes the code much more reasonable. Thanks! |
Slightly neater:
|
Merged in that patch, testing now. Ack 368dcc3 |
677e0e8
to
368dcc3
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.
I found this crash of lnprototest in the CI it is new to me! Looks like that, but not sure if this is related to this change!
ERROR:concurrent.futures:exception calling callback for <Future at 0x7fd189204d90 state=finished raised RpcError>
Traceback (most recent call last):
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 342, in _invoke_callbacks
callback(self)
File "/work/external/lnprototest/lnprototest/clightning/clightning.py", line 304, in _done
raise exception
File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/work/external/lnprototest/lnprototest/clightning/clightning.py", line 297, in _fundchannel
return runner.rpc.fundchannel(
File "/work/contrib/pyln-client/pyln/client/lightning.py", line 771, in fundchannel
return self.call("fundchannel", payload)
File "/work/contrib/pyln-client/pyln/client/lightning.py", line 408, in call
raise RpcError(method, payload, resp['error'])
pyln.client.lightning.RpcError: RPC call failed: method: fundchannel, payload: {'id': '02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5', 'amount': 999877, 'feerate': '253perkw', 'announce': True}, error: {'code': 400, 'message': 'Unable to connect, no address known for peer', 'data': {'id': '02c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5', 'method': 'connect'}}
3be8cfe
to
9233535
Compare
When private channel updates exceed the gossip ratelimit, the previous gossip store entry was not deleted even though all private channel updates are stored. This caused gossip store corruption due to duplicate entries for the same channel. Fixes: ElementsProject#5656 Changelog-Fixed: Fixed gossip_store corruption from duplicate private channel updates
Adds a simple test covering the gossip_store corruption issue ElementsProject#5656 stemming from failure to delete prior private channel updates in all cases.
Private channel updates can no longer be flagged as spam during handling of a new channel update (this was a bug.) Also slightly reworked previous channel_update deletion for clarity.
9233535
to
2807742
Compare
Rebased on top of |
gossipd: ensure old private channel updates are properly deleted
When private channel updates exceed the gossip ratelimit, the previous gossip store entry was not deleted even though all private channel updates are stored. This caused gossip store corruption due to duplicate entries for the same channel.
Fixes: #5656
Changelog-Fixed: Fixed gossip_store corruption from duplicate private channel update