Commit Graph

3764 Commits

Author SHA1 Message Date
benthecarman
64bc1367c5
Add listPendingChannels to LND (#4603) 2022-08-12 06:23:04 -05:00
Chris Stewart
e413f04106
Remove the daemonUser/daemonUserId combination to make our docker images more portable (#4601) 2022-08-11 15:09:28 -05:00
Chris Stewart
46502496c1
Update DLCClientIntegrationTest to use the newest bitcoind (#4596) 2022-08-10 09:34:35 -05:00
Chris Stewart
a22e847e2e
Implement small optimization to not query for DLCDb twice (#4592)
* Implement small optimization to not query for DLCDb twice

* Optimize findDLCStatusAction to use a single db query to fetch offers,contracts

* Make findDLCStatusesAction to batch fetch statuses for a set of dlcDbs

* Add querying acceptDb to the sql query

* Implement sql query for getDLCOfferDataAction
2022-08-10 09:26:59 -05:00
benthecarman
26492d2449
Add descriptor for TaprootScriptPubKey (#4595) 2022-08-10 07:10:23 -05:00
Chris Stewart
326cb9845e
Implement listDLCs(state), use it in getWalletAccounting() (#4591) 2022-08-09 11:02:45 -05:00
Chris Stewart
95139bdc3d
Improve logging on getBlockchainInfo() (#4590) 2022-08-09 09:18:53 -05:00
benthecarman
ef3bfed1dc
Add ChainNotifier to LND (#4589) 2022-08-09 06:27:35 -05:00
rorp
d95d3db75c
Download arm64-apple-darwin bitcoind binary on M1 Mac OS X (#4588) 2022-08-08 16:46:34 -05:00
benthecarman
b04a34ad02
Use FutureUtil.makeAsync where we are attmepting to create async Futures (#4583) 2022-08-08 15:22:32 -05:00
rorp
7b754138b8
Drop support for the experimental bitcoind version (#4586)
* Drop support for the experimental bitcoind version

* update docs
2022-08-08 14:48:33 -05:00
benthecarman
675b210333
Add PSBT database mapper (#4584) 2022-08-08 06:50:50 -05:00
Chris Stewart
c7e5317294
2022 08 06 1.9.3 release notes (#4582)
* Initial sorting of commits for 1.9.3

* Add summaries to each section

* 1.9.2 -> 1.9.3

* fix typo
2022-08-07 07:32:42 -05:00
Chris Stewart
c10f7beadb
Run yarn upgrade to update website deps (#4581) 2022-08-06 17:14:26 -05:00
benthecarman
6119a334fa
Make fundRawTransactionInternal use DBIOActions (#4575)
* Make fundRawTransactionInternal use DBIOActions

* Fix to correctly use callback

* Move reservedUTXOsCallbackF to FundRawTxHelper
2022-08-06 17:14:02 -05:00
rorp
cf22816003
Fix rescan batch boundary bug (#4549)
* Fix rescan batch boundary bug

* Make arguments for rescan required to avoid bugs

* WIP: Debug rescan batches

* Add forceGenerateSpks to fix one bug

* Remove addressCount != 0 check now that we have forceGenerateSpks

* Remove comment

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-06 14:07:35 -05:00
rorp
0404cffe26
Embedded Pg v1.0.1 (#4567)
* Embedded Pg v1.0.1

* fix GitHub action evironment

* fix Windows CI tests

* test db-commons in different environments

* remove dbCommontTest from Windows and Mac Github actions

* cleanup

* configurable postgres startup wait

* Empty commit to run CI

* Bump default timeout to 60

* Empty commit

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-06 07:30:26 -05:00
rorp
ed4e332cef
Dafalut to the latest Bitcoin Core version (#4579) 2022-08-06 07:08:24 -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
ad21a11254
Create BitcoindStreamUtil and refactor to use it (#4578)
* Create BitcoindStreamUtil and refactor to use it

* Fix BitcoindBackendTest bugs

* Fix handling of chainCallbacks
2022-08-05 15:31:00 -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
benthecarman
f286b42c71
Retry lnd startup if it fails (#4573) 2022-08-04 16:43:09 -05:00
benthecarman
2fa7c39f64
Use DBIOActions to speed up processing transactions (#4572) 2022-08-04 14:40:31 -05:00
Chris Stewart
c03b158f94
Implement RescanTerminatedEarly exception to terminate the stream, implement ArgumentSource (#4574)
* Implement RescanTerminatedEarly exception to terminate the stream, implement ArgumentSource to understand where arguments passed into bitcoin-s are coming from

* Bump timeout
2022-08-04 14:11:07 -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
a02e25b0ce
Refactor WalletRoutes to take DLCWalletLoaderApi as a paramete (#4565)
* Refactor WalletRoutes to take DLCWalletLoaderApi as a parameter, use the walletHolder inside of DLCWalletLoaderApi to fulfill requests

Fix rebase

Reduce parallelism in fetchFiltersFlow to 1 to reduce chance of hitting akka's max open requests

* Try fix loader test by catching RejectedExecutionException

* Add println to see if catching excpetion gets hit

* WIP: Try to fix recursive rescan

* Don't map on recursiveRescan so we don't block on it
2022-08-04 09:16:46 -05:00
benthecarman
524c0af536
Make wallet.getBalance more effienct (#4566) 2022-08-04 09:01:29 -05:00
rorp
78648f1e40
PostgreSQL friendly wallet names (#4571)
* Postgres friendly wallet names

* cleanup

* fix unit tests
2022-08-04 08:54:33 -05:00
Chris Stewart
8cb45e8208
Add unit tests for loader rescans (#4570)
* Add unit tests for loader rescans

* Move common methods into super class to be DRY

* Cleanup
2022-08-03 13:16:52 -05:00
Chris Stewart
c89491c3e7
2022 07 29 fix multiple batch test (#4556)
* Fix multiple batch unit test so it fails

* Fix compile

* Move generateScriptPubKeys into buildFilterMatchFlow()

* Rename param to filterBatchSize

* Rename to buildRescanFlow

* Remove println

* Cleanup
2022-08-03 12:33:37 -05:00
Chris Stewart
1d3db879ad
Add rescanState variable to DLCWalletLoaderApi (#4569)
* Add rescanState variable to DLCWalletLoaderApi so we can track rescan state accurately

* Add isRescanStateEmpty

* scalafmt
2022-08-03 06:33:26 -05:00
Chris Stewart
ec0103dab3
2022 08 02 loadwallet startup logic (#4568)
* move handleDuplicateSpendingInfoDb into DLCWalletLoaderApi

* Pull over restartRescanIfNeeded to DLCWalletLoaderApi
2022-08-02 18:22:17 -05:00
Chris Stewart
08699c0ee0
Remove nested Option[Option[AesPassword]] (#4564) 2022-08-02 14:08:26 -05:00
Chris Stewart
b1a7f92c67
Refactor to not use filterThenSum() when calculating balances (#4562)
* Refactor to not use filterThenSum() when calculating balances

* Add await for balance as blocks are processed async

* Add more assertions, fix bad assertions I introduced
2022-08-02 12:33:46 -05:00
GreyMcCarthy
b7c7cb8fc2
Moving duplicate dataStructures in cli and app-server into app-commons (#4541)
* duplicate data structures in (ConsoleCli.scala) and (ServerJsonModels.scala) moved to (Command.scala)

* removed unused imports

* rebase for merge conflitcts

* change output type for Accept DLC

* more error fixes

* error fixes

* fixed destintaion error

* scala reformatting

* send from outpoints test runs and passes

* removed unnecessary braces, removed incorrect extensions on objects

* scala reformatting

* removed commented out code
2022-08-02 11:55:43 -05:00
Chris Stewart
ba396f2fb3
Fetch findByFundingTxId/findByFundingOutPoints in parallel as an optimization (#4560) 2022-08-02 06:40:28 -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
Shreyansh
8b646802b3
Fix postgres database not clearing after test (#4558)
* fix postgres database not clearing after test

* Empty commit to run CI

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-01 07:49:55 -05:00
Chris Stewart
f487c1270e
Implement cleanup of dlcWallet/wallet DbAppConfig threadpools (#4557)
* Implement cleanup of dlcWallet/wallet DbAppConfig threadpools

* Cleanup

* Remove uncessary walletHolder.start()
2022-08-01 06:55:02 -05:00
benthecarman
603b7e0aea
Make DLCWallet.listDLCs use DBIOActions (#4555)
* Make DLCWallet.listDLCs use DBIOActions

* Add comment

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-07-31 14:09:23 -05:00
Chris Stewart
936a65edd4
2022 07 21 Modify helper methods in BitcoindRpcBackendUtil to not materialize streams eagerly. (#4526)
* Refactor syncWalletToBitcoind impl to be completely stream based

* Add getParallelism, refactor usages in BitcoindRpcBackendUtil to use it

* Fix compile

* Replace usages of 'WalletApi with NeutrinoWalletApi' with NeutrinoHDWalletApi

* Revert wallet sync height logic

* Refactor to make things cleaner
2022-07-31 12:16:26 -05:00
Chris Stewart
af9e5eaeef
Expose DBIOActions for various models in wallet, remove address queue (#4524)
* Expose DBIOActions for various models in wallet, use them in generateScriptPubKeys

* Remove addresses queue

* Remove test case

* Fix rebase
2022-07-31 10:36:45 -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
2cd8c80f67
Refactor so we don't create multiple WalletAppConfig in testkit (#4548)
* Refactor so we don't create multiple WalletAppConfig in testkit

Fix buildBip39PasswordConfig

* Remove bip39Password argument from dlcWalletTest fixtures

* Fix allowExternalDLCAddresses config in tests

* Remove unnecessary overrides of BitcoinSWalletTest.getFreshConfig, fix docs

* Add DLCExecutionBackendTest.afterAll()

* Fix nodeTest bip39Password usage

* Fix bug where we weren't using correct config inside of getFreshConfig

* Fix DLCExecutionBitcoindBackendtest.afterAll()

* Fix RescanDLCTest
2022-07-30 17:20:18 -05:00
Chris Stewart
17ef1dcdd9
Fix rescan flag getting set, add unit test (#4554) 2022-07-29 15:17:48 -05:00
Chris Stewart
a2117e2551
Downgrade CI jdk 18 -> 17 (#4546)
* Downgrade CI jdk 18 -> 17

* Empty commit to run CI
2022-07-28 12:25:43 -05:00
GreyMcCarthy
3ae169a41f
V22 RPC Support Update Continued (#4424)
* bitcoind rpc client v22

* addresses and reqSigs deprecation

* getNodeAddresses rpc now returns a network field

* fixed so that support for V23

* debuggging changed extends BitcoindRpcClient to extends BitcoindV21RpcClient

* added network input to getnodeaddresses which makes it so only outputs addresses with that specified network

* getnodeaddresses accepts a network input and outputs addresses with that network. Test did not run on previous commit now it passes.

* added (listdescriptors rpc testing in progress), added descriptors flag to getwallet info rpc (testing in progress), added include unsafe option for fundrawtransaction and walletcreatefundedpsbt rpcs (testing in progrss), adding test for createwallet with descriptors enabled (not complete)

* fix so that getwalletinfo works with descriptors flag, fix so now can create descriptor wallet, test for create descriptor wallet now runs and passes

* added tests, bug in listdescriptors implmentation

* listDescriptors rpc is implmented and passes all tests

* listDescriptors test was previously causing (be able to decode a redeem script) test in the suite to fail becasue of createwallet, the bug is now resolved

* bug fix in V17AssortedRpc

* bug fixes

* fixed listdescriptors test, create descriptor wallet test, wallet with priv keys enabled test, decode redeem script test, so that no longer use await return and await result

* fix for tests failing

* listDescriptors Rpc implmented and passes tests

* cleanup

* scala formating changes

* generate block to address test uncommented V22 changed to PostV22 in some of the names of the case classes

Co-authored-by: shruthii625 <shruthii1410@gmail.com>
2022-07-28 07:53:08 -05:00
Chris Stewart
f608c5d5e4
Create a helper case class called FundRawTxHelper (#4544)
* Create a helper case class called FundRawTxHelper to encapsulate the values returned by fundRawTransactionInternal

* Return FundRawTxHelper[ShufflingNonInteractiveFinalizer]

* make FundRawTxHelper.signedTx be a lazy val
2022-07-27 17:12:42 -05:00
Chris Stewart
b69e487d04
Move MockChainQueryApi/MockNodeApi out of BaseWalletTest (#4542)
* Move MockChainQueryApi/NodeApi out of BaseWalletTest

* fix docs

* Move wallet configurations out of BaseWalletTest

* Move helper methods out of BitcoinSFixture trait into companion object to simplify the hierarchy

* Refactor usage of WalletWithBitcoind to allow parameterization of the BitcoindRpcClient type
2022-07-27 10:18:22 -05:00
Chris Stewart
6c76639ba3
Move processBlock into WalletApi (#4543) 2022-07-27 09:32:22 -05:00