Bitcoin Core Github
44 subscribers
122K links
Download Telegram
💬 Sjors commented on issue "v27.2 guix build fails with hash mismatch":
(https://github.com/bitcoin/bitcoin/issues/31266#issuecomment-2486378063)
This could be a problem... I can't find `net-tools-1.60-0.479bb4a.zip.drv` anywhere on the internet, so I had to copy it from my other guix machine instead.

So the problem may not be limited to backport releases like v27.2
💬 ryanofsky commented on pull request "mining: add early return to waitTipChanged()":
(https://github.com/bitcoin/bitcoin/pull/31297#discussion_r1848821236)
Are you are seeing a difference in practice? At least according to https://en.cppreference.com/w/cpp/thread/condition_variable/wait_for, `wait_for(lock, rel_time, pred)` is equivalent to `wait_until(lock, rel_time + now, pred)` and according to https://en.cppreference.com/w/cpp/thread/condition_variable/wait_until that should be equivalent to `while(!pred()) wait...` checking the predicate before there is any waiting.
💬 ryanofsky commented on pull request "mining: add early return to waitTipChanged()":
(https://github.com/bitcoin/bitcoin/pull/31297#issuecomment-2486457573)
re: https://github.com/bitcoin/bitcoin/pull/31297#issuecomment-2485712161

> Otherwise we'd never get past this point:

I think we typically get past that point on line 1795 in `AppInitMain` even though `m_tip_block` is still null at that point, because when the node restarted the `chainman.ActiveTip() == nullptr` check will normally be false. This is because of the `InitAndLoadChainstate` call on line 1624, which calls `Chainstate::LoadChainTip()` and sets the active tip to `coins_cache.Get
...
👍 ryanofsky approved a pull request: "Add destroy to BlockTemplate schema"
(https://github.com/bitcoin/bitcoin/pull/31288#pullrequestreview-2446300488)
Code review ACK 9aa50152c1cfa1c41215b2b51ed7a516aa67137a
💬 achow101 commented on pull request "test: Introduce ensure_for helper":
(https://github.com/bitcoin/bitcoin/pull/30893#issuecomment-2486474269)
ACK 111465d72dd35e42361fc2a089036f652417ed37
💬 Sjors commented on pull request "mining: add early return to waitTipChanged()":
(https://github.com/bitcoin/bitcoin/pull/31297#discussion_r1848870979)
I thought I did, but give what the documentation says, it indeed shouldn't be needed. Will test again.
📝 Sjors converted_to_draft a pull request: "mining: add early return to waitTipChanged()"
(https://github.com/bitcoin/bitcoin/pull/31297)
It's useful to be able to wait for an active chaintip to appear, by calling ` waitTipChanged(uint256::ZERO);`.

Unfortunately this doesn't work out of the box, because `notifications().m_tip_block` is `ZERO` until a new block arrives.

Additionally we need an early return before calling `wait_for`.
👍 ryanofsky approved a pull request: "Drop script_pub_key arg from createNewBlock"
(https://github.com/bitcoin/bitcoin/pull/31318#pullrequestreview-2446313068)
Concept ACK . It seems like a nice improvement to not require specifying an option that won't typically be used. But I'm a little hazy on the details of this. I think better documentation could help. Left a suggestion and some questions below.
💬 ryanofsky commented on pull request "Drop script_pub_key arg from createNewBlock":
(https://github.com/bitcoin/bitcoin/pull/31318#discussion_r1848878221)
re: https://github.com/bitcoin/bitcoin/pull/31318#discussion_r1846813317

Would it make sense to declare the field as `CScript coinbase_output_script{CScript{} << OP_TRUE}` instead of `std::optional<CScript> coinbase_output_script{};` just to be clearer about what the default value is? Or maybe just add documentation to say what happens if this is not set?

I think the drawback of using std::optional here is that it's not really clear what happens if the option is not set. It's also not clea
...
🚀 achow101 merged a pull request: "test: Introduce ensure_for helper"
(https://github.com/bitcoin/bitcoin/pull/30893)
📝 Sjors opened a pull request: "kernel: make m_tip_block std::optional"
(https://github.com/bitcoin/bitcoin/pull/31325)
Suggested in https://github.com/bitcoin/bitcoin/pull/31297#discussion_r1844244309
💬 Sjors commented on pull request "mining: add early return to waitTipChanged()":
(https://github.com/bitcoin/bitcoin/pull/31297#issuecomment-2486525961)
It's a bit tricky at the moment to test the interaction of multiple pull requests on my stratum v2 branches. I'll test this again later, and most likely close the PR then.

Meanwhile I extracted the make `m_tip_block std::optional` commit into #31325 for separate consideration.
💬 Sjors commented on pull request "Add waitNext() to BlockTemplate interface":
(https://github.com/bitcoin/bitcoin/pull/31283#issuecomment-2486536906)
#31297 is on hold, as it's probably unnecessary.

Please review #31325 first, so I can decide whether to build this PR on top of it.
💬 stickies-v commented on pull request "kernel: Introduce initial C header API":
(https://github.com/bitcoin/bitcoin/pull/30595#discussion_r1754989437)
nit / meta discussion: even though it'll make things more verbose, I think it might be worth referring to flags with their full name to make it easier for users to find them? I.e. "If the witness flag is set" would become "if kernel_SCRIPT_FLAGS_VERIFY_WITNESS is set in `flags`".
🤔 stickies-v reviewed a pull request: "kernel: Introduce initial C header API"
(https://github.com/bitcoin/bitcoin/pull/30595#pullrequestreview-2297633388)
Strong concept ACK.

I've started building a python wrapper library to get familiar with and actually use the interface, so most of my comments for now will be based on that experience and reading the documentation.
💬 stickies-v commented on pull request "kernel: Introduce initial C header API":
(https://github.com/bitcoin/bitcoin/pull/30595#discussion_r1757015877)
nit: I like that we're using this guard. Do you see a downside to making it variadic?

(Should be a pretty trivial rebase with e.g. `for i in {1..3}; do sed -i -E "s/BITCOINKERNEL_ARG_NONNULL\(([^)]+)\) BITCOINKERNEL_ARG_NONNULL\(([0-9]+)\)/BITCOINKERNEL_ARG_NONNULL(\1, \2)/" ./src/kernel/bitcoinkernel.h; done`)
💬 stickies-v commented on pull request "kernel: Introduce initial C header API":
(https://github.com/bitcoin/bitcoin/pull/30595#discussion_r1757065221)
Is there benefit to this stand-alone Context documentation, since we already have (and could expand on/merge with) the `kernel_Context` documentation? I think perhaps a more useful alternative would be to start the documentation with a minimal example on how to use the kernel (or a non-code "getting started" guide), which would inevitably include/reference the `kernel_Context`, providing users a good starting point on which documentation to read first?
💬 stickies-v commented on pull request "kernel: Introduce initial C header API":
(https://github.com/bitcoin/bitcoin/pull/30595#discussion_r1848821020)
What's the point of the `context` parameter - it seems unused, and inconsistent with the other `_destroy` functions?
💬 stickies-v commented on pull request "kernel: Introduce initial C header API":
(https://github.com/bitcoin/bitcoin/pull/30595#discussion_r1757105125)
I find this phrasing a bit confusing. Is this a correct replacement?

```suggestion
* A function that takes pointer arguments makes no assumptions on their lifetime. Once the function
* returns the user can safely de-allocate the memory owned by those pointers.
```
💬 stickies-v commented on pull request "kernel: Introduce initial C header API":
(https://github.com/bitcoin/bitcoin/pull/30595#discussion_r1757108471)
1) What's "it"?

2) I think adopting and sticking to a clear definition of MUST, MAY, SHOULD, ... would be appropriate here? E.g. in this case, I think they "MUST" not be de-allocated by the user, rather than "SHOULD"?