Skip to content

Supports dynamic loading of more configurations #6577

@zeusoo001

Description

@zeusoo001

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.maxConnections
  • node.minConnections
  • node.minActiveConnections
  • node.maxConnectionsWithSameIp
  • node.fastForward
  • node.isOpenFullTcpDisconnect
  • node.inactiveThreshold
  • node.unsolidifiedBlockCheck
  • node.maxUnsolidifiedBlocks
RPC / HTTP / gRPC Parameters
  • node.rpc.minEffectiveConnection
  • node.walletExtensionApi
  • node.disabledApi
JSON-RPC Parameters
  • node.jsonrpc.maxBlockRange
  • node.jsonrpc.maxSubTopics
  • node.jsonrpc.maxBlockFilterNum
Dynamic Rate Limiting
  • rate.limiter.http
  • rate.limiter.rpc
  • rate.limiter.global.qps
  • rate.limiter.global.ip.qps
Node Monitoring (Metrics / Logging)
  • node.metricsEnable
  • node.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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions