-
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
Add blockchain watchdog #1545
Add blockchain watchdog #1545
Conversation
4a7034d
to
e848b1d
Compare
I'm not sure how I should instantiate my top-level actor ( |
I believe a child of |
Introduce a blockchain watchdog that fetches headers from multiple sources in order to detect whether we're being eclipsed. Use blockchainheaders.net and blockstream.info as first sources of blockchain data. More blockchain sources will be added in future commits.
3b3218d
to
e509818
Compare
Codecov Report
@@ Coverage Diff @@
## master #1545 +/- ##
==========================================
- Coverage 87.28% 87.25% -0.03%
==========================================
Files 139 144 +5
Lines 10916 11034 +118
Branches 474 451 -23
==========================================
+ Hits 9528 9628 +100
- Misses 1388 1406 +18
|
This is another blockchain explorer that can be used as a secondary source.
Use the same actor for all explorers we'll want to support. Each explorer watchdog simply implements the API calls. Fix the `BlockchainWatchdogSpec`: there was a race condition where we may send `CurrentBlockCount` to the `eventStream` before the actor under test was registered to these events.
You should probably add https://mempool.space/api. |
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 think that instead of looking for a blockCountDelta
in the future, we should simply compare tips. In the case of bitcoinheaders.net which doesn't have this feature, we can look for n + 10
blocks. Maybe we are even more late than that but it's enough to raise the alarm.
This is an esplora-based API which makes it very easy.
eclair-core/src/main/scala/fr/acinq/eclair/blockchain/watchdogs/HeadersOverDns.scala
Show resolved
Hide resolved
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 have just suggestions, but we can go with this version if you want.
Introduce a blockchain watchdog, that fetches headers from multiple sources in order to detect whether we're being eclipsed.
The current blockchain sources we use are:
We can add more sources later if needed.