Skip to content

feat(cmd): add node-mode bootnode - #5690

Merged
martinconic merged 1 commit into
masterfrom
feat/node-mode-bootnode
Nov 11, 2026
Merged

martinconic merged 1 commit into
masterfrom
feat/node-mode-bootnode

Conversation

@martinconic

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have added or updated fuzz targets for any code handling untrusted input. (Not applicable: operator configuration only.)
  • I have filled out the description and linked the related issues.

Description

Closes #5689. Follow-up to #5596, proposed by @gacevicljubisa there.

Bootnodes can now be configured with node-mode: bootnode instead of node-mode: full plus the separate bootnode-mode option. Like #5596, this changes configuration only: node-mode: bootnode resolves to exactly the node that full-node: true + bootnode-mode: true gives today (full mode with bootnode mode set), so nothing changes on the network. No code under pkg/ changes; /node keeps reporting beeMode: full for bootnodes.

node-mode: bootnode

  • Requires a blockchain RPC endpoint, as full mode does ("bootnode requires blockchain-rpc-endpoint to be set").
  • Implies no swap, chequebook or storage incentives. Swap starts only when swap-enable: true is set, and chequebook follows swap, as for bootnodes today.
  • storage-incentives-enable: true is accepted with a warning that it has no effect on a bootnode. reserve-capacity-doubling is passed through unchanged, as today: it is not unused on a bootnode (NewBee range-checks it, derives the push-sync receipt tolerance from it and passes it to staking).
  • The value is matched case-insensitively. An explicit bootnode-mode: false is overridden, with a warning.

bootnode-mode is deprecated, not removed.

  • Without node-mode (legacy), full-node: true + bootnode-mode: true keeps working. The migration warning now reports node_mode=bootnode and lists set=[node-mode=bootnode], remove=[full-node, bootnode-mode].
  • node-mode: full + bootnode-mode: true keeps working as a bootnode and logs that bootnode-mode is deprecated in favor of node-mode: bootnode.
  • The --bootnode-mode flag is marked deprecated, like --full-node.
  • "boot node must be started as a full node" now adds "use node-mode: bootnode".

Packaging: the four bee.yaml variants, the Docker env template and the Docker README document bootnode, mark bootnode-mode deprecated, and list bootnodes under the RPC requirement.

Motivation and Context

A bootnode is effectively its own mode: full mode exempts it from the options it implies, and bootnode-mode is only valid together with full mode. Making it a node-mode value lets operators say what they run in one option. Landing it before the release that ships node-mode avoids migrating bootnode configs twice (first to node-mode: full + bootnode-mode, then to node-mode: bootnode).

Related Issue

Test plan

  • TestResolveNodeMode and TestResolveNodeModeWithBoundFlags cover node-mode: bootnode: implied defaults, case-insensitive value, missing RPC endpoint, swap with chequebook following it, chequebook without swap rejected, verification without swap, explicit bootnode-mode: false, storage incentives and reserve doubling.
  • TestResolveNodeModeWarnings asserts the deprecation warning for node-mode: full + bootnode-mode, the bootnode warnings, and the legacy migration (node_mode=bootnode, set/remove lists).
  • TestNodeModeBootnodeMatchesFullBootnode resolves node-mode: bootnode and node-mode: full + bootnode-mode: true over every combination of RPC, swap, chequebook, incentives, verification and reserve doubling (216) and requires identical results or identical errors.
  • TestLegacyMigrationPreservesBehavior now also varies bootnode-mode (unset, true, false) and reserve-capacity-doubling: across 1944 legacy combinations, every config that starts (504) runs the same after applying the migration warning, and the rejected ones match the pre-node-mode rules.
  • Each new rule was broken on purpose and caught by these tests.
  • Resolver outcomes compared against master over 1080 configs: only node-mode: bootnode rows change (previously an invalid value); 168 other rows change only their error message (the two improved bootnode messages).
  • Config file (flat and nested blockchain-rpc keys) and BEE_* environment variables checked through the real config pipeline; bee start smoke tests with node-mode: bootnode, the deprecated alias and a legacy bootnode.
  • go vet ./..., golangci-lint v2.15.0 (0 issues), make build, make check-whitespace and make test pass.

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

Bootnodes can be configured with node-mode: bootnode instead of
node-mode: full plus the bootnode-mode option. It resolves to the same
node as before, full mode with bootnode-mode set, so nothing changes on
the network. A bootnode requires an RPC endpoint, implies no swap,
chequebook or storage incentives, and warns when storage incentives are
enabled, since it never runs them.

bootnode-mode is deprecated. It keeps working in configs without
node-mode, where the migration warning now lists node-mode=bootnode,
and next to node-mode: full, where it logs a deprecation warning.
@martinconic
martinconic merged commit e9589c0 into master Nov 11, 2026
23 of 25 checks passed
@martinconic
martinconic deleted the feat/node-mode-bootnode branch November 11, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make bootnode a node-mode value (node-mode: bootnode)

3 participants