-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Description
Background
Java-Tron already supports dynamic loading of the node.active and node.passive configurations through dynamicConfig, allowing these parameters to be modified at runtime without restarting the node.
To further improve operational flexibility, we propose extending the dynamic loading capability to more configuration items, including network connection strategies, RPC / HTTP / gRPC parameters, JSON-RPC parameters, dynamic rate limiting, and node monitoring switches.
Rationale
Why should this feature exist?
- Operators can adjust key parameters without restarting nodes, improving overall network stability and availability.
- In testing environments or large-scale node deployments, operators could dynamically tune RPC concurrency, P2P connection strategies, and rate-limiting strategies flexibly.
- It avoids service interruptions or temporary unavailability caused by frequent node restarts.
Use Cases
- Temporarily adjusting node connection limits to handle network fluctuations.
- Dynamically modifying RPC or HTTP parameters such as minimum effective connections or rate-limiting policies during high traffic periods.
- Enabling or disabling metrics collection without stopping the node.
- Quickly responding to operational needs or testing scenarios such as stress testing or traffic shaping.
Specification
The following configuration items are proposed to support dynamic loading.
Network / P2P Connection Strategy
node.maxConnectionsnode.minConnectionsnode.minActiveConnectionsnode.maxConnectionsWithSameIpnode.fastForwardnode.isOpenFullTcpDisconnectnode.inactiveThresholdnode.unsolidifiedBlockChecknode.maxUnsolidifiedBlocks
RPC / HTTP / gRPC Parameters
node.rpc.minEffectiveConnectionnode.walletExtensionApinode.disabledApi
JSON-RPC Parameters
node.jsonrpc.maxBlockRangenode.jsonrpc.maxSubTopicsnode.jsonrpc.maxBlockFilterNum
Dynamic Rate Limiting
rate.limiter.httprate.limiter.rpcrate.limiter.global.qpsrate.limiter.global.ip.qps
Node Monitoring (Metrics / Logging)
node.metricsEnablenode.openPrintLog
Test Specification
- Modify the configuration file and trigger dynamic reload to verify that the updated parameters take effect immediately without restarting the node.
- Ensure that dynamic updates do not interrupt existing P2P connections or RPC sessions.
- Verify that configuration change events are recorded in the logs.
- Validate that invalid configuration values are properly rejected to ensure node stability.
Scope Of Impact
- P2P module: connection limits, maximum connections per IP, fast-forward node lists.
- RPC / HTTP / gRPC modules: minimum effective connections, extension API switches.
- Rate limiter module: QPS limits for HTTP / RPC / P2P components and global QPS.
- Metrics module: node monitoring switch.
- Operations and testing environments: configuration changes can be applied without restarting the node.
Implementation
- The implementation could extend the existing dynamicConfig mechanism by adding logic to monitor and apply additional configuration parameters.
- Each time the configuration file is read, validate new values and atomically update the corresponding module parameters.
- Implement refresh methods for different modules, such as P2P, RPC, RateLimiter, and Metrics.
- Log every dynamic reload event to facilitate tracking and auditing.
Reactions are currently unavailable