Skip to content

harness: make the warnet lab image deployable - #906

Merged
reardencode merged 4 commits into
masterfrom
harness/warnet-lab
Oct 4, 2026
Merged

reardencode merged 4 commits into
masterfrom
harness/warnet-lab

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Warnet lab image could follow blocks in a kind cluster, and Warnet itself still could not deploy or observe those tanks. This makes the documented image something warnet deploy can render, log, and show in fork-observer.

  • Kind/Helm tag is the release 28.0.0. That is the chart's Core-version gate, not the rbitcoin version. semverCompare ">=0.17.0" is true, so the chart writes [regtest] before rpcport, rpcpassword, rpcauth, and addnode. 0.7.99 and a prerelease of it compare below 0.17.0 and omit that section even when helm template exits 0. local is not a semantic version. The compose example stays rbitcoin-warnet:local.
  • RBITCOIN_LOG_STDOUT=1 (set by the image) copies each node line to the container stdout and to debug.log. The switch stays off for the functional harness, so a clean stop still keeps stderr to mapped Error: lines.
  • The RPC proxy accepts Warnet's published fork-observer rpcauth (HMAC-SHA256) for getchaintips, getblockheader, getblockhash, getblock, and getnetworkinfo, and refuses other methods under rpcwhitelistdefault=0. The tank rpcuser/rpcpassword user and cookie Basic auth stay unrestricted.
  • The image sets RBITCOIN_LAB_HEAD_SCALE=tiny, so a Helm tank that omits head_scale does not fallocate mainnet heads. Conf head_scale=mainnet still wins. addnode= is still --connect.

Fixes #820.

--connect peers already report manual on master (PR #876).

Tests

  • scripts/core-functional/rpc_proxy.test.sh drives RpcProxy with the published fork-observer line.
  • scripts/core-functional/bitcoind.test.sh drives the shim for the log tee and for tiny-versus-mainnet head scale.
  • scripts/core-functional/warnet/Dockerfile.test.sh rejects a kind instruction that tags or loads local, and requires the shim to read RBITCOIN_LOG_STDOUT.

No Docker on the agent VM, so example.sh and a live helm template were not run here. Label warnet runs the two-tank compose example.

rearden-grok Bot added 2 commits October 4, 2026 09:55
Fork-observer's published rpcauth was refused because the lab proxy
only accepted the tank rpcpassword. Accept Core HMAC rpcauth and apply
rpcwhitelist with default 0, so that user can call its chain methods
and the commander user is not locked out.

RBITCOIN_LOG_STDOUT copies each node line to the shim stdout and to
debug.log. The lab image turns it on; functional tests leave it off.

RBITCOIN_LAB_HEAD_SCALE=tiny, set by the image, selects tiny heads when
conf omits head_scale. Conf head_scale=mainnet still wins.
Helm semverCompare rejects rbitcoin-warnet:local, so the kind
instructions build and load 0.7.99-warnet0. The compose example stays
on local. The image text test fails if those instructions regress
or if the log switch is only a Dockerfile string.
semverCompare ">=0.17.0" is false for 0.7.99, including after Warnet
main strips a prerelease. The chart then omits [regtest] while helm
template still exits 0, so rpcport, rpcpassword, rpcauth, and addnode
land outside the network section. The kind tag is the release 28.0.0.
The image text test rejects a tag below 0.17.0 and any prerelease.

@rearden-grok rearden-grok Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The lab image tag, head-scale default, and stdout tee do what the change claims. Kind/Helm docs use release tag 28.0.0 (no prerelease), which passes Warnet semverCompare ">=0.17.0" on both 1.1.20 and current main so the chart emits [regtest]; compose stays rbitcoin-warnet:local (example.sh / example-compose.yml). RBITCOIN_LAB_HEAD_SCALE=tiny is applied only when that env value is tiny and conf has no head_scale; an explicit conf value, including mainnet under [regtest], wins because read_conf_keys still returns those lines. The log tee writes the child's raw stdout bytes only when RBITCOIN_LOG_STDOUT is on.

The default Core functional path is unchanged. With no rpcauth and no rpcwhitelist (the running harness; rpc_users.py and rpc_whitelist.py are skipped), authenticated_user plus an empty whitelist matches authorization_ok: no cookie stays open, cookie Basic and password-equals-rpcpassword succeed, and a wrong password is 401. handle_http parses JSON, then authorizes, then does the existing forward / testmempoolaccept rewrite. rpcwhitelistdefault=0 limits only names present in rpcwhitelist; the tank rpcuser and __cookie__ stay unrestricted, and the published forkobserver / tabconf2024 login is HMAC-checked and rejected for methods outside Warnet's list (the new test covers generatetoaddress → 403). No harness break on that default path.

Issue counts by severity

  • bugs: 0
  • suggestions: 2
  • nits: 0

Comment thread scripts/core-functional/rpc_proxy.py
Comment thread scripts/core-functional/rpc_proxy.py
A failed HMAC on the first rpcauth row for a user hid a later row, so
password rotation could not log in. Repeated rpcwhitelist lines were
unioned; Core intersects them.
@reardencode
reardencode merged commit 32322ec into master Oct 4, 2026
23 of 24 checks passed
@rearden-grok
rearden-grok Bot deleted the harness/warnet-lab branch October 5, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

warnet Two-tank Docker Warnet example

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warnet lab image: the documented image tag fails to render, node logs never reach stdout, fork-observer is refused

1 participant