💬 ajtowns commented on pull request "fuzz: enable running fuzz test cases in Debug mode":
(https://github.com/bitcoin/bitcoin/pull/32113#issuecomment-2743752847)
Related historical PRs: #31191 #24472
(https://github.com/bitcoin/bitcoin/pull/32113#issuecomment-2743752847)
Related historical PRs: #31191 #24472
💬 maflcko commented on pull request "fuzz: enable running fuzz test cases in Debug mode":
(https://github.com/bitcoin/bitcoin/pull/32113#issuecomment-2743792938)
I don't think the current patch will work. `G_FUZZING` influences more than just the behavior of the asserts/assumes. For example:
* POW checks are different
* The task runner is different
* The random seeding is different
So with this patch it looks like you are instead opting into non-reproducible fuzz behavior.
In debug mode the performance doesn't matter, so a possible alternative fix could be to just make G_FUZZING a runtime bool again?
(https://github.com/bitcoin/bitcoin/pull/32113#issuecomment-2743792938)
I don't think the current patch will work. `G_FUZZING` influences more than just the behavior of the asserts/assumes. For example:
* POW checks are different
* The task runner is different
* The random seeding is different
So with this patch it looks like you are instead opting into non-reproducible fuzz behavior.
In debug mode the performance doesn't matter, so a possible alternative fix could be to just make G_FUZZING a runtime bool again?
💬 ajtowns commented on pull request "cluster mempool: introduce TxGraph":
(https://github.com/bitcoin/bitcoin/pull/31363#issuecomment-2743809558)
ReACK 1601906941fa559ebbee7898453fa77f4606ad38
(https://github.com/bitcoin/bitcoin/pull/31363#issuecomment-2743809558)
ReACK 1601906941fa559ebbee7898453fa77f4606ad38
📝 instagibbs opened a pull request: "test: Add encodable PUSHDATA1 examples to feature_taproot"
(https://github.com/bitcoin/bitcoin/pull/32114)
Inspired by discussion in https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743492906 I made an example adding coverage I think is missing, with some extra commentary that might help future contributors (including myself when I forget how it works again).
Open for suggestions how we can make it more welcoming beyond this.
cc @darosior @EthanHeilman @sipa
(https://github.com/bitcoin/bitcoin/pull/32114)
Inspired by discussion in https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743492906 I made an example adding coverage I think is missing, with some extra commentary that might help future contributors (including myself when I forget how it works again).
Open for suggestions how we can make it more welcoming beyond this.
cc @darosior @EthanHeilman @sipa
💬 EthanHeilman commented on pull request "tests: improves tapscript unit tests":
(https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743854492)
@sipa
This PR doesn't contain any improvements to the python functional tests because they are excellent and did not require modifications to write clear tapscript tests. This PR is not intended to replace more complex tests. It is only intended to make simple unit tests easy to write and read.
In defense of simple unittests for tapscript:
1. **JSON script_test is the lowest effort way to add a test** Adding a JSON script_test for everything but tapscript is trivially easy. Given huma
...
(https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743854492)
@sipa
This PR doesn't contain any improvements to the python functional tests because they are excellent and did not require modifications to write clear tapscript tests. This PR is not intended to replace more complex tests. It is only intended to make simple unit tests easy to write and read.
In defense of simple unittests for tapscript:
1. **JSON script_test is the lowest effort way to add a test** Adding a JSON script_test for everything but tapscript is trivially easy. Given huma
...
💬 EthanHeilman commented on pull request "tests: improves tapscript unit tests":
(https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743856578)
@darosior
The static test cases are valuable, but they are multistep process to create and are hard to read. Imagine you write some code and get a test failure.
Would you rather the test failure be:
```JSON
{"tx": "f705d6e8019870958e85d1d8f94aa6d74746ba974db0f5ccae49a49b32dcada4e19de4eb5ecb00000000925977cc01f9875c000000000016001431d2b00cd4687ceb34008d9894de84062def14aa05406346", "prevouts": ["b4eae1010000000022512039f7e9232896f8100485e38afa652044f855e734a13b840a3f220cbd5d911ad5"],
...
(https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743856578)
@darosior
The static test cases are valuable, but they are multistep process to create and are hard to read. Imagine you write some code and get a test failure.
Would you rather the test failure be:
```JSON
{"tx": "f705d6e8019870958e85d1d8f94aa6d74746ba974db0f5ccae49a49b32dcada4e19de4eb5ecb00000000925977cc01f9875c000000000016001431d2b00cd4687ceb34008d9894de84062def14aa05406346", "prevouts": ["b4eae1010000000022512039f7e9232896f8100485e38afa652044f855e734a13b840a3f220cbd5d911ad5"],
...
💬 instagibbs commented on pull request "cluster mempool: introduce TxGraph":
(https://github.com/bitcoin/bitcoin/pull/31363#issuecomment-2743883179)
reACK 1601906941fa559ebbee7898453fa77f4606ad38
> Dropping the TxGraphImpl destructor body then causes segfaults (rather than a nice assertion failure).
Right, I got myself turned around on this thinking it was harder to achieve. I'd suggest adding coverage here or in a quick follow-up.
(https://github.com/bitcoin/bitcoin/pull/31363#issuecomment-2743883179)
reACK 1601906941fa559ebbee7898453fa77f4606ad38
> Dropping the TxGraphImpl destructor body then causes segfaults (rather than a nice assertion failure).
Right, I got myself turned around on this thinking it was harder to achieve. I'd suggest adding coverage here or in a quick follow-up.
💬 instagibbs commented on pull request "tests: improves tapscript unit tests":
(https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743888829)
> Would you rather the test failure be:
If you "walk" backwards to the functional test via the `comment` field it's ok, but I agree I would rather the tests cases be declared in the functional test rather than the dumped qa-assets version which lacks the context.
With regards to debugging, I found both this and https://github.com/bitcoin/bitcoin/pull/32114 similar in pain to review/fix, but I admit I've gotten used to gdb-attaching to bitcoind for functional tests regardless.
(https://github.com/bitcoin/bitcoin/pull/31640#issuecomment-2743888829)
> Would you rather the test failure be:
If you "walk" backwards to the functional test via the `comment` field it's ok, but I agree I would rather the tests cases be declared in the functional test rather than the dumped qa-assets version which lacks the context.
With regards to debugging, I found both this and https://github.com/bitcoin/bitcoin/pull/32114 similar in pain to review/fix, but I admit I've gotten used to gdb-attaching to bitcoind for functional tests regardless.
💬 theStack commented on pull request "contrib: add tool to convert compact-serialized UTXO set to SQLite database":
(https://github.com/bitcoin/bitcoin/pull/27432#issuecomment-2743896375)
> Curious about policy on tooling since I'm currently working on UTXO analysis: it would be nice to refactor the (1) reading of the compressed UTXO format and (2) storing it in SQL format into separate components, so there's a reference for reading dumped UTXO sets people can readily use (e.g. `import CompressedUTXOReader from contrib/utxo-tools`). Or should code like that not be a part of Core?
If we do that, I think it would make most sense to move some routines or (new) classes to the func
...
(https://github.com/bitcoin/bitcoin/pull/27432#issuecomment-2743896375)
> Curious about policy on tooling since I'm currently working on UTXO analysis: it would be nice to refactor the (1) reading of the compressed UTXO format and (2) storing it in SQL format into separate components, so there's a reference for reading dumped UTXO sets people can readily use (e.g. `import CompressedUTXOReader from contrib/utxo-tools`). Or should code like that not be a part of Core?
If we do that, I think it would make most sense to move some routines or (new) classes to the func
...
📝 Sjors opened a pull request: "Rust tool to import bip39 mnemonic"
(https://github.com/bitcoin/bitcoin/pull/32115)
Since we're probably not going to support bip39 mnemonics in the wallet itself, but it's often requested feature, this PR provides a simple Rust utility to import one.
This puts the utility in `share` so it's included in releases. Alternatively we could make a separate repo akin to HWI.
Usage (first bip39 [test vector](https://github.com/trezor/python-mnemonic/blob/master/vectors.json)):
```sh
cd share/wallet
cargo run -- import bip39
Specify network: 'main' (default) or 'test' (te
...
(https://github.com/bitcoin/bitcoin/pull/32115)
Since we're probably not going to support bip39 mnemonics in the wallet itself, but it's often requested feature, this PR provides a simple Rust utility to import one.
This puts the utility in `share` so it's included in releases. Alternatively we could make a separate repo akin to HWI.
Usage (first bip39 [test vector](https://github.com/trezor/python-mnemonic/blob/master/vectors.json)):
```sh
cd share/wallet
cargo run -- import bip39
Specify network: 'main' (default) or 'test' (te
...
💬 Sjors commented on pull request "wallet: add `seeds` argument to `importdescriptors`":
(https://github.com/bitcoin/bitcoin/pull/27351#issuecomment-2743948319)
I wrote a little rust-bitcoin helper to generate a `importdescriptors` incantation for bip39 mnemonics, see #32115. If that makes it in, it could be expanded to handle codex32.
(https://github.com/bitcoin/bitcoin/pull/27351#issuecomment-2743948319)
I wrote a little rust-bitcoin helper to generate a `importdescriptors` incantation for bip39 mnemonics, see #32115. If that makes it in, it could be expanded to handle codex32.
💬 Sjors commented on issue "support BIP39 mnemonic in descriptors":
(https://github.com/bitcoin/bitcoin/issues/19151#issuecomment-2743950601)
#32115 may be useful
(https://github.com/bitcoin/bitcoin/issues/19151#issuecomment-2743950601)
#32115 may be useful
📝 theStack opened a pull request: "contrib: refactor: dedup deserialization routines in utxo-to-sqlite script"
(https://github.com/bitcoin/bitcoin/pull/32116)
The compact-size/varint/amount deserialization routines already exist in the functional test framework (with the advantage of having proper unit tests executed in CI), so we can just import them from there instead of leaving duplicated code in the repository.
(https://github.com/bitcoin/bitcoin/pull/32116)
The compact-size/varint/amount deserialization routines already exist in the functional test framework (with the advantage of having proper unit tests executed in CI), so we can just import them from there instead of leaving duplicated code in the repository.
🤔 darosior reviewed a pull request: "test: Add encodable PUSHDATA1 examples to feature_taproot"
(https://github.com/bitcoin/bitcoin/pull/32114#pullrequestreview-2706703935)
Nice. Concept ACK on having an example there.
(https://github.com/bitcoin/bitcoin/pull/32114#pullrequestreview-2706703935)
Nice. Concept ACK on having an example there.
💬 darosior commented on pull request "Rust tool to import bip39 mnemonic":
(https://github.com/bitcoin/bitcoin/pull/32115#issuecomment-2744013541)
> This puts the utility in `share` so it's included in releases
Does this mean the Guix build will now have to bootstrap a Rust compiler?
(https://github.com/bitcoin/bitcoin/pull/32115#issuecomment-2744013541)
> This puts the utility in `share` so it's included in releases
Does this mean the Guix build will now have to bootstrap a Rust compiler?
💬 Sjors commented on pull request "Rust tool to import bip39 mnemonic":
(https://github.com/bitcoin/bitcoin/pull/32115#issuecomment-2744136043)
@darosior no, the user has to `cargo run` it themselves. It's similar to the RPC auth script we ship, which also doesn't include Python itself: https://github.com/bitcoin/bitcoin/tree/master/share/rpcauth
(https://github.com/bitcoin/bitcoin/pull/32115#issuecomment-2744136043)
@darosior no, the user has to `cargo run` it themselves. It's similar to the RPC auth script we ship, which also doesn't include Python itself: https://github.com/bitcoin/bitcoin/tree/master/share/rpcauth
💬 murchandamus commented on issue "BnB untested/unused condition in UTXO exclusion optimization":
(https://github.com/bitcoin/bitcoin/issues/32047#issuecomment-2744164157)
> In summery, two UTXOs are equivalent if both value and weight are the same, and if value is the same but weight is different, prefer the UTXO with lower weight since waste score is a derivative of weight.
Close, but there is a subtlety here. If we were sorting by effective_value and tie-breaking fee or weight, we would always be preferring lower weight, but instead, we tie-break on waste. That means that we will prefer lower weight if `fee_rate` is higher than `long_term_fee_rate`, but we wi
...
(https://github.com/bitcoin/bitcoin/issues/32047#issuecomment-2744164157)
> In summery, two UTXOs are equivalent if both value and weight are the same, and if value is the same but weight is different, prefer the UTXO with lower weight since waste score is a derivative of weight.
Close, but there is a subtlety here. If we were sorting by effective_value and tie-breaking fee or weight, we would always be preferring lower weight, but instead, we tie-break on waste. That means that we will prefer lower weight if `fee_rate` is higher than `long_term_fee_rate`, but we wi
...
💬 murchandamus commented on pull request "fuzz: split `coinselection` harness":
(https://github.com/bitcoin/bitcoin/pull/31870#issuecomment-2744215852)
Oh I had missed this, and noticed it via the new fuzz target corpora. Great idea!
(https://github.com/bitcoin/bitcoin/pull/31870#issuecomment-2744215852)
Oh I had missed this, and noticed it via the new fuzz target corpora. Great idea!
💬 sipa commented on pull request "Rust tool to import bip39 mnemonic":
(https://github.com/bitcoin/bitcoin/pull/32115#discussion_r2008187157)
86, no?
(https://github.com/bitcoin/bitcoin/pull/32115#discussion_r2008187157)
86, no?
💬 Sjors commented on pull request "Rust tool to import bip39 mnemonic":
(https://github.com/bitcoin/bitcoin/pull/32115#discussion_r2008203657)
Indeed, fixed.
(https://github.com/bitcoin/bitcoin/pull/32115#discussion_r2008203657)
Indeed, fixed.