Commit Graph

545 Commits

Author SHA1 Message Date
Chris Stewart
30226219e6
2022 03 01 static wix upgrade product code (#4149)
* Try fixing a stic wix productId so the windows OS can understand installations of bitcoin-s are the same product

* Add this branch to release.yml

* Use 1.9.0 windows product id

* Add EnvUtil.parseCommitsSinceLastTag, make last number on windows version be the number of commits since last tag

* Add ability to parse the version from a string

* use upgradeId rather than productId

* Remove feature branch from release.yml

* Remove test
2022-03-01 18:25:13 -06:00
Chris Stewart
6b7058af4a
Add the temporaryContractId field to the json rpc response for offers (#4146)
* Add the temporaryContractId field to the json rpc response for offers

* Fix test case
2022-03-01 13:00:44 -06:00
Chris Stewart
c315dce05b
Add jdk version to log (#4142) 2022-03-01 10:12:44 -06:00
rorp
c1dccd7831
Offer inbox RPC (#4129)
* Offer inbox RPC

* fix syntax errors

* change parameter type

* change receivedAt type

* rename RPC methods

* WS support

* fix syntax errors
2022-02-28 14:25:46 -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
3ba95700b2
Add RescanState, make sure we don't start concurrent rescans (#4131) 2022-02-25 05:23:51 -06:00
rorp
34b7d18268
External payout addresses for acceptdlc (#4121) 2022-02-22 14:47:48 -06:00
Chris Stewart
528e7c8f0e
Remove TxoState.DoesNotExist (#4108) 2022-02-18 16:31:03 -06:00
benthecarman
f657510d80
Remove invoice max amount limit (#4104) 2022-02-18 12:16:39 -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
2bce49b519
Remove things deprecated in 1.8 (#4097) 2022-02-15 09:24:22 -06:00
rorp
4d85b7a3d7
Support for big SPKs (#4084)
* Support for big SPKs

* Support for big SPKs

* Bump number of migrations

* Fix other test case

* cleanup

* cleanup

* fix psql migrations

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-02-14 07:22:34 -06:00
Chris Stewart
13c46e0af8
Move expensive script checks to last inside of P2PKWithTimeoutScriptPubKey (#4087)
* Move expensive script checks to last inside of P2PKWithTimeoutScriptPubKey

* Fix compile
2022-02-12 16:18:23 -06:00
Chris Stewart
9de4b0272a
2022 01 31 issue 4030 (#4066)
* WIP

* WIP

* Get basic unit test passing for new adaptor sig states

* Fix compile
2022-02-09 13:15:44 -06:00
Chris Stewart
f253b5055e
2022 02 08 dlc accept refactor (#4064)
* Create buildAcceptWithoutSigs

* Create DLCAcceptUtil

* Address roman's code review
2022-02-09 07:39:07 -06:00
rorp
e2b9c458e4
Change DLCUtil.buildOracleSignatures (#4061) 2022-02-07 19:50:53 -06:00
Chris Stewart
7f344ad3ff
2022 02 06 announcement creation logging (#4055)
* Add logs for creating announcements

* Add attestation logs

* scalafmt
2022-02-06 17:30:42 -06:00
Chris Stewart
590cd9c72e
2022 02 06 remoteclaimed refactor (#4054)
* Small refactors to make things more readable

* Add invariants to make sure things are defined when doing the RemoteClaimed flow

* Move where we update DLCDb state to RemoteClaimed so its atomic with the rest of the db updates

* Consoldiate uses of updatedDlcDb

* Add logs

* scalafmt
2022-02-06 16:31:13 -06:00
Chris Stewart
7a6f0430d6
2022 02 03 issue 4032 (#4042)
* get all dlcWalletTest/test passing

* Get dlcTest/test working with ignored test cases

* WIP

* Rework match oracleSignatures

* Refactor checkSingleContractInfoOracleSigs to use matchOracleSignatures

* Clean up checkOracleSignaturesAgainstContract for disjoint, still doesn't pass test cases

* Some DRY in numeric test cases

* Add test case for enum contracts

* Fix disjoint union contract bug

* Refactor matching of oracle announcements and oracle signatures into DLCUtil

* Fix compile on on 2.12.x

* Address parts of code review
2022-02-05 09:04:04 -06:00
rorp
2066447cdc
Add isEndpoint to numeric contract descriptor serialization (#4033)
* Add isEndpoint to numeric contract descriptor serialization

* Fix compile

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-02-01 09:42:21 -06:00
Chris Stewart
71711ca582
Add invariant to make sure spendingTxId is different than the txid (#4019) 2022-01-27 09:52:12 -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
d983ad14f3
Fix contractid computation (#4012) 2022-01-26 05:30:29 -06:00
Chris Stewart
dbfd58da86
Add log txids inside of inventories in big endian rather than little endian (#4013) 2022-01-25 10:50:58 -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
Chris Stewart
ee0d62c5b8
2022 01 14 DLCDataManagement refactor (#3982)
* WIP

* Finish refactor, get unit tests working

* Remove log
2022-01-18 08:12:27 -06:00
Chris Stewart
214213b59d
2022 01 16 issue 3983 (#3987)
* Add test case

* Add check that the pubkey is valid in WitnessScriptPubKeyV1.isValidAsm()
2022-01-17 14:38:51 -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
93c5121632
2021 01 06 tlv invariants (#3965)
* Add invariant to CETSignaturesTLV so we don't have empty adaptor sigs

* Add invariant to make sure FundingSignaturesTLV witnesses are not empty

* Add invariant that contractOraclePairs aren't empty

* Add fundingInputs and ordered announcement invariants

* fix docs

* Move invaraints from TLVs to in memory data structures

* WIP

* WIP2

* Modify return type of DLCDataManagement.executorAndSetupFromDb() to return an Option. The None case represents when we have pruned CET signatures from the database

* Add some comments, clean up a bit

* more cleanup
2022-01-08 16:21:58 -06:00
Chris Stewart
8857af2b66
Address ben's code review on #3854 (#3962)
* Address ben's code review

* Rename DLCSerializationVersion

* Scalafmt and bug fix'

* Fix docs
2022-01-05 08:49:23 -06:00
benthecarman
b342f373ae
Make ContractDescriptorTemplate an unsealed trait (#3963) 2022-01-05 08:49:11 -06:00
Chris Stewart
8c5288d758
Implemented general payout curves (#3854)
* Implemented general payout curves including hyperbola curve piece support

WIP

Get GUI compiling

* WIP

* Get backward compatible serialization working, everything is equivalent except for in memory Scala data structures

* Get numeric contracts backward compatible

* Get rest of codebase compiling

* Add test case for old contract info

* Add sanity test vector for old enum contract descriptors

* Fix docs

* Remove comment

* Scalafmt

* Add DLCSerializationVersion, replace isOldSerialization

* Remove ValueIterator.takeNoSkip()

* Fix docs

Co-authored-by: nkohen <nadavk25@gmail.com>
2022-01-05 07:07:22 -06:00
benthecarman
c3d1b2ee12
Give DLCOracle to filter events by pending/completed (#3953) 2021-12-30 06:33:16 -06:00
Nadav Kohen
6652448f99
Added constructor for p2pkh for decompressed public keys (#3944) 2021-12-27 15:23:38 -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
41b96c4c7e
Add rescan field to walletinfo response (#3933) 2021-12-23 14:30:26 -08: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
3cd57d37f5
Remove backupwallet / backup oracle (#3920)
* Remove backupwallet / backup oracle

* Add zipdatadir documentation

* Fix submodule
2021-12-20 08:19:46 -06:00
benthecarman
d66afe9e43
Add satoshisRounded to Bitcoins (#3904) 2021-12-14 17:20:57 -06:00
Chris Stewart
0d37c4b54f
2021 12 08 block parsing bug caused by 65 byte taproot signatures (#3887)
* Add block  0000000000000000000593310d3b0cdc082af49f38b8a1611239072aef8433a8 test vector

* Add test cases

* wip

* Fix bug where we were classifying taproot txs as P2WPKHWitnessV0

* revert logging level

* Some cleanup

* Add logback.xml for scripts, remove scheduler in scan bitcoind

* Fix imports

* Take ben's suggestion and add check to CryptoUtil.isValidPubKey
2021-12-09 06:38:25 -06:00
Chris Stewart
d393848cc2
2021 11 30 issue 3847 (#3862)
* Start pulling over accept serializers from dlc message spec PR

* Get sign tlv json serialization working

* Implement decodeaccept,decodesign in CoreRoutes

* Move messages to DLCTestUtil, add documentation
2021-12-01 13:30:18 -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
90e01d7fc6
Fix broadcasting witness vs legacy txs (#3841)
* Fix broadcasting witness vs legacy txs

* Fix version test
2021-11-22 07:25:58 -06:00
benthecarman
079fa62073
Lnd v0.14.0 (#3835) 2021-11-19 06:55:56 -06:00
benthecarman
422aea2242
Fix TypeIdentifier fromBytes (#3832) 2021-11-17 06:26:07 -06:00