Skip to content

[Feature] SolidityNode supports conditional shutdown #6610

@liuyifei001

Description

@liuyifei001

Background

A SolidityNode is designed to provide query services for blocks and events that are finalized. Its core value lies in stability, determinism, and suitability for production workloads. Since it does not need to perform signature verification for transactions and blocks, its synchronization speed is over 30% faster than a FullNode.

However, compared to a FullNode, SolidityNode lacks certain functionalities, which introduces inconvenience for users. For example, it currently does not support conditional shutdown, which is critical for scenarios such as verifying the global state at a specific block height.

Rationale

Why should this feature exist?

  • To enable the SolidityNode to stop automatically based on specified conditions, allowing users to query and verify the state at a target block.

What are the use cases?

  • Synchronizing a specific block range more quickly than FullNode
  • Performing state consistency verification across nodes

Specification

The following configuration allows customizing the automatic shutdown conditions. Only one of the three options can be enabled at a time:

node.shutdown = {
#  BlockTime  = "54 59 08 * * ?"  # Trigger shutdown when block header time matches
#  BlockHeight = 33350800         # Trigger shutdown when block height matches
#  BlockCount = 12                # Trigger shutdown after syncing a number of blocks since startup
}

Design Context

To verify global execution consistency across heterogeneous architectures (e.g., x86 vs.  ARM) during full sync, the blockchain is partitioned into segments based on snapshots for parallel processing. Data continuity is validated by ensuring the Final State of a preceding segment perfectly matches the Initial State of the subsequent one. While SolidityNodes accelerate this synchronization, their current inability to halt at a specific block height necessitates further enhancements.

Implementation Approach

We introduce these three condition checks from TronNetDelegate into the org.tron.program.SolidityNode class.

Additionally: Force p2pdisable = true, ensure that:

  • Core block processing logic remains unchanged
  • Shutdown conditions can still be triggered correctly

No modification is required for the existing configuration format.

Test Specification

Set different conditions to verify whether the node shutdowns as expected.

Scope of Impact

This change only affects the Solidity Node.

Implementation

Do you have ideas regarding the implementation of this feature?

Yes

Are you willing to implement this feature?

Yes

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Review

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions