Commit graph

437 commits

Author SHA1 Message Date
Chris Stewart
d6799df122
Update versions to 1.9.10 (#5888)
* Update versions to 1.9.10

* fix version
2025-01-25 09:13:11 -06:00
Chris Stewart
52040da386
node: Fix bug where we we could have more connections than allowed by bitcoin-s.node.maxConnectedPeers (#5885)
* node: Fix bug where we we could have more connections than allowed by bitcoin-s.node.maxConnectedPeers

* node: Add log to indiciate if we are initializing disconnect
2025-01-24 11:15:45 -06:00
Chris Stewart
6a51b7c103
node: Limit initial stack push in PeerFinder.start() to maxSearchCount^2 (#5882)
* node: Limit initial stack push in PeerFinder.start() to maxSearchCount^2

* Shuffle peers to get a randomized list of peers to connect to

* Add Random.shuffle()

* Call .take() before adding socks5ProxyParams

* Add pattern match network for hardcoded-peers.txt which are mainnet peers

* Revert logback-test.xml
2025-01-24 08:59:08 -06:00
Chris Stewart
baa4ddf166
2025 01 23 issue 5878 (#5883)
* node: Remove offer to queue calling connectPeer() inside PeerManager stream

* node: When disconnecting peers don't offer to queue to avoid deadlock

* node: When shutting down node don't offer to queue to avoid deadlock

* cleanup
2025-01-23 17:39:50 -06:00
Chris Stewart
57860d74d0
wallet: Batch requests for blocks during rescan (#5866)
* wallet: Batch requests for blocks during rescan

* Revert node/

* Revert node/

* Try reintroducing backpressure into Node.downloadBlocks()

* Revert wallet/
2025-01-22 17:05:30 -06:00
Chris Stewart
40fef6e508
node: Add invariant we have peerServices when we cann PeerManager.handleConnect() (#5880) 2025-01-22 16:59:29 -06:00
Chris Stewart
fa4c2868ee
node: Update hardcoded-peers.txt with whats in bitcoin/contrib/seeds/nodes_main.txt (#5877)
* node: Update hardcoded-peers.txt with whats in bitcoin/contrib/seeds/nodes_main.txt

* Fix parsing of network address comments in hardcoded-peers.txt
2025-01-21 14:51:27 -06:00
Chris Stewart
9adbd88f69
node: Only query p2p seeds if we have no peers in our database (#5875) 2025-01-20 16:00:08 -06:00
Chris Stewart
3bf7e6a39e
node: Use approprate ServiceIdentifer throughout node/ module (#5874) 2025-01-20 15:43:30 -06:00
Chris Stewart
85cc536cd5
node: Rename PeerData.stop() -> PeerData.disconnect() (#5867) 2025-01-17 12:45:29 -06:00
Chris Stewart
4f0c3da303
node: Fix bug where we were dropping cached outbound messages on the floor (#5853)
* node: Fix bug where we were dropping cached outbound messages on the floor

* cleanup logs

* cleanups
2025-01-15 15:41:40 -06:00
Chris Stewart
07270ba8ca
core: Rework NetworkPayload traits to use Vector instead of Seq for methods (#5845) 2025-01-15 11:17:39 -06:00
Chris Stewart
a94fc3a92d
node: Add PeerStackTest, fix bug where we could have the same ip address multiple times in PeerStack (#5848)
* node: Add PeerStackTest, fix bug where we could have the same ip address multiple times in PeerStack

* make implicit Ordering private in PeerStack

* Rename PeerOrdering.peer -> PeerOrdering.peerData
2025-01-15 11:16:58 -06:00
Chris Stewart
4d9c52c75c
node: Move killswitch downstream to avoid queue deadlocks (#5819) 2024-12-23 08:57:12 -06:00
Chris Stewart
812f735110
node: Update DNS seeds, optimize PeerFinder.start() to start querying… (#5807)
* node: Update DNS seeds, optimize PeerFinder.start() to start querying dns seeds as early as possible

* Add new seeds, disable bad seeds

* scalafmt
2024-12-13 11:41:54 -06:00
Chris Stewart
eb6edab240
Add NodeState.NoPeers, cache network messages (#5800)
* Add NodeState.NoPeers, cache network messages that need to be sent when we establish a connection with a peer

* Cleanup

* Bump maxTries to avoid spurious timeout

* Empty commit to re-run CI
2024-12-09 13:30:13 -06:00
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