Commit Graph

4668 Commits

Author SHA1 Message Date
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
Scala Steward
f77b4efe11
Update logback-classic to 1.5.3 (#5448) 2024-03-04 10:46:49 -06:00
Chris Stewart
9aa730dd0a
Revert yml files (#5449) 2024-03-04 09:47:52 -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
8b23b1f4f6
Add delay to wait for zmq to get setup in chainTest (#5427)
* 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
2024-03-03 11:54:50 -06:00
Chris Stewart
1f0af696f6
Reduce DataMessageHandler log levels (#5447) 2024-03-02 17:06:14 -06:00
Chris Stewart
dd7131306c
Consolidate disabled secp256k1 workflow into Compile workflow (#5445)
* Consolidate disabled secp256k1 workflow into Compile workflow

* Re-add -J-Xmx4g
2024-03-01 11:51:17 -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
1317adfdad
Add zmq/test and chainTest/test to OS's we weren't previously running on (#5443) 2024-03-01 10:02:34 -06:00
Chris Stewart
00c84a9c25
Set max-open-requests = 64 for appServerTest (#5442) 2024-03-01 06:33:54 -06:00
Chris Stewart
c407c2e874
2024 02 29 cleanup logback files (#5441)
* Remove logback settings for things that don't exist anymore

* Consolidate slick logging

* Clean up chain logs

* Conslidate wallet logging

* Consolidate node logging

* Remove comments in logback files
2024-02-29 16:55:43 -06:00
Chris Stewart
8f812c644f
Fix Promise already completed errors in chainTest (#5440) 2024-02-29 14:53:55 -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
Scala Steward
5ab8da9adc
Update logback-classic to 1.5.1 (#5438) 2024-02-29 11:50:40 -06:00
Chris Stewart
320773a99c
Add OverflowStrategy.backpressure on Source.queue in bitcoind polling job (#5437)
* Add backpressure on Source.queue in polling job

* Empty commit to run CI
2024-02-29 09:42:15 -06:00
Scala Steward
87003eb703
Update sbt-scalafmt to 2.5.2 (#5218) 2024-02-28 14:15:00 -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
42e5e87350
Reduce various logs in org.bitcoins.wallet to DEBUG (#5434) 2024-02-27 15:55:14 -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
3ed78b5270
Upgrade to scala 2.13.13, fix compiler errors (#5428) 2024-02-27 10:21:39 -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
cb26f6de07
Add WalletZmqSubscribers (#5423)
Move connection logic into ZMQSubscriber.start() rather than SubscriberRunnable
2024-02-26 11:28:39 -06:00
Scala Steward
dae6ebf9aa
Update sbt-scoverage to 2.0.11 (#5424) 2024-02-25 09:36:34 -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
b27cebca1c
2024 02 23 TaprootKeyPath.isValid() bug (#5421)
* Add reproducible test case for serialization symmetry failure

* Add check for TaprootKeyPath.isValid() for checking the SchnorrPublicKey is a valid x-cord in the SchnorrDigitalSignature()

* Reset ScalaTest settings
2024-02-23 14:33:36 -06:00
Scala Steward
3c2184156b
Update sbt to 1.9.9 (#5419) 2024-02-23 14:24:59 -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
Chris Stewart
783ed1903d
Rename bitcoin-s.node.inactivity-timeout -> bitcoin-s.node.health-check-interval (#5418) 2024-02-23 08:31:22 -06:00
Scala Steward
0a96f72c5e
Update postgresql to 42.7.2 (#5414) 2024-02-22 10:27:09 -06:00
Chris Stewart
1dff918848
2023 02 21 pekko (#5413)
* Get dependencies resolving, get tor module compiling

* Get everything compiling with pekko

* Rework configs/logging to use pekko namespace

* Rename AkkaUtil -> PekkoUtil, BitcoinSAkkaAsyncTest -> BitcoinSPekkoAsyncTest
2024-02-22 10:26:21 -06:00
Chris Stewart
1b25994fc2
Re-add java.sql module to cli jlink image to fix #5411 (#5412) 2024-02-20 14:02:15 -06:00
Chris Stewart
3177ee405f
Move away from suredbits provided peers by default (#5390)
* 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()
2024-02-20 12:12:57 -06:00
Scala Steward
caeb8d559c
Update sbt-scoverage to 2.0.10 (#5409) 2024-02-20 08:53:05 -06:00
Scala Steward
1efede0401
Update junixsocket-core to 2.9.0 (#5407) 2024-02-20 08:52:53 -06:00
Scala Steward
b059c2f57e
Update jeromq to 0.6.0 (#5410) 2024-02-20 08:52:43 -06:00
Scala Steward
7c8acc4484
Update client3:core, ... to 3.9.3 (#5408) 2024-02-19 15:36:53 -06:00
Scala Steward
7ea72f279f
Update logback-classic to 1.5.0 (#5406) 2024-02-19 15:35:00 -06:00
benthecarman
195cfbd273
Fix handling invoice with minimal encoding of feature bits (#5405) 2024-02-19 08:37:18 -06:00
Chris Stewart
b89b31fe09
2024 02 18 peerfinder duplicate connect (#5403)
* 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
2024-02-18 11:47:32 -06:00
Chris Stewart
155b4fbc76
Fix case were we weren't cancelling the syncFilter job onDisconnect() (#5402) 2024-02-17 17:41:34 -06:00
Chris Stewart
f5087c5e3f
Remove PeerManager.{getPeerMessageSender(), getPeerConnection()}, use NodeState.{getPeerMessageSender(), getPeerConnection()} (#5400) 2024-02-17 07:37:50 -06:00