💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182977847)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167821634
> It took me a while to figure out what's going on here with the recursive `Construct` calls and the lambda that's passed along. How about instead of passing a lambda along use a `bool` template argument like so:
Thanks, that's much better! Took suggestion jsut renaming argument to "Failure"
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182977847)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167821634
> It took me a while to figure out what's going on here with the recursive `Construct` calls and the lambda that's passed along. How about instead of passing a lambda along use a `bool` template argument like so:
Thanks, that's much better! Took suggestion jsut renaming argument to "Failure"
💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182977232)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167765212
> Maybe it would be a bit clearer to use `(O&& other)` here?
Sure, changed this.
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182977232)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167765212
> Maybe it would be a bit clearer to use `(O&& other)` here?
Sure, changed this.
💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978470)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167765212
> Same here, I'd say `void MoveConstruct(Result<OT, OF>&& other)` is a bit clearer
Sure, changed
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978470)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167765212
> Same here, I'd say `void MoveConstruct(Result<OT, OF>&& other)` is a bit clearer
Sure, changed
💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978708)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167981676
> nit: I don't think the `if (!src.m_info->errors.empty())` check is necessary.
It's not strictly necessary, but it avoids allocating an ErrorInfo object in the common case where there are no errors or warnings. Since this is called whenever result objects are moved, it's good to avoid unnecessary allocations here.
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978708)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1167981676
> nit: I don't think the `if (!src.m_info->errors.empty())` check is necessary.
It's not strictly necessary, but it avoids allocating an ErrorInfo object in the common case where there are no errors or warnings. Since this is called whenever result objects are moved, it's good to avoid unnecessary allocations here.
💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182977109)
> I'd add a check somewhere to ensure that the size of the Result is as claimed in the commit message, something like that:
>
> ```c++
> static_assert(sizeof(util::Result<int>) == sizeof(void*)*2);
> static_assert(sizeof(util::Result<void>) == sizeof(void*));
> ```
Thanks, added to result_tests.cpp
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182977109)
> I'd add a check somewhere to ensure that the size of the Result is as claimed in the commit message, something like that:
>
> ```c++
> static_assert(sizeof(util::Result<int>) == sizeof(void*)*2);
> static_assert(sizeof(util::Result<void>) == sizeof(void*));
> ```
Thanks, added to result_tests.cpp
💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978551)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174414223
> move constructors should usually be `noexcept`, but then all methods it uses also have to be `noexcept`.
It would be possible to add a constructor that move constructs `Result<T, F>` from `Result<OT, OF>` and is noexcept. For this to work, move constructing `T` from `OT` would have to be noexcept, and `F` and `OF` types would need to be identical so `unique_ptr<ErrorInfo<F>>` could be moved without any allocations.
...
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978551)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174414223
> move constructors should usually be `noexcept`, but then all methods it uses also have to be `noexcept`.
It would be possible to add a constructor that move constructs `Result<T, F>` from `Result<OT, OF>` and is noexcept. For this to work, move constructing `T` from `OT` would have to be noexcept, and `F` and `OF` types would need to be identical so `unique_ptr<ErrorInfo<F>>` could be moved without any allocations.
...
💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978948)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174415841
> Could be just `return util::Error();`
Thanks, simplified
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1182978948)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174415841
> Could be just `return util::Error();`
Thanks, simplified
💬 ryanofsky commented on pull request "refactor: Use util::Result class for wallet loading":
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1269813522)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174297928
I agree with all of this and want to do more work to address it.
I think by default types convertible to bool should be disallowed with `Result`. I think `Result<bool>` or `Result<optional<T>>` types are inherently ambiguous and code accessing those return values would be fragile and prone to errors from dereferencing incorrectly.
But disallowing all types convertible to bool would go to far because being able to r
...
(https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1269813522)
re: https://github.com/bitcoin/bitcoin/pull/25722#discussion_r1174297928
I agree with all of this and want to do more work to address it.
I think by default types convertible to bool should be disallowed with `Result`. I think `Result<bool>` or `Result<optional<T>>` types are inherently ambiguous and code accessing those return values would be fragile and prone to errors from dereferencing incorrectly.
But disallowing all types convertible to bool would go to far because being able to r
...
💬 darosior commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270901466)
It's not avoiding them, it's hiding them behind `UCharCast`? :p
It boils down to choosing between casting to `uint8_t` or to `std::byte`, and i went for the option with less casts.
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270901466)
It's not avoiding them, it's hiding them behind `UCharCast`? :p
It boils down to choosing between casting to `uint8_t` or to `std::byte`, and i went for the option with less casts.
💬 darosior commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270902655)
Done, thanks. (And also in the function's doc comment.)
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270902655)
Done, thanks. (And also in the function's doc comment.)
💬 MarcoFalke commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270903253)
`UCharCast` uses `reinterpret_cast`, but yeah this doesn't matter for the fuzz tests.
I only left the comment, so that it would be easier if CKey::Set was changed to take `std::byte`, it would be a smaller diff in the future.
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270903253)
`UCharCast` uses `reinterpret_cast`, but yeah this doesn't matter for the fuzz tests.
I only left the comment, so that it would be easier if CKey::Set was changed to take `std::byte`, it would be a smaller diff in the future.
💬 darosior commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270904211)
Happy to do it then.
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270904211)
Happy to do it then.
💬 MarcoFalke commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270904366)
Done in the wrong commit, though? :sweat_smile:
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270904366)
Done in the wrong commit, though? :sweat_smile:
💬 darosior commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270906119)
Done.
(However i just checked and `UCharCast` does indeed use C-style casts)
https://github.com/bitcoin/bitcoin/blob/d23fda05842ba4539b225bbab01b94df0060f697/src/span.h#L272
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270906119)
Done.
(However i just checked and `UCharCast` does indeed use C-style casts)
https://github.com/bitcoin/bitcoin/blob/d23fda05842ba4539b225bbab01b94df0060f697/src/span.h#L272
💬 darosior commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270906387)
:facepalm:
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270906387)
:facepalm:
💬 darosior commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270907877)
And i can't even blame it on anything but myself this time! Fixed.
(https://github.com/bitcoin/bitcoin/pull/27888#discussion_r1270907877)
And i can't even blame it on anything but myself this time! Fixed.
💬 MarcoFalke commented on pull request "Fuzz: a more efficient descriptor parsing target":
(https://github.com/bitcoin/bitcoin/pull/27888#issuecomment-1646016856)
re-ACK 131314b62e899f95d1863083d303b489b3212b16 🐓
<details><summary>Show signature</summary>
Signature:
```
untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: re-ACK 131314b62e899f95d18
...
(https://github.com/bitcoin/bitcoin/pull/27888#issuecomment-1646016856)
re-ACK 131314b62e899f95d1863083d303b489b3212b16 🐓
<details><summary>Show signature</summary>
Signature:
```
untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
trusted comment: re-ACK 131314b62e899f95d18
...
💬 sipa commented on pull request "BIP324 ciphersuite":
(https://github.com/bitcoin/bitcoin/pull/28008#discussion_r1270921379)
Yeah, it gives the tag separately; the RFC doesn't actually require the tag to be sent at the end.
(https://github.com/bitcoin/bitcoin/pull/28008#discussion_r1270921379)
Yeah, it gives the tag separately; the RFC doesn't actually require the tag to be sent at the end.
💬 CaseyCarter commented on pull request "util: Don't derive secure_allocator from std::allocator":
(https://github.com/bitcoin/bitcoin/pull/27930#issuecomment-1646037735)
I've made consistent changes to `zero_after_free_allocator`, and also performed some "aggressive cleanup" of cruft in both allocators that's unnecessary (as far as the Standard Library is concerned) after C++11. The CI will let me know if bitcoin itself was using any of that "cruft". If I have to fix any fallout, I'll learn how to build locally and stop lazily relying on CI ;)
(https://github.com/bitcoin/bitcoin/pull/27930#issuecomment-1646037735)
I've made consistent changes to `zero_after_free_allocator`, and also performed some "aggressive cleanup" of cruft in both allocators that's unnecessary (as far as the Standard Library is concerned) after C++11. The CI will let me know if bitcoin itself was using any of that "cruft". If I have to fix any fallout, I'll learn how to build locally and stop lazily relying on CI ;)
📝 achow101 reopened a pull request: "Enable users to configure their monospace font specifically"
(https://github.com/bitcoin-core/gui/pull/497)
This replaces the overly-verbose radio-button font setting (which only allows embedded or autodetected from system) with a simple combobox providing both existing options as well as a custom option to allow the user to select any font of their choice/style.
(https://github.com/bitcoin-core/gui/pull/497)
This replaces the overly-verbose radio-button font setting (which only allows embedded or autodetected from system) with a simple combobox providing both existing options as well as a custom option to allow the user to select any font of their choice/style.