* Fix bug in getFilterSyncMarkerFromStopBlockHeader where we were previously querying for children rather than the block hashes at the given height for building the FilterSyncMarker for getcfilter request. Also introduce delay in sending getcfheader because of https://github.com/bitcoin/bitcoin/issues/27085
* Only fallback to reorg scenario if we find no headers at height + 1
* Remove the best filter's block header from the candidate headers in reorg scenarios
* Get ChainApi.nextBlockHeaderBatchRange() tests passing
* Get all tests passing in chainTest/test
* Get all tests passing
* Add BlockHeaderDAO.getBlockchainFrom(header,startHeight), use it for filter marker computation
* Add carve out for IBD when syncing filter headers to avoid loading entire block header chain into memory
* Cleanup
* Fix inconsistencies between ChainApi.{nextBlockHeaderBatchRange, nextFilterHeaderBatchRange}
* Fix bug when requesting FilterSyncMarker for filter headers outside of our in memory blockchain's range
* Rework buildNHeaders to be faster, move it to ChainUnitTest
* Add ChainApi.getBestChainTips()
* Implement BitcoindRpcClient.getBestChainTips()
* Revert NodeTestUtil
* Use ChainApi.getBestChainTips() throughout codebase rather than blockHeaderDAO.getBestChainTips()
* Rework randomPeerWithServices() to be inside of NodeState, try to move more state into NodeState
* Don't try to sync from peer waitingForDisconnection
* Add PeerWithServices, keep track of ServiceIdentifier in PeerManager and NodeState
* Try to make reorg test more reliable
* Empty commit to run CI
* Rework ChainApi.nextBlockHeaderBatchRange() to take stopHash parameter, get chainTest/test passing
* WIP: Refactor ChainApi.nextFilterHeaderBatchRange()
* Finish ChainApi.nextFilterHeaderBatchRange() refactor, get all tests passing except reorg related tests in nodeTest
* Get NeutrinoNodeTest reorg test case working
* Improve flaky test
* Cleanup
* Switch sync check to bitcoinds(1)
* Empty commit to run CI
* Implement batchSize tests in ChainHandlerTest
* Rework ChainHandlerTest to not assume we have the genesis filter header / filter inserted into the database already
* Cleanup println
* Fix bug with nextFilterHeaderBatchRange() wrt to startHeightOpt parameter
* Fix off by one bug with compact filter sync
* Add check for connectionCount
* Add longer timeout
* scalafmt
* Add test case for reorg on bitcoin network for NeutrinoNodeTest
* Get unit tests passing
* Refactor findNextHeader() to not take an Option[BlockHeaderDb], not it just takes BlockHeaderDb
* Explicity return None in the case where we don't need sync filter headers
* Fix off by one bug when starting filter header sync
* Fix bug where compact filters weren't being processed in order of block height during IBD
* Use sorted compact filter messages in chainApi.processFilters()
* WIP
* Modify DataMessageHandler to use Set for filter batch, fix test case
* revert log level
* Remove duplicate filters test
* Re-add test to make sure we don't throw an exception when processing a filter we've seen before
* Empty commit to re-run CI
* Empty commit to re-run CI
* Empty commit to re-run CI
* Fix NeutrinoNodeTest
* Empty commit to re-run CI
* Empty commit to re-run CI
* Make PeerManager.finder private
* Make PeerManager.supervisor private
* Write unit test to see if default peer is added to PeerManager
* Use withNeutrinoNodeUnstarted fixture
* Get unit tests passing
* Add println to try and debug CI
* Add more println
* more println
* Adjust nodeTest / parallelExecution = false
* Try to make error logged to figure out why failure is happening on CI
* Adjust log level to ERROR
* Add catch to try and log failure messages
* Add log for sending messages to peers
* Try to increase threadpool size to see if we are deadlocking
* Add more logs
* Add another log to detect where failure is
* Try using Actor.tell() with explicit ActorRef.noSender
* Very detailed logging
* Remove duplicate method from rebase
* Revert things
* Revert build.sbt
* Empty commit
* Bump timeout
* Empty commit to run CI
* Revert more files
* Pull things over from 4950 that shouldn't cause issues to reduce size of 4950
* Reduce timeout for processing a batch of messages from 1000 seconds -> 60 seconds
* scalafmt
* Empty commit
* upgrade to scala 2.13.10
* Remove 2.13.8 from CI
* Try upgrading to sbt 1.8.0-RC1 to see if build works on CI
* Try to update scoverage to 2.0.6
* Upgrade sbt native packager to 1.9.11
* Upgrade to sbt 1.8.0
* implement chain callbacks for compact filter headers / compact filters
* Wire it up through the websocket
* Fix type for compactfilterprocessed
* Fix bug to write json rather than write a string
* Implement isinitialblockdownload flag in databaes
* Change to IsInitialBlockDownload to be less confusing
* Fix missing refactors, add ChainApi.isIBD()
* Implement logic for ChainApi.isIBD(), add configuration flag to toggle whether to emit websocket events while IBD is ongoing or not, add isinitialblockdownload field to getinfo endpoint
* Remove confusing ChainApi.isIBD() that didn't accurately account for the case where IBD wasn't set in the database
* Fix bug around emitting the websocket events
* Add some documentation
* Check if bitcoind is syncing before running scheduled job to poll bitcoind
* Set syncing flag to true if initialblockdownload is true
* Implement logic so we only emit websocket events when state is changed, rather than everytime we poll bitcoind
* Implement logic to only emit websocket event when descriptor flag changes rather than when it is set
* removed logger parameter from where it's used with callbacks
* removed logger from onTXRecived... and onBlockRecived...
* removed unused imports
* removed logger from walletCallbacks
* Add `sync` JSON field to the `getinfo` endpoint output
* improve test coverage
* update docs
* rename sync flag
* WebSocket notifications
* fix unit tests
* fix unit tests
* increase test timout
* Try to add block generate to address in fixture setup to get around the case where block headers & filter headers are synced but compact filters are not
* Push to github to force re-run of CI 2
* Add ChainApi.getBestFilter(), use it in sync to determine if filter headers & filters are in sync
* Push to github to force re-run of CI 3
* Simplify getBestFilter, add unit test
* Add more comments, clean up some code
Turn off logging again
Try to move things around even more to make sure zmq is started
Turn logging level down to ERROR to hopefully get some meaningful output
Adjust both valdiation & ChainHandler to be ERROR level logging
switch zmqpubrawblock to be the port we know is free
Reduce logging to WARN
Bump bitcoind max retries to 120
Fix rebase
Revert logging
Remove some noisy logs
Restore logs to trace level
Add explicit tag
* Get FilterSync test working with cached bitcoind in chainTest project
* Small refactor to be DRY
* Fix docs
* Refactor ChainSyncTest to use 1 cached bitcoind, as a by product add ChainWithBitcoindNewestCachedUnitTest
* Remove unecessary mixin trait
* Fix missing ChainWithBitcoindNewestCachedUnitTest.afterAll()
* Reduce thread pool size for akka's internal dispatcher in unit tests from 2 -> 1. Same with the blocking dispatcher
* Add comment
* Fix missing super.stop() to shutdown DbAppConfig db connection pool inside of all DbAppConfig subclasses that override stop()
* Fix import
* Remove implicit modifier to NodeUnitTest.getFreshConfig(), make sure we are shutting down chainAppConfig inside NodeUnitTest
* Remove chainTest subclasses implementing ActorSystem, make sure we do correct cleanup in ChainUnitTest
* Decouple CachedChainAppConfig & CachedAppConfig. When using only one sub module in the CachedAppConfig, teardown may fail as the other modules might not be started such as using chainAppConfig in chainTest, BitcoinSAppConfig.stop() requires us to call nodAppConfig.stop() first, which isn't started.
* Push to github to force re-run of CI 4