refactor(config): remove unused storage index and json parsing config#6794
Open
317787106 wants to merge 4 commits into
Open
refactor(config): remove unused storage index and json parsing config#6794317787106 wants to merge 4 commits into
317787106 wants to merge 4 commits into
Conversation
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Removes two groups of unused or over-engineered config items:
node.http.maxNestingDepth/node.http.maxTokenCount— these are JSON-parsing DoS-protection caps that were exposed as user-configurable fields inreference.conf,NodeConfig.HttpConfig, andCommonParameter. Because the values were baked into theJSON/JsonRpcServletclass-levelObjectMapperat first class-load, exposing them as runtime config created a silent initialization-order trap: if any code touchedJSONbeforeArgs.setParam()completed, the user's overrides would be silently ignored. The values (100 / 100 000) are security constants, not operator-tunable settings. This PR promotes them toConstant.MAX_NESTING_DEPTH/Constant.MAX_TOKEN_COUNT, removes the config binding, and deletes the fragile init-order comment that described the footgun.storage.index.directory/storage.index.switch— legacy config keys that have no consumers in runtime code.Storage.indexDirectoryandStorage.indexSwitchwere populated from config but never read. TheStorageConfig.IndexConfiginner class and all config/field bindings are removed. The corresponding CLI flags (--storage-index-directory,--storage-index-switch) retain their@Parameterdeclarations so JCommander still recognises them — preventing a misleading startup crash for operators whose launch scripts still pass these flags — but the values are no longer applied anywhere.Why are these changes required?
reference.confand for developers maintaining the config-binding pipeline.CommonParameter-backedmaxNestingDepth/maxTokenCountfields removes a class-initialization ordering constraint that was documented only in a comment, making startup order more robust and the JSON utility class simpler.Invalid inetSocketAddresscrash with no indication that the flag was removed.CommonParameterandreference.confof accumulated legacy fields (part of thefeature/reduce_482_configseries).This PR has been tested by:
StorageConfigTest,ArgsTest,JsonTest,JsonRpcServletTestupdated/passing)--storage-index-directory/--storage-index-switchstill start normally and emit a deprecation warning instead of crashingFollow up
Continue auditing
CommonParameterandreference.conffor additional unused or redundant config entries.Extra details
No behaviour change for any running node: the JSON depth/token limits remain exactly 100 / 100 000; index storage was already a no-op. Operators passing the removed index CLI flags get a deprecation warning on startup; the flags are silently consumed and ignored.