Commit Graph

118 Commits

Author SHA1 Message Date
Chris Stewart
602725174f
Pull over simple syntax changes for scala3 pt2 (#5720)
* Pull over simple syntax changes for {nodeTest,keyManager,keyManagerTest,chainTest,bitcoind,bitcoindRpcTest,appServer,appServerTest,tor,zmq} from #5713

* Fix tor/compile
2024-10-17 14:14:32 -05:00
Chris Stewart
90203b295b
Use default play-json json serialization macros for bitcoind json classes that cause issues with scala3 (#5718) 2024-10-16 16:38:00 -05:00
Chris Stewart
38f0f4d692
2024 10 07 v28 bitcoind (#5696)
* Update to bitcoind v28

* Add macOS arm64 hash

* Add 28.0 version for windows

* Fix windows hash

* Replace 'port' with 'bind' in bitcoin.conf

* Fix BitcoindConfig.bind, add -deprecatedrpc=warnings

* Add version specific warnings handling for V28

* Add pattern matching based on version to support new json format for warnings fields in Info RPCs

* Fix pattern match on V28

* Remove infinite loop w/ 'getnetworkinfo' when determing the version of a BitcoindRpcClient

* Pin lndRpcTest to bitcoind v27 until v28 is supported

* Add mempoolconflicts to 'gettransaction' RPC

* init 'gethdkeys' rpc

* WIP: createwalletdescriptor

* Get createwalletdescriptor test passing

* Revert files
2024-10-13 09:05:14 -05:00
Chris Stewart
4471f74ccf
Add error field toImportDescriptorResult, move BitcoindException to app-commons (#5705)
* Add error field to ImportDescriptorResult, move BitcoindException to app-commons

* Fix docs
2024-10-12 09:49:42 -05:00
Chris Stewart
0843d7ecb5
Remove -port and -rpcport settings for bitcoind on startup for tests (#5702)
* Remove -port and -rpcport settings for bitcoind on startup for tests

* Revert logback-test.xml
2024-10-10 10:18:42 -05:00
Chris Stewart
38850d22e3
2024 07 31 bitcoind callbacks (#5631)
* Add NodeApiCallbacks

* Add BitcoindCallbacks

* Add BitcoindRpcAppConfig

* fix docs

* Add helper method for construction

* Add helper constructor method to avoid explicitly passing BitcoindRpcAppConfig parameter to BitcoindRpcClient when we have a BitcoindInstanceLocal

* Fix docs
2024-08-02 07:43:24 -07:00
Chris Stewart
c8266cfb51
Implement getrawmempool verbose (#5573)
* Implement getrawmempool verbose

* Clear mempool before test
2024-05-08 15:19:34 -05:00
Chris Stewart
5d0056a01f
Add missing fields to GetMemPoolInfoResult (#5572)
* Add missing fields to GetMemPoolInfoResult

* Fix test when running entire MempoolRpcTest suite
2024-05-07 14:38:20 -05:00
Chris Stewart
6543b261c4
Implement bitcoind RPC 27.0 (#5552)
* Add bitcoind 27.0

* Fix linux, windows hashes

* Add BitcoindV27RpcClient

* Switch BitcoindVersion.newest = V27

* Try downgrading lndRpcTest to use V26 in tests

* Make pattern matching against 'bitcoind --version' more resilient for new versions of bitcoind

* Add awaitDisconnect() to BitcoindRpcTestUtil.disconnectNodes(), fix flaky v2 connection in unit test
2024-04-28 13:16:39 -05:00
Chris Stewart
7ef6086673
Implement bitcoind RPC 26.x (#5550)
* Get build started for 26.1

* Start introducing v26 data structures

* Switch BitcoindVersion.newest = V26

* Fix GetTxOutSetInfoResult to use hash_serialized_3

* Fix WalletRpcTest

* Refactor PeerInfoResponse to add transport_protocol_type and session_id fields in v25

* Add ServiceIdentifier.NODE_P2P_V2, add support for v2transport to addnode, add default config setting for bitcoind to have v2transport=1 in test framework, add unit test to make sure we can establish a v2 connection

* Remove V20AssortedRpc

* Add loadtxoutset

* Implement getchainstates

* Add getprioritisedtransactions

* Add getaddrmaninfo

* Add importmempool

* Cleanup println
2024-04-27 14:51:45 -05:00
Chris Stewart
5dc5cca9cf
2024 04 24 rm v24 (#5549)
* WIP

* Fix simulaterawtransaction test

* Remove unneeded AdressInfoResult data strutures for versions of bitcoind pre-v21

* Remove v24

* Remove support for v24 bitcoind from bitcoind-rpc.sbt

* Fix tests

* Fix UtilRpcTest

* Fix teardown of bitcoind

* scalafmt
2024-04-26 11:58:55 -05:00
Chris Stewart
d23d7851b8
rework bitcoind-rpc to take a walletName parameter that is a String (#5545)
* rework bitcoind-rpc to take a wallet name parameter that is a String rather than Option[String]

* Fix docs
2024-04-26 08:09:28 -05:00
Chris Stewart
1d42de0977
Make wallet.dat be the default wallet name for bitcoind in our codebase (#5543)
* Make 'wallet.dat' be the default wallet name in our codebase

* Fix MultiWalletRpcTest
2024-04-25 06:51:39 -05:00
Chris Stewart
23e32652f3
Implement bitcoind 25.2 (#5540)
* Implement downloading of bitcoind 25.2

* Add aarch64 hash

* Update x86 macos hash, windows hash

* WIP: scanblocks RPC

* Get in progress scanblocks state working

* Get scanblocks start request working

* Fix BitcoindRpcTestUtil.signRawTransaction

* Implement scanblocks abort

* Remove println

* Switch newest version of bitcoind to v25

* Fix BitcoindV25RpcClient.version

* move decodescript test to WalletRpcTest, rework decodescript test to use descriptors,  fix LoadWalletResult

* Empty commit to run CI

* sendrawtransaction maxburnamount param

* Modify testmempoolaccept RPC return type to have two new fields for fee information

* Add test for base too
2024-04-23 17:26:23 -05:00
Chris Stewart
68d267ab8c
2024 04 21 bitcoindrpc testfixtures (#5539)
* Get MiningRpcTest, MessageRpcTest using test fitures

* Remove MultisigRpcTest, move test case to WalletRpcTest

* WIP: P2PRpcTest with fixtures

* Get P2PRpcTest working, comment out test cases that require unconnected nodes for now

* upgrade UtilRpcTest, RawTransactionRpcTest to use test fixture

* Upgrade UTXORpcTest to use test fixtures

* Create DisconnectedPeersRpcTest, create disconnected test fixtures for it

* Remove PreciousBlockRpcTest suite, move test into DisconnectedPeersRpcTest

* Remove UtilRpcTest, move test cases into other files

* Fix unit tests

* Fix rebase
2024-04-22 07:47:00 -05:00
Chris Stewart
f7adb6264e
Remove support for 23.x of bitcoind (#5538)
* Remove support for 23.x of bitcoind

* Remove duplicate test

* Fix compile

* Move unit bech32m unit test earlier in WalletRpcTest

* Make wallet name unique in WalletRpcTest
2024-04-22 05:50:32 -05:00
Chris Stewart
7b3463229f
2024 04 21 Remove BitcoindV22RpcClient (#5537)
* WIP: Remove v22

* Remove TestMempoolAcceptRpc, move it into MempoolRpc

* Remove downloading of bitcoind v22 from bitcoind-rpc.sbt

* move test case above where other test cases create wallets

* Remove duplicate test

* Remove duplicate test
2024-04-21 12:24:09 -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
9442dba217
Remove support for v21 of bitcoind (#5496)
* Remove support for v21 of bitcoind

* WIP: Remove deprecated rpcs wit legacy wallets

* WIP: Work up to importdescriptor

* Get low-r test case passing

* Simplify test case

* Remove BitcoindV21RpcClientTest and move test cases to BitcoindV24RpcClientTest

* Remove RpcTransactionRpcTest that only works on legacy wallet

* Fix MempoolRpcTest

* Delete MultisigRpcTest that depends on legacy wallet

* Get WalletRpcTest passing, ignore keypoolrefill test case for now until https://github.com/bitcoin/bitcoin/issues/29924 is resolved
2024-04-20 16:57:30 -05:00
Chris Stewart
c01793dc89
Implement importdescriptors RPC (#5534) 2024-04-19 17:11:26 -05:00
Chris Stewart
e143792fb9
2024 04 16 bitcoindrpc descriptor (#5530)
* Integrate Descriptor class into 'getdescriptorinfo' RPC

* WIP: Invalid checksum that is valid according to bitcoin core

* Add descriptor.py in comments

* Get deriveaddresses RPC working with descriptors

* Parse descriptors in DescriptorsResult to Descriptor data type
2024-04-18 11:46:33 -05: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
Scala Steward
d7037ede28
Update scala-library to 2.13.12 (#5235)
* Update scala-library to 2.13.12

* Fix compiler errors on scala 2.13.12

---------

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2023-09-12 10:45:17 -05:00
Chris Stewart
3db663a387
Remove v20 bitcoind support (#4992)
* Remove v20 bitcoind support

* Remove v20 bitcoind from downloadBitcoind task

* Remove duplicate test
2023-02-19 13:28:46 -06:00
Chris Stewart
af349d2179
Remove support for v19 of bitcoind (#4991)
* Remove support for v19 of bitcoind

* Remove downloading v19 bitcoind inside of bitcoind-rpc.sbt

* Clean up docs

* Move unit tests in BitcoindV19RpcClientTest into other test files so we don't remove them, these rpcs are supported in future versions of bitcoind
2023-02-16 10:27:56 -06:00
Chris Stewart
9a80644509
Fix UTXORpcTest flakiness (#4986) 2023-02-12 15:54:30 -06:00
benthecarman
332893b67b
Add generateblock bitcoind rpc (#4906)
This lets us generate a block with a transaction without having to
broadcast to the mempool first, useful for testing non-standard txs as
well as wallets without mempool support
2022-12-05 09:03:59 -06:00
benthecarman
f4244d7a0e
Add bitcoind v24 (#4902)
* Add bitcoind v24

* Make newest bitcoind version v23 for now
2022-11-28 08:43:49 -06:00
Chris Stewart
dbd54ca55f
2022 11 11 sbt 1.8.0 (#4883)
* upgrade to scala 2.13.10

* Remove 2.13.8 from CI

* Try upgrading to sbt 1.8.0-RC1 to see if build works on CI

* Try to update scoverage to 2.0.6

* Upgrade sbt native packager to 1.9.11

* Upgrade to sbt 1.8.0
2022-11-16 12:05:59 -06:00
Chris Stewart
746635a551
Remove v18 from bitcoind-rpc (#4845)
* Remove v18 from bitcoind-rpc

* Remove v18 from bitcoind downloads

* WIP

* Fix submitheader RPC test with v23 bitcoind

* Have join psbt handle randomizing input & output ordering

* Cleanup

Co-authored-by: benthecarman <benthecarman@live.com>
2022-10-23 08:59:18 -05:00
benthecarman
1d1af1d52e
Add generate helper function for bitcoind (#4852) 2022-10-19 14:22:30 -05:00
Chris Stewart
2482eb939a
remove v17 bitcoind rpc (#4822)
* remove v17

* fix one error in sign a raw transaction

* try to get BlockchainRpcTest working

* fix MiningRpcTest

* WIP

* Get RawTransactionRpcTest working with v21 of bitcoind

* Fix MiningRpcTest

* Remove println

* Remove prune unit test as i cannot get it to pass on regtest
2022-10-16 12:47:43 -05:00
Chris Stewart
9f53b4e572
Add address type to createmultisig bitcoind rpc (#4828)
* Add address type to createmultisig rpc

* Fix tests

* Fix UtilRpcTests
2022-10-13 15:55:00 -05:00
benthecarman
9179fe1794
Add way for to handle utxo not existing with bitcoind.getTxOut (#4797) 2022-09-23 06:18:31 -05:00
benthecarman
9518826882
Add blockheight to bitcoind's ListTransactionsResult (#4795) 2022-09-22 17:15:51 -05:00
Chris Stewart
ea123139d9
Remove support for bitcoind v16 rpc client (#4634) 2022-08-21 08:17:16 -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
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
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
Chris Stewart
9769fbcbb6
Add TaprootWitness, new methods to XOnlyPubKey (#4394)
* Add TaprootWitness, new methods to XOnlyPubKey

* Address codereview
2022-06-14 20:27:01 -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
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
rorp
a6898defe2
Support for Bitcoin Core v22 (#3834)
* Support for Bitcoin Core v22

* respond to the PR comments
2021-11-19 13:58:27 -06:00
Chris Stewart
af96843e69
Try to fix race condition when shutting down bitcoind connection pool (#3665)
* Try to fix race condition when shutting down bitcoind connection pool and seeing if bitcoind is still alive

* Add cases for BitcoindInstanceRemote and BitcoindInstanceLocal when determining isStartedF
2021-09-14 15:14:20 -05:00
Shruthii RG
d53f164478
BitcoindRpcClient Improvements (#3600)
* Changes in bitcoind-rpc module

* Get things compiling

* Implement BitcoindInstanceRemote & BitcoindInstanceLocal

* Fix doc compile

* bitcoind remote instance test

* rename BitcoindInstanceRemote

* Scalafmt

* Applied requested changes(except one)

* implemented fromConfigFile and fromDataDir for BitcoindInstanceRemote

* implemented fromNetworkVersion

* BitcoindInstanceRemote changes

* Get things compiling

* Add implict type parameter to InstanceFactory

* Fix recursive reference of version <-> getNetworkInfo

* bug fix

* bug fix 2

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2021-09-07 08:49:01 -05:00
Nadav Kohen
78f4dfb8c6
Pubkey Refactor (#2936)
* Removed ExecutionContext from ECKey

* Refactored ECPublicKey to remove compression state and introduced ECPublicKeyBytes to handle cases where serialization of input is important

* Fixed the rest of bitcoin-s so that it passes all tests

* Made all ECKeys into case classes

* Successfully added isFullyValid invariant to ECPublicKey!

* Fixed docs

* Added scaladocs and fixed a RpcPsbtResult bug

* Reject private keys of length < 32 and fix WIF parsing bug
2021-05-06 13:19:52 -05:00
Chris Stewart
e064cd77ea Fix missing teardown code for MultiWalletRpcTest (#2946) 2021-04-23 09:31:12 -05:00
Chris Stewart
bb379ecfcf Add docs for using CachedBitcoind (#2880)
* Add docs for using CachedBitcoind

* revert paths in testkit.md to be references to the appropriate scaladoc
2021-04-09 09:43:22 -05:00
benthecarman
d726c498d0 Have BitcoindV21RpcClientTest wait for indexes to sync (#2855) 2021-04-05 07:33:05 -05:00