Dev stack controls: on-demand miner and configurable reward destination #14

Open
opened 2026-08-12 18:07:54 +01:00 by vnprc-agent · 0 comments
Collaborator

Give the dev stack two switches — run the CPU miner only on demand, and choose where block rewards get paid — so epoch work can be exercised deliberately instead of against ~2 uncontrollable blocks per second.

Primary goals:

  • Miner gating — the miner process in devenv.nix is an unconditional infinite-restart loop today; gate it behind a profile/env flag with a just recipe so the stack can idle quiescent or mine for a bounded window.
  • Reward destination — document and use the pool's existing one-line coinbase config (coinbase_reward_script in config/pool.config.toml) as the test knob; regtest bcrt1 addresses and raw() script forms both parse. The dev config currently carries a testnet tb1q… address on a regtest network — replace it with a regtest address while touching it.
  • Dev default unchanged — miner on, coinbase pointed away from the mint's address, so the share→quote→ehash loop runs exactly as today with zero epoch noise once rotation exists (epochs only react to rewards on the mint's script).

Current state and specifics

The dev harness mines ~2 blocks/second through the full miner→translator→pool→sv2-tp path (every share beats the regtest network target), and rewards land on the single configured pool address. There is no way to pause the miner short of killing the process, which auto-restarts every 5s. just generate-blocks exists but uses the bitcoind wallet's -generate, not a chosen address; a generatetoaddress variant is the second half of the reward-destination knob.

Witness

With the miner gated off: the stack idles, no new blocks. just-recipe mining window produces blocks whose coinbase pays the configured script (assert via bitcoin-cli against the decoded coinbase). Dev default behaves identically to today.

Scope

In: devenv/justfile/config changes only. Out: any epoch logic (#16, #18); cleaning up the harness's other rough edges (append-only logs, no just clean all) unless trivially adjacent.

Part of #13.

Give the dev stack two switches — run the CPU miner only on demand, and choose where block rewards get paid — so epoch work can be exercised deliberately instead of against ~2 uncontrollable blocks per second. Primary goals: - **Miner gating** — the `miner` process in `devenv.nix` is an unconditional infinite-restart loop today; gate it behind a profile/env flag with a `just` recipe so the stack can idle quiescent or mine for a bounded window. - **Reward destination** — document and use the pool's existing one-line coinbase config (`coinbase_reward_script` in `config/pool.config.toml`) as the test knob; regtest `bcrt1` addresses and `raw()` script forms both parse. The dev config currently carries a testnet `tb1q…` address on a regtest network — replace it with a regtest address while touching it. - **Dev default unchanged** — miner on, coinbase pointed away from the mint's address, so the share→quote→ehash loop runs exactly as today with zero epoch noise once rotation exists (epochs only react to rewards on the mint's script). ### Current state and specifics The dev harness mines ~2 blocks/second through the full miner→translator→pool→sv2-tp path (every share beats the regtest network target), and rewards land on the single configured pool address. There is no way to pause the miner short of killing the process, which auto-restarts every 5s. `just generate-blocks` exists but uses the bitcoind wallet's `-generate`, not a chosen address; a `generatetoaddress` variant is the second half of the reward-destination knob. ### Witness With the miner gated off: the stack idles, no new blocks. `just`-recipe mining window produces blocks whose coinbase pays the configured script (assert via `bitcoin-cli` against the decoded coinbase). Dev default behaves identically to today. ### Scope In: devenv/justfile/config changes only. Out: any epoch logic (#16, #18); cleaning up the harness's other rough edges (append-only logs, no `just clean all`) unless trivially adjacent. Part of #13.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
vnprc/hashpool#14
No description provided.