Skip to content

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

Open
martinconic wants to merge 2 commits intomasterfrom
refactor/node-mode-config
Open

refactor: replace full-node flag with explicit node-mode config#5431
martinconic wants to merge 2 commits 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

Comment thread .github/workflows/beekeeper.yml
@acud
Copy link
Copy Markdown
Contributor

acud commented Apr 16, 2026

needs a rebase

@martinconic martinconic force-pushed the refactor/node-mode-config branch from b374fd7 to b58c43a Compare April 16, 2026 09:12
Copy link
Copy Markdown
Contributor

@akrem-chabchoub akrem-chabchoub left a comment

Choose a reason for hiding this comment

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

Thanks @martinconic, Glad to see this change, It will simplify and enhance the UX 🚀

Comment thread cmd/bee/cmd/cmd.go
cmd.Flags().Bool(optionNameSwapEnable, false, "enable swap")
cmd.Flags().Bool(optionNameChequebookEnable, true, "enable chequebook")
cmd.Flags().Bool(optionNameFullNode, false, "cause the node to start in full mode")
cmd.Flags().Bool(optionNameChequebookEnable, false, "enable chequebook (requires swap-enable)")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure how this change will affect old users ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe some tests could help for those changes ?

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

4 participants