Skip to content

Commit 970b47a

Browse files
317787106claude
andcommitted
fix(config): address review findings in docs and reference.conf
- Remove incorrect DnsConfig Javadoc referencing nonexistent PublishConfig - Move deprecated activeConnectFactor/connectFactor to end of node block in reference.conf with clearer deprecation comment - Fix double backtick typo in configuration.md (Args.logConfig()) - Fix capitalisation inconsistency in configuration.md table - Add missing trailing newline to configuration.md - Clarify nesting depth in configuration-conventions.md: CI gate hard ceiling is 5 (historical max); new keys must stay within 3 levels Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent fb88159 commit 970b47a

4 files changed

Lines changed: 14 additions & 16 deletions

File tree

common/src/main/java/org/tron/core/config/args/NodeConfig.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,6 @@ public static class DynamicConfigSection {
267267
private long checkInterval = 600;
268268
}
269269

270-
/**
271-
* All default parameters come from PublishConfig
272-
*/
273270
@Getter
274271
@Setter
275272
public static class DnsConfig {

common/src/main/resources/reference.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ node {
195195
maxHttpConnectNumber = 50
196196
minParticipationRate = 0
197197

198-
# Deprecate, don't use
199-
activeConnectFactor = 0.1
200-
# Deprecate, don't use
201-
connectFactor = 0.6
202-
203198
# WARNING: Some shielded transaction APIs require sending private keys as parameters.
204199
# Calling these APIs on untrusted or remote nodes may leak your private keys.
205200
# It is recommended to invoke them locally for development and testing.
@@ -397,6 +392,11 @@ node {
397392
# Open history query APIs on lite FullNode (may return null for some queries)
398393
openHistoryQueryWhenLiteFN = false
399394

395+
# Deprecated: these fields were used by the old connection-factor algorithm.
396+
# They are still accepted from user config for backward compatibility but have no effect.
397+
activeConnectFactor = 0.1
398+
connectFactor = 0.6
399+
400400
jsonrpc {
401401
# Note: Before release_4.8.1, if you turn on jsonrpc and run it for a while and then turn it off,
402402
# you will not be able to get the data from eth_getLogs for that period of time. Default: false

docs/configuration-conventions.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,17 @@ A HOCON key named `isOpenFullTcpDisconnect` produces the setter `setIsOpenFullTc
8181

8282
## Nesting Depth
8383

84-
Keep nesting to **at most 3 levels** from the top-level section. Deeper nesting creates long key paths that are hard to override in `config.conf` and require more boilerplate inner bean classes.
84+
The CI gate enforces a hard ceiling of **5 levels** (the historical maximum in `reference.conf`). New parameters must stay within **3 levels** from the top-level section. The gap between 3 and 5 is reserved for legacy paths that already exist — it is not a license to add new deep keys.
8585

8686
```
8787
level 1: node { ... }
8888
level 2: node { rpc { ... } }
89-
level 3: node { rpc { flowControl { ... } } } ← maximum
90-
level 4+: node { rpc { flowControl { window { ... } } } } ← avoid
89+
level 3: node { rpc { flowControl { ... } } } ← limit for new keys
90+
level 4+: node { rpc { flowControl { window { ... } } } } ← legacy only; do not add new keys here
91+
level 6+: rejected by CI gate unconditionally
9192
```
9293

93-
Each level of nesting requires a corresponding inner static bean class. If you find yourself going 4 levels deep, consider flattening by moving the leaf keys up one level or using a longer camelCase key at level 2.
94+
Each level of nesting requires a corresponding inner static bean class. If you find yourself going beyond 3 levels deep, consider flattening by moving the leaf keys up one level or using a longer camelCase key at level 2.
9495

9596
## Adding a New Parameter: Checklist
9697

@@ -190,7 +191,7 @@ nc.shutdownBlockTime = section.hasPath("shutdown.BlockTime")
190191
| Standard camelCase | `maxConnections` | `MaxConnections`, `max_connections`, `max-connections` |
191192
| No `is` prefix | `openFullTcpDisconnect` | `isOpenFullTcpDisconnect` |
192193
| No all-caps acronym prefix | `pbftExpireNum`, `pBFTPort`* | `PBFTExpireNum` |
193-
| Nesting ≤ 3 levels | `node.rpc.maxMessageSize` | `node.rpc.limits.size.max` |
194+
| New keys: nesting ≤ 3 levels | `node.rpc.maxMessageSize` | `node.rpc.limits.size.max` |
194195
| Java field name matches HOCON key exactly | field `maxConnections` ↔ key `maxConnections` | field `maxConns` ↔ key `maxConnections` |
195196

196197
\* `PBFTEnable` / `PBFTPort` are legacy exceptions; do not model new keys after them.

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ java-tron uses [Typesafe Config](https://github.com/lightbend/config) and applie
99
| File | Location | Purpose |
1010
|------|----------|---------|
1111
| `reference.conf` | Bundled inside the jar (`common` module) | Declares every parameter with its default value |
12-
| `config.conf` | bundled template and optionally edited & passed via -c | Overrides only the values that differ from defaults |
12+
| `config.conf` | Bundled template, optionally edited & passed via -c | Overrides only the values that differ from defaults |
1313

1414
**Loading priority:** values in `config.conf` always win. Any parameter that your `config.conf` omits is automatically filled in from `reference.conf`. You never need to copy the entire `reference.conf` into your own file — only include the parameters you actually want to change.
1515

@@ -242,7 +242,7 @@ Not all parameters support hot-reload. Parameters that affect node identity, gen
242242

243243
## Viewing Effective Configuration
244244

245-
At startup, the node unconditionally logs a summary of key parameters under `Net config`, `Backup config`, `Code version`, `DB config`, and `shutDown config` headers (see `Args.logConfig()`` for the exact fields). For parameters not in this summary, you must inspect runtime behavior or consult `reference.conf` directly — the full merged configuration is never dumped.
245+
At startup, the node unconditionally logs a summary of key parameters under `Net config`, `Backup config`, `Code version`, `DB config`, and `shutDown config` headers (see `Args.logConfig()` for the exact fields). For parameters not in this summary, you must inspect runtime behavior or consult `reference.conf` directly — the full merged configuration is never dumped.
246246

247247
Note: `node.openPrintLog` is a separate flag that controls runtime verbosity of P2P/inventory/pending-tx logs, not startup config logging.
248248

@@ -254,4 +254,4 @@ Every parameter with its default value and an inline comment is documented in:
254254
common/src/main/resources/reference.conf
255255
```
256256

257-
When you need the authoritative default for a parameter or want to understand what a key does, consult that file directly.
257+
When you need the authoritative default for a parameter or want to understand what a key does, consult that file directly.

0 commit comments

Comments
 (0)