Commit Graph

426 Commits

Author SHA1 Message Date
Shreyansh
0b53c7be12
Change tests to use disconnectnode rpc instead of restarting bitcoind (#4468)
* change tests to use disconnectnode rpc instead of restarting bitcoind

* fix issue with querying for node uri when not initialized
2022-07-08 18:53:37 -05:00
benthecarman
64183568fe
Allow creation of TaprootTxSigComponent (#4445)
* Allow creation of TaprootTxSigComponent

* PreviousOutputMap using MapWrapper
2022-07-04 08:46:10 -05:00
Shreyansh
111df25df0
Fix sync issues post #4408 (#4441)
* fix node test shared fixtures bug

The cached bitcoind fixtures were used and stopped in UnsyncedNeutrinoNodeTest which causes an error if NeutrinoNodeTest is run at the same time on high performant systems, which is why it escaped CI. Merges NeutrinoNodeTest and UnsyncedNeutrinoNodeTest

* fix possible issues with PeerMessageReceiverTest

This reverts commit 55e7cafee6c6fd8515650cf65d96f9d92a2a8812.

* fix filter sync issue when wallet creation time indicates already synced

* move switch peer test to NeutrinoNodeWithUnachedBitcoindTest
2022-07-04 08:42:45 -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
benthecarman
99b75d166f
Fixes support for bitcoind taproot descriptor wallets (#4415) 2022-06-23 07:10:51 -05:00
Shreyansh
4dc1bc7050
add bitcoind v23 rpc (#4368) 2022-06-21 13:20:47 -05:00
benthecarman
531845adfa
Accept keysend and amp in lnd fixtures (#4407) 2022-06-21 07:53:37 -05:00
benthecarman
a0ab0638f8
Allow for custom channel sizes in LndRpcTestUtil.createNodePair (#4398) 2022-06-16 19:36:03 -05:00
rorp
1ad540703c
Improve bitcoind connection retry logic (#4386) 2022-06-14 08:40:04 -05:00
rorp
fdf281b469
DLC <-> contact mapping (#4346)
* DLC <-> contact mapping

* updated docs

* populate dlc/contact mapping automatically

* typo

* respond to the PR comments

* rename `contact` to `peer`

* fix unit tests

* create a contact when an incoming offers gets created

* drop dlc_contact_mapping table

* fix build

* update the docs

* Revert "update the docs"

This reverts commit 2386adadcd.

* revert dlc-contact-* endpoints
t Please enter the commit message for your changes. Lines starting
2022-06-14 08:14:28 -05:00
benthecarman
c2d8735dd7
LND: Add configs for gossip in test env (#4378) 2022-06-13 11:58:50 -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
benthecarman
6845caf778
Make all uint64 types from lnd a UInt64 (#4332)
* Make all uint64 types from lnd a UInt64

* Make all uint32 types from lnd a UInt32
2022-05-11 05:05:16 -05:00
Chris Stewart
2f4bbf7014
Upgrade flyway to 8.5.9 (#4311)
* Upgrade flyway to 8.5.9

* Remove comment
2022-05-04 11:24:51 -05:00
rorp
3dc709386a
Upgrade Eclair to v0.7.0 (#4308)
* Upgrade Eclair to v0.7.0

* Scala 2.12 compatibility

* reformat
2022-05-02 09:04:56 -05:00
Chris Stewart
f4d864fab8
2022 04 26 Startup time of appServer (#4294)
* Make Server's route be async

* WIP

* Add StartedBitcoinSAppConfig to indicate when tor starts up

* Add torStarted flag to getinfo response
2022-04-28 13:50:28 -05:00
Chris Stewart
5ad5993f1a
Refactor WalletAppConfig test fixture destructions to stop the config… (#4266)
* Refactor WalletAppConfig test fixture destructions to stop the config when tearing down

* Fix test fixture where walletappconfig might not be started
2022-04-17 09:23:21 -05:00
Chris Stewart
24125eaca3
Fix case where we broadcast tx with a tag, and then also add the tag when we receive the tx in a block (#4239) 2022-04-03 13:40:19 -05:00
Chris Stewart
f2fa56221d
2022 03 31 collateral invariant (#4232)
* DLCMessage.totalCollateral -> DLCMessage.collateral

* Fix bad names of {DLCOfferTLV,DLCAcceptTLV}.totalCollateralSatoshis, its not the total collateral, rather the collateral being contributed by the offerer and acceptor

* Fix rebase

* Fix appServerTest

* Fix docs
2022-03-31 09:48:08 -05:00
Chris Stewart
8081772b57
Allow acceptor to upsert same outpoint multiple times for different offers (#4230)
* Allow acceptor to upsert same outpoint multiple times for different offers

* Remove extra log

* Revert DLCOffer invariant

* Fix OP_RETURN tests
2022-03-31 07:47:10 -05:00
Chris Stewart
d5807daeab
Remove SpendingInfoDb.txid parameter (#4199) 2022-03-19 15:21:36 -05:00
Chris Stewart
fe86233489
Add better tor message to UI (#4181)
* Add better tor message to UI

* Fix compile
2022-03-11 11:17:52 -06:00
Chris Stewart
374c1d7b9f
Upgrade RescanHandlingTest to use the newest release of bitcoind (#4151) 2022-03-02 09:59:25 -06:00
Chris Stewart
7a5c2971dd
Refactor receive flow to use the same utxo state transitions (#4134)
* Refactor receive flow to use the same utxo state transitions as the rest of the wallet

Get tests passing again with refactored utxos

Remove unecessary wallet methods

Fix test cases

* Remove fixture on UTXOHandlingTest

* Fix bug where funding happens in parallel in fixture and can lead to blockchain reorgs
2022-02-26 19:08:50 -06:00
Chris Stewart
b46574c0c4
2022 02 18 sync since creationtime pt2 (#4109)
* Get things compiling and tests passing

* Fix bug where we weren't using filter height correctly

* Fix docs

* Move creationTime into KeyManagerAppConfig

* Fix nodeTest/test test fixtures
2022-02-22 08:00:14 -06:00
rorp
ffd7d921a8
Database support for incoming offers (#4105)
* Database support for incoming offers

* fix tests
2022-02-18 14:03:05 -06:00
rorp
5777ec1c31
Add an ability to set custom payout and change addresses (#4101)
* Add an ability to set custom payout and change addresses

* config changes

* formatting

* respond to the comments
2022-02-18 09:29:00 -06:00
Chris Stewart
dc47c070a2
Fix SpendingInfoDAO.findOutputsReceived() bug (#4090) 2022-02-14 10:11:23 -06:00
rorp
bce58ba33d
Validate announcement signatures on create/accept offer (#4071)
* Validate announcement signatures on create/accept offer

* unit tests
2022-02-11 06:50:45 -06:00
Chris Stewart
5aeecdb893
Reworking/refactoring acceptDLCOffer (#4048)
* Part 1 of reworking/refactoring acceptDLCOffer

* scalafmt

* WIP

* Move offer creation into initDLCForAccept

* Refactor method name to getDlcDbOfferDbAccountDb

* Push to github to force re-run of CI
2022-02-07 11:41:17 -06:00
benthecarman
142612f034
Make newConfigOfType use Vector[Config] (#4039) 2022-02-04 06:14:16 -06:00
Chris Stewart
b918cf78b7
Fix bugs where we were building internally inconsistent SpendingInfoDb (#4016)
* Fix bugs where we were building internally inconsistent SpendingInfoDb

* Fix error message
2022-01-27 07:22:09 -06:00
Chris Stewart
bd5bcfef3a
2022 01 18 issue 3969 Add serialization_version to global_dlc_data (#3992)
* Get refactor working where we decouple CETSignatures and the partial refund signature

* WIP

* Implement migration to specify serialization_version on global_dlc_data table

* Fix migrations test

* WIP

* implement contractid computation

* Get migration working for wallet on testnet

* Add check to make sure we only try to migrate old wallets

* Refactor DLCDataManagement.getOfferAndAcceptWithoutSigs to not use DLCTxBuilder

* WIP

* Bubble up Option[] into DLCWallet, trivially assert on it and then use .get. We will have to do the refactor of DLCWallet sometime in the future

* Change global_dlc_data serializationVersion at database level to not have an Option

* Add DLCDbState, propogate it through the codebase

* Remove log

* Remove invariant for making sure all DLCs are defined on migraiton, add log for the case of issue 4001

* Add filter on ALPHA serialization DLCs. We dont need to migrate DLCs that are using the beta serialization

* Rebase onto 4004

* Refactor to use the refund signature in the accept/sign message

* Add output index to the return of DLCTxBuilder.buildFundingTransaction()

* Fix compile

* Remove log
2022-01-26 14:57:45 -06:00
Chris Stewart
98c5d816ac
2022 01 25 issue 4014 (#4015)
* Refactor testkit tests to use same nodeCallbacks that BitcoinSServerMain uses for neutrino

* Add test case

* Add logs for callbacks

* Cleanup

* Add test case for when funds are spent when we are offline

* Turn off logging again

* Cleanup more logs and comments
2022-01-26 13:16:15 -06:00
Chris Stewart
e802254a20
2022 01 24 rm appconfig varargs (#4011)
* Get things compiling

* Get tests passing

* Fix docs
2022-01-25 07:25:05 -06:00
Chris Stewart
21de609ed8
2022 01 22 cetsignatures refactor (#4004)
* Get refactor working where we decouple CETSignatures and the partial refund signature

* Add DLCAcceptWithCetSigs() for the case where we have a refund sig, but no cet signatures

* Fix bugs

* Fix sighash parsing bugs
2022-01-23 16:13:36 -06:00
Chris Stewart
7ee1f0f406
Implement batching of database calls for our chain callback (#4003) 2022-01-23 07:39:10 -06:00
rorp
f438ce2897
Refactor zipDatadir (#3999)
* Refactor zipDatadir

* cleanup
2022-01-21 10:03:53 -06:00
rorp
ee3ee53191
RPC password authentication (#3961)
* RPC password authentication

* fix compiler error

* add more unit tests

* change default behavior

* Cleanup and add unit test for sad path for rpc authentication

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-01-13 05:55:33 -06:00
Chris Stewart
bf8b165fe9
Implement recovery for when we cannot receive a fee rate from a FeeRateApi (#3975)
* Implement recovery for when we cannot receive a fee rate from a FeeRateApi. Now we return -1 sats/vbyte if we cannot get the fee rate from a fee provider rather than throwing an internal server error

* Fix compile
2022-01-12 14:09:15 -06:00
Chris Stewart
9dd126bb9f
Modify estimatefee endpoint to return a number rather than a string (#3973)
* Modify estimatefee endpoint to return a number rather than a string

* Fix compile

* Fix infinite loop on converting to sats/vb, add tests
2022-01-12 12:17:04 -06:00
Shreyansh
a58ef1cd02
Storing peers in database (#3773)
* rebase

* fix

* fix

* remove unwanted diffs

* fix

* formatting

* changes from comments

* Revert "changes from comments"

This reverts commit eb8a795718dc590802a19c7ce4cce4501bd2de1f.

* changes from comments

* add PeerManager

* add sha3-256

* add NetworkUtilTest

* formatting
2022-01-09 07:21:59 -06:00
Chris Stewart
d06b064b6b
2021 12 28 blockprocessed callback (#3946)
* WIP

* Get appServerTest passing with chain notifications

* Reorder where SourceQueue gets initialized so that we can use it to construct the wallet's callbacks

* DRY

* Fix missing callback for neutrino chaincallbacks

* Bump timeout

* Bump timeout

* When wallet is empty call doSync() with the last blockheader bitcoind has seen

* Revert skipping compact filters on IBD for bitcoind

* Revert logging
2021-12-30 13:41:17 -06:00
Chris Stewart
50bec2abc6
2021 12 14 websockets (#3906)
* WIP

* Get basic websocket working (sort of)

* Push websocket fixes

* WIP: Implementing SpendingInfoDb json serializer

* Implement onreserved callbacks, add json serializers for SpendingInfoDb

* Get first unit test working for websockets when a address is generated

* Rework WalletNotification to have case classes, get unit test working for receiving addresses over the websocket

* WIP

* Add websocket callback for when a wallet processes a block

* Cleanup

* basic updates to unit test

* Fix compile

* Fix submodule

* Fix compile

* Get both unit tests passing when run by themselves

* Fix so both test cases can be run

* Implement unit tests for blockpressed and reservedutxos websockets

* Fix RoutesSpec get a block header test

* Implement configuration for wsbind and wsport via bitcoin-s.conf

* Add some nonblocking sleeps on all WebsocketTests

* Add documentation

* Properly close the server with .terminate() rather than .unbind()

* Add BitcoinSServerMainBitcoindFixture.afterAll()

* Add println

* Add more println

* Try to downgrade bitcoind version

* Fix datadir bug

* Cleanup callbacks so they don't have nested futures

* Fix SpendingInfoDb.apply() pattern match

* Add spendingInfoDb json serializer test, does not pass

* Fix SpendingInfoDb json serializer

* Make small refactors

* Fix compile

* Add maxBufferSize, change overflow strategy to OverflowStrategy.dropHead

* Address Nadav's code review

* Address ben's code review
2021-12-25 11:11:04 -06:00
rorp
4b07629d56
Add getmediantimepast RPC call (#3921)
* Add `getmediantimepast` RPC call

* update docs

* respond to the PR comments
2021-12-22 16:15:30 -06:00
Chris Stewart
4ca586ca46
2021 12 19 dlc callbacks (#3923)
* Implement DLC wallet callbacks

Add callbacks and tests for Claimed/RemoteClaimed

Add unit test for confirmed state

* Add some docs

* Address ben's code review

* Fix scalafmt
2021-12-20 14:28:52 -06:00
Chris Stewart
2d9d12816b
Add WalletCallbacks.onBlockProcessed() (#3912) 2021-12-16 12:26:48 -06:00
Chris Stewart
f71d3567ed
2021 11 23 crud action (#3851)
* WIP

* Finish implementing {CRUD,CRUDAction}.createAllAction()

* Try to make database inserts more atomic

* Consolidate more database calls in DLCWallet.initDLCForAccept()

* WIP2

* More refactor and using actions

* Add DLCIdDaoUtilNoPK for querying when dlcId is not a primary key

* Add DLCDataManagement.deleteDLC()

* make DLCWalletApi.createDLCOffer() use actions

* Rework DLCWallet.createNewDLCAccept() to use DBIOAction

* Use actions in DLCWallet.registerDLCAccept() a bit

* Create DLCActionBuilder, move actions to there

* Move more actions into ActionBuilder

* Implement transactionally on database writes for actions
2021-11-30 12:38:55 -06:00
Chris Stewart
8765c2f845
Disjoint union dlc (#3839)
* Implemented Disjoint Union DLC related data structures with dlcTest passing

Broke DLCClientTest up into multiple test files

Optimized DLC execution unit tests by checking all outcomes on a single setup DLC

Refactored DLCTest to allow for Disjoint Union DLC construction and validation, added tests

Responded to review

Fixed after cherry-pick

Fixed docs

* Fixed things after rebase

* Rebase

* Fix json serializer

* Finish fixing compile

* Start trying to make APIs better for multi oracle contract infos

* Clean things up in the GUI, try to make failures on disjoint union contracts as explicit as possible

* Use less numDigits as optimization for non secp CI test cases

* Fix compile

* Refactor BroadcastDLCDialog

* Fix test case optimization

* Clean up comment

Co-authored-by: nkohen <nadavk25@gmail.com>
2021-11-29 19:26:00 -06:00
benthecarman
155301fc1d
Allow lnd remote to work with certificate string (#3840) 2021-11-20 18:59:46 -06:00