* Refactor codebase to have has-a relationship with RescanHandling rather than is-a
get everything compiling
Get all tests passing
* Revert and clean up files
* Fix docs
* Add NodeApiCallbacks
* Add BitcoindCallbacks
* Add BitcoindRpcAppConfig
* fix docs
* Add helper method for construction
* Add helper constructor method to avoid explicitly passing BitcoindRpcAppConfig parameter to BitcoindRpcClient when we have a BitcoindInstanceLocal
* Fix docs
* Update scalafmt-core to 3.8.1
* Update .scalafmt.conf settings to be factory default settings
* Fix typo
* scalafmt
* Empty commit to re-run CI
* Revert some scalafmt back to original scalafmt.conf
---------
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
* Rework DataMessageHandler to consider syncing filterheaders if we receive a headers message with 0 block headers
* scalafmt
* Remove syncfilter job
* Cleanup
* Reduce received headers log to DEBUG
* Rework SyncNodeState.toString()
* Call PeerManager.startFilterSync() in DataMessageHandler
* Don't test MTP in unrelated test
* Add sentQuery Instant to SyncNodeState subclasses, add logic in DataMessageHandler.handlePayload() to detect if a query has timed out
* Refactor to use NodeTestUtil.disconnectNode()
* Cleanup comments
* Add NodeRunningState.removePeer(), add helper method onDisconnectNodeStateUpdate() to consolidate disconnect logic
* Remove duplicate logic
* Add bitcoin-s.node.maxConnectedPeers test
* Clean up resources in test case
* Remove unecessary replacePeers()
* Add NodeState.addPeer()
* Add NodeRunningState.connectedPeerCount, separate handling of connection slots and filter slots
* Disconnect from bitcoind side rather than bitcoin-s side to make sure we don't run into a race condition for updating lastSeen
* Remove usage of CachedAppConfig, switch implicit param args for PeerDAO to be consistent with rest of code base
* Fix bug in getNodeURIFromBitcoind(), disconnect from bitcoind side in PeerManagerTest
* Add println to see why still fialing
* Add PeerConnection.getLocalAddress, add parameter localAddressBitcoinS to NodeTestUtil.getNodeURIFromBitcoind() to make sure we are getting the correct URI
* Empty commit to run CI
* Get dependencies resolving, get tor module compiling
* Get everything compiling with pekko
* Rework configs/logging to use pekko namespace
* Rename AkkaUtil -> PekkoUtil, BitcoinSAkkaAsyncTest -> BitcoinSPekkoAsyncTest
* Pull PeerFinder changes over from #5390
* Filter out peers we are already connected when attempting to discover peers inside of PeerFinder
* Try to work around mutable.Map.isEmpty bug by converting to immutable Map
* Fix bug in PeerManager.connect() where we would throw ane xception when our PeerFinder had not seen the peer before
* Remove ReConnectionTest case where we constantly try to reconenct o a peer we disconnected, revert logback-test.xml
Refactor ReConnectionTest to use NodeTestUtil.awaitConnectionCount()
Refactor more of codebase to use NodeTestUtil.awaitConnectionCount()
Refactor PeerManagerTest to use NodeTestUtil.awaitConnectionCount()
Refactor more nodeTest to use NodeTestUtil.awaitConnectionCount()
use bitcoinds.size for expectedConnectionCount
* Move NodeState back to node module
* Refactor peerWithServicesDataMap into NodeState
* More usage of state.peerDataMap in stream
* Fix log message
* Fix compile
* Move PeerFinder into NodeState
* WIP: Move PeerFinder init into NeutrinoNode.start()
* Get things mostly working again after rebase
* Fix bug in handling of headers message where we wouldn't transition to DoneSyncing if a peer sent us 0 headers
* Move SendToPeer into stream
* scalafmt
* Empty commit to run CI
* Re-add DataMessageHandlerTest
* Renable disconnecting portion of NeutrinoNodeTest
* Empty commit to run CI
* Remove disconnection part of test again
* Empty commit to re-run CI
* Empty commit to re-run CI
* Dont initiate disconnect logic from bitcoind, its falky for some reason
* Fix bug where we weren't switching sync to another peer on disconnect for the case where we were waiting for disconnection
* Empty commit to run CI
* Empty commit to run CI
* Rework NodeTestUtil to use a specific bestBlockHash, this is useful in reorg situations
Use param in reorg test, modify scaladoc
WIP
* Cleanup
* Try to fix usage of stopHashBE
* Cleanup
* WIP: Fix getCompactFilterStartHeight()
* Revert logback-test.xml
* Fix bug with isFiltersSynced() in reorg situations
* scalafmt, fix compile
* Fix another bug with isFiltersSynced()
* Fix compile
* Fix another bug with isFiltersSynced()
* Fix compile
* Cleanup uncessary checks
* Empty commit to re-run CI
* Empty commit to re-run CI
* Empty commit to re-run CI
* 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
* Pull queue, PeerFinder into NeutrinoNode and out of PeerManager
* Remove ControlMessageHandler param from PeerData
* Make ControlMessageHandle.handleControlPayload() take PeerMessageSenderApi as a param instead of just a Peer
* move construction of akka stream from PeerManager to NeutrinoNode
* Move inactivity checks out of PeerManager and into NeutrinoNode
* Move queue initialization into NeutrinoNode
* cleanup
* Set NeutrinoNode.isStarted to true when NeutrinoNode.start() is called
* Empty commit to re-run CI
* Modify FilterSync.toString()
* scalafmt
* Fix bug where we weren't checking if connection is timed out on activity checks
* Empty commit to run CI
* reset log level
* Reset PeerConnection.connectionGraphOpt = None when connection is disconnected
* Move resetting connectionGraphOpt into PeerConnection.disconnect()
* Call PeerData.stop() inside of PeerManager.onDisconnect()
* Empty commit to run CI
* Empty commit to re-run CI
* Rename PeerMessageSender -> PeerConnection
* WIP: Move gossip methods into PeerManagerApi, keep single peer methods in PeerMessageSenderApi, but remove peer parameter
* PeerData.peerMessaageSender -> PeerData.peerConnection
* Remove DataMessageHandler.queue as it is redundant
* Get most test cases passing in nodeTest
* Fix ReConnectionTest
* Fix NeutrinoNodeWithUncachedBitcoindTest test case
* Rename PeerManager.{randomPeerMsgSender, getPeerMessageSender} -> PeerManager.{randomPeerConnection,getPeerConnection}
* Refactor PeerManager.getPeerMessageSender to return the new PeerMessageSender
* Rename param
* scalafmt
* Remove unused method
* Revert onInitialization
* 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
* simplify re-query invalid headers test case
* Cleanup test
* Cleanup another test
* Fix re-query invalid headers unti test
* fix unit test
* Empty commit to run CI
* Empty commit to re-run CI
* Empty commit to run CI