Commit Graph

92 Commits

Author SHA1 Message Date
Chris Stewart
29f10d046c
Turn on -Xlint (#5728)
Get entire codebase compiling

Fix DLCDAO

Revert .jvmopts

Finish rebase
2024-10-24 06:59:50 -05:00
Chris Stewart
e419b18d9c
2024 10 23 merkle vector (#5734)
* Rework MerkleBlock/PartialMerkleTree data structures to use Vector

* Fix base case for Merkle.build()
2024-10-23 16:14:33 -05:00
Chris Stewart
07f17cfedf
Rework Block and Transaction data structures to use Vector rather than Seq (#5733) 2024-10-23 14:27:07 -05:00
Chris Stewart
65e67287f8
2024 10 21 Replace Future.sequence() usage with Future.traverse() (#5732)
* Use more Future.traverse()

* More Future.traverse()
2024-10-22 16:57:23 -05:00
Chris Stewart
ab6d3f5cb7
Pull over simple syntax changes for scala3 libraries (#5719)
* Pull over simple syntax changes for {cryptTest,coreTest,testkitCore,appCommons} from #5713

* Fix case analysis in Picklers.scala
2024-10-17 13:00:33 -05:00
Chris Stewart
41fab3dfd2
2024 08 07 createnewaccount rpc (#5638)
* Implement creatnewaccount rpc

* Get WalletRoutesSpec createnewaccount unit test passing

* Rename HDPurposes -> HDPurpose

* Fix docs

* Implement ConsoleCli arg, change HDPurpose json serialization to be a json string instead of a num
2024-08-13 10:32:03 -05:00
Chris Stewart
458f3cb7d3
2024 07 29 rm tx bitcoind callbacks (#5632)
* fix docs

* Fix docs

* WIP

* Integrate BitcoindCallbacks

* Revert loback-test.xml

* Remove logs
2024-08-03 05:16:57 -07:00
Chris Stewart
05894e8c54
2024 05 10 keymanager xsource3 (#5583)
* Get key-manager compiling with -Xsource:3

* Get testkit-core compiling with -Xsource:3
2024-05-10 18:44:11 -05:00
Chris Stewart
7ed2b8801a
2024 04 30 upgrade eclair v0.10.0 (#5557)
* Fix open, audit commands for v0.10.0

* Get all unit tests passing

* Add logger.error() to try to debug channel state

* Try adding delay to see if dual funding process can complete before we generate blocks

* scalafmt

* Try bumping number of blocks generated

* Try disabling dual funding

* Cleanup
2024-04-30 14:25:50 -05:00
Chris Stewart
7ee749adcb
2024 04 29 eclair upgrade v0.9.0 (#5556)
* Rework EclairRpcTestUtil.shutdown() to shutdown eclair/bitcoind separately

* Fix keysend test

* Add new eclair websocket events

* Empty commit to re-run CI

* First bug where we weren't shutting down a bitcoind in eclairRpcTest
2024-04-30 07:36:36 -05:00
Scala Steward
afddf73c48
Update scalafmt-core to 3.8.1 (#5501)
* Update scalafmt-core to 3.8.1

* Update .scalafmt.conf settings to be factory default settings

* Fix typo

* scalafmt

* Empty commit to re-run CI

* Revert some scalafmt back to original scalafmt.conf

---------

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2024-04-20 19:55:49 -05:00
Chris Stewart
a6d93622f8
2024 04 16 descriptor fidelity (#5529)
* Implement unit tests for key expression fidelity to user input for hardened paths

* Create HardenedType, rework BIP32Node to take Option[HardenedType] as a parameter

* Fix docs
2024-04-17 18:35:33 -05:00
Chris Stewart
790327639a
Tighten P2WSHWitnessSPKV0.apply() to only take RawScriptPubKey (#5509) 2024-04-06 16:57:21 -05: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
3ed78b5270
Upgrade to scala 2.13.13, fix compiler errors (#5428) 2024-02-27 10:21:39 -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
deb79c5994
Make another instance of Gen[ECPrivateKey] be deterministic (#5353)
* Make another instance of Gen[ECPrivateKey] be deterministic

* Revert CommonSettings.scala
2024-01-14 12:01:06 -06:00
Chris Stewart
4913b12431
2023 11 10 peermanager refactor (#5303)
* Pull queue, PeerFinder into NeutrinoNode and out of PeerManager

* Remove ControlMessageHandler param from PeerData

* Make ControlMessageHandle.handleControlPayload() take PeerMessageSenderApi as a param instead of just a Peer

* move construction of akka stream from PeerManager to NeutrinoNode

* Move inactivity checks out of PeerManager and into NeutrinoNode

* Move queue initialization into NeutrinoNode

* cleanup

* Set NeutrinoNode.isStarted to true when NeutrinoNode.start() is called

* Empty commit to re-run CI

* Modify FilterSync.toString()

* scalafmt

* Fix bug where we weren't checking if connection is timed out on activity checks

* Empty commit to run CI

* reset log level
2023-11-17 13:16:26 -06:00
Chris Stewart
579318cad0
Make Gen[ECPrivateKey] in scalacheck to use randomness from scalacheck to preserve reproducibility of test cases (#5285)
* Make Gen[ECPrivateKey] in scalacheck to use randomness from scalacheck to preserve reproducibility of test cases

* Revert build.sbt
2023-11-06 17:03:09 -06:00
Chris Stewart
abeaaa05de
Remove awaitPeerWithServices() (#5093)
* Remove awaitPeerWithServices()

* Empty commit to run CI

* Rework Node.sync() to return Future[Option[Peer]] rather than Future[Unit]. This returns the peer we are syncing with, if we could find one to sync with

* Turn logging OFF again

* Empty commit to re-run CI

* Use AsyncUtil.retryUntilSatisfied() when calling node.sync() after starting node to make sure we have a peer to sync from in a test case

* Await on re-started node not stale reference in NeutrinoNodeWithWalletTest

* Fix second reference

* Empty commit to re-run CI
2023-06-07 04:47:39 -05:00
Chris Stewart
dc0e3645d0
2023 03 24 is tip stale (#5024)
* WIP

* Fix test

* Add more tests for stale header

* remove uncessary comments
2023-03-26 08:20:27 -05:00
Chris Stewart
f6207b1c9f
Add check we have more than 1 peer before we try to syncFromNewPeer() (#4966)
* Add check we have more than 1 peer before we try to syncFromNewPeer()

* Empty commit

* Return failed Future rather than just logging an error
2023-02-03 15:46:24 -06:00
Chris Stewart
c5983730bb
2023 01 10 refactor peermanager (#4950)
* Make PeerManager.finder private

* Make PeerManager.supervisor private

* Write unit test to see if default peer is added to PeerManager

* Use withNeutrinoNodeUnstarted fixture

* Get unit tests passing

* Add println to try and debug CI

* Add more println

* more println

* Adjust nodeTest / parallelExecution = false

* Try to make error logged to figure out why failure is happening on CI

* Adjust log level to ERROR

* Add catch to try and log failure messages

* Add log for sending messages to peers

* Try to increase threadpool size to see if we are deadlocking

* Add more logs

* Add another log to detect where failure is

* Try using Actor.tell() with explicit ActorRef.noSender

* Very detailed logging

* Remove duplicate method from rebase

* Revert things

* Revert build.sbt

* Empty commit

* Bump timeout

* Empty commit to run CI

* Revert more files
2023-01-27 10:43:50 -06:00
benthecarman
8bd10d0f40
Correctly handle witness v1+ spks in fallback addresses (#4949) 2023-01-12 11:39:56 -06:00
Chris Stewart
e8ebcf55cd
Fix bug where signatures were out of order from what was posted in the announcement (#4809) 2022-09-30 14:00:14 -05:00
Chris Stewart
34e023e93f
2022 09 29 handle unordered sigs (#4807)
* Get unit tests passing for unordered nonces/signatures

* Get v0 oracle announcements working again on listannouncements

* Add unit test to make sure we can still validate signatures for attestments with nonces out of order
2022-09-29 11:43:50 -05:00
Chris Stewart
9c506b639f
Add OrderedSchnorrSignatures, use it in OracleAttestment (#4803)
* Add OrderedSchnorrSignatures, use it in OracleAttestment, propagate it threw the codebase

* Small cleanups

* Add SortedVecFactory

* Fix test case with out of order nonces
2022-09-26 19:35:04 -05:00
Chris Stewart
3ee4fe1138
Upgrade dependencies (#4705)
* Upgrade dependencies

* upgrade micropickle to 2.0.0

* Add .env file with FLYWAY_CLEAN_DISABLED=false to allow cleaning in test cases

* Fix logging pattern bug

* Add action to load .env file

* Add default flyway.conf at root of repository, disable flywayClean

* remove env action
2022-09-05 07:11:23 -05:00
benthecarman
b04a34ad02
Use FutureUtil.makeAsync where we are attmepting to create async Futures (#4583) 2022-08-08 15:22:32 -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
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
benthecarman
59732809d0
Represent and handle SIGHASH_DEFAULT correctly in TaprootKeyPath (#4488)
* Represent and handle SIGHASH_DEFAULT correctly in TaprootKeyPath

* Prevent construction of invalid TaprootKeyPath, fix tests

* Have SIGHASH_DEFAULT be SIGHASH_ALL in preTaproot cases
2022-07-11 07:22:08 -05:00
Chris Stewart
83cff9a44c
2022 07 07 issue 4455 (#4457)
* Get simple serialization symmetry working for taproot keypath

* Implement generators for TaprootScriptPath, check serialization symmetry

* Make sure bytes are symmetrical too

* Add check in TaprootScriptPath.hasAnnex() to make sure therer is more than one stack element

* Cleanup

* Address ben's review

* Fix pattern match
2022-07-07 12:04:16 -05:00
Chris Stewart
aca59ca352
Fix test logging (#4446) 2022-07-04 10:49:07 -05:00
benthecarman
64183568fe
Allow creation of TaprootTxSigComponent (#4445)
* Allow creation of TaprootTxSigComponent

* PreviousOutputMap using MapWrapper
2022-07-04 08:46:10 -05:00
Chris Stewart
a680f03c04
Implement BIP341 (#4409)
* Implement BIP341

Get coreTest working

* REmove logger

* scalafmt

* Cleanup

* Make checkSigTapScrip() take a SchnorrPublicKey

* Address ben's code review

* Adjust error type on WitenssVersionV1.rebuild()
2022-06-22 09:36:55 -05:00
Chris Stewart
ddbdde495d
2022 06 13 taprootspk xonlypubkey (#4388)
* Implement XOnlyPubKey inside of TaprootScriptPubKey

* Add ECPrivateKey.toXOnly

* Address code review
2022-06-13 18:43:43 -05:00
benthecarman
344a8fd759
Add TLVs defined in BOLT 4 (#4380)
* Add TLVs defined in BOLT 4

* Fix test case
2022-06-13 11:58:11 -05:00
Nadav Kohen
b80bf4649e
Add HashType to ECDigitalSignature API (#4320)
* HashType now uses Int instead of Int32

* Moved HashType from core to crypto

* Added HashType helper functions to ECDigitalSignature

* Added tests

* Fixed compile
2022-05-29 18:25:22 -05:00
benthecarman
bac3cb4190
Fix rolling log file (#4288) 2022-04-25 06:53:08 -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
d5807daeab
Remove SpendingInfoDb.txid parameter (#4199) 2022-03-19 15:21:36 -05:00
Chris Stewart
8d2a749df6
Rename WitnessScriptPubKeyV1 -> TaprootScriptPubKey (#4198) 2022-03-19 13:26:03 -05:00
Chris Stewart
c11d9ef1fe
Fix unit test where coinbase input was sometimes selected (#4165) 2022-03-04 16:09:08 -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
c069b01e53
2022 02 24 rm prune addresses after rescan (#4130)
* Fix bug where we prune unused addreses on rescan. This doesn't let us discover funds for addresses sent that were not paid to until after the rescan was completed

* Add test case

* Fix neutrino node test case

* Some cleanup
2022-02-26 07:43:23 -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
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
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