-
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
[RFC] lightningd: pass the current known block height down to the getchaininfo call #6181
[RFC] lightningd: pass the current known block height down to the getchaininfo call #6181
Conversation
d4a05d2
to
1623860
Compare
This is build on top of this RFC from core lightning ElementsProject/lightning#6181 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This is build on top of this RFC from core lightning ElementsProject/lightning#6181 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This is build on top of this RFC from core lightning ElementsProject/lightning#6181 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This is build on top of this RFC from core lightning ElementsProject/lightning#6181 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
1623860
to
56c0691
Compare
56c0691
to
ed825c0
Compare
Trivial Rebase |
ed825c0
to
f2e69cf
Compare
I think this is the wrong approach? We should really handle blockheight below what we expect more gracefully. Possibly by just waiting for bitcoind to catch up? |
Mh, yeah, if we want to fix this in core lightning, we can try waiting for bitcoind to sync up instead of failing. However, there are some corner cases that lead me to propose this change. Bitcoin Core is extremely slow to sync up, so the question here is, how long should we wait? The time depends on various factors. The problem I want to solve is that I don't want to be left in the dark when we run In my specific case, I was integrating a BIP 157 compatible backend, so it was very convenient to use But again, I am happy to work on a solution inside core lightning if you do not think my is the correct path |
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.
Minor changes, but also mention the new parameter in docs/PLUGINS.md?
f2e69cf
to
850e48d
Compare
Thanks @rustyrussell Review applied and also commit docs updated to clarify why we are not |
9de6477
to
3fc8b3e
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.
Ack 3fc8b3e
When core lightning is asking the information about the blockchain with `getchaininfo` command lightningd know already the information about the min and max block height. the problem is when we have a smarter Bitcoin backend that is able to switch between different clients in some cases is helpful give the information about current known height by lightningd and pass it down to the plugin. In this way, the plugin knows what is the correct known height from lightnind, and can try to fix some problems if any exit. This is particularly useful when you are syncing a new backend from scratch like https://github.com/cloudhead/nakamoto and we avoid returning the lower height from the known, and avoid the crash of core lightning. With this information, the plugin can start to sync the chain and return the answer back only when the chain is in sync with the current status of lightningd. Another reason to add this field and not wait the correct block in core lightning itself is because Bitcoin Core is extremely slow to sync up, so the question here is, how long should we wait? The time depends on various factors. With this approach of informing the plugin about the height, in some cases, you can start the syncing but move the execution to another backend until the previous one is ready. The problem I want to solve is that I don't want to be left in the dark when we run `getchaininfo`, and I want to have the opportunity to wait for the blockchain sync or decide to dispatch the request elsewhere. Changelog-Added: Pass the current known block height down to the getchaininfo call. Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
3fc8b3e
to
f3bfd1d
Compare
Added the changelog inside the commit (we miss the check in the CI, if the CI fails in some previous steps) and trivial rebase! Ack f3bfd1d |
Based on ElementsProject/lightning#6181 feature to allow sync nakamoto. Link: #54 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Based on ElementsProject/lightning#6181 feature to allow sync nakamoto. Link: #54 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Based on ElementsProject/lightning#6181 feature to allow sync nakamoto. Link: #54 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Based on ElementsProject/lightning#6181 feature to allow sync nakamoto. Link: #54 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Based on ElementsProject/lightning#6181 feature to allow sync nakamoto. Link: #54 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
When core lightning is asking the information about
the blockchain with
getchaininfo
command lightningdknow already the information about the min and max block height.
the problem is when we have a smarter Bitcoin backend that is able
to switch between different clients in some cases is helpful
give the information about current known height by lightningd and
pass it down to the plugin.
In this way, the plugin knows what is the correct known height from lightnind, and can
try to fix some problems if any exist.
This is particularly useful when you are syncing a new backend from scratch
like https://github.com/cloudhead/nakamoto and we avoid returning the
lower height from the known, and avoid the crash of core lightning.
With this information, the plugin can start to sync the chain and return
the answer back only when the chain is in sync with the current status of
lightning.
Used to fix the switch backend in https://github.com/coffee-tools/folgore