* 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
* Add delay to wait for zmq to get setup in chainTest
* Add println
* only run zmq tests on CI
* Bump Thread.sleep from 1ms -> 10ms
* Empty commit to re-run CI
* Revert things
* try making thread names more unique
* try no sleep
* Remove println
* Put logging back
* Try removing ZMQ.NOBLOCK
* turn off parallelExecution to see if it matters
* Add more logging
* Re-enable parallelExecution
* Try catching all NonFatal exns
* Bump timeout
* Bump maxTries
* Try downgrading jeromq back to 0.5.4
* Revert things
* scalafmt
* 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
* Move away from suredbits provided peers by default
* Remove setting bitcoin-s.node.use-default-peers
* Don't allow peer to stay connected if it doesn't support compact filters
* Move disconnection logic into managePeerAfterInitialization()
* Remove reconnect() when we have no other peers, send getaddr message after we know we are keeping the peer connection
* Remove hasCf flag check, revert log
* Reduce inactivity-timeout to 5 minutes by default, shuffle peers in PeerFinder beforing pushing onto stack
* Add logic to disconnect AttemptToConnect peers after addr mesage is received
* Create PeerFinder.queryForPeerConnections(), call it directly from PeerManager on health checks rather than restarting PeerFinder
* scalafmt
* Move more logic into managePeerAfterInitalization()
* Don't set isPersistent for db peers by default
* Add call to queryForPeerConnections() inside of PeerManager.onDisconnect() to try to attempt to more peers when we have no more connections, fix MisBehavingPeer logic to not start sync, starting sync should happen in onDisconnect()
* Revert logback-test.xml
* Sort peers we are attempting to connect to by lastSeen parameter
* Refactor DoneSyncing.toHeaderSync() to return Option[HeaderSync] to represent the case where we don't have a peer to sync with
* scalafmt
* Remove duplicate PeerFinder.buildPeerData()
* 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
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
* Conslidate PeerFinder.start() logic into peerConnectionScheduler, add bitcoins-s.node.try-peers-start-delay config settig to indicate how long until we start attempting to connect to peers in PeerFinder
* Cleanup
* Revert logback-test.xml
* Add documentation
* Empty commit to run CI
* Rework NodeAppConfig.peers to return Vector[Peer] rather than Vector[String]
* Add higher priority to paramPeers
* 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
* 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
* Add ChainApi.getBestChainTips()
* Implement BitcoindRpcClient.getBestChainTips()
* Revert NodeTestUtil
* Use ChainApi.getBestChainTips() throughout codebase rather than blockHeaderDAO.getBestChainTips()
* 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
* WIP: Implement WalletCallbackStreamManager
* Implement stopping of WalletCallbackStreamManager in WalletAppConfig
* WIP: DLCWalletCallbackStreamManager
* Refactor DLCWalletCallbacks to be a trait
* Integrate DLCWalletCallbackStreamManager into WebsocketUtil
* Use java.util.concurrent.atomic.AtomicBoolean rather than monix
* Remove logger param from dlc callbacks
* fix docs
* Call super.stop() in DLCappConfig
* Empty commit to run CI
* Try to debug
* Empty commit to run CI
* Revert things
* Fix bug where we just ned to awaitAllSync() rather than attempt to sync()
* Use awaitSyncAndIBD, mv awaitSyncAndIBD to NodeTestUtil
* Replace more NodeUnitTest.syncNeutrinoNode() with NodeTestUtil.awaitSyncAndIBD
* Replace more NodeUnitTest.syncNeutrinoNode() with NodeTestUtil.awaitSyncAndIBD
* Remove explicit call to sync()
* Remove extra call to NodeUnitTest.syncNeutrinoNode() in test fixture
* Add NeutrinoNodeNotConnnectedWithBitcoinds
* Don't switch sync peer if its the same peer we are currently syncing from it
* Fix another test
* Remove another sync() call
* Add carve out with MisBehavingPeers for the case where the badPeer was our last peer
* Remove more .sync() calls
* Make PeerMessageSender.reconnect() return a Future that is completed when the connection is established
* Replace hard require() with AsyncUtil.retryUntilSatisfiedF()
* Defensively try to sync everytime a peer is a initialized
* Turn logging OFF
* Fix DataMessagehandlerTest, remove calls to NeutrinoNode.sync() in test fixtures
* First attempt at implementing inactivityChecks()
* Move lastParsedMessage logic into PeerMessageSender
* Add bitcoin-s.node.inactivity-timeout config option
* implement unit test
* Fix CommonSettings
* scalafmt
* scalafmt
* Rename lastSuccessfulParsedMsg -> lastSuccessfulParsedMsgOpt
* make sure we disconnect in the case the stream terminates with an error
* Reduce log level
* WIP: Try to move byte streaming/parsing of p2p messages out of P2PClient
* WIP2: Work on killing the actor, replace it with a steram
* Get basic ability to send/receive version message working
* Transition PeerMessageReceiverState to Initializing inside of PeerMessagesender.connect()
* Refactor things out of PeerMessageSender.connect(), add some flow logs
* Get NeutrinoNodeTest be able to sync passing
* Fix some bugs, create ConnectionGraph helper class
* Use killswitch rather than Source.maybe to disconnect peer
* WIP: Debug
* Switch halfClose to false on Tcp.outgoingConnection() to not keep lingering connections
* Delete P2PClientActorTest
* Delete all P2PClient stuff
* Attempt implementing reconnection logic in PeerMessageSender
* remove supervisor
* Empty commit to re-run CI
* Small cleanups
* Implement sendResponseTimeout()
* Restore logback-test.xml
* Add callback to log error message on reconnect
* Increase queueSize/maxConcurrentOffers size
* Get PeerMessageSenderApi using akka streams for outbound p2p messages
* Use offer method rather than accessing queue directly
* Fix flaky unit test
* Empty commit to re-run CI
* Move methods for requesting filterheaders/filters into PeerManager, now use akka stream for those outbound p2p message
* Move sendInventoryMessage to PeerManager
* Move sendGetHeadersMessage() methods to PeerManager
* WIP: move more methods to PeerMessageSenderApi
* WIP2
* initialize stream before calling PeerFinder.start() so oubound messages get processed
* Rebase
* Make queue buffer size dependent on maxConnectedPeers
* Change state to HeaderSync() if we are re-querying for block headers
* Empty commit to re-run CI
* Remove PeerMessageSender from handleDataPayload()
* Limit access to PeerManager.peerMessageSenders
* revert a few things
* Fix rebase issues
* Fix rebase
* Turn down logging
* Rebase
* remove guard that checks peer size before labeling as MisBehavingPeer
* Fix small bug where we needed to switch syncPeer and we weren't
* Empty commit to run CI
* Empty commit to re-run CI
* Fix test case where we weren't awaiting for Node.sync() to return Some(peer)
* Empty commit to re-run CI
* Fix another reference where we were calling Node.sync() too soon after Node.start()
* scalafmt
* Add another retryUntilSatisfied() on NeutrinoNode.sync()
* Remove awaitPeerWithServices()
* Empty commit to run CI
* Rework Node.sync() to return Future[Option[Peer]] rather than Future[Unit]. This returns the peer we are syncing with, if we could find one to sync with
* Turn logging OFF again
* Empty commit to re-run CI
* Use AsyncUtil.retryUntilSatisfied() when calling node.sync() after starting node to make sure we have a peer to sync from in a test case
* Await on re-started node not stale reference in NeutrinoNodeWithWalletTest
* Fix second reference
* Empty commit to re-run CI
* Move P2PClientCallbacks.onStop() into disconnection logic rather than Actor.postStop()
* Rename onStop -> onDisconnect
* Add reconnect flag to P2PCallbacks.onDisconnect so we don't attempt to reconnect when not necessary
* Rename flag to forceReconnect, check getPeerConnectionCount in PeerManager.onP2PClientDisconnect to see if we have 0 connections. If we do reconnect
* Add PeerManager.isStarted flag, guard reconnection logic with this flag in onP2PClientDisconnected()
* Clear PeerFinder._peerData when PeerFinder.stop() is called
* WIP: Move disconnection logic into stream
* Rework ordering of PeerManager.stop() to shutdown queue after peers are removed
* Empty commit to re-run CI
* Await for getConnectionCount async in test case
* Try increasing queue size
* Bump queue size to 16
* Put initialization, initialization timeout logic in queue rather than callbacks
* Make messages that are sent to the queue rather than callbacks for various control messages
* Empty commit to re-run CI
* Empty commit to re-run CI
* Empty commit to re-run CI
* Remove P2PCallbacks all together
* Re-add PeerMessageReceiverTest
* WIP
* Reset PeerManager.dataMessageHandler to None on PeerManager.stop()
* WIP2
* Always set dataMessageHandler.peerData we process a new message in the stream
* remove PeerManager from PeerDatta
* Make PeerFinder mutable inside of PeerManager, pass the queue into PeerFinder to decouple PeerManager and PeerFinder
* Don't verify actor system shutdown for now
* Make ControlMessageHandler take PeerManager rather than Node as a param
* refactor PeerData to not take a reference to Node
* Move ControlMessageHandler out of {Node,NeutrinoNode}
* Remove node parameter to PeerMessageReceiver, pass the ControlMessageHandler and DataMessageHandler as parameters
* Remove node reference in DataMessageHandler, just pass PeerManager as parameter
* Fix pattern match to be exhaustive
* Move fetchCompactFilterHeaders, sendFirstGetCompactFilterHeadersCommand out of DataMessagehandler to decouple DataMessageHandler, PeerManager
* scalafmt
* WIP: Refactor PeerMessageReceiver methods into PeerMessageReceiverState
* Remove state helper methods from PeerMessageReceiver
* WIP: Remove PeerMessageReceiverState from PeerMessageReceiver
* Get things compiling and tests passing
* Remove currentPeerMessageHandlerReceiver
* Refactor PeerMessageReceiverTest to not use bitcoind