Commit Graph

421 Commits

Author SHA1 Message Date
Chris Stewart
29f10d046c
Turn on -Xlint (#5728)
Get entire codebase compiling

Fix DLCDAO

Revert .jvmopts

Finish rebase
2024-10-24 06:59:50 -05:00
Chris Stewart
4befe4e70a
Fix potential deadlock when offering to queue in managePeerAfterInitialization() (#5667) 2024-09-14 13:23:10 -05:00
Chris Stewart
cbccecf95d
Add caveat for ConnectPeer logic to only attempt to sync from a peer when a query is timed out (#5666)
* Add caveat for ConnectPeer logic to only attempt to sync from a peer when a query is timed out

* Revert logback.xml
2024-09-13 07:36:50 -05:00
Chris Stewart
490e0217f1
Add payload to query timeout log (#5660)
* Add payload to query timeout log

* scalafmt

* Add first header we are requesting to invalid headers query log

* Remove noisy max headers received log

* Remove noisy max filter headers / filters received log
2024-09-11 15:08:52 -05:00
Chris Stewart
9feabc1c2b
Make WebsocketTests rescan test more robust (#5661)
* Make WebsocketTests rescan test more robust

* Bump timeout on WebsocketTests address generated unit test

* Rework importseed endpoint to return a bool indicating if the import was successful

* Reduce Server.httpBadRequest() log level from ERROR -> INFO

* Remove adhoc json for walletinfo
2024-09-11 10:39:32 -05:00
Chris Stewart
38850d22e3
2024 07 31 bitcoind callbacks (#5631)
* 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
2024-08-02 07:43:24 -07:00
Chris Stewart
83ffea0214
Bump versions to 1.9.9 (#5598) 2024-05-16 06:25:25 -05:00
Chris Stewart
562e5602e3
Add -Xsource:3 to node/ node-test/ tor/ tor-test/ (#5589) 2024-05-11 11:21:08 -05:00
Chris Stewart
36ec8a2911
Rework PeerManagerApi.{sendToRandomPeer, gossipMessage} to return Unit rather than Future[Unit], this removes the possibility of deadlocking on a full queue (#5561) 2024-05-04 08:53:22 -05:00
Scala Steward
afddf73c48
Update scalafmt-core to 3.8.1 (#5501)
* 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>
2024-04-20 19:55:49 -05:00
Chris Stewart
302110cb56
Bump max connected peers default to 2 (#5515) 2024-04-08 09:14:28 -05:00
Chris Stewart
6b21a900ce
Bump versions to 1.9.8, add 1.9.8 version of website (#5280)
* Bump versions to 1.9.8, add 1.9.8 version of website

* Update website version
2024-03-25 09:06:31 -05:00
Chris Stewart
9fef2c505c
Add bitcoin-s.node.connection-attempt-cool-down-period (#5489)
* Add bitcoin-s.node.connection-attempt-cool-down-period

Add bitcoin-s.node.connection-attempt-cool-down-period

* Re-add shuffling
2024-03-22 13:16:45 -05:00
Chris Stewart
7e2a4c97e6
Reduce requesting next cfheaders log level to DEBUG (#5490) 2024-03-22 11:42:01 -05:00
Chris Stewart
47c7680d8c
Refactor Node.chainApiFromDb() to return ChainApi (#5484)
* Refactor Node.chainApiFromDb() to return ChainApi

* Adjust log level for ignoring p2p messages to DEBUG
2024-03-20 08:56:50 -05:00
Chris Stewart
3cfe700fad
Reduce stream failure log to DEBUG to avoid tor spam (#5483) 2024-03-19 11:30:34 -05:00
Chris Stewart
177542a13c
Remove grizzled.sl4fj was its no longer maintained (#5482) 2024-03-18 16:48:58 -05:00
Chris Stewart
a875f08d2e
Reduce log level of PeerConnection logs to DEBUG (#5481) 2024-03-18 16:03:49 -05:00
Chris Stewart
af342dd6c1
2024 03 18 rm unused configs (#5480)
* Remove bitcoin-s.node.connection-timout setting as it wasn't used

* Remove bitcoin-s.node.peer-discovery-timeout
2024-03-18 15:26:31 -05:00
Chris Stewart
d44344f07b
Check if peer is waitingForDisconnection when receiving InitializeDisconnect() message (#5479) 2024-03-18 14:20:35 -05:00
Chris Stewart
f7dd69bec3
refactor: Use 'peerWithServicesDataMap' name consistently across NodeState and PeerManager (#5478) 2024-03-17 16:30:52 -05:00
Chris Stewart
db64a6d136
Reduce various log levels to DEBUG (#5477) 2024-03-17 07:59:53 -05:00
Chris Stewart
5c247e65a5
Reduce 'Attempting to connect' log to DEBUG (#5476) 2024-03-17 05:44:34 -05:00
Chris Stewart
9a71a96fb8
2024 03 11 Remove filtersync job (#5471)
* 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
2024-03-12 15:05:54 -05:00
Chris Stewart
23337b7137
2024 03 11 PeerFinder.getPeersFromDnsSeeds async (#5472)
* WIP: Make getPeersFromDns async

* Get things compiling

* Comment out slow seeds
2024-03-12 12:14:01 -05:00
Chris Stewart
708ce41f24
Re-implement bitcoin-s.node.query-wait-time (#5470)
* 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
2024-03-11 09:54:44 -05:00
Chris Stewart
54a356b300
Don't unnecessarily create new NodeState objects, use helper methods to state transition (#5469) 2024-03-10 15:41:06 -05:00
Chris Stewart
fa6cb1ba3a
Send p2p messages to syncPeer when we are in and a specific peer is not set in SendToPeer (#5468) 2024-03-09 22:19:56 -06:00
Chris Stewart
9e50c5fd12
Fix bug where we weren't checking if isFiltersSynced is true before sending our next getcfilters to our peer (#5466) 2024-03-09 16:24:28 -06:00
Chris Stewart
16aeb56df5
Remove implicit NodeAppConfig from PeerMessageSender (#5465) 2024-03-09 15:00:58 -06:00
Chris Stewart
567c2400ca
Small refactors to use RunningNodeState methods, improve logs (#5463) 2024-03-09 09:25:34 -06:00
Chris Stewart
5967caeca7
2024 03 07 Add NodeState.FilterOrFilterHeaderSync, refactor PeerManager to use it (#5459)
* Refactor syncHelper() to return SyncNodeState rather than Unit

* Add FilterOrFilterHeaderSync, rework various methods in PeerManager to return Option[FilterOrFilterHeaderSyncState] to indicate if we are syncing rather than Future[Unit]

* Don't use getPeerMessageSender() if we can use syncPeerMessageSender()

* Fix case where syncpeer and new peer are different when creating a filter sync job

* Adjust createFilterSyncJob() return type, throw exception when we try to sync but PeerManager is not started

* Refactor to use SyncNodeState.{toFilterHeaderSync,toFilterSync}

* Cleanup comments
2024-03-08 10:13:58 -06:00
Chris Stewart
e793c53dd7
Add guards on sending blockfilter messages to non-blockfilter peers (#5457)
* Add guards on sending blockfilter messages to non-blockfilter peers

* Simplify logic

* add scaladoc

* Remove misleading log
2024-03-06 08:26:32 -06:00
Chris Stewart
55e4dab86e
Rework NodeApi.downloadBlocks() to use DoubleSha256DigestBE (#5456)
* Rework NodeApi.downloadBlocks() to use DoubleSha256DigestBE rather than DoubleSha256Digest

* Fix test cases

* Fix docs

* Fix compile
2024-03-05 15:19:32 -06:00
Chris Stewart
898d2b44ee
Fix bug where we were executing block callbacks when we hadn't seen a block header (#5455)
* Fix bug where we were executing block callbacks when we hadn't seen a block header

* reduce log to DEBUG
2024-03-05 13:47:03 -06:00
Chris Stewart
238948e185
Remove PeerMessageSenderApi param from DataMessageHandler (#5453) 2024-03-05 11:12:17 -06:00
Chris Stewart
ddb6f01d65
Simplify / reduce log level for compact filter logs (#5452) 2024-03-05 09:20:32 -06:00
Chris Stewart
367285d9b9
Reduce reliance of PeerManager._peerDataMap in favor of NodeState.peerDataMap (#5451)
* Reduce reliance of PeerManager._peerDataMap in favor of NodeState.peerDataMap

* Fix bug where we weren't removing peers from NodeState

* Remove invariants

* Empty commit to run CI

* Empty commit to re-run CI
2024-03-05 08:16:29 -06:00
Chris Stewart
0d2e0a98f0
fix bug where we weren't properly transferring state to FilterHeaderSync, reduce log level of peer we fail to connect to (#5450) 2024-03-04 13:19:22 -06:00
Chris Stewart
ae3a634703
2024 03 01 Fix syncPeer exceptions (#5446)
* 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
2024-03-04 09:22:16 -06:00
Chris Stewart
1f0af696f6
Reduce DataMessageHandler log levels (#5447) 2024-03-02 17:06:14 -06:00
Chris Stewart
951bdc5b34
Always try to attempt to connect to our param peers in PeerFinder (#5444) 2024-03-01 11:28:17 -06:00
Chris Stewart
8fb62ad21c
Use NodeCallbackStreamManager when calling NodeCallbacks constructors (#5439)
* Use NodeCallbackStreamManager when calling NodeCallbacks constructors to avoid dropping messages

* Fix handling of CallBackHandler.empty and names

* Empty commit to re-run CI

* Empty commit to re-run CI
2024-02-29 12:01:11 -06:00
Chris Stewart
70f983213c
Ignore invs while in IBD rather than when syncing (#5433)
* Ignore invs while in IBD rather than when syncing

* Ignore bitcoiner.live test case for now
2024-02-28 13:30:08 -06:00
Chris Stewart
d1ecd35e63
Fix PeerDb.lastSeen race condition in unit tests (#5435)
* 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
2024-02-28 10:33:01 -06:00
Chris Stewart
ab0b0e2209
Fix bug where we weren't removing peer from NodeRunningState.waitingForDisconnection (#5425)
* Fix bug where we weren't removing peer from NodeRunningState.waitingForDisconnection

* Empty commit to re-run CI

* Remove _peerDataMap.remove(i.peer)

* Empty commit to re-run CI

* Replace state even if client.stop() results in a failed Future
2024-02-27 15:38:16 -06:00
Chris Stewart
0053ccd853
Rework NodeState.toString() (#5432) 2024-02-27 13:59:51 -06:00
Chris Stewart
8a0c00637c
Remove duplicate PeerConnection.disconnect() call (#5426)
* Remove duplicate disconnect() call

* Remove log for case where we haven't set PeerConnection.connectionGraphOpt but call PeerConnection.stop()

* Remove bitcoin-s.node.initialization-timeout
2024-02-27 08:03:37 -06:00
Chris Stewart
6934b33474
Fix bug in health checks were we wouldn't attempt to connect NodeAppConfig.maxConnectedPeers if we didn't have any non compact filter peers connected (#5422) 2024-02-23 16:45:01 -06:00
Chris Stewart
90b9e76e56
Keeping finding peers until all peers are blockfilter peers (#5417)
* Keep attempting to connect to block filter peers until all connection slots are block filter peers

* Empty commit to run CI
2024-02-23 08:33:22 -06:00