Commit Graph

3705 Commits

Author SHA1 Message Date
benthecarman
6b9d2db350
Update license to latest year (#4525) 2022-07-20 16:36:06 -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
benthecarman
c210052640
Refactor coin selection to be not be bitcoin-s specific (#4496)
* Refactor coin selection to be not be bitcoin-s specific

* Add to CoinSelectorUtxo
2022-07-20 08:40:11 -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
rorp
5d309fbae0
Fee rate WS notification (#4518)
* Fee rate WS notification

* make the test more CI friendly

* fix the default config

* always return errors

* fix build

* scalafmt

* send notifications every time
2022-07-19 16:41:06 -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
0cb93ddbf4
2022 07 17 node callback akka streams (#4516)
* 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
2022-07-19 13:45:41 -05:00
Chris Stewart
e3a7c0971f
Refactor to hide the Message paramter that gets fed to the websocket queue, move it to a internal implementation detail (#4514) 2022-07-18 07:32:18 -05:00
Chris Stewart
f6df30c45e
Make appServerTest run in parallel to speed up test suite (#4515) 2022-07-17 18:08:39 -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
Chris Stewart
948d2b424e
Make KeyManagerAppConfig.walletName return String rather than Option[String] (#4507) 2022-07-16 09:33:10 -05:00
Chris Stewart
6f42f83146
Move OSX check inside of jre path check, fix bug where quarantine wasn't working in case where we are in the same directory as script (#4508) 2022-07-14 06:57:52 -05:00
Chris Stewart
d1375a589e
2022 07 12 server startup cleanup (#4501)
* Remove handleMissingSpendingInfoDb

* Remove chainwork recalc

* Fix compile error and move torcallbacks in to buildNeutrinoCallbacks()

* Fix compile pt2
2022-07-13 14:22:19 -05:00
Chris Stewart
cdef8c01dd
Set syncing flag to true on startup (#4506) 2022-07-13 13:09:06 -05:00
Chris Stewart
6dfa7683e4
Implement a timeout on fee rate requests (#4503)
* Switch to bitgo fee provider by default

* Implement 1 second timeout on retrieving fee rate
2022-07-12 19:49:31 -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
9930c964f7
sbt 1.7.1 (#4497) 2022-07-12 07:49:26 -05:00
Chris Stewart
9412170f09
2022 07 11 fix invalid csa neg (#4495)
* Implement incorrect signature handling correctly for OP_CHECKSIGADD

* Revert tests

* scalafmt
2022-07-12 06:58:09 -05:00
benthecarman
f8f4facdd1
Correctly parse TaprootKeyPath how they are represented (#4494) 2022-07-11 19:45:59 -05:00
Chris Stewart
5b44c074f1
Fix chmod: jre/bin/java: No such file or directory errors (#4493)
* Fix 'chmod: jre/bin/java: No such file or directory' errors

* Remove echos

* Remove duplicate quaratine in oracle-server-extra-startup-script.sh
2022-07-11 15:04:04 -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
Chris Stewart
b16a8ca6aa
Fix bug where we weren't checking if a TaprootKeyPath w/ annex has two stack elements (#4491) 2022-07-11 09:17:52 -05:00
Chris Stewart
1fc6d2a793
Upgrade sbt to 1.7.0 (#4490) 2022-07-11 08:05:22 -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
benthecarman
ef50becf1b
Enforce MAX_PUSH_SIZE for taproot (#4486) 2022-07-11 06:41:37 -05:00
benthecarman
db63b286b3
Fix hashtype check to correctly handle scala's conversion (#4487) 2022-07-11 06:40:40 -05:00
benthecarman
91a1c84a6f
Enforce minimalif for tapscripts (#4484) 2022-07-10 19:03:51 -05:00
benthecarman
990e344a49
Disallow OP_CMS in taproot (#4485) 2022-07-10 18:47:31 -05:00
benthecarman
cc45924ed8
Validate max ScriptNumber bytes in OP_CHECKSIGADD (#4483)
* Validate max ScriptNumber bytes in OP_CHECKSIGADD

* Use correct error

* Fix so we check stack length before getting sig bytes
2022-07-10 17:55:44 -05:00
Chris Stewart
3892fa23ef
Restrict hash types allowed by taproot signature verification (#4481)
* Restrict hash types allowed by taproot signature verification

* Comment and small refactor

* Re-ignore taproot tx tests failures

* scalafmt

* Address ben's code review

* Calculate hash after doing cheap checks
2022-07-10 16:49:05 -05:00
benthecarman
3821060e68
Schnorr sig parsing checks (#4482) 2022-07-10 16:00:38 -05:00
Chris Stewart
ec599a5c3d
Fix containsOpSuccess implementation (#4480)
* Fix containsOpSuccess implementation

* Cache opSuccessBytes
2022-07-10 13:54:47 -05:00
benthecarman
0397ca6c78
tapscript/sigopsratio_3 failing correctly (#4461) 2022-07-10 08:11:57 -05:00
Chris Stewart
84ce76e16c
Fix race condition related to sqlite3 database not being created before we access it (#4479) 2022-07-09 21:38:21 -05:00
Chris Stewart
1ae4d40dac
Implement rescancomplete callback (#4475)
* Implement rescancomplete callback

* Add walletName to payload

* Add to documentation
2022-07-09 16:23:15 -05:00
Chris Stewart
de935032ea
Make coreTestJVM.dependOn(testkit), add new multi core dispatcher to allow more cores for TaprootTTests to hopefully take load off the scala execution context (#4477) 2022-07-09 09:40:39 -05:00
rorp
414557effb
Add imported flag to the seed JSON (#4459)
* Add `imported` flag to the seed JSON

* scalafmt

* update `walletinfo`

* fix docs

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-07-08 18:55:47 -05:00
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
Chris Stewart
9985db3b41
Bump to jdk18 (#4471) 2022-07-08 14:56:03 -05:00
Chris Stewart
3ea4763cfc
Change 2.13.7 -> 2.13.8 in a few spots where I missed it (#4470) 2022-07-08 14:24:18 -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
Chris Stewart
2968a9ee15
Try to test out setup-java CI action (#4466)
* Try to test out setup-java CI action

* Attempt to fix
2022-07-08 13:43:17 -05:00
benthecarman
5df5bf6741
Add support for taproot keyspend PSBTs (#4462) 2022-07-08 09:08:19 -05:00
Chris Stewart
211339f344
Add static test vectors for Taproot (#3769)
* Add static test vectors for Taproot and the ability to parse those test cases

Add TaprootWitness data structure, get parsing working for first static test case

WIP: Distinguish between TaprootKeyPath and TaprootScriptPath

Remove invariants and make val to method in TaprootScriptPath so we can parse test cases

Add TaprootTestCase.{txSigComponents, programs} methods

Try to run test case

WIP

Wrap failure case in Try

Get first test case passing

Fix building of sig component for p2sh

WIP test case legacy/pk-wrongkey

Get more test cases passing

Move where MAX_PUSH_SIZE is checked for segwit

Get another test case passing

Add links to bitcoin core in test case

Fix stack parsing for witness

Get success test cases passing (without signature verification?)

Add failure test cases

Fix basic compile failures except in javascript projects

Get basic TaprootKeyPath parsing working from ScriptWitness

Get invariants implemented correctly for TaprootScriptPath

WIP

WIP

Get first taproot signature serialization test working

Get tagged hash working correctly

Rework test framework, get 2nd success test case passing

Get compile working with rebase

Implement computeTapleafHash with a unit test case

Add scaffolding of computing merkle root test case

Implement computeTaprootMerkleRoot() with a unit test

Implement computeTapTweakHash() with a unit test

WIP: checkTapTweak()

WIP

Implement computeTapTweakHash() unit test

Rebase onto master

Get verifyTaprootCommitment() passing unit test

Refactors to be more readable

* WIP: Tapscript signature checking

* Get taproot script path signature serialization working for unit test

* Add carve out for unknown public key types

* WIP: OP_CHECKSIGADD

* Add test case to detect annex and compute its hash

* Get test case passing when using upgradable public keys with an annex on the stack

* Fix missing pattern match

* Fix bug with tapscript SIGHASH_ALL and add test case

* Add check if taproot flag is enabled

* Get signature verification working with annex hash

* Implement correct handling of fail case for OP_CHECKSIGADD

* Get test case passing

* DRY

* Fix bug, now we only allow tapscript sig checking when pubkey is 32 bytes in size

* Refactor evalChecksigTapscript to use XOnlyPubKey

* Get signature serialization working with OP_CODESEPARATOR

* Get SIGHASH_ANYONECANPAY|SINGLE example working

* Fix bug in BIP342 impl where we don't count op codes if the version is taproot

* Fix OP_CODESEPARATOR bug

* Implement calculating of OP_CODESEPARATOR idx relative to other opcodes, not push operations

* Fix OP_CHECKSIG tapscript bug where we didn't push OP_FALSE onto stack in case of signature validation failure

* Add annex to TaprootKeyPath

* Get signature chcking working with tapscript keypath annex

* Cleanup test framework code a bit to avoid casting exceptions

* Implement handling of OP_SUCCESS

* WIP: Segwit v0 serialization with nonstandard sighash flag

* Fix hash bug in segwit v0 serialization

* WIP

* Fix bug where we weren't defaulting to SIGHASH_DEFAULT when using tapscript

* Add disabled opcodes to OP_SUCCESS case

* Fix parsing for witnesses in test case

* Get a SIGHASH_SINGLE test case working

* Clean up rebase

* Fix default hash type in TaprootKeyPath

* Implement opCodeSeparator counting that does NOT work when OP_CODESEPARATOR is is not executed inside of an OP_IF, otherwise is very simple for the base case

* Cherry-pick ben's commits & rebase

* Remove script size limit for tap scripts

* Fix incorrect handling of unassigned spk

* Fix invariant

* get correct test case failing

* WIP: SIGHASH_ALL_ANYONECANPAY test case

* Cleanup logging/println

* Refactors & fix regressions in some simple unit tests

* Remove logback in core to get the entire project compiling again

* Make TapscriptPath.hasAnnex() more robust against exceptions

* Add validation of XOnlyPubKey to control block

* Implement known leaf versions in the control block

* Add TaprootUnknownPath and UnknownControlBlock

* Fix rebase

* Fix interpreter bug where v0 segwit wasn't failing when a wrong program was used

* Cleanup println

* Clean up println pt2

* Re-enable -Xfatal-warnings

* Turn off logback-test.xml

* Parallelize taproot success test cases

* Try to bump timeout

* Optimization: Reduce number of intersections in ScriptInterpreter.run()

* Ben's code review

* Take ben's clean stack bugfix

Co-authored-by: benthecarman <benthecarman@live.com>
2022-07-07 14:53:28 -05:00
benthecarman
000e7a7930
Have FutureUtil.makeAsync handle thrown exceptions (#4458) 2022-07-07 14:26:38 -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
2b60bbb1c3
Remove .map() and use .foreach() with buffer in CryptoBytesUtil.toByteVector() (#4454) 2022-07-06 18:23:14 -05:00
Nadav Kohen
ae0962d7ed
Musig2 Implementation (#4418)
* An initial (not yet working) implementation with test

* Added custom (non-bip-340) verification for now

* Made KeySet a case class

* Got MuSig2 working with BIP340 verification passing

* Responds to Ben's review

* Fixed hash tags and added parital signature verification

* Added point multiplication that allows infinity and did some refactoring

* Refactored type defs into case classes

* Added tests for more signers and fixed single-party bug

* Added key aggregation test vectors from BIP

* Added nonce generation test vectors from BIP

* Added nonce aggregation test vectors from BIP

* Made nonce aggregation test vectors pass by having MultiNoncePub wrap SecpPoints

* Added remaining static test vectors from BIP

* Implements tweaking support and adds tests, including all of the remaining BIP tests

* Added factory objects for nonce types

* Refactored things into multiple files with renaming and restructuring

* Some minor renaming

* Introduced ParityMultiplier ADT to remove unneccesary computations

* Added scaladocs

* Added messages to invariants

* Fixed a typo

* Nonce generation now takes a SchnorrPublicKey instead of raw bytes

* Made point multiplication more robust

* Responded to Ben nits

* Added musig.md
2022-07-06 12:59:13 -05:00
benthecarman
eae16a52f8
Allow creating input info of simple OP_TRUE script pub key (#4450) 2022-07-06 10:52:06 -05:00
Chris Stewart
11f6c8f024
2022 07 05 UnknownControlBlock (#4449)
* Add TaprootUnknownPath and UnknownControlBlock

* Fix small bugs and make validation more resilient against exceptions

* Take ben's suggestion and use abstract class

* Fix bug in TaprootKeyPath's default hash type

* Fix comment
2022-07-05 19:26:28 -05:00