Skip to content

refactor: replace full-node flag with explicit node-mode config#5431

Draft
martinconic wants to merge 1 commit intomasterfrom
refactor/node-mode-config
Draft

refactor: replace full-node flag with explicit node-mode config#5431
martinconic wants to merge 1 commit intomasterfrom
refactor/node-mode-config

Conversation

@martinconic
Copy link
Copy Markdown
Contributor

@martinconic martinconic commented Apr 9, 2026

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 filled out the description and linked the related issues.

Description

Fixes #5172. The previous approach to node mode was implicit and
inconsistent: the mode was inferred from a combination of --full-node
(bool) and whether blockchain-rpc-endpoint was non-empty, which
diverged from the documented definition of modes and allowed silent
misconfigurations.

This PR introduces a single explicit --node-mode option with three
valid values: full, light, and ultra-light.

Key changes:

  • NodeMode string type added to pkg/node with constants FullMode,
    LightMode, UltraLightMode; replaces FullNodeMode bool in Options
  • --node-mode flag added; --full-node deprecated with a warning
    pointing to --node-mode=full
  • resolveNodeMode() in start.go enforces mode requirements at startup:
    Mode Requires
    full swap-enable: true + blockchain-rpc-endpoint
    light blockchain-rpc-endpoint
    ultra-light swap-enable must be false
  • isChainEnabled rewritten: no longer infers chain state from the RPC
    endpoint string — now reads directly from NodeMode
  • storage-incentives-enable default corrected to false (full node only)
  • chequebook-enable default corrected to false (requires swap-enable)
  • All packaging yamls (bee.yaml, scoop, homebrew-amd64, homebrew-arm64)
    restructured into labelled mode-based sections

Test plan

  • Start with node-mode: ultra-light and no RPC — node starts cleanly
  • Start with node-mode: light, no RPC — rejected with clear error
  • Start with node-mode: light + RPC — node starts in light mode
  • Start with node-mode: full, no RPC — rejected with clear error
  • Start with node-mode: full + RPC + swap-enable: false — rejected
  • Start with node-mode: full + RPC + swap-enable: true — full node
  • Start with legacy full-node: true — deprecation warning, behaves as node-mode: full
  • Start with node-mode: ultra-light + swap-enable: true — rejected

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.

@martinconic martinconic added this to the 2026 milestone Apr 9, 2026
@martinconic martinconic added enhancement enhancement of existing functionality user-experience issue affecting user experience labels Apr 9, 2026
@martinconic martinconic self-assigned this Apr 9, 2026
@martinconic
Copy link
Copy Markdown
Contributor Author

Beekeeper changes are also needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement enhancement of existing functionality user-experience issue affecting user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate and refactor Bee node modes in node.go

1 participant