refactor: replace full-node flag with explicit node-mode config#5431
refactor: replace full-node flag with explicit node-mode config#5431martinconic wants to merge 6 commits into
Conversation
|
Beekeeper changes are also needed |
|
needs a rebase |
b374fd7 to
b58c43a
Compare
akrem-chabchoub
left a comment
There was a problem hiding this comment.
Thanks @martinconic, Glad to see this change, It will simplify and enhance the UX 🚀
|
What's the actual difference between |
The actual semantics are:
Functionally yes, we need them both, because swap=on, chequebook=off (receive-only / cash-out-only) is a genuine state. It's useful for: a node booting before its chequebook is funded, an operator who wants to earn from serving content without depositing collateral yet, and any deferred-funding workflow. |
Resolves a conflict in pkg/node/node.go where master (#5460) added a startup block-height verification guard for the postage listener, while this branch replaced the o.FullNodeMode bool with o.NodeMode == FullMode. Resolution keeps master's new guard and applies the NodeMode predicate to the subsequent batch-service start branch.
akrem-chabchoub
left a comment
There was a problem hiding this comment.
Just there are some git conflicts
New things were merged until my last commit, so yes, will address the merge conflicts. |
Resolved packaging yaml conflicts (bee, scoop, homebrew-amd64, homebrew-arm64): kept the mode-based section layout from this branch and added the new 'use-simd-hashing' option from master. The p2p-wss, nat-wss, autotls, and withdrawal-addresses-whitelist options master appended already exist in the reorganized Network/Payments sections, so master's duplicates were dropped.
Checklist
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-endpointwas non-empty, whichdiverged from the documented definition of modes and allowed silent
misconfigurations.
This PR introduces a single explicit
--node-modeoption with threevalid values:
full,light, andultra-light.Key changes:
NodeModestring type added topkg/nodewith constantsFullMode,LightMode,UltraLightMode; replacesFullNodeMode boolinOptions--node-modeflag added;--full-nodedeprecated with a warningpointing to
--node-mode=fullresolveNodeMode()instart.goenforces mode requirements at startup:fullswap-enable: true+blockchain-rpc-endpointlightblockchain-rpc-endpointultra-lightswap-enablemust be falseisChainEnabledrewritten: no longer infers chain state from the RPCendpoint string — now reads directly from
NodeModestorage-incentives-enabledefault corrected tofalse(full node only)chequebook-enabledefault corrected tofalse(requires swap-enable)bee.yaml, scoop, homebrew-amd64, homebrew-arm64)restructured into labelled mode-based sections
Test plan
node-mode: ultra-lightand no RPC — node starts cleanlynode-mode: light, no RPC — rejected with clear errornode-mode: light+ RPC — node starts in light modenode-mode: full, no RPC — rejected with clear errornode-mode: full+ RPC +swap-enable: false— rejectednode-mode: full+ RPC +swap-enable: true— full nodefull-node: true— deprecation warning, behaves asnode-mode: fullnode-mode: ultra-light+swap-enable: true— rejectedAI Disclosure