forked from btcsuite/btcd
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bump to v0.24.0 #5
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this commit, we fix an inadvertent mutation bug that would at times cause the private key passed into the tweak function to actually be *modified* in place. We fix this by accepting the value instead of a pointer. The actual private key struct itself contains no pointer fields, so this is effectively a deep copy via dereference. We also add a new unit test that fails w/o this change, to show that the private key was indeed being modified.
This commit adds the pk option to NonceGen and makes it mandatory. Reference: jonasnick/bips@a89f857
This commit adds the public key to the sec nonce and ensures that we're signing with the right key. Reference: jonasnick/bips#74
This commit adds a check that the public key of the private key that is passed to the Sign function is included in the slice of public keys. Reference jonasnick/bips@ea47d52
This commit adds a GetTxFee method to the psbt.Packet structure. The method returns the PSBT's fee.
btcutil/psbt: add method Packet.GetTxFee
txscript: modify TweakTaprootPrivKey to operate on private key copy
This is a fix similar to btcsuite#1905. We'll always make a copy of the key in the local scope before passing it around elsewhere. Depending on the parity of the public key, the private key itself might need to be negated. A similar test is added here that fails without the patch to the signature.go file.
btcec/schnorr: use private key copy for BIP-340 signatures
Musig2: Update to 1.0.0.rc2
In this commit, we fix the `BenchmarkPartialVerify` test. When we moved to musig 1.0, we stopped requiring the input as an x-only key. So we need to remove the round trip serialization to force the key to be x-only.
btcec/schnorr/musig2: fix BenchmarkPartialVerify
base58: fix decoding issue
Alpine 3.12 is EOL and contains multiple vulnerabilites. Deploying on Alpine 3.16 works fine.
As DockerHub image non existant, update the documentation for Compose to build your own image instead.
chainhash: JSON marshal hash as string
Update Dockerfile to Alpine 3.16
fix memory leak in connmanager caused by: * pending entries are not removed on error * new connection always allocates new struct * capture id value for callback Fix by calling Remove in both handleFailedConn callbacks to delete the item from the pending hash map Signed-off-by: Christopher Hall <hsw@bitmark.com>
minor changes to increase readability.
In this commit, we fix a bug in RawTxInTaprootSignature that would cause the function to not properly apply the sighash flag for non-default sighash signatures. The logic would end up applying `0x00` as a mask, which will always be `0x00` on the other end. The RawTxInTapscriptSignature function was correct, though it had the ordering switched as it applies the sighash if the type doesn't equal default.
…ignature In this commit, we add tests for the public functions used to generate keyspend and tapscript signatures. Without the prior commit, these tests will fail as the keyspend function won't properly add the sighash bytes for things that aren't sighash default.
…nd-bug-fix Sighash taproot keyspend bug fix
btcutil: update to chaincfg/chainhash/v1.1.0
* fix: enhance code comments
In this commit, we update the top-level btcd package to use the latest version of btcutil and also the chainhash package. With this version bump, we can now use the new optimized dsha256 routine where applicable. With this commit, I've covered most of the areas we'll hash an entire transaction/block/header, but we may want to optimize some other areas further, in particular, the witness sighash calc.
…sighash In this commit, we optimize the sighash calc further by writing directly into the buffer used for serialization by the sha256.New() instance rather than to an intermediate buffer, which is then write to the hash buffer.
We can write direly into the hash writer vs serializing into a buffer, then writing that into the hash writer.
We used to use a lot of small buffers for serialization, but now we'll use one buffer large enough, and slice into it when needed. `` name old time/op new time/op delta CalcWitnessSigHash-8 31.5µs ± 0% 29.2µs ± 0% -7.05% (p=0.000 n=10+10) name old alloc/op new alloc/op delta CalcWitnessSigHash-8 19.9kB ± 0% 18.5kB ± 0% -7.14% (p=0.000 n=10+10) name old allocs/op new allocs/op delta CalcWitnessSigHash-8 801 ± 0% 445 ± 0% -44.44% (p=0.000 n=10+10) ```
…c-2023 multi: update main package and btcutil to chainhash/v1.1.0, use optimized dsha256
btcutil.Block caches the serialized raw bytes of the block during ibd. This serialized block bytes includes the serialized tx. The current tx hash generation will re-serialized the de-serialized tx to create the raw bytes and it'll only then hash that. This commit changes the code so that the re-serialization never happens, saving tons of cpu and memory overhead.
This commit adds a new NextAvailablePortForProcess function that takes a process ID and then assures unique (non-occupied) port numbers are returned per process. This uses a temporary file that contains the latest used port and a secondary temporary lock file to assure only a single goroutine can request a new port at a time. The GenerateProcessUniqueListenerAddresses is intened to be used as a package-level override for the ListenAddressGenerator variable. We don't use it by default to make sure we don't break any existing assumptions.
rpctest: integration test harness fixes
…txhash btcutil: reuse serialized tx during TxHash
wire: only borrow/return binaryFreeList buffers at the message level
In this commit, we fix the following race condition: ``` ================== WARNING: DATA RACE Write at 0x00c000216018 by goroutine 31: github.com/btcsuite/btcd/rpcclient.(*Client).wsReconnectHandler() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:736 +0x2aa github.com/btcsuite/btcd/rpcclient.New·dwrap·13() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:1496 +0x39 Previous read at 0x00c000216018 by goroutine 29: github.com/btcsuite/btcd/rpcclient.(*Client).doDisconnect() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:1079 +0x247 github.com/btcsuite/btcd/rpcclient.(*Client).Disconnect() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:1111 +0x47 github.com/btcsuite/btcd/rpcclient.(*Client).wsInHandler() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:491 +0x1eb github.com/btcsuite/btcd/rpcclient.(*Client).start·dwrap·11() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:1181 +0x39 Goroutine 31 (running) created at: github.com/btcsuite/btcd/rpcclient.New() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:1496 +0xd77 github.com/btcsuite/btcd/rpcclient.makeClient() /home/runner/work/btcd/btcd/rpcclient/chain_test.go:268 +0x1f9 github.com/btcsuite/btcd/rpcclient.TestClientConnectedToWSServerRunner.func2() /home/runner/work/btcd/btcd/rpcclient/chain_test.go:164 +0x47 testing.tRunner() /opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1259 +0x22f testing.(*T).Run·dwrap·21() /opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1306 +0x47 Goroutine 29 (finished) created at: github.com/btcsuite/btcd/rpcclient.(*Client).start() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:1181 +0x2e4 github.com/btcsuite/btcd/rpcclient.New() /home/runner/work/btcd/btcd/rpcclient/infrastructure.go:1493 +0xc51 github.com/btcsuite/btcd/rpcclient.makeClient() /home/runner/work/btcd/btcd/rpcclient/chain_test.go:268 +0x1f9 github.com/btcsuite/btcd/rpcclient.TestClientConnectedToWSServerRunner.func2() /home/runner/work/btcd/btcd/rpcclient/chain_test.go:164 +0x47 testing.tRunner() /opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1259 +0x22f testing.(*T).Run·dwrap·21() /opt/hostedtoolcache/go/1.17.5/x64/src/testing/testing.go:1306 +0x47 ``` This arises as in `wsReconnectHandler`, the mutex isn't held while the `conn` pointer is modified.
build: create btcd v0.24 release branch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
New release of btcd. This PR updates our fork. Specifically by merging in the tag
git merge v0.24.0
Changes
handleSendPostMessage
doDisconnect