Commit graph

789 commits

Author SHA1 Message Date
Chris Stewart
124451f124
core: Add carveout for parsing 'nonstandard' string to ScriptType.NONSTANDARD (#5933) 2025-02-17 09:53:15 -06:00
Chris Stewart
0c8f86545e
core: Tighthen ScriptFactory.isValidAsm() checks (#5929)
* core: Tighthen ScriptFactory.isValidAsm() checks

* Fix CLTV/CSV constraints
2025-02-12 13:47:26 -06:00
Chris Stewart
12c1bdfe09
core: Tighten MultiSignatureScriptPubKey.isValidAsm() check (#5928)
* core: Tighten MultiSignatureScriptPubKey.isValidAsm() check

* Use string interpolation
2025-02-12 13:28:22 -06:00
Chris Stewart
b291e6d31a
core: Use splitAt() rather than duplicitvely slicing in ScriptParser.sliceConstant() (#5927) 2025-02-12 11:01:42 -06:00
Chris Stewart
31fbadaeb3
core: Remove ParsingHelper inside of ScriptParser (#5926) 2025-02-12 09:26:25 -06:00
Chris Stewart
adfeb7fd04
core: Use ByteVector.concat in RawTransactionInputParser.write() (#5925)
* core: Use ByteVector.concat in RawTransactionInputParser.write()

* Remove Vector concat
2025-02-11 16:42:39 -06:00
Chris Stewart
2a0b2e6238
core: Use ArrayBuffer instead of Vector inside of ScriptParser.parse() (#5922)
* core: Use ArrayBuffer instead of Vector inside of ScriptParser.parse() to avoid Array copies

* Avoid O(N) behavior in ArrayBuffer by always appending rather than prepending

* Use '+=' and '++=' operations as they don't require ineffeciently copying the collection

* Use ArrayBuffer rather than Vector to take advantage of operations in ArrayBuffer.addAll()
2025-02-10 07:36:38 -06:00
Chris Stewart
3c148ebf48
core: Don't unnecessarily encode to hex when parsing pushdata ops (#5923) 2025-02-09 15:34:05 -06:00
Chris Stewart
a1dc9fb59a
core: Optimize Int64.fromBytes(), add invariant that WitnessTransaction.fromBytes must have at least 4 bytes left over for the locktime (#5914) 2025-02-09 08:24:55 -06:00
Chris Stewart
8954e24422
core: Check maxPushSize limit inside of P2SHScriptSignature.isValidAsm() (#5921)
* core: Check maxPushSize limit inside of P2SHScriptSignature.isValidAsm()

* Make p2sh generator's script length be <= MAX_PUSH_SIZE
2025-02-08 16:44:23 -06:00
Chris Stewart
16e2ea2e92
core: Check if P2SHScriptSignature is push only when type checking (#5920) 2025-02-08 12:31:32 -06:00
Chris Stewart
c96df6a5eb
core: Optimize WitnessCommitment.isValidAsm() (#5918)
* core: Optimize WitnessCommitment.isValidAsm()

* scalafmt
2025-02-08 12:18:07 -06:00
Chris Stewart
618338b636
core: Use ByteVector.concat() to create transaction serialization (#5910)
Fix bug

scalafmt
2025-02-06 14:44:57 -06:00
Chris Stewart
752a7580b9
core: Make BytesUtil.writeCmpctSizeUInt() faster by avoiding BigInt allocations in CompactSizeUInt (#5909)
* core: Make BytesUtil.writeCmpctSizeUInt() faster by avoiding BitInt allocations in CompactSizeUInt

* Add invariant that CompactSizeUInt from long cannot be negative
2025-02-06 14:44:48 -06:00
Chris Stewart
4547052111
core: Optimize writing of block headers to avoid unncessay array copies (#5908) 2025-02-06 14:44:38 -06:00
Chris Stewart
6f9efafa91
core: Add ScriptNumber check in P2SHScriptSignature.isRedeemScript() (#5900) 2025-02-03 10:30:54 -06:00
Chris Stewart
73cf14d03e
core: Optimize ScriptParser.parseOperationByte() (#5899) 2025-02-01 13:21:18 -06:00
Chris Stewart
cda49a1fe4
Upgrade eclair to 0.11.0 (#5894)
* Upgrade eclair to 0.11.0

* Fix getinfo RPC call

* Remove Future parameters from EclairRpctestUtil.openAndConfirmChannel()

* Fix docs

* fix lnd hash
2025-01-29 07:06:04 -06:00
Chris Stewart
3bf7e6a39e
node: Use approprate ServiceIdentifer throughout node/ module (#5874) 2025-01-20 15:43:30 -06:00
Chris Stewart
07270ba8ca
core: Rework NetworkPayload traits to use Vector instead of Seq for methods (#5845) 2025-01-15 11:17:39 -06:00
Chris Stewart
b9616066f2
wallet: Refactor {UTXOHandlingApi,AccountHandlingApi,AddressHandlingApi} to use 'get' prefix rather than 'list' prefix for method names (#5828) 2025-01-01 09:41:21 -06:00
Chris Stewart
b1403155fc
wallet: Refactor AddressHandling to be account specific (#5825)
* wallet: Refactor AddressHandling to be account specific

* fix compile

* Add test

* Fix AddressType.fromPurpose() for HDPurpose.Multisig

* Fix nodeTest/test

* Don't use HDPurpose.Multisig in test

* Return None for HDPurpose.Multisig inside of AddressType.fromPurpose()
2024-12-30 06:48:47 -06:00
Chris Stewart
812f735110
node: Update DNS seeds, optimize PeerFinder.start() to start querying… (#5807)
* node: Update DNS seeds, optimize PeerFinder.start() to start querying dns seeds as early as possible

* Add new seeds, disable bad seeds

* scalafmt
2024-12-13 11:41:54 -06:00
Chris Stewart
d29dad4472
2024 12 11 issue 5625 (#5803)
* wallet: Get UTXOHandlingApi.listUtxos() to be account specific

* wallet: Add UTXOHandlingApi.{getBalance(), getUnconfirmedBalance(), getConfirmedBalance(), getBalance(account), getUnconfirmedBalance(account), getConfirmedBalance(account)}

* wallet: Remove listDefaultAccountUtxos(), use listUtxos() instead
2024-12-11 14:26:22 -06:00
Chris Stewart
98e89a6e93
2024 11 27 processtransaction flaky test (#5793)
* Fix TxUtil.isValidFeeRange()

* Make fee checks exclusive
2024-11-28 10:58:31 -06:00
Chris Stewart
fb318efe5e
core: Fix bug where we weren't checking for valid hash types in TaprootKeyPath.isValid() (#5780)
* core: Fix bug where we weren't checking for valid hash types in TaprootKeyPath.isValid()

* Fix TaprootWitness generator to use valid taproot hash types
2024-11-21 11:42:18 -06:00
Chris Stewart
b6cc97a663
2024 11 20 prevoutmap ordering (#5776)
* Add test case and add invariant to RawTxSigner.sign()

* Add InputInfo.sortPreviousOutputMap()

* Fix bug where we were sorting prevoutputmap when it didn't need to be sorted
2024-11-21 08:59:15 -06:00
Chris Stewart
d8ad023254
wallet: Implement taproot keypath handling in the wallet (#5772) 2024-11-20 11:16:27 -06:00
Chris Stewart
67bb3ceabd
2024 10 31 taproot signing (#5767)
* core: Implement TaprootKeyPath signing

* core: Rebase, remove isDummySignature

* Empty commit to run CI
2024-11-18 09:43:29 -06:00
Chris Stewart
80be2f5989
2024 11 15 partialsig typeparam (#5770)
* Add DigitalSignature type param to PartialSignature

* Remove isDummySignature
2024-11-18 09:15:33 -06:00
Chris Stewart
bb0e40f05b
2024 11 16 rm isdummysig (#5771)
* WIP: Remove isDummySignature

* Add ECDigitalSignature.LOW_R_SIZE, use it in ECDigitalSignature.dummyLowR

* Regenerated dlc_test.json and dlc_tx_test.json to add hash type to dummy ecdsa signatures in static test vectors

* Regenerated dlc_test.json and dlc_tx_test.json to add hash type to dummy ecdsa signatures in static test vectors

* Fix InputInfoTest maxWitnessLengths checks to be >=

* Fix docs
2024-11-17 07:45:24 -06:00
Chris Stewart
fc4802d4b0
core: Implement BIP86 (#5768)
* core: Implement BIP86

* Fix HDUtil.getXprivVersion()

* Fix WalletUnitTest
2024-11-14 11:16:25 -06:00
Chris Stewart
cccaa582bd
Add Sign.{schnorrSign(),schnorrSignWithNonce()} to Sign interface (#5754)
* Add Sign.{schnorrSign(),schnorrSignWithNonce} to Sign interface

* Add schnorrSignWithHashType()
2024-11-13 10:42:45 -06:00
Chris Stewart
c5d57de618
core: Fix divergence in behavior between TransactionSignatureSerializer.hashForSignature() methods (#5765) 2024-11-13 10:03:40 -06:00
Chris Stewart
17f965fd45
2024 11 09 schnorrsig hashtype (#5764)
* Add SchnorrDigitalSignature.hashTypeOpt, add DigitalSignature.{hashTypeOpt,appendHashType}

* Remove TaprootKeyPath.hashTypeOpt param
2024-11-09 12:52:45 -06:00
Chris Stewart
d255914765
refactor: Use ECDigitalSignature.appendHashType() throughout codebase (#5761) 2024-11-09 09:15:37 -06:00
Chris Stewart
4e8d5ecc7f
Add Sign.{signWithHashType(),signLowRWithHashType} (#5757)
* Add Sign.{signWithHashType(),signLowRWithHashType}, integrate it throughout the codebase

* Remove deprecated SignerUtils.doSign()
2024-11-07 09:07:41 -06:00
Chris Stewart
e69e1e5ad1
2024 10 31 digitalsignature (#5752)
* Add DigitalSignature, extend it with ECDigitaSignature,SchnorrDigitalSignature

* WIP: Remove EmptyDigitalSignature case object in favor of val

* Fix byte representation of ECDigitalSignature.emptyDigitalSignature

* Simplify names to ECDigitalSignature.{empty, dummy, dummyLowR}

* Fix docs
2024-11-01 11:46:26 -05:00
Chris Stewart
5187eee42a
core: Terminate rescan early when RescanStarted.stop() is called rather than wait for the rescan to complete (#5749)
Add checks if recursiveRescanP is completed before attempting to fail the Future

Fix potential deadlock in RescanStarted.stop(), add RescanState test

Add unit test to make sure we propagate exceptions correctly

Move RescanStateTest to jvm only

Link completeRescanEarlyP and blocksMatchedF together in RescanStateTest

Revert DLCWalletLoaderApi.scala
2024-10-30 16:47:39 -05:00
Chris Stewart
f75a52b521
Refactor TransactionProcessing.processTransaction() to use BlockHashWithConfs (#5744)
* Refactor TransactionProcessing.processTransaction() to use BlockHashWithConfs

Create WalletUtil.getBlockHashWithConfs(), use it in various places through the codebase

* Fix docs
2024-10-28 12:52:53 -05:00
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
dca2146647
2024 10 19 rm generic btree (#5725)
* Remove BinaryTree.scala

* Enable -Xlint:type-parameter-shadow

* Remove implicit usage in BinaryTreeDoubleSha256Digest
2024-10-19 15:13:01 -05:00
Chris Stewart
5f47fbe9ac
Use BinaryTreeDoubleSha256Digest inside of Merkle.scala rather than BinaryTree[DoubleSha256Digest] (#5724) 2024-10-19 08:33:12 -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
52c0625ba9
2024 09 30 dlcwallet has a wallet (#5692)
* refactor: Rework codebase so that DLCWallet has-a instance of Wallet rather than is-a via inheritance

* Fix cast

* Fix RescanHandling in DLCWallet

* Remove default implementation of WalletApi.broadcastTransaction()

* fix broadcast callback for DLCWallet

* Add DLCWalletDAOs.fromDLCAppConfig()

* Fix scaladoc for AddressHandlingApi.getUnusedAddress
2024-10-01 13:29:58 -05:00
Chris Stewart
13a895efe9
2024 09 24 simplify wallet (#5685)
* WIP: Simplify wallet

# Conflicts:
#	fee-provider/src/main/scala/org/bitcoins/feeprovider/FeeProviderFactory.scala

# Conflicts:
#	wallet/src/main/scala/org/bitcoins/wallet/Wallet.scala

* Get walletTest/test passing

* Remove WalletApi.{start(),stop()}

 Conflicts:
	core/src/main/scala/org/bitcoins/core/api/wallet/WalletApi.scala
	wallet/src/main/scala/org/bitcoins/wallet/Wallet.scala
	wallet/src/main/scala/org/bitcoins/wallet/WalletHolder.scala

* Cleanup RescanDLCTest

* Move checkRootAccount into AccountHandling.scala

* Fix rebase

* Fix docs
2024-09-27 13:40:29 -05:00
Chris Stewart
7caea21b6a
refactor: Move more methods out of WalletApi (#5681)
Remove more methods out of WalletApi

refactor: move getTransactionsToBroadcast to SendFundsHandlingApi
2024-09-26 16:22:30 -05:00
Chris Stewart
d17934f17f
Add SendFundsHandlingApi, remove HDWalletApi (#5680)
* Begin moving methods out of HDWalletApi

* Add SendFundsHandlingApi, remove HDWalletApi

* Fix docs

* Move makeOpReturnCommitment() to SendFundsHandlingApi

* Remove MockWalletApi

* Cleanup

* Fix RoutesSpec

* Revert logback-test.xml
2024-09-22 09:32:01 -05:00