🤔 stickies-v reviewed a pull request: "node: reduce unsafe uint256S usage"
(https://github.com/bitcoin/bitcoin/pull/30569#pullrequestreview-2227455502)
Force-pushed to address all outstanding review comments, mainly:
- [avoid string re-allocation](https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1707728879)
- [cleaned up](https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1707958805) `util/random.cpp` a bit more
- [removed](https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1707734248) unnecessary docstring
(https://github.com/bitcoin/bitcoin/pull/30569#pullrequestreview-2227455502)
Force-pushed to address all outstanding review comments, mainly:
- [avoid string re-allocation](https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1707728879)
- [cleaned up](https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1707958805) `util/random.cpp` a bit more
- [removed](https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1707734248) unnecessary docstring
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709206741)
Would be nice to have std::optional support in BOOST_CHECK_EQUAL but this PR has already had quite a bit of churn so I'm going to limit the scope and leave as is given that it's not super relevant.
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709206741)
Would be nice to have std::optional support in BOOST_CHECK_EQUAL but this PR has already had quite a bit of churn so I'm going to limit the scope and leave as is given that it's not super relevant.
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709194170)
Don't think this is worth spending too much time on but given that the only non-test call is quite likely to require padding, I've updated it to:
```diff
diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp
index 4e0317cd0e..be946af269 100644
--- a/src/util/strencodings.cpp
+++ b/src/util/strencodings.cpp
@@ -8,6 +8,7 @@
#include <crypto/hex_base.h>
#include <span.h>
+#include <algorithm>
#include <array>
#include <cassert>
#include <cstring>
@@ -54,10 +55,8
...
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709194170)
Don't think this is worth spending too much time on but given that the only non-test call is quite likely to require padding, I've updated it to:
```diff
diff --git a/src/util/strencodings.cpp b/src/util/strencodings.cpp
index 4e0317cd0e..be946af269 100644
--- a/src/util/strencodings.cpp
+++ b/src/util/strencodings.cpp
@@ -8,6 +8,7 @@
#include <crypto/hex_base.h>
#include <span.h>
+#include <algorithm>
#include <array>
#include <cassert>
#include <cstring>
@@ -54,10 +55,8
...
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709207046)
I disagree, a227cb511ec948b37ddbc9ee65de586109ebc1da is a refactor commit so I prefer keeping the behaviour-changing commits such as e6f81b9d81359a7ffeff6d1830188f00df0e8db0 smaller and separate.
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709207046)
I disagree, a227cb511ec948b37ddbc9ee65de586109ebc1da is a refactor commit so I prefer keeping the behaviour-changing commits such as e6f81b9d81359a7ffeff6d1830188f00df0e8db0 smaller and separate.
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709211452)
> However, in the tests, personally I like to use it for brevity.
I agree. The tests fail gracefully, and the error message is helpful, including the location of the assertion which documents that we're expecting a 64 char hex string. Going to leave as is.
```
Running 1 test case...
test/util/random.cpp:29 operator(): Assertion `uint256::FromHex(num)' failed.
unknown location:0: fatal error: in "timeoffsets_tests/timeoffsets_warning": signal: SIGABRT (application abort requested)
test/
...
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709211452)
> However, in the tests, personally I like to use it for brevity.
I agree. The tests fail gracefully, and the error message is helpful, including the location of the assertion which documents that we're expecting a 64 char hex string. Going to leave as is.
```
Running 1 test case...
test/util/random.cpp:29 operator(): Assertion `uint256::FromHex(num)' failed.
unknown location:0: fatal error: in "timeoffsets_tests/timeoffsets_warning": signal: SIGABRT (application abort requested)
test/
...
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709204523)
Agreed, autogenerated and didn't think to remove it. Done.
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709204523)
Agreed, autogenerated and didn't think to remove it. Done.
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709155583)
I think you're right that `inline` was not necessary here. No longer applies as I've adopted [maflcko's suggestion](https://github.com/bitcoin/bitcoin/pull/30569/files#r1707958805) which moves the var back inside the `SeedRandomForTest` scope.
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709155583)
I think you're right that `inline` was not necessary here. No longer applies as I've adopted [maflcko's suggestion](https://github.com/bitcoin/bitcoin/pull/30569/files#r1707958805) which moves the var back inside the `SeedRandomForTest` scope.
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709153215)
Done, I've taken your commit (hadn't seen the commit message earlier, very nice) but just added the docstring (and smaller `num` scope) back in.
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709153215)
Done, I've taken your commit (hadn't seen the commit message earlier, very nice) but just added the docstring (and smaller `num` scope) back in.
💬 stickies-v commented on pull request "node: reduce unsafe uint256S usage":
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709162569)
This feels like a distraction to me tbh, we're not unit testing `ParseParameters` here. I think it's safe to rely on `ParseParameters` returning `false` when there's an error.
(https://github.com/bitcoin/bitcoin/pull/30569#discussion_r1709162569)
This feels like a distraction to me tbh, we're not unit testing `ParseParameters` here. I think it's safe to rely on `ParseParameters` returning `false` when there's an error.
💬 maflcko commented on issue "Faster way to get block with prevouts in JSON-RPC":
(https://github.com/bitcoin/bitcoin/issues/30495#issuecomment-2275543824)
https://github.com/bitcoin/bitcoin/pull/30595 mentions "Traversing the block index as well and using block index entries for reading block and undo data." However, it does not return JSON-RPC, but a `kernel_BlockUndo*`/`BlockUndo`, also the pull is experimental, doesn't have versioning and has some other drawbacks. (Just mentioning it for context, because if you care about speed, this may be faster than JSON)
(https://github.com/bitcoin/bitcoin/issues/30495#issuecomment-2275543824)
https://github.com/bitcoin/bitcoin/pull/30595 mentions "Traversing the block index as well and using block index entries for reading block and undo data." However, it does not return JSON-RPC, but a `kernel_BlockUndo*`/`BlockUndo`, also the pull is experimental, doesn't have versioning and has some other drawbacks. (Just mentioning it for context, because if you care about speed, this may be faster than JSON)
💬 Sjors commented on pull request "Stratum v2 Noise Protocol":
(https://github.com/bitcoin/bitcoin/pull/29346#discussion_r1709228465)
@itornaza thanks, I'll look into your patch. Another guiding principle would be to stay close to `bip324.h` in terms of coding style. I haven't compared with that yet.
(https://github.com/bitcoin/bitcoin/pull/29346#discussion_r1709228465)
@itornaza thanks, I'll look into your patch. Another guiding principle would be to stay close to `bip324.h` in terms of coding style. I haven't compared with that yet.
💬 Sjors commented on pull request "Have createNewBlock() return a BlockTemplate interface":
(https://github.com/bitcoin/bitcoin/pull/30440#discussion_r1709250026)
I'm not sure if we end using `getTxFees()` and `getTxSigops()` in stratum v2, or only for the existing stratum v1 RPC calls. Once sv2 code is a bit more mature it's indeed worth going over the interface once more.
(https://github.com/bitcoin/bitcoin/pull/30440#discussion_r1709250026)
I'm not sure if we end using `getTxFees()` and `getTxSigops()` in stratum v2, or only for the existing stratum v1 RPC calls. Once sv2 code is a bit more mature it's indeed worth going over the interface once more.
💬 Sjors commented on pull request "p2p: For assumeutxo, download snapshot chain before background chain":
(https://github.com/bitcoin/bitcoin/pull/29519#issuecomment-2275573473)
What you recall sounds similar to what still happens. But it seems this PR makes recovery from that failure easier (just delete the snapshot dir). I just don't fully understand why and it's very time consuming to reproduce on testnet3.
(https://github.com/bitcoin/bitcoin/pull/29519#issuecomment-2275573473)
What you recall sounds similar to what still happens. But it seems this PR makes recovery from that failure easier (just delete the snapshot dir). I just don't fully understand why and it's very time consuming to reproduce on testnet3.
🤔 paplorinc reviewed a pull request: "build: Introduce CMake-based build system"
(https://github.com/bitcoin/bitcoin/pull/30454#pullrequestreview-2227399035)
Checked a few more scenarios on mac
(https://github.com/bitcoin/bitcoin/pull/30454#pullrequestreview-2227399035)
Checked a few more scenarios on mac
💬 paplorinc commented on pull request "build: Introduce CMake-based build system":
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709170006)
Nit:
```suggestion
-DCMAKE_C_COMPILER=/usr/pkg/gcc12/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/pkg/gcc12/bin/g++ \
```
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709170006)
Nit:
```suggestion
-DCMAKE_C_COMPILER=/usr/pkg/gcc12/bin/gcc \
-DCMAKE_CXX_COMPILER=/usr/pkg/gcc12/bin/g++ \
```
💬 paplorinc commented on pull request "build: Introduce CMake-based build system":
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709105914)
nit, what's the purpose of the comment?
Is it to explain to the reviewers how to review it or will this make sense after we remove autotools? If the second, maybe we can explain in the commit message instead - or add a TODO in front of this to signal that it's a temporary explanation (otherwise people will be afraid to remove it),
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709105914)
nit, what's the purpose of the comment?
Is it to explain to the reviewers how to review it or will this make sense after we remove autotools? If the second, maybe we can explain in the commit message instead - or add a TODO in front of this to signal that it's a temporary explanation (otherwise people will be afraid to remove it),
💬 paplorinc commented on pull request "build: Introduce CMake-based build system":
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709206550)
nit: not very important, but can help with avoiding merge conflicts if we always sort these alphabetically (would be nice to have an automatic check for these, of course).
Unless this is deliberate, in which case a comment could help.
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709206550)
nit: not very important, but can help with avoiding merge conflicts if we always sort these alphabetically (would be nice to have an automatic check for these, of course).
Unless this is deliberate, in which case a comment could help.
💬 paplorinc commented on pull request "build: Introduce CMake-based build system":
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709172104)
Nit: to be a bit more consistent, we may want to add quotes only when they're needed (or always)
```suggestion
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
```
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709172104)
Nit: to be a bit more consistent, we may want to add quotes only when they're needed (or always)
```suggestion
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
```
💬 paplorinc commented on pull request "build: Introduce CMake-based build system":
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709187478)
nit: slightly unrelated, but in other cases similar code blocks are annotated as either "\```bash" or "```sh" which are treated a bit different in e.g. CLion:
<img src="https://github.com/user-attachments/assets/13f30a0a-1f92-4a39-87ce-8ca11a05a44f">
Also note that "\``` bash" is also a formatted differently than "```bash".
Should probably be done in a different PR, though...
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709187478)
nit: slightly unrelated, but in other cases similar code blocks are annotated as either "\```bash" or "```sh" which are treated a bit different in e.g. CLion:
<img src="https://github.com/user-attachments/assets/13f30a0a-1f92-4a39-87ce-8ca11a05a44f">
Also note that "\``` bash" is also a formatted differently than "```bash".
Should probably be done in a different PR, though...
💬 paplorinc commented on pull request "build: Introduce CMake-based build system":
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709167244)
nit: "Python 3" is a bit confusing here since Python 2 was sunset in 2020, and we don't accept all 3.x versions.
Would it make sense to simplify these "Python 3" references to just "Python"?
(https://github.com/bitcoin/bitcoin/pull/30454#discussion_r1709167244)
nit: "Python 3" is a bit confusing here since Python 2 was sunset in 2020, and we don't accept all 3.x versions.
Would it make sense to simplify these "Python 3" references to just "Python"?