Commit Graph

225 Commits

Author SHA1 Message Date
Chris Stewart
4e4c6d03f1
Remove Await.result() in initializationTimeoutCancellable (#4956) 2023-01-23 09:00:38 -06:00
Chris Stewart
9646994a99
Encapsulate PeerData.client (#4944) 2023-01-09 11:56:38 -06:00
Chris Stewart
09d53460a1
Implement ability to cancel background task for querying peer with specific services (#4937)
* Implement ability to cancel background task for querying peer with specific services

* Cancel scheduled job when promise is completed
2023-01-02 11:39:13 -06:00
Chris Stewart
a7930657f9
Rework logging so that stack traces aren't printed when we receive duplicate data over the p2p network (#4936) 2022-12-30 14:51:27 -06:00
Chris Stewart
bd79ab0b73
2022 12 12 rm dmh params (#4925)
* WIP

* WIP2

* Get all DataMessageHandlerTest passing

* Get NeutrinoNodeTest passing

* Fix NeutrinoNodeWithUncachedBitcoindTest unit test

* Use chainApi to detect if we are in IBD

* Empty commit

* Revert logging levels
2022-12-28 16:37:28 -06:00
Chris Stewart
96392edde7
Stop P2PClientActor when we receive Tcp.{ErrorClosed,ConfirmedClosed,Closed,Aborted,PeerClosed} commands (#4926) 2022-12-15 16:45:08 -06:00
Chris Stewart
24c6dc2cdb
Download blocks from random peer if we aren't in IBD (#4924)
* Download blocks from random peer if we aren't in IBD

* scalafmt
2022-12-14 16:49:54 -06:00
Chris Stewart
0d76a06331
Call handleDataPayloadHelper explicitly on DataMessageHandlerState (#4921)
* Call handleDataPayloadHelper explicitly on DataMessageHandlerState

* revert changes from other PR

* revert logs
2022-12-14 09:28:56 -06:00
Chris Stewart
6293d45a37
Fix synced flag but in DataMessageHandler bug (#4920)
* Fix synced flag but in DataMessageHandler bug

* Make variable name be syncing since that is what it actually represents
2022-12-13 07:40:00 -06:00
Chris Stewart
aab2b274f0
Remove default parameters from DataMessageHandler (#4918)
* Remove default parameters from DataMessageHandler

* Remove syncPeer default parameter
2022-12-12 15:46:34 -06:00
Chris Stewart
f2be536211
Delay querying for peers for 30 minutes (#4897) 2022-11-23 16:45:04 -06:00
Chris Stewart
1127c56a98
Bump versions to 1.9.7 (#4886) 2022-11-16 09:35:42 -06:00
Chris Stewart
f483e356cb
Adjust period of time we query for peers on the p2p network from 12 seconds -> 1 hour (#4847) 2022-10-17 14:42:14 -05:00
Chris Stewart
e73b328833
Prepare for 1.9.6 (#4820) 2022-10-09 11:12:43 -05:00
Chris Stewart
eb5924ba94
2022 10 03 1.9.5 release notes (#4813)
* add new commits

* Bump versions

* update release notes

* Update release notes
2022-10-03 14:34:36 -05:00
Chris Stewart
88fce93268
Bump more logs to INFO (#4769) 2022-09-12 09:31:30 -05:00
Chris Stewart
0cfad33fae
Add 1.9.4 website, add 1.9.4 release notes (#4726)
* Add 1.9.4 website, add 1.9.4 release notes

* Add versioned sidebars

* Bump more versions to 1.9.4

* update release notes
2022-09-12 08:19:28 -05:00
Chris Stewart
fae1a53579
Bump bitcoin-s.node.query-wait-time=120 seconds (#4759)
* Bump query-wait-time to 120 seconds

* bump disconnection log level

* Bump log to INFO where peer disconnects us
2022-09-10 09:47:50 -05:00
Chris Stewart
d2f8811a1c
Add log when we are fetching peers to sync with (#4693) 2022-08-31 17:39:21 -05:00
Chris Stewart
9353c41e8f
Add some guards for when we set IBD flag to reduce false positive WARN messages (#4683) 2022-08-30 11:47:54 -05:00
Shreyansh
2cae3f803d
Fix infinite invalid header loop (#4667)
* fix infinite invalid header loop

* Adjust log levels to WARN

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-26 09:43:07 -05:00
benthecarman
02f525fd39
Make CRUDAction types more strict (#4657) 2022-08-24 06:15:24 -05:00
rorp
7c112b8a90
Fix rescan for existing wallets (#4656) 2022-08-24 05:42:53 -05:00
Shreyansh
4e4e4aa9ed
change stream to use backpressure (#4654) 2022-08-23 15:54:15 -05:00
Shreyansh
068187c93d
increase buffer size of dataMessageStream to 10000 (#4646) 2022-08-23 08:59:16 -05:00
Chris Stewart
e65346f558
Version 1.9.3 of everything (#4643) 2022-08-22 18:21:07 -05:00
Shreyansh
2c2e03b279
Header sync validation (#4456)
* add header sync validation

* fix docs, minor fixes

* Refactor to us InvalidBlockHeader ChainException, also refactor recovery to private helper method

* changes from comments

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-22 17:05:41 -05:00
Chris Stewart
86463231d6
2022 08 18 Add configuration to only emit websocket events when IBD is done (#4627)
* Implement isinitialblockdownload flag in databaes

* Change to IsInitialBlockDownload to be less confusing

* Fix missing refactors, add ChainApi.isIBD()

* Implement logic for ChainApi.isIBD(), add configuration flag to toggle whether to emit websocket events while IBD is ongoing or not, add isinitialblockdownload field to getinfo endpoint

* Remove confusing ChainApi.isIBD() that didn't accurately account for the case where IBD wasn't set in the database

* Fix bug around emitting the websocket events

* Add some documentation
2022-08-22 10:09:00 -05:00
Chris Stewart
d241e6f9e4
Remove merklebuffers (#4615) 2022-08-16 09:46:31 -05:00
Shreyansh
dea99457b5
fix mac node-wallet test failure (#4585) 2022-08-12 14:25:11 -05:00
GreyMcCarthy
c34b0de886
removed logger parameter from where it's used with callbacks (#4598)
* removed logger parameter from where it's used with callbacks

* removed logger from onTXRecived... and onBlockRecived...

* removed unused imports

* removed logger from walletCallbacks
2022-08-12 12:09:58 -05:00
rorp
9f89ba9b7a
loadwallet endpoint (#4417)
* `loadwallet` endpoint

* Scala 2.12 compatibility

* remove `getwalletname`

* fix unit tests

* fix DbManagementTest

* fix wallet tests

* fix DbManagementTest

* fix RejectedExecutionException

* fix postgres tests

* fix password override

* update `loadwallet`

* Move WalletHolder into wallet module

* Kill use of null in WalletHolder

* Kill use of null in WalletHolder

* Refactor to use WalletAppConfig.DEFAULT_WALLET_NAME

* update cli and unit tests

* cleanup

* Refactors to get compatible with master

* Fix compile

* Distinguish between loadWalletNeutrino & loadWalletBitcoind

* Fix initialized bug with WalletHolder in loadWallet methods

* Refactor loadWalletBitcoindBackend/loadNeutrinoWallet to have a common helper method

* Introduce DLCWalletLoaderApi, refactor codebase to use it

* Fix dumb initialization bug

* Fix test:compile

* Cleanup

* Get loadwallet mostly working with neutrino wallet

* Fix compile

* scalafmt

* Move loadwallet into app-commons

* Remove {DLCWallet,Wallet}.stop()

* Implement LoadWallet json parsing unit test

* Implement stopping of NodeStreamManager callbacks

* Fix rebase, integrate setRescanState into WalletRoutes

* Fix import

* Fix unit tests

* Implement listwallets in ConsoleCli

* Fix imports

* Cleanup

* scalafmt

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-05 17:34:14 -05:00
Chris Stewart
5acbba9377
Replace BoundedSourceQueueWithComplete with SourceQueueWithComplete (#4576)
* Replace BoundedSourceQueueWithComplete with SourceQueueWithComplete so we can use the returned Future

* Recover the expected exceptions in CallBackUtilTest
2022-08-05 11:57:13 -05:00
Shreyansh
c4d358061a
Add P2PClientSupervisor (#4509)
* add P2PClientSupervisor

* changes from comments: made P2PClient Future

* empty commit to see if mac failures are consistent on ci

* changes from comments

* changes from comments
2022-08-04 10:06:04 -05:00
Chris Stewart
191df09196
Move pollBitcoind out of startBitcoindBlockPolling (#4559)
* Move pollBitcoind out of startBitcoindBlockPolling

* Rework startBitcoindBlockPolling to not return Future[Cancellable]

* Stop NodeCallbacksStreamManager inside of NodeAppConfig.stop()

* Make BitcoindSyncState which encapsulates syncing with bitcoind and polling of mempool

* Fix bug where processingBitcoindBlocks cannot be top level val as that method may be used by different parts of the codebase

* Rename isPolling -> processingBitcoindBlocks

* Cleanup more resources in appServerTest/test

* Complete polling stream regardless if we synced blocks are not to complete the Future returned by pollBitcoind

* Empty commit to run CI
2022-08-02 06:40:17 -05:00
Chris Stewart
4b83286922
2022 07 25 wallet api refactor (#4545)
* Move MockChainQueryApi/NodeApi out of BaseWalletTest

* refactor BitcoinSServerMain.start() to return WalletHolder

* Add walletConfig to WalletWithBitcoind

* Move findOutputsBeingSpent into WalletApi

* Add WalletApi.clearAllAddresses(), HDWalletApi.{findAccount, getnewaddress(account)}

* Add HDWalletApi.fundRawTransaction() with an account as parameter

* Add WalletApi.findByScriptPubKey()

* Fix lots of tests in WalletIntegrationTest

* Create WalletApi.processOurTransaction()

* Get things compiling

* Fix tag integration test

* Refactor AnyDLCHDWalletApi -> DLCNeutrinoHDWalletApi

* Fix docs

* Get postgres tests passing locally

* Move initBalance map before calling callback in CallBackUtilTest

* Get compile working, rename to destroyOnlyWalletWithBitcoindCached

* Fix docs

* Fix missing destroyWalletAppConfig

* Fix scalafmt

* Fix bug in dlcWalletTest where wallet db thread pools weren't being shutdown after unit test completes

* Empty commit
2022-07-31 08:04:39 -05:00
Chris Stewart
d4210fad65
Pull over changes from loadwallet branch (#4527) 2022-07-21 12:12:32 -05:00
Chris Stewart
f5cca7e5e1
Add guard for calling NodeCallbackStreamManager.stop() (#4523)
* Add guard for calling NodeCallbackStreamManager.stop()

* scalafmt
2022-07-20 10:16:26 -05:00
Chris Stewart
0a127368f0
2022 07 18 node callback stream manager (#4520)
* Implement akka stream proxy for nodecallbacks

Add killswitch to createBitcoindNodeCallbacksForWallet

Add unit test for killswitch in createBitcoindNodeCallbacksForWallet

Add delays to make sure callbacks are executed

Fix rebase

Move killswitch out of methods into class level val

* Bump timeout

* Attempt to implement NodeCallbacks proxy with akka streams

* Refactor CallbackUtil to use NodeCallbackStreamManager

* Rebase & remove killswitch

* Implement NodeCallbackStreamManager.+ method
2022-07-20 06:28:55 -05:00
Shreyansh
2e309086d5
Fix block fetch issue #4513 (#4522)
* fix block fetch issue #4513

* start syncing before rescane
2022-07-19 16:40:36 -05:00
Chris Stewart
5c9092889b
Add abillity to clear callbacks (#4512)
Fix missing clearCallbacks()

Add some tests

Remove uncessary code from test
2022-07-17 09:10:57 -05:00
rorp
e90e372e54
Add sync JSON field to the getinfo endpoint output (#4452)
* Add `sync` JSON field to the `getinfo` endpoint output

* improve test coverage

* update docs

* rename sync flag

* WebSocket notifications

* fix unit tests

* fix unit tests

* increase test timout
2022-07-12 14:41:43 -05:00
Chris Stewart
1b169d8fa0
Implement torstarted websocket callback (#4476)
* Implement tor started websocket callback

* Implement tor callbacks when tor is provided
2022-07-11 10:26:30 -05:00
Shreyansh
7c649d39db
Fix filter sync if headers received while syncing (#4463)
* fix filter sync if headers received while syncing

* remove unintended diffs
2022-07-08 13:44:15 -05:00
Shreyansh
42564bc810
Find and switch peers (#4408)
* add support to find and switch peers

* fix compile on 2.12

* allow empty config peers in regtest

* fix test

* minor fixes

changes timeouts, fix issue with ipv6 dns seeds, initDisconnect when disconnected bug, dbPeers order fix

* fix: not removing peers on initialization timeout

* fix: query again when previous failed

* fix: wrong condition for deferred peers

* restore log levels

* clean up

* add PeerStack to allow trying peers based on priority values

* fix migrations

* changes from comments

* use StartStopAsync

* changes from comments

* fix switch if peer down test

* changes from comments
2022-06-28 10:19:13 -05:00
Chris Stewart
906e1f5c53
Bump previousStableVersion to 1.9.2 (#4432) 2022-06-27 15:22:17 -05:00
Shreyansh
a7ba46f67d
Update hardcoded seeds (#4412)
* update hardcoded seeds

* run tests again
2022-06-22 05:59:43 -05:00
Chris Stewart
7f43ef98ad
Default to suredbits node if peers field is left empty (#4404)
* Default to suredbits node if peers field is left empty

* Remove log
2022-06-18 18:40:53 -05:00
Shreyansh
d8fc8e588f
Remove Spv code (#4356)
* change node tests to neutrino

* get node test working

* merge DataMessageHandlerTest and DataMessageHandlerNeutrinoNodeTest

* delete unused files

* remove commented out spv parts

* formatting

* delete spv node

* remove merkle callback for neutrino node

* remove spv node wallet callbacks

* formatting

* remove SpvWalletApi

* replace SpvTestConfig with NeutrinoTestConfig

* more replace SpvTestConfig with NeutrinoTestConfig

* minor fix

* fix tests
2022-05-30 07:57:31 -05:00
Chris Stewart
b980c432fd
Bump node initialization timeout to 20 seconds (#4328) 2022-05-10 18:02:12 -05:00