Bitcoin Core Github
44 subscribers
120K links
Download Telegram
💬 l0rinc commented on pull request "qa: Verify clean shutdown on startup failure":
(https://github.com/bitcoin/bitcoin/pull/30660#discussion_r2053925442)
I think it applies to the other `findall` instances after this
🚀 fanquake merged a pull request: "ci: Drop no longer necessary `-Wno-error=array-bounds`"
(https://github.com/bitcoin/bitcoin/pull/32308)
🚀 fanquake merged a pull request: "doc: Add deps install notes for multiprocess"
(https://github.com/bitcoin/bitcoin/pull/32293)
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053495512)
Unused?
🤔 hodlinator reviewed a pull request: "[IBD] multi-byte block obfuscation"
(https://github.com/bitcoin/bitcoin/pull/31144#pullrequestreview-2783071854)
Code Review 46854038e7984b599d25640de26d4680e62caba7

Didn't get much deeper than surface level yet, but sharing what I found so far.

My primary suggestion is to change the `Obfuscation`-ctors to take static-extent `span`s to prevent accidental out-of-bounds access and also to clarify that we don't consume bigger `vector`s (see inline comment). `std::array` of matching size maps well to such `span`s.

#### Branch with suggestions

https://github.com/bitcoin/bitcoin/compare/master...hodl
...
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053502958)
nit: Could declare default initialization value for `m_obfuscation` in header to avoid touching these lines.
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053511581)
There's no `return` before the assignment on line 271, and we already set this field to 0 during initialization, so could be removed?
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053535171)
2009?
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053538744)
```suggestion
// Cached key rotations for different offsets.
std::array<uint64_t, SIZE_BYTES> m_rotations;

```
Most important for me is `m_`-prefix, newline and comment are nits.
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053529374)
(Thanks for restoring sanity with the `m_`-prefix).
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053627072)
util/check.h, random and cstring seem unused?
bit-header seems required for `rotr` and `std::endian`.

```suggestion
#include <serialize.h>
#include <span.h>

#include <array>
#include <bit>
#include <cassert>
#include <climits>
#include <cstdint>
```
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053635433)
nit:
```suggestion
BOOST_CHECK_EQUAL(obfuscate, dbwrapper_private::GetObfuscation(dbw));
```
Here and above on line 30.
💬 hodlinator commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2053648375)
nit: This is inherited from stream.h, but could change to "target"/"dest" to make it more of a noun?
```suggestion
void operator()(std::span<std::byte> target, const size_t key_offset_bytes = 0) const
```
Same in `xor_roundtrip_random_chunks` and `xor_bytes_reference` test cases.
💬 janb84 commented on pull request "depends: Fix cross-compiling on macOS":
(https://github.com/bitcoin/bitcoin/pull/32215#issuecomment-2821181976)
I'm trying to test this PR, but having trouble verifying it. Am I correct to conclude that the fix is really mac only ( not nix-shell on macos? or GUIX cross-compile ? )

Can confirm that the `mv -t` option is not supported on MacOS .
💬 rkrux commented on pull request "test: Test that migration automatically repairs corrupted metadata with doubled derivation path":
(https://github.com/bitcoin/bitcoin/pull/29124#discussion_r2053991401)
Nit:
```diff
- # Retrieve all records that have the keymeta prefix
+ # Retrieve all records that have the "keymeta" prefix, rest of the key data is the pubkey that differs for each record
```
🤔 rkrux reviewed a pull request: "test: Test that migration automatically repairs corrupted metadata with doubled derivation path"
(https://github.com/bitcoin/bitcoin/pull/29124#pullrequestreview-2783901872)
Nice that the migration flow can fix it automatically and no new custom handling is required now while loading the legacy wallets!
💬 rkrux commented on pull request "test: Test that migration automatically repairs corrupted metadata with doubled derivation path":
(https://github.com/bitcoin/bitcoin/pull/29124#discussion_r2053994529)
Isn't [076b65796d6574, 076b65796d6575) a little too wide of a search range?

"keymeta" in hex is "6b65796d657461", prepending it with the compact size length "07" should make the key prefix "076b65796d657461" in the serialised form imo, making the range as [076b65796d657461, 076b65796d657462)
💬 rkrux commented on pull request "test: Test that migration automatically repairs corrupted metadata with doubled derivation path":
(https://github.com/bitcoin/bitcoin/pull/29124#discussion_r2053996701)
```diff
- # Make sure that this is being detected and automatically cleaned up
+ # Make sure that this it is being automatically cleaned up during migration
```
💬 l0rinc commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2054042572)
This is needed to be able to read without obfuscation - as the comment states. Can you suggest how to reword that to make it obvious?
💬 l0rinc commented on pull request "[IBD] multi-byte block obfuscation":
(https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2054043508)
I'm moving code, I never know what that implies