-
Notifications
You must be signed in to change notification settings - Fork 266
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
Limit how far we look into the blockchain #2731
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sstone
reviewed
Aug 29, 2023
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/rpc/BitcoinCoreClient.scala
Outdated
Show resolved
Hide resolved
sstone
reviewed
Aug 29, 2023
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/bitcoind/rpc/BitcoinCoreClient.scala
Outdated
Show resolved
Hide resolved
pm47
previously approved these changes
Sep 19, 2023
sstone
previously approved these changes
Sep 21, 2023
If we're unable to find the spending tx in the mempool, we start looking for it in the blockchain. Unfortunately, there are cases where we end up in that code path even though the spending tx is not confirmed: - a timeout on the `getTransaction` call - the spending tx gets dropped from our mempool for some reason - bitcoind is malicious or buggy Fetching the whole blockchain isn't really useful: after enough time has passed, we can be pretty sure that a potential attacker would have claimed the transaction's outputs already and we can't punish them. We limit this to the last month of blockchain data, which should be much larger than our `to_delay`.
And add a unit test.
t-bast
force-pushed
the
limit-blockchain-speleology
branch
from
September 21, 2023 14:57
1276f2c
to
3a75af7
Compare
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #2731 +/- ##
==========================================
- Coverage 85.89% 85.80% -0.09%
==========================================
Files 215 216 +1
Lines 17854 18016 +162
Branches 756 787 +31
==========================================
+ Hits 15335 15458 +123
- Misses 2519 2558 +39
|
pm47
approved these changes
Sep 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If we're unable to find the spending tx in the mempool, we start looking for it in the blockchain. Unfortunately, there are cases where we end up in that code path even though the spending tx is not confirmed:
getTransaction
callFetching the whole blockchain isn't really useful: after enough time has passed, we can be pretty sure that a potential attacker would have claimed the transaction's outputs already and we can't punish them. We can limit that to the maximum amount of time we expect our node to be offline.