<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[TRON - Medium]]></title>
        <description><![CDATA[The scalable, available layer 1 network to decentralize the web. - Medium]]></description>
        <link>https://medium.com/tronnetwork?source=rss----839d5c53e074---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>TRON - Medium</title>
            <link>https://medium.com/tronnetwork?source=rss----839d5c53e074---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 06 Apr 2026 04:59:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/tronnetwork" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Mainnet Democritus Announcement]]></title>
            <link>https://medium.com/tronnetwork/mainnet-democritus-announcement-39ee3e3cf69c?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/39ee3e3cf69c</guid>
            <category><![CDATA[announcements]]></category>
            <category><![CDATA[tron]]></category>
            <category><![CDATA[java-tron]]></category>
            <category><![CDATA[java-tron-new-release]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 08:02:01 GMT</pubDate>
            <atom:updated>2026-02-06T08:02:03.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*JnQExnVCdtR2xLelscTtHg.png" /></figure><p>The TRON network has released the GreatVoyage-v4.8.1(Democritus) version (hereafter referred to as “Democritus”). This is a mandatory upgrade that introduces support for the ARM64 architecture, alongside several key updates and governance proposals. Please find the details below.</p><h3>Core</h3><h4>1. Expand compatibility for ARM64 architecture and JDK 17</h4><p>To further enrich the java-tron technical ecosystem, the Democritus version introduces support for the arm64 architecture. In arm64 environments, the system currently supports JDK 17 and the RocksDB database.</p><p><strong>ARM64 architecture</strong></p><ul><li><strong>Mandatory JDK 17</strong>: JDK 17 is the required Java runtime environment to ensure the operational stability of the node in the arm64 environments (based on JEP 237, 388, 391).</li><li><strong>Mandatory RocksDB</strong>: The database only supports <strong>RocksDB (v9.7.4)</strong>. LevelDB JNI does not support arm64 architecture and lacks maintenance, so the community-active RocksDB was chosen.</li><li><strong>Floating point computation adaptation</strong>: Floating-point calculations have been switched to use StrictMath via a proposal to ensure consistent results across different platforms. Before the proposal took effect, differences in floating-point implementations between arm64 and x86_64 architectures could lead to inconsistent results. Therefore, on arm64 architectures, results are kept consistent with x86_64 mainnet data via hardcoding. <strong>Warning</strong>: Private networks on x86_64 platforms using floating-point computation (specifically Bancor transactions involving pow) may face synchronization issues from genesis on arm64. In such cases, please use a database snapshot from an existing height to start arm64 nodes.</li><li><strong>Toolkit limitations</strong>: LevelDB-related commands (db archive and db convert) are not supported in arm64 environments.</li></ul><p><strong>Changes under x86_64 architecture</strong></p><ul><li><strong>Mandatory JDK 8</strong>: Since versions higher than JDK 8 have removed Java EE modules (per JEP 320), annotations such as @PostConstruct will fail, leading to NullPointerExceptions and block synchronization failures. Democritus introduces mandatory JDK 8 validation on x86_64 to ensure environment stability.</li><li><strong>RocksDB/LevelDB compatibility restrictions</strong>: Due to version discrepancies (x86_64 uses RocksDB v5.15.10 which supports LevelDB, while arm64 uses v9.7.4 which does not), forcing RocksDB to open LevelDB in an arm64 environment triggers “Database Corruption” errors. To ensure consistent cross-platform behavior and data migration, <strong>Democritus uniformly prohibits RocksDB from accessing LevelDB databases</strong> (Existing databases successfully opened via compatibility mode remain unaffected). Error prompts for LevelDB attempting to open RocksDB have also been optimized, and interfaces/exception logic have been standardized.</li><li><strong>Toolkit update</strong>: Previously, db convert defaulted to a “compatibility mode” that only updated the value of engine.properties to RocksDB while keeping the underlying data in LevelDB format. To align with arm64’s strict RocksDB requirements, the db convert command has been refactored to perform a <strong>non-compatibility conversion</strong> (previously the -safe flag logic). Consequently, the -safe parameter and “compatibility mode” have been removed to ensure seamless data migration across architectures.</li></ul><p><strong>Other changes</strong></p><p><em>JDK 17 Compatibility</em></p><ul><li>Null pointer compatibility: Optimized null pointer prompt information to facilitate problem positioning (based on JEP 358).</li><li>Number conversion exception compatibility: Optimized number conversion exception prompts and added conversion radix error prompts (based on JDK-8176425).</li><li>JDK version parsing compatibility: Adapted to JDK 10+ version number format changes (based on JEP 223).</li><li>var inference keyword: Supports var type inference mechanism (based on JEP 286).</li></ul><p><em>RocksDB Resource Optimization</em></p><ul><li>Increase max handle setting parameter: Added the parameter dbSettings.maxOpenFiles, default is 5000 (previously mandatory and unconfigurable), developers can adjust according to server load.</li><li>Resource release optimization: Set a reasonable lifecycle for RocksDB resources to release used resources in time, avoiding potential memory leak problems.</li></ul><p><em>To support JDK 17 and arm64 architecture, the following dependency changes were made:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fEqaBMVTr2VFPLHlnQB0yg.png" /></figure><p><strong>Issue</strong>: <a href="https://github.com/tronprotocol/java-tron/issues/5954">https://github.com/tronprotocol/java-tron/issues/5954</a></p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6327">https://github.com/tronprotocol/java-tron/pull/6327</a> <a href="https://github.com/tronprotocol/java-tron/pull/6421">https://github.com/tronprotocol/java-tron/pull/6421</a> <a href="https://github.com/tronprotocol/java-tron/pull/6440">https://github.com/tronprotocol/java-tron/pull/6440</a> <a href="https://github.com/tronprotocol/java-tron/pull/6455">https://github.com/tronprotocol/java-tron/pull/6455</a> <a href="https://github.com/tronprotocol/java-tron/pull/6457">https://github.com/tronprotocol/java-tron/pull/6457</a> <a href="https://github.com/tronprotocol/java-tron/pull/6459">https://github.com/tronprotocol/java-tron/pull/6459</a> <a href="https://github.com/tronprotocol/java-tron/pull/6472">https://github.com/tronprotocol/java-tron/pull/6472</a> <a href="https://github.com/tronprotocol/java-tron/pull/6502">https://github.com/tronprotocol/java-tron/pull/6502</a></p><h3>TVM</h3><h4>1. Modify the behavior of SELFDESTRUCT</h4><p>Following the proposal to deprecate the SELFDESTRUCT instruction via <a href="https://github.com/tronprotocol/tips/blob/master/tip-652.md">TIP-652</a> in GreatVoyage-4.8.0 (Kant), the Democritus release formally introduces behavioral adjustments to SELFDESTRUCT. This change ensures deep compatibility with Ethereum’s EIP-6780, aligning the TVM (TRON Virtual Machine) with EVM standards. Detailed specifications can be found in <a href="https://github.com/tronprotocol/tips/blob/master/tip-6780.md">TIP-6780</a>.</p><p>In versions prior to Democritus, SELFDESTRUCT allowed a contract to terminate itself, transfer its funds to a designated address, and delete all associated account data (code, storage, and the account itself). Starting with the Democritus release, the behavior of the SELFDESTRUCT instruction is modified as follows:</p><p><strong>Restricted Execution Scenarios</strong></p><p>Account data deletion (including code, storage, and the account itself) is now only permitted if SELFDESTRUCT is invoked within the same transaction in which the contract was created.</p><p><em>Scenario 1: invoke </em><em>SELFDESTRUCT in a Subsequent Transaction (Standard Case)</em></p><ul><li>The contract account is <strong>not</strong> destroyed.</li><li>Execution of the current contract stops immediately.</li><li>No data is deleted, including storage keys, code, or the account itself. However, all assets (TRX, staked TRX, and TRC10 tokens) are transferred to the target address.</li><li>If the target address is the contract itself, the assets are not burned.</li></ul><p><em>Scenario 2: invoke </em><em>SELFDESTRUCT in the Same Transaction (Creation &amp; Destruction)</em></p><ul><li>Execution stops immediately.</li><li>All account data is purged.</li><li>All assets are transferred to the target address.</li><li>If the target address is the contract itself, the balance is reset to zero and the assets are burned.</li></ul><p><strong>Energy Cost Adjustment</strong></p><p>To increase the threshold for usage and further mitigate abuse, the Energy cost for the SELFDESTRUCT opcode has been increased from 0 to 5,000.</p><p><strong>NOTE</strong>: This feature is governed by TRON network parameter #94. It is disabled by default (value: 0) and can be enabled through a governance proposal vote. Once enabled, it cannot be disabled.</p><p><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-6780.md">https://github.com/tronprotocol/tips/blob/master/tip-6780.md</a></p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6383">https://github.com/tronprotocol/java-tron/pull/6383</a> <a href="https://github.com/tronprotocol/java-tron/pull/6448">https://github.com/tronprotocol/java-tron/pull/6448</a></p><h3>Net</h3><h4>1. Fix “gt lastNum” and “gt highNoFork” error during block synchronizing</h4><p>The synchronization service previously outputted full exception stack traces during specific edge-case scenarios involving gt highNoFork and gt lastNum errors. To better align with standard error-level logging practices, this behavior has been adjusted. The service now logs only the specific exception message, suppressing the full stack trace to reduce log noise and improve readability.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6381">https://github.com/tronprotocol/java-tron/pull/6381</a></p><h4>2. Fix the light node incorrectly reporting a FORKED disconnection</h4><p>In versions prior to Democritus, light nodes often misidentified connection issues as FORKED during handshakes with Full Nodes of lower block heights. This occurred specifically when a Full Node’s highest solidified block was not present on the light node’s local main chain.</p><p>The Democritus release refines this logic by introducing a specific height threshold: a FORKED status is now only triggered if the light node’s lowest block height is lower than the Full Node’s highest solidified block height. In all other cases of chain mismatch, the error is correctly categorized as LIGHT_NODE_SYNC_FAIL.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6375">https://github.com/tronprotocol/java-tron/pull/6375</a></p><h4>3. Optimize P2P disconnection reason codes</h4><p>Prior to the Democritus release, certain P2P_DISCONNECT messages utilized vague reason codes, hindering accurate network troubleshooting. This update refines the error reporting logic for three specific scenarios to provide clearer diagnostic data:</p><ul><li><strong>Scenario 1</strong>: If a connection is terminated because a received block fails signature verification, the reason code is updated from UNKNOWN to BAD_BLOCK.</li><li><strong>Scenario 2</strong>: Previously, failures during the HelloMessage validation incorrectly triggered an UNEXPECTED_IDENTITY error, even when no identity-specific checks were performed. This has been corrected to INCOMPATIBLE_PROTOCOL to accurately reflect the validation failure.</li><li><strong>Scenario 3</strong>: When a P2P_HELLO message contains a block ID with a length other than 32 bytes, the disconnection reason is now reported as INCOMPATIBLE_PROTOCOL instead of UNKNOWN.</li></ul><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6394">https://github.com/tronprotocol/java-tron/pull/6394</a></p><h4>4. Implement P2P message rate limit</h4><p>Prior to the Democritus release, P2P message processing was not rate-limited, leaving nodes vulnerable to resource exhaustion (bandwidth, CPU, and RAM) when handling high message volumes. To address this, Democritus introduces a per-peer rate limiting mechanism. If the frequency of specific messages from a single peer exceeds defined thresholds, the node will drop the messages and proactively disconnect from that peer. The following limits are applied based on message type and node state:</p><ul><li>SyncBlockChainMessage: Restricted to 3 QPS during the synchronization phase (defined as ChainInventory.remainNum &gt; 0).</li><li>FetchInvDataMessage: Restricted to 3 QPS during the block synchronization stage.</li><li>P2P_DISCONNECT: Processing is limited to 1 QPS.</li></ul><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6393">https://github.com/tronprotocol/java-tron/pull/6393</a></p><h4>5. Optimize concurrent access to fields of PeerConnection</h4><p>The Democritus release optimizes concurrent access to PeerConnection by applying the volatile keyword to shared fields and refining the sequence of variable assignments. These changes ensure thread-safe visibility and prevent race conditions, significantly reducing exceptions caused by state inconsistencies during network synchronization.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6360">https://github.com/tronprotocol/java-tron/pull/6360</a></p><h3>Other Changes</h3><h4><strong>Configuration &amp; Dependencies</strong></h4><h4>1. Optimize the configuration switch for zkSNARK</h4><p>Added configuration item node.allowShieldedTransactionApi to replace node.fullNodeAllowShieldedTransaction.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6371">https://github.com/tronprotocol/java-tron/pull/6371</a> <a href="https://github.com/tronprotocol/java-tron/pull/6427">https://github.com/tronprotocol/java-tron/pull/6427</a></p><h4>2. Upgrade gradle to support jitpack publish</h4><p>Gradle version has been upgraded to 7.6.4, using the maven-publish plugin to support jitpack publishing.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6367">https://github.com/tronprotocol/java-tron/pull/6367</a></p><h4>3. Optimize local witness initialization logic</h4><p>The Democritus release refines the local witness initialization process. Private key and address initialization logic is now executed exclusively by witness nodes. If an invalid witness address is configured, the program will throw an exception and terminate. Additionally, the cryptography library has been upgraded from org.bouncycastle:bcprov-jdk15on:1.69 to org.bouncycastle:bcprov-jdk18on:1.79.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6368">https://github.com/tronprotocol/java-tron/pull/6368</a> <a href="https://github.com/tronprotocol/java-tron/pull/6452">https://github.com/tronprotocol/java-tron/pull/6452</a></p><h4>4. Optimize log prompts for missing Blackhole configuration</h4><p>The Democritus release improves the error logging for missing Blackhole account configurations. The updated logs provide more actionable guidance, explicitly notifying users to configure the Blackhole account address within the config.conf file.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6356">https://github.com/tronprotocol/java-tron/pull/6356</a></p><h4>5. Enrich FullNode command-line options</h4><p>Starting with the Democritus release, the standalone SolidityNode.jar and KeystoreFactory.jar have been merged into FullNode. Users can start the SolidityNode service using the command-line parameter—-solidity, or start the KeystoreFactory service using --keystore-factory. This unification reduces storage overhead and simplifies build and deployment workflows.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6397">https://github.com/tronprotocol/java-tron/pull/6397</a> <a href="https://github.com/tronprotocol/java-tron/pull/6450">https://github.com/tronprotocol/java-tron/pull/6450</a> <a href="https://github.com/tronprotocol/java-tron/pull/6446">https://github.com/tronprotocol/java-tron/pull/6446</a></p><h4>6. Synchronize config.conf with tron-deployment</h4><p>The Democritus version introduces full synchronization of configuration items between config.conf and the tron-deployment repository, and updates the seed node list in seed.node.ip.list.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6332">https://github.com/tronprotocol/java-tron/pull/6332</a></p><h4>7. Standardize full configuration and annotation guidelines</h4><p>The Democritus version introduces a standardized configuration file containing all supported parameters. <strong>Any configuration item not included in this file is considered invalid or deprecated.</strong> Additionally, this release defines specific annotation and commenting standards within the configuration files:</p><ul><li>Whole-line comments Must begin with the # prefix.</li><li>Comments appended to the end of a configuration line may use either # or //.</li><li>Configuration items without default values must be prefixed with # to serve as a commented-out template.</li></ul><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6430">https://github.com/tronprotocol/java-tron/pull/6430</a></p><h4>8. Update dependencies</h4><p>Upgraded dependencies such as grpc-java, spring, jackson, and jetty:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZ4Khl9LKOgHUK9ZO4OInA.png" /></figure><p>Deleted dependencies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*T-kAZdX2EJuJO1CKR3d2_w.png" /></figure><p>Additionally, the Democritus version upgrades the underlying network library libp2p, from 2.2.6 to 2.2.7. This version not only adds compilation support for JDK 17 but also introduces numerous optimizations and improvements:</p><ul><li>Added formal compilation support for JDK 17 (<a href="https://github.com/tronprotocol/libp2p/pull/113">#113</a>).</li><li>Upgraded grpc-netty and protobuf libraries (<a href="https://github.com/tronprotocol/libp2p/pull/110">#110</a>).</li><li>Optimized connection pool (connPool) and general resource allocation logic (<a href="https://github.com/tronprotocol/libp2p/pull/116">#116</a>).</li><li>Implemented a concurrent external IP acquisition mechanism with built-in validation (<a href="https://github.com/tronprotocol/libp2p/pull/120">#120</a>, <a href="https://github.com/tronprotocol/libp2p/pull/121">#121</a>).</li><li>Refined network detection logic (<a href="https://github.com/tronprotocol/libp2p/pull/122">#122</a>).</li></ul><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6400">https://github.com/tronprotocol/java-tron/pull/6400</a> <a href="https://github.com/tronprotocol/java-tron/pull/6429">https://github.com/tronprotocol/java-tron/pull/6429</a> <a href="https://github.com/tronprotocol/java-tron/pull/6431">https://github.com/tronprotocol/java-tron/pull/6431</a> <a href="https://github.com/tronprotocol/java-tron/pull/6481">https://github.com/tronprotocol/java-tron/pull/6481</a></p><h4>9. Update code version to 4.8.1</h4><p>The version number has been formally defined as 4.8.1 to reflect the Democritus release.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6445">https://github.com/tronprotocol/java-tron/pull/6445</a></p><h4>Event Service</h4><h4>1. Optimize transaction info retrieval logic for Event Services</h4><p>The Democritus release addresses compatibility issues encountered during the retrieval of transaction info. To ensure data availability, if the event service fails to retrieve data from the transactionRetStore database, it will automatically perform a compatibility fallback to retrieve data from the transactionHistoryStore database.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6443">https://github.com/tronprotocol/java-tron/pull/6443</a> <a href="https://github.com/tronprotocol/java-tron/pull/6453">https://github.com/tronprotocol/java-tron/pull/6453</a></p><h4>2. Remove bloom filter write toggle</h4><p>The section-bloom database is used to store bloom filters for contract logs and their corresponding block indexes. When processing eth_getLogs requests, the node queries this database to quickly locate matching blocks. This is a critical step for efficient event retrieval.</p><p>Prior to the Democritus Release, writing to this database was controlled by the node.jsonrpc.httpFullNodeEnable configuration. If this setting was disabled, the node would not record block bloom filter data to the section-bloom database. Because these index data points cannot be retrospectively backfilled automatically, users were unable to query historical transaction events that occurred while the toggle was off — even if they enabled the configuration later.</p><p>Starting with the Democritus version, dependency on this configuration toggle has been removed. The node now persistently writes data to the section-bloom database by default. This change ensures the continuity and integrity of the bloom filter index, completely resolving the issue where eth_getLogs failed to retrieve historical data due to specific configuration states.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6372">https://github.com/tronprotocol/java-tron/pull/6372</a></p><h4>3. Optimize event service shutdown logic</h4><p>The Democritus version introduces an optimized shutdown logic for the HistoryEventService thread. By implementing a global state variable, isClosed, the system now ensures that resource deallocation occurs exactly once, even if the close function is invoked multiple times. This optimization effectively prevents redundant resource disposal and associated exceptions, significantly enhancing system stability during termination.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6463">https://github.com/tronprotocol/java-tron/pull/6463</a></p><h4>Test Case</h4><h4>1. Optimize resource management for test cases</h4><p>The Democritus version introduces a systematic optimization of resource management for unit testing. These enhancements significantly improve execution efficiency while further ensuring the cleanliness and stability of the testing environment.</p><ul><li><strong>Standardized Cleanup Mechanism</strong>: Implemented a more rigorous file cleanup protocol to ensure that all temporary data generated during testing is thoroughly removed post-execution.</li><li><strong>Improved Execution Performance</strong>: By optimizing high-latency test cases, the total duration of the unit testing suite has been reduced by up to 30%.</li><li><strong>Robust Resource Release</strong>: Addressed known resource leak issues and standardized the resource release logic.</li><li><strong>Enhanced Runtime Stability</strong>: Resolved specific NullPointerExceptions.</li></ul><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6437">https://github.com/tronprotocol/java-tron/pull/6437</a> <a href="https://github.com/tronprotocol/java-tron/pull/6483">https://github.com/tronprotocol/java-tron/pull/6483</a> <a href="https://github.com/tronprotocol/java-tron/pull/6486">https://github.com/tronprotocol/java-tron/pull/6486</a></p><h4>2. Implement gRPC timeout mechanism</h4><p>When executing test cases repeatedly (e.g., over 100 times) on arm64, certain gRPC test cases would hang. To solve this, the Democritus version introduces a gRPC timeout mechanism. A 5-second execution timeout was added for individual gRPC test case, and a 30-second timeout for the entire test execution; if it times out, it breaks and continues executing subsequent logic.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6441">https://github.com/tronprotocol/java-tron/pull/6441</a> <a href="https://github.com/tronprotocol/java-tron/pull/6460">https://github.com/tronprotocol/java-tron/pull/6460</a></p><h4>3. Ensure automated termination of unit test</h4><p>The Democritus version introduces optimizations to the termination logic of the ConditionalStopTest unit test. Specifically, within SR scenarios, the logic has been refined to accurately identify stop conditions even when the block production sequence undergoes changes. This ensures that the unit test terminates correctly and automatically as expected.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6469">https://github.com/tronprotocol/java-tron/pull/6469</a></p><h4>4. Enhance log context isolation mechanism</h4><p>The Democritus version addresses the issue of global logger configuration pollution previously triggered by the TronErrorTest unit test. By strengthening the output of error and warning messages during the LogService configuration loading phase and explicitly restoring the logger context within unit tests, the system now ensures complete log environment isolation between different test cases. This improvement eliminates interference in logging behavior across test suites and provides clearer diagnostic data for rapidly locating Logback configuration loading anomalies.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6476">https://github.com/tronprotocol/java-tron/pull/6476</a></p><h4>5. Resolve CheckStyle violations in test cases</h4><p>Added a line break to a comment statement in the test case file to fix checkStyle issues in test cases.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6392">https://github.com/tronprotocol/java-tron/pull/6392</a></p><h4>Documents</h4><h4>1. Update readme for FullNode startup JVM parameters</h4><p>Adjusted the JVM startup parameters for java-tron on x86_64 and arm64 platforms, aiming to ensure that FullNode nodes can meet basic disaster recovery requirements under minimum hardware configurations; meanwhile, modified hardware requirements to recommend more stable machine configurations.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6478">https://github.com/tronprotocol/java-tron/pull/6478</a></p><h4>2. Fix README badge display errors</h4><p>The Democritus version fixed the issue where the GitHub badge at the top of the README document displayed as “unknown”, and modified the badge image link.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6340">https://github.com/tronprotocol/java-tron/pull/6340</a></p><h4>3. Update telegram info and doc link in README</h4><p>The Democritus version udpated the README document to add Telegram contact information for the official TRON development discussion group.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6364">https://github.com/tronprotocol/java-tron/pull/6364</a></p><h4>Others</h4><h4>1. TIP-767: Transitioning voting window configuration to chain governance</h4><p>To ensure high uniformity of governance parameters across the entire network and enhance protocol consistency, the Democritus version introduces TRON №.92 network parameter (PROPOSAL_EXPIRE_TIME), transitioning the configuration of proposal expiration time to on-chain governance.</p><p><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-767.md">https://github.com/tronprotocol/tips/blob/master/tip-767.md</a></p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6399">https://github.com/tronprotocol/java-tron/pull/6399</a> <a href="https://github.com/tronprotocol/java-tron/pull/6454">https://github.com/tronprotocol/java-tron/pull/6454</a></p><h4>2. Fix protocol buffer syntax compatibility issue</h4><p>Fixed the hexadecimal casing error in the ReasonCode struct, resolving compilation compatibility issues in JavaScript environments.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6426">https://github.com/tronprotocol/java-tron/pull/6426</a></p><h3>API</h3><h4>1. Introduce the eth_getBlockReceipts API</h4><p>The Democritus version introduces the eth_getBlockReceipts interface, used to query all transaction receipts in a specified block. For genesis blocks, blocks already pruned by light nodes, and unproduced blocks, it returns null.</p><ul><li><strong>Parameters</strong>: Block identifier (required). Supports three types: a block number represented as a hexadecimal string, a block hash (with or without the 0x prefix), or a block tag (&quot;latest&quot;, &quot;earliest&quot;, &quot;finalized&quot;).</li><li><strong>Returns</strong>: An array of objects. Each object is a receipt for a transaction within that block, and follows the same structure as the response returned by <a href="https://developers.tron.network/reference/eth_gettransactionreceipt">eth_getTransactionReceipt</a>.</li></ul><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6379">https://github.com/tronprotocol/java-tron/pull/6379</a> <a href="https://github.com/tronprotocol/java-tron/pull/6433">https://github.com/tronprotocol/java-tron/pull/6433</a></p><h4>2. Introduce a new API to query the real-time vote count of witness</h4><p>The Democritus version introduces the getPaginatedNowWitnessList interface. This endpoint is designed to query real-time voting data for the current epoch and return a paginated list of witnesses sorted in descending order of their vote counts.</p><p><strong>Parameters</strong></p><ul><li>offset: long, start index, requires &gt;= 0.</li><li>limit: long, number of items to return, requires &gt; 0, upper limit is 1000.</li><li>visible: boolean, optional; controls whether the returned address is in base58check or hex format.</li></ul><p><strong>Returns</strong></p><ul><li>Success: witnesses array, each item is a Witness (containing address, vote count, URL, etc.), sorted descending by “real-time votes”.</li><li>Failure: No result. When invalid parameters (e.g., limit &lt;= 0, offset &lt; 0, or offset &gt;= total Witness count) returns {}, http code = 200.</li></ul><p>API-specific errors: When in a maintenance period and requesting non-solidified data, throws a maintenance period unavailable exception, http code = 200.</p><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6373">https://github.com/tronprotocol/java-tron/pull/6373</a> <a href="https://github.com/tronprotocol/java-tron/pull/6451">https://github.com/tronprotocol/java-tron/pull/6451</a></p><h4>3. Optimize the return data of eth_call</h4><p>In versions prior to Democritus, the eth_call interface provided limited feedback upon contract execution failure. It typically returned a generic error message (e.g., “REVERT opcode executed”) while leaving the data field empty. This lack of detailed execution context made it difficult for developers to diagnose and trace specific issues within the smart contract.</p><p>The Democritus version introduced JsonRpcException as the base class for all JsonRpc exceptions, and a JsonRpcErrorResolver class for data field generation logic.</p><p>Using the <a href="https://nile.tronscan.org/#/contract/TAFPPQK2NaqSPwKcaomLXJmwbxLB34x8Lr/code">demo contract</a> as an example, the following information was returned when calling the testInsufficientBalance method prior to the change:</p><pre>{<br> &quot;jsonrpc&quot;: &quot;2.0&quot;,<br> &quot;id&quot;: 1,<br> &quot;error&quot;: {<br>    &quot;code&quot;: -32000,<br>    &quot;message&quot;: &quot;REVERT opcode executed&quot;,<br>    &quot;data&quot;: &quot;{}&quot;<br>  }<br>}</pre><p>After modification: The data field returns error information (e.g., encoded revert reason), allowing developers to obtain the specific error reason via ABI parsing. (Consistent with Ethereum node strategy, returns unparsed data for everything except default Error(string)).</p><pre>{<br> &quot;jsonrpc&quot;: &quot;2.0&quot;,<br> &quot;id&quot;: 1,<br> &quot;error&quot;: {<br>    &quot;code&quot;: -32000,<br>    &quot;message&quot;: &quot;REVERT opcode executed&quot;,<br>    &quot;data&quot;: &quot;0xcf47918100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000064&quot;<br>  }<br>}</pre><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6369">https://github.com/tronprotocol/java-tron/pull/6369</a></p><h4>4. Performance optimization for eth_getLogs, eth_getFilterLogs</h4><p>Event query interfaces like eth_getLogs rely on a partialMatch function to query the bloom database. The query conditions are derived from 3 bitIndexes generated for each topic or address. Since the bloom filter has a bit limit (2048 bits), when the number of topics reaches 683, the total number of indexes (683 * 3 &gt; 2048) exceeds the filter capacity. This inevitably leads to bit collisions and redundant bitIndexes, resulting in duplicate database queries. To address this, the proposed optimization implements de-duplication of bitIndexes prior to execution, significantly reducing the frequency of database lookups.</p><p>The table below contrasts the duplication rate of bitIndex and execution time of partialMatch under different numbers of topics and addresses. It shows that as the number of topics increases, the higher the bitIndex duplication, the more significant the performance improvement after optimization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*MJBJw6njlkkfRt8oD9N90w.png" /></figure><p><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6370">https://github.com/tronprotocol/java-tron/pull/6370</a></p><blockquote>To a wise and good man the whole earth is his fatherland. — — Democritus</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39ee3e3cf69c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/mainnet-democritus-announcement-39ee3e3cf69c">Mainnet Democritus Announcement</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is TIP-6780?]]></title>
            <link>https://medium.com/tronnetwork/tip-6780-change-to-the-selfdestruct-opcode-b992ed3885e6?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/b992ed3885e6</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[smart-contracts]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[tron]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Tue, 18 Nov 2025 09:27:28 GMT</pubDate>
            <atom:updated>2025-11-19T05:29:55.392Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANa890tMYk1_wz-6Mn_1GA.png" /></figure><h3><strong>1. Background</strong></h3><p><a href="https://github.com/tronprotocol/tips/blob/master/tip-652.md">TIP-652</a> proposed the deprecation of the SELFDESTRUCT opcode. This change discouraged its use in newly deployed contracts and suggested its functionality may be further limited in future TVM upgrades.</p><p>As an EVM-compatible public chain, TRON has introduced <a href="https://github.com/tronprotocol/tips/blob/master/tip-6780.md">TIP-6780</a> to align with Ethereum’s <a href="https://eips.ethereum.org/EIPS/eip-6780">EIP-6780</a> and maintain behavioral consistency with the EVM.</p><h3><strong>2. Changes</strong></h3><p>Previously, the SELFDESTRUCT opcode allowed a contract to destroy itself, transfer its entire balance to a specified address, and subsequently delete all associated data of the contract account (i.e., code, storage, and the account itself).</p><h4><strong>2.1 Core Change: Restriction on </strong>SELFDESTRUCT<strong> Usage Scenarios</strong></h4><p>Account data (i.e., code, storage, and the account itself) is only deleted if SELFDESTRUCT is executed within the contract’s creation transaction.</p><p><strong>Scenario 1: </strong><strong>SELFDESTRUCT Called in a Different Transaction (Default Case)</strong></p><ul><li>The account is not actually destroyed.</li><li>The current contract’s execution halts immediately.</li><li>No data is deleted, including storage keys, code, or the account itself.</li><li>However, all assets held by the contract (TRX, staked TRX, TRC-10 tokens) are transferred to the target address.</li><li>If the target address is the contract itself, the assets are not burned.</li></ul><p><strong>Scenario 2: </strong><strong>SELFDESTRUCT Called in the Same Transaction (Immediate Self-Destruction after Creation)</strong></p><p>In this scenario, the opcode’s legacy behavior is retained:</p><ul><li>The current contract’s execution halts immediately.</li><li>All account data is deleted.</li><li>All assets are transferred to the target address.</li><li>If the target address is the contract itself, its balance is set to 0, and the assets are burned.</li></ul><h4><strong>2.2 Energy Cost Adjustment</strong></h4><p>The fixed Energy cost of the SELFDESTRUCT opcode is adjusted from <strong>0</strong> to <strong>5,000</strong>. This raises the execution cost to further deter misuse.</p><h3>​<strong>3. Impact</strong></h3><h4><strong>3.1. Impact on Developers and Smart Contracts</strong></h4><p><strong>Hard Fork Requirement:</strong> This TIP is a consensus layer change that must be implemented via a hard fork.</p><p><strong>TRX Burning Behavior: </strong>Previously, with SELFDESTRUCT, a contract could burn its TRX by specifying itself as the target address. Now, this action is restricted:</p><ul><li>If the contract was not created in the current transaction, its TRX will not be burned, and no transfer occurs.</li><li>TRX can only be burned if the contract is created and SELFDESTRUCT is called within the same transaction.</li></ul><p><strong>Invalidated Design Patterns:</strong> Some solutions that rely on SELFDESTRUCT to implement security mechanisms or proxy upgrades are no longer secure or effective. For example:</p><ul><li>The pattern of using CREATE2 + SELFDESTRUCT to implement “upgradeable contracts” is broken.</li><li>The practice of relying on SELFDESTRUCT to destroy an account to protect sensitive data is no longer viable.</li></ul><h4><strong>3.2. Impact on the TRON Ecosystem</strong></h4><ul><li><strong>Enhanced Ethereum Compatibility:</strong> This change improves alignment with the EVM, simplifying the migration and integration of cross-chain infrastructure, developer tools, and decentralized applications (DApps).</li><li><strong>Improved Contract Security:</strong> This change encourages developers to adopt more robust and predictable contract design patterns, moving away from opcodes that are considered unstable or are planned for future deprecation.</li></ul><h3><strong>3. </strong>TRON<strong> On-Chain Data Analysis</strong></h3><h4><strong>3.1 Analysis of Contracts Containing the </strong><strong>SELFDESTRUCT Opcode</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*B2tJog-mAkWj1mpJ5ekA1g.png" /><figcaption><strong>Table 1:</strong> Contracts containing SELFDESTRUCT on TRON, by Asset Value.</figcaption></figure><p>As shown in the table, the number of contracts containing the SELFDESTRUCT opcode is very low, and the number of such contracts holding assets is even lower. Furthermore, none of these contracts have executed an actual SELFDESTRUCT transaction. The opcode is generally included as a mechanism to transfer assets out of the contract, a functionality that will remain unaffected after this proposal is implemented.</p><h4><strong>3.2 Analysis of SELFDESTRUCT Transactions</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JYduGTnMJBC0CDxrYZulSA.png" /><figcaption><strong>Figure 1</strong>: Example of the “create-then-destroy” pattern shown in TRON’s internal transactions.</figcaption></figure><ol><li>An analysis of data from 2025 (up to October 17) reveals 957,324 internal transactions involving SELFDESTRUCT. The overwhelming majority — 957,316 (99.999%) — followed an identical pattern: the contract was created and self-destructed within the same transaction. This specific use case will not be affected after this proposal is implemented.<br><br>The remaining 8 transactions show a similar pattern: the contracts were also self-destructed on the same day they were created, and these addresses were never reactivated or reused after destruction.</li><li>A historical analysis of all SELFDESTRUCT transactions confirms that addresses that have self-destructed were never re-created afterwards.</li></ol><h3><strong>4. Conclusion</strong></h3><p>This proposal restricts the functionality of the SELFDESTRUCT opcode to enhance compatibility with Ethereum. Developers are strongly advised to avoid using SELFDESTRUCT in new smart contracts and instead adopt safer, more maintainable patterns for contract lifecycle management.</p><p>The change to the SELFDESTRUCT opcode will be included in an upcoming version release. Once released, it must be activated via <strong>network governance voting</strong> to take effect. Please stay tuned for the latest updates on the proposal via <a href="https://tronscan.org/#/proposals">TRONSCAN</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b992ed3885e6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/tip-6780-change-to-the-selfdestruct-opcode-b992ed3885e6">What is TIP-6780?</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Committee Proposal 103]]></title>
            <link>https://medium.com/tronnetwork/committee-proposal-103-3d00872aaba0?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/3d00872aaba0</guid>
            <category><![CDATA[governance]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Thu, 26 Jun 2025 06:19:04 GMT</pubDate>
            <atom:updated>2025-06-26T06:18:47.354Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eyV0whYP_2PNUMBAuB2ZYQ.png" /></figure><p><strong>Committee Proposal №103</strong> is a voting request aimed at enabling chain parameters №83, №88, and №89 on the TRON network. These changes align the TRON Virtual Machine (TVM) with the Ethereum Cancun upgrade and introduce optimizations to the consensus layer’s verification mechanism. Please refer to <a href="https://github.com/tronprotocol/tips/issues/763">here</a> for the origin discussion. The № 103 committee proposal is already in effect, please refer to <a href="https://tronscan.org/#/proposal/103">here</a> for the voting details.</p><p>The proposal has officially taken effect as of <strong>2025–06–26 14:00 (SGT)</strong>. And this post provides a detailed breakdown of the proposal’s content and significance.</p><h3>What does this proposal include?</h3><p>Proposal 103 activates parameters defined in the following four TIPs:</p><ul><li><a href="https://github.com/tronprotocol/tips/issues/650"><strong>TIP-650</strong></a></li><li><a href="https://github.com/tronprotocol/tips/issues/651"><strong>TIP-651</strong></a></li><li><a href="https://github.com/tronprotocol/tips/issues/694"><strong>TIP-694</strong></a></li><li><a href="https://github.com/tronprotocol/tips/issues/745"><strong>TIP-745</strong></a></li></ul><h4>TIP-650: Transient Storage Opcodes</h4><p>Two new EVM-compatible opcodes are enabled:</p><ul><li>TLOAD (0x5c) — Load from transient storage</li><li>TSTORE (0x5d) — Store to transient storage</li></ul><p>Transient storage offers an energy-efficient alternative to memory for storing temporary data across internal calls within the same transaction, without persisting data beyond the transaction.</p><h4>TIP-651: Memory Copy Instruction</h4><p>One new opcode is enabled:</p><ul><li>MCOPY (0x5e) — Copy memory efficiently from one location to another</li></ul><p>This instruction provides energy optimization for contracts that need to manipulate memory regions directly.</p><h4>TIP-745: BLOB Opcodes for Cancun Compatibility</h4><p>Two new opcodes are enabled in placeholder form:</p><ul><li>BLOBHASH (0x49)</li><li>BLOBBASEFEE (0x4a)</li></ul><p>While these opcodes return default values (0) for now, they ensure forward compatibility with Ethereum Cancun bytecode.</p><h4>TIP-694: Consensus Layer Verification Enhancements</h4><p>This proposal strengthens validation logic in the consensus layer:</p><ul><li>Enforces a maximum size for account creation transactions to prevent bandwidth abuse</li><li>Validates total transaction sizes more strictly to avoid exceeding block limits</li><li>Ensures that the number of transaction results matches the number of invoked contracts</li><li>Applies stricter filtering for near-expiry transactions to preserve network bandwidth</li></ul><h3>What’s the benefit brought by this proposal?</h3><h4>For Virtual Machine (TVM) Compatibility:</h4><ul><li>Ensures alignment with Ethereum Cancun specs</li><li>Maintains bytecode-level compatibility with the EVM</li><li>Simplifies smart contract migration from Ethereum to TRON</li><li>Provides developers with the same energy-saving improvements</li></ul><h4>For Consensus Layer Security and Efficiency:</h4><ul><li>Strengthens block verification during sensitive periods (e.g., maintenance windows)</li><li>Prevents malicious blocks with non-standard timestamps</li><li>Refines Super Representative (SR) ranking algorithm for rare edge cases</li><li>Mitigates risk from oversized or malformed transactions</li></ul><p>Additionally, this proposal sets the groundwork for enhanced cross-platform compatibility in the future by signaling a transition from java.lang.Math to deterministic math libraries in Java-Tron. This ensures consistent behavior across environments and JDK versions.</p><h3>Summary</h3><p>Committee Proposal 103 enables TRON’s compatibility with the Ethereum Cancun upgrade and significantly enhances consensus layer verification. With the activation of new opcodes and stricter validation rules, the TRON network further improves its performance, security, and developer-friendliness.</p><p>The TRON Virtual Machine is now Cancun-compatible — enabling seamless DApp migration, cross-chain development, and more efficient contract execution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d00872aaba0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/committee-proposal-103-3d00872aaba0">Committee Proposal 103</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Committee Proposal 102]]></title>
            <link>https://medium.com/tronnetwork/committee-proposal-102-feced698a9ee?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/feced698a9ee</guid>
            <category><![CDATA[governance]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Fri, 13 Jun 2025 06:26:13 GMT</pubDate>
            <atom:updated>2025-06-13T06:24:54.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RO1q6-zBVWSVRINRwAkfyQ.png" /></figure><p>Committee proposal 102 is a voting request for modifying the № 5 and № 31 chain parameters on TRON network, adjusting the block reward from 16 TRX to 8 TRX, and the voting reward from 160 TRX to 128 TRX. Please refer to <a href="https://github.com/tronprotocol/tips/issues/738">here</a> for the origin discussion. The № 102 committee proposal is already in effect, please refer to <a href="https://tronscan.org/#/proposal/102">here</a> for the voting details, this post is dedicated to provide more details.</p><h3>Why does the TRON network need this proposal at this time?</h3><p>The implementation of a series of proposals within TRON’s tokenomics model has significantly impacted the TRX supply, resulting in a transition from inflation to deflation, but with a potential rebound trend showing recently. Especially after increasing the total energy limit from August to October 2024, the net increase of TRX supply shows a gradual increasing trend in recent months, indicating a potential resurgence of inflation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JFXffVWyJD-gGmxs" /><figcaption>Fig. 1 — The TRX supply shows a deflationary trend since 2022</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r-i9a2j1epuN8t9V" /><figcaption>Fig. 2 — The net increase of TRX supply shows a positive number some days in recent months</figcaption></figure><h3>The feasibility and reasonability of this proposal</h3><p>The community has widely and deeply discussed this proposal on Github and during multiple core devs community calls, and finally made consensus on enabling this proposal.</p><p>The previous TRX block rewards effectively stimulated network staking and transaction volume growth in the early stages. However, as the TRON network develops, the relatively high production rates of TRX may dilute the token’s value over time and reduce the incentive for long-term staking.</p><p>By reducing the TRX reward from 176 TRX to 136 TRX in total, the expected annual deflation rate will become about 1.29%, which better adapts the transaction volume and activities on the TRON network.</p><p>Diving into other mainstream public chains, most have designed mechanism to control the inflation rate:</p><ul><li><strong>BTC</strong> is well-known for halving every 4 years to cut the supply.</li><li><strong>ETH</strong> implemented EIP-1599 introducing base fee to accelerate burning in 2021, and significantly reduced ETH supply rate after the merge in 2022, bringing the inflation rate drop from about 4% to 0.3% at the moment, reduced by about 90%.</li><li><strong>SOL</strong> supply rate is pre-set, currently about 5.1%, and is designed to decrease by about 15% each year.</li></ul><p>The current supply rate of TRX has remained for more than 5 years, as the total energy limitation has been enlarged a lot and many chain parameters have been adjusted, it’s time to consider the proper TRX supply rate.</p><p>The biggest question during the discussion is that reducing TRX reward will decrease the benefit of staking holders. However, taking the advantage of energy renting into consideration, the expected comprehensive APR will change from about 9.15% to 7.08%, which is still attractive and competitive.</p><h3>What’s the benefit brought by this proposal?</h3><p>Enabling this calculation performance optimization brings several benefits:</p><ul><li><strong>Enhance Deflation:</strong> Lowering the TRX block rewards will enhance the network’s deflation rate, potentially increasing its value.</li><li><strong>Incentivize Staking:</strong> Leveraging the advantage of TRON’s staking model, the increase in TRX value can encourage more users to stake TRX to obtain the resources for transactions.</li><li><strong>Strengthen Network Security:</strong> Increased staking participation strengthens the network’s security by locking up more TRX.</li><li><strong>Improve Economic Incentives:</strong> Align token distribution with the maturity of the network, ensuring that incentives remain robust and meaningful for both new participants and long-term holders.</li></ul><h3>Summary</h3><p>After the proposal of reducing TRX reward takes effect, the annualized deflation rate of TRX is expected to increase from the previous 0.85% to 1.29%, which will further accelerate the deflation process of TRX, optimize TRON’s economic model, and enhance the long-term sustainability of the network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=feced698a9ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/committee-proposal-102-feced698a9ee">Committee Proposal 102</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TRON Virtual Machine vs Ethereum Virtual Machine]]></title>
            <link>https://medium.com/tronnetwork/tron-virtual-machine-vs-ethereum-virtual-machine-41e65b4f9f34?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/41e65b4f9f34</guid>
            <category><![CDATA[tron]]></category>
            <category><![CDATA[tron-virtual-machine]]></category>
            <category><![CDATA[ethereum-virtual-machine]]></category>
            <category><![CDATA[evm]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Thu, 15 May 2025 10:47:13 GMT</pubDate>
            <atom:updated>2025-05-15T10:45:04.393Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dUOZ0aKZb_31Fw3nll2O1A.png" /></figure><p>The TRON Virtual Machine (TVM) exhibits fundamental compatibility with the Ethereum Virtual Machine (EVM), with notable distinctions in the following aspects:</p><ol><li>The TVM employs an Energy model instead of the Gas model. energyPrice is a network parameter (it can be changed by<a href="http://committee"> committee proposals</a>), currently set at 210 SUN on Mainnet. Unlike the fluctuating Gas prices and the presence of a basefee in the EVM, the TVM’s GASPRICE and BASEFEE opcodes both return the energyPrice.</li><li>The Energy consumption of the majority of TVM opcodes aligns with their EVM counterparts, with certain opcodes exhibiting lower Energy costs, such as SLOAD and CALL.</li><li>The prefix for contract addresses generated via CREATE2 in the TVM is different from the EVM. The TVM utilizes the 0x41 prefix, determined by the formula (where ++ represents string concatenation):<br> <br> <strong><em>keccak256(0x41++ address ++ salt ++ keccak256(init_code))[12:]</em></strong></li><li>TRX can be transmitted to contracts through two mechanisms: standard transfers and TriggerSmartContract invocations carrying a callValue. Standard transfers bypass the execution of the contract’s fallback function.</li></ol><h3><strong>Differences in Instructions</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AAigXQMsqJrLPwm8phm62Q.png" /></figure><h3>Differences in Precompiled Contracts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FUWwV8grgYba3v_cW00YRw.png" /></figure><h3><strong>New Features of the TVM</strong></h3><h4><strong>Instructions</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2zNmE-aLtWuRyyxo6PuXBg.png" /></figure><h4><strong>Precompiled Contracts</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6OryGsMXVNhoAKKZGKkgyw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41e65b4f9f34" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/tron-virtual-machine-vs-ethereum-virtual-machine-41e65b4f9f34">TRON Virtual Machine vs Ethereum Virtual Machine</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Guide for Smart Contracts]]></title>
            <link>https://medium.com/tronnetwork/security-guide-for-smart-contracts-87a7ed6f90f2?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/87a7ed6f90f2</guid>
            <category><![CDATA[smart-contract-blockchain]]></category>
            <category><![CDATA[tron]]></category>
            <category><![CDATA[smart-contract-security]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Mon, 12 May 2025 04:34:15 GMT</pubDate>
            <atom:updated>2025-05-12T04:31:56.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORIotg9nn4-7d1YYGx5QBQ.png" /></figure><p>Please note that this guide provides general recommendations. Security audits and testing tailored to specific business logic and contract requirements are still necessary in actual projects.</p><h3><strong>1. Understanding the TRON Ecosystem</strong></h3><h4>Differences between the TRON Virtual Machine (TVM) and the Ethereum Virtual Machine (EVM)</h4><ul><li>While TRON shares similarities with Ethereum in the execution logic of the underlying virtual machine, differences exist in opcodes, resource models, and event handling mechanisms. Developers should thoroughly understand these distinctions to avoid potential security risks caused by directly applying EVM-centric patterns to the TVM.</li></ul><h4>TRC Standards and Interfaces</h4><ul><li>Common token standards in the TRON ecosystem include TRC-10, TRC-20, and TRC-721 (NFT). These are similar to Ethereum’s ERC-20 and ERC-721 but differ in implementation details. Developers should carefully review and cross-reference the TRC standard specifications when implementing contract logic.</li></ul><h4>Network and Account Model</h4><ul><li>On the TRON Mainnet, contract transaction execution consumes resources (Energy and Bandwidth). These resources’ consumption patterns and contract invocation costs differ from Ethereum’s gas model. Developers should carefully evaluate resource consumption and the potential for resource depletion during contract development and security audits.</li></ul><h3><strong>2. Contract Security Design Principles</strong></h3><h4><strong>Principle of Least Privilege</strong></h4><ul><li>In contract design, ensure that only essential functions or roles execute high-risk operations, minimizing function call permissions that can critically impact the contract state.</li><li>Implementing multi-role management or a multi-signature (multisig) mechanism is recommended to restrict critical operations, such as contract upgrades, core parameter modifications, and large-amount asset transfers.</li></ul><h4><strong>Keep It Simple &amp; Stupid (KISS) Principle</strong></h4><ul><li>The more complex the smart contract logic, the greater the risk of introducing unintended vulnerabilities or unexpected state changes. Developers should decompose contracts into smaller, focused modules designed according to the “Single Responsibility Principle” to avoid redundant and unnecessary features.</li></ul><h4><strong>Strict Input and Output Data Validation</strong></h4><ul><li>Functions should check input parameters for valid boundary, type, and permission, and logically verify return values to prevent issues such as numerical overflows and erroneous state updates.</li></ul><h4><strong>Safe Mode and Emergency Strategies</strong></h4><ul><li>Design an emergency stop (Circuit Breaker / Pausable) mechanism for contracts to halt critical functions or freeze the contract upon detecting significant security risks, thereby preventing further financial losses or the spread of erroneous states.</li><li>Develop emergency repair or migration plans before project launch to avoid reactive and disorganized responses in the event of an incident.</li></ul><h3><strong>3. Common Security Risks and Prevention Essentials</strong></h3><h4><strong>Reentrancy Attacks</strong></h4><ul><li>As one of the most well-known attacks on Ethereum, reentrancy also remains a concern on TRON. If a contract calls an external contract or sends TRX, the external contract might call back into the original contract’s function, potentially violating the original contract function’s security assumptions.</li></ul><p><strong>Typical prevention measures:</strong></p><ul><li>Update the contract state before calling external contracts or performing transfers.</li><li>Use function-level mutual exclusion mechanisms (such as mutex or reentrancyGuard); similar logic can be designed within the TVM framework.</li><li>Ensure external calls occur as the last line of contract logic.</li></ul><h4><strong>Integer Overflow/Underflow</strong></h4><ul><li>Solidity compiler versions on TRON can also encounter integer overflow and underflow issues (as seen in earlier compiler versions). Using a newer compiler (with built-in security checks) or manually incorporating a secure math library, such as SafeMath, is recommended.</li><li>Developers should familiarize themselves with the security checks implemented by the compiler versions they use. If using an earlier version, be sure to incorporate SafeMath or equivalent protections.</li></ul><h4><strong>Access Control Vulnerabilities</strong></h4><ul><li>Missing or inadequate permission modifiers or validation on contract functions can enable attackers to invoke administrative functions.</li><li>Developers should manage critical functions using either a modifier (such as onlyOwner / onlyAdmin) or role-based access control components. Sensitive operations may require secondary confirmation via multi-signature contracts.</li></ul><h4><strong>Random Number Security</strong></h4><ul><li>Generating random numbers on the blockchain is a common challenge, as they are susceptible to manipulation by miners or nodes. This also applies to the TRON network.</li><li>Contracts that require random numbers (such as lottery or raffle contracts) should integrate off-chain random numbers or use a trusted third-party oracle. Random values generated locally via block.hash, now, or other similar methods are insecure.</li></ul><h4><strong>Logic Flaws and Business Risks</strong></h4><ul><li>For contracts involving financial assets, business logic issues should also be considered in addition to code implementation. For example, the transfer logic, lock-up logic, and minting/burning functionalities of token contracts should be evaluated for potential abuse or unauthorized access.</li><li>Independent threat modeling is necessary: Scrutinize each business functionality from an attacker’s perspective to assess its risk of manipulation or exploitation.</li></ul><h4><strong>Upgrade and Migration Risks</strong></h4><ul><li>TRON smart contracts, once deployed, cannot be easily modified. When using proxy contracts or upgradeable contract architecture for contract upgrades or migrations, carefully address the security risks associated with the proxy pattern:</li><li>Upgrade procedures require strict permission and multi-signature verification.</li><li>Proxy contract logic can introduce complexities such as additional storage collisions and delegatecall vulnerabilities.</li></ul><h3><strong>4. Security Development and Audit Process Recommendations</strong></h3><h4><strong>Use a Reliable Development Toolchain</strong></h4><ul><li>Select official or mature community-maintained TRON development tools (such as TronBox, TronGrid, and TronLink) and utilize established code auditing tools for static and dynamic testing.</li><li>When choosing third-party libraries, ensure the versions you use are secure and reliable.</li></ul><h4><strong>Phased Testing</strong></h4><ul><li><strong>Unit Test: </strong>Test individual contract functions, particularly for core logic and high-risk permission functions.</li><li><strong>Integration Test: </strong>Conduct integration testing of the entire business process in a local private network environment or on a testnet.</li><li><strong>Security Audit: </strong>Use a professional audit team or an audit platform/tool for source code auditing and dynamic analysis of the contract.</li><li><strong>Bug Bounty Program: </strong>In the period surrounding Mainnet launch, encourage white hat hackers and the security community to participate in vulnerability discovery and offer rewards.</li></ul><h4><strong>Log and Event Monitoring</strong></h4><ul><li>Design and trigger contract events effectively to enable blockchain explorers and monitoring scripts to track key state changes and detect potential anomalies.</li><li>Set up real-time monitoring and alert thresholds for critical events, including transfers, permission changes, and upgrade operations.</li></ul><h4><strong>Multi-Signature and Custody</strong></h4><ul><li>Introducing a multi-signature mechanism can significantly reduce the risk of single-point-of-failure when managing contract assets or performing critical contract operations.</li><li>For large projects or projects involving high-value assets, consider using secure custody service providers or hardware wallets to manage private keys.</li></ul><h3><strong>5. Operation and Continuous Security Assurance</strong></h3><h4>Version Control and Traceability</h4><ul><li>Implement version control for smart contracts. After contract deployment, promptly record and publicly disclose the contract address, ABI, source code hash, and other relevant information to facilitate tracking and auditing of updates by users and audit institutions.</li><li>If performing contract upgrades or migrations, publicly disclose the upgrade process, explain the differences between old and new versions, and provide data migration plans.</li></ul><h4>Timely Response to Community and Industry Developments</h4><ul><li>Follow security vulnerabilities, compiler bugs, developer warnings, and other relevant information released by the TRON or other security communities, and promptly patch potential issues.</li><li>Continuously update threat models and security strategies to address emerging attack methods (such as flash loan attacks and oracle manipulation).</li></ul><h4>Compliance and Legal Risks</h4><ul><li>If the project involves financial or securities attributes (such as exchanges, collateralized lending), consult with legal counsel and complete necessary filings to ensure regulatory compliance.</li><li>Adhere to relevant laws, regulations, and industry best practices to protect user assets and privacy.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87a7ed6f90f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/security-guide-for-smart-contracts-87a7ed6f90f2">Security Guide for Smart Contracts</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Event Service Framework V2.0]]></title>
            <link>https://medium.com/tronnetwork/event-service-framework-v2-0-0622f2f07249?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/0622f2f07249</guid>
            <category><![CDATA[event-subscription]]></category>
            <category><![CDATA[tron]]></category>
            <category><![CDATA[java-tron]]></category>
            <category><![CDATA[event-service]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 09:53:11 GMT</pubDate>
            <atom:updated>2025-04-29T09:52:59.175Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FAZWyqfWkoa5pwToRG2IUA.png" /></figure><p>TRON features an event service mechanism that enables developers to receive and process on-chain events via custom event plugins. The overall architecture of the event service is as follows: The event service retrieves and encapsulates on-chain event information, then writes this data to an event cache queue for asynchronous consumption by the event plugin. Upon receiving the event data, the plugin can write the data to databases, message queues, or other target systems based on business requirements to further support upper-layer applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t8SQFhArjSFPd-yx" /></figure><p>In the event service framework V1.0 (hereafter <strong>the V1.0 framework</strong> or <strong>V1.0</strong>), the encapsulation of event data and the operation of writing data to the queue were highly coupled with the block execution process:</p><ul><li><strong>Transaction Execution Phase</strong>: Encapsulates contract event data (contractEventTrigger) and contract log event data (contractLogTrigger);</li><li><strong>Block Execution Phase</strong>: Encapsulates block event data (blockTrigger) and transaction event data (transactionTrigger).</li></ul><p>Following encapsulation, the event data was immediately written to the event queue for subsequent processing by the event plugin. The overall process flow is illustrated in the following diagram:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VZJA-V6pzhUEnyjp" /></figure><p>Due to the coupling of the event processing logic with the block processing flow, any event service anomaly could cause block processing failures, thereby impacting block broadcasting and synchronization. Additionally, V1.0 did not support historical event replay and lacked an event push rate control mechanism, making it inadequate for complex application scenarios.</p><p>To address these issues, TRON introduced the event service framework V2.0 (hereafter <strong>the V2.0 framework </strong>or <strong>V2.0</strong>) in the GreatVoyage-v4.8.0 (Kant) release. This framework decouples the event processing logic from the block execution flow, restructuring it as an independent module, which significantly enhances system stability and scalability. Concurrently, V2.0, while preserving the independence of the block processing flow, supports historical event replay and incorporates an event push rate control mechanism, effectively improving the applicability and robustness of the event service across various use cases.</p><h3><strong>Event Service Framework V2.0 Overview</strong></h3><p>This document will provide a detailed explanation of the V2.0 framework, covering the following key aspects:</p><ul><li>Independent Event Service Module</li><li>Historical Event Replay Feature</li><li>Consumption Rate Awareness Mechanism</li></ul><h4><strong>Independent Event Service Module</strong></h4><p>In V2.0, the event service is designed as an <strong>independent module</strong>, achieving complete decoupling from the core block processing logic. This module <strong>neither depends on other business modules nor can it be directly invoked by them</strong>.</p><p>Upon startup, the event service <strong>reads block data from the database</strong>, then encapsulates the required event types based on user-configured event subscription options. The encapsulated event data is then placed into the event queue for subsequent processing by the event plugin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pnSWR1L3un1xvxon" /></figure><p>This architecture significantly enhances system <strong>flexibility, stability, and scalability</strong>, especially effective for complex or high-concurrency application scenarios.</p><p><strong>Core Data Structure</strong></p><p>BlockEvent: Represents the complete set of event data for a block. It includes:</p><ul><li>Block Event Data (blockTrigger)</li><li>Transaction Event Data (transactionTrigger)</li><li>Contract Event Data (contractEventTrigger)</li><li>Contract Log Event Data (contractLogTrigger)</li></ul><p>In contrast to V1.0, which processed event data separately, V2.0 completes the unified encapsulation of all event data in a single load operation.</p><p><strong>Core Interface</strong></p><p>BlockEvent getBlockEvent(long blockNum): Reads data related to the specified block height from the database, encapsulates the event data, and returns a BlockEvent object.</p><p><strong>Core Threads</strong></p><p>BlockEventLoad (Data Loading Thread): Reads block-related data from the database and encapsulates event data. The encapsulated data is then passed to the following threads for processing:</p><ul><li>RealtimeEventService (Real-time Event Processing Thread): Processes event data for new blocks.</li><li>SolidEventService (Solidified Block Event Processing Thread): Processes event data for newly solidified blocks.</li></ul><p>The following diagram illustrates the thread collaboration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dp5vH97t6QM1P2fE" /></figure><h4><strong>Historical Event Replay Feature</strong></h4><p>V2.0 introduces the <strong>historical event replay feature</strong>, addressing V1.0’s limitation of only supporting real-time event pushing.</p><p>In V1.0, events were only pushed to subscribers in real time when new blocks were processed, with no support for replaying events from historical blocks.</p><p>V2.0 now supports <strong>processing and pushing events from local historical blocks</strong>, meeting user demand for historical data subscriptions. This feature can be configured via the following option:</p><pre>event.subscribe.startSyncBlockNum = &lt;starting block height&gt;</pre><ul><li>startSyncBlockNum &lt;= 0 indicates that the historical event synchronization feature is turned off.</li><li>startSyncBlockNum &gt; 0 indicates that this feature is turned on, and historical events will be synchronized starting from the specified block height. (<strong>Note</strong>: Enabling this feature is recommended in conjunction with the consumption rate control mechanism to avoid abnormal node resource utilization due to event backlog.)</li></ul><p><strong>Caution</strong>: Always ensure that the startSyncBlockNum parameter is configured correctly before restarting the node. A correctly configured node will synchronize historical events from the specified block height upon startup. Incorrect configuration can lead to duplicate or missed event pushes, thus affecting the correctness of the business logic.</p><h4><strong>Consumption Rate Awareness Mechanism</strong></h4><p>In the V1.0 framework, event data, once encapsulated, was directly pushed to the event queue for asynchronous consumption by the plugin. However, <strong>when a plugin’s consumption capacity was insufficient, event data could continuously accumulate in the memory, eventually leading to memory overflow problems</strong>.</p><p>To address this problem, V2.0 introduces a consumption rate awareness mechanism by <strong>adding a new plugin interface </strong><strong>getPendingSize</strong> to query the number of pending events in the current event queue. Before loading new event data, the event service will call the getPendingSize interface to check the plugin’s current consumption status:</p><ul><li>Return value &gt; 50000 indicates that the plugin is in a busy state, and the event service will pause loading new event data to prevent continuous memory accumulation.</li><li>Return value &lt;= 50000 indicates that the plugin has sufficient consumption capacity, and the event service will continue to push data.</li></ul><p>This mechanism enables dynamic regulation between event loading and the plugin consumption capacity, effectively enhancing the system’s stability and robustness in <strong>high-concurrency processing</strong> and <strong>historical data synchronization</strong> scenarios.</p><p><strong>Note</strong>: If you choose to use the V2.0 framework, we strongly recommend upgrading the event plugins to their latest versions (v2.1.0) to ensure compatibility with consumption rate control.</p><h3><strong>Version Notes</strong></h3><p>To ensure application developers have sufficient time for a smooth transition to the new version, the original V1.0 framework is still retained in Kant. We recommend that you gradually migrate to the V2.0 framework based on your specific needs.</p><p>The V1.0 framework will be completely removed in a future release when deemed appropriate, with only V2.0 retained. We strongly recommend that application developers plan for compatibility adaptation and version switching in advance.</p><p>The event service will default to V1.0 after the Kant version deployment. To enable V2.0, the switch can be made via the following configuration option:</p><pre>event.subscribe.version = 1 // 1 means v2.0 , 0 means v1.0</pre><h3><strong>Compatibility</strong></h3><p>The specific differences between the Event Service Framework V1.0 and V2.0 are as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*G3quwtSwMyF7klpXnNLKDg.png" /></figure><h3><strong>How to Migrate to the V2.0 Framework?</strong></h3><h4><strong>Key Considerations Before Migration</strong></h4><ul><li><strong>Application Dependency on Internal Transactions Subscription Feature<br></strong>The V2.0 framework does not support internal transaction log subscription. The internalTransactionList field in emitted TransactionLogTrigger events will be empty. Therefore, migration is not recommended at this time for applications that rely on internal transaction information. Please continue using the V1.0 framework until this feature is supported in a later version.</li><li><strong>Plugin Version Compatibility<br></strong>To support the consumption rate awareness mechanism of V2.0, we strongly recommend upgrading to and using the event plugins’ latest versions (v2.1.0). This is especially important when synchronizing events from a specified block height, due to the potential for a large volume of event data. Insufficient plugin consumption capacity can lead to continuous memory growth or even <strong>memory leaks</strong> in the node.</li></ul><h4><strong>Steps for Migration</strong></h4><p><strong>1. Generating the New Event Plugin</strong></p><p>Clone the <a href="https://github.com/tronprotocol/event-plugin">event-plugin</a> project from the GitHub repository and switch to the dedicated branch for the new plugin version. Then, execute the build command to generate the .zip file for the new plugin.</p><pre>git clone git@github.com:tronprotocol/event-plugin.git<br>cd event-plugin<br>git checkout feature/new_event_service<br>./gradlew build</pre><p><strong>2. Enabling the V2.0 Framework via Configuration</strong></p><p>In the FullNode configuration file, add the following configuration to enable the V2.0 framework:</p><pre>event.subscribe.version = 1</pre><p><strong>3. Configuring Event Subscription</strong></p><p>The V2.0 framework’s subscription configuration method remains consistent with V1.0; no additional modifications are required. Please refer to the <a href="https://developers.tron.network/docs/event-subscription">event subscription configuration documentation</a> for detailed configuration instructions.</p><p><strong>4. (Optional) Synchronizing Historical Block Events</strong></p><p>The V2.0 framework supports historical event synchronization starting from a specified block height. You can set the starting synchronization height using the following configuration:</p><pre>event.subscribe.startSyncBlockNum = &lt;block_height&gt;</pre><p><strong>5. Starting the Node and Plugin</strong></p><p>Upon completing the aforementioned configurations, start the FullNode and the corresponding event plugin to finalize the migration to the V2.0 framework. The node startup command is as follows:</p><pre>java -jar FullNode.jar -c config.conf --es</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0622f2f07249" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/event-service-framework-v2-0-0622f2f07249">Event Service Framework V2.0</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction of Cancun Compatible Features in TRON]]></title>
            <link>https://medium.com/tronnetwork/introduction-of-cancun-compatible-features-in-tron-b84dff7ed6b8?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/b84dff7ed6b8</guid>
            <category><![CDATA[java-tron]]></category>
            <category><![CDATA[tron]]></category>
            <category><![CDATA[cancun-compatible]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 09:45:06 GMT</pubDate>
            <atom:updated>2025-04-30T01:51:53.017Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O6OgBWKXpCvHG1DdSYGPJw.png" /></figure><h3>Summary</h3><p>The TRON network continues to evolve with significant upgrades to enhance its performance, security, and compatibility since its inception. One of the most notable recent advancements of the TRON Virtual Machine (TVM) is the compatibility upgrade with Ethereum’s Cancun, which introduces several new features while maintaining TRON’s core value proposition of high throughput and low transaction costs.</p><p>In March 2024, Ethereum officially launched its Dencun (Cancun-Deneb) upgrade, with the Cancun portion specifically bringing several critical virtual machine enhancements. To maintain compatibility with these new Ethereum features and to further expand TRON’s blockchain efficiency, interoperability, and ecosystem growth, we have introduced the Cancun upgrade functionality to the TRON network.</p><p>The TRON Virtual Machine (TVM) serves as the execution environment for smart contracts on the TRON blockchain, interpreting bytecode compiled from high-level languages like Solidity. With the Cancun upgrade, the TVM now supports the latest EVM opcodes and features, ensuring that developers can seamlessly port their Ethereum applications to TRON while benefiting from TRON’s unique advantages in terms of cost and speed.</p><p>In this article, we’ll delve into the technical aspects of the Cancun features in TRON, exploring its implementation details and the improvements it brings to the Java-Tron codebase, with a particular emphasis on the TVM enhancements.</p><h3>Technical Foundations</h3><h4>1. TIP-745: Introduce EIP-4844 and EIP-7516 instructions</h4><p>At the heart of the Cancun upgrade is <strong>EIP-4844</strong>, a protocol originally pioneered by Ethereum to optimize Layer 2 scalability.</p><p><strong>EIP-4844</strong> introduces a new transaction format for “blob-carrying transactions”, which contain a large amount of data and a new instruction <strong>BLOBHASH</strong> to get versioned hashes of blob transactions.</p><p><strong>EIP-7516</strong> introduces a new instruction that returns the value of the blob base-fee of the current block it is executing in.</p><p>Due to the different demands for L2 and data processing capabilities between TRON and Ethereum, we have not introduced blob-type transactions for the time being. And in view of this situation, the implementations of <strong>BLOBHASH </strong>and <strong>BLOBBASEFEE</strong> instructions differ from Ethereum.</p><p>It’s also important to note that this implementation currently focuses only on introducing the new instructions. Full blob transaction support and the point evaluation precompiled contract will be implemented in future versions. When we implement the point evaluation precompile, we will use an address different from Ethereum’s implementation (0x0a), as this address is already allocated to the <strong>ValidateMultiSign</strong> precompile on TRON. This phased approach allows us to carefully adapt Ethereum’s data availability solutions to TRON’s unique architecture while maintaining backward compatibility.</p><h4>2. TIP-650: Implement EIP-1153 Transient storage opcodes</h4><p><strong>EIP-1153</strong> introduces transient storage opcodes for manipulating state that behaves almost identically to storage but is discarded after every transaction.</p><h4>3. TIP-651: Implement EIP-5656 MCOPY — Memory copying instruction</h4><p><strong>EIP-5656</strong> introduces an efficient EVM instruction for copying memory areas.</p><h4>4. TIP-652: Announce EIP-6049 Deprecate SELFDESTRUCT</h4><p><strong>EIP-7516</strong> announces to deprecate SELFDESTRUCT by discouraging its use in Ethereum Shanghai upgrade and its behavior has been modified after the Ethereum Cancun upgrade. In accordance with the development plan of TRON, we declare the deprecation of the SELFDESTRUCT in this upgrade.</p><h3>Overview of New TVM Instructions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*_O5Q3TfAKYg448lGNVUwhQ.png" /></figure><h3>Technical Interpretation</h3><h4>1. BLOBHASH instruction</h4><ul><li>Introduces a new instruction <strong>BLOBHASH</strong> (with opcode <strong>0x49</strong>) and has an Energy cost of <strong>3</strong>.</li><li>This opcode reads the index from the top of the stack and places a single item with the value 0 onto the stack.</li></ul><h4>2. BLOBBASEFEE instruction</h4><ul><li>Introduces a new instruction <strong>BLOBBASEFEE</strong> (with opcode <strong>0x4a</strong>) and has an Energy cost of <strong>2</strong>.</li><li>This opcode returns a single value 0.</li></ul><h4>3. Transient storage instructions</h4><ul><li>Introduces two new instructions <strong>TLOAD</strong> (with opcode <strong>0x5c</strong>) and <strong>TSTORE</strong> (with opcode <strong>0x5d</strong>), and has an Energy cost of <strong>100</strong> separately.</li><li><strong>TLOAD</strong> opcode pops a 32-byte word from the top of the stack, uses this value as the address in transient storage, retrieves the corresponding 32-byte word from that address, and then pushes this value back onto the stack.</li><li><strong>TSTORE</strong> opcode pops two 32-byte words from the top of the stack, using the first as the address in transient storage and the second as the value to be stored. It then saves this value at the corresponding location in transient storage.</li></ul><h4>4. Memory copy instruction</h4><ul><li>Introduces a new instruction <strong>MCOPY</strong> (with opcode <strong>0x5e</strong>) and the Energy consumption for this operation is calculated as follows:</li></ul><pre>words_copied = (length + 31) // 32<br>g_verylow    = 3<br>g_copy       = 3 * words_copied + memory_expansion_cost<br>gas_cost     = g_verylow + g_copy</pre><ul><li>This opcode pops three 32-byte words from the top of the stack, which are the destination position, the source position, and the length of the memory copy. It returns no item on stack.</li></ul><h3>Contract Example</h3><p>This is an example contract that includes all the new instructions mentioned above：</p><pre>// SPDX-License-Identifier: MIT<br>pragma solidity ^0.8.24;<br><br>contract CancunTest {<br><br>    constructor() payable {}<br><br>    receive() payable external {}<br><br>    // BLOBHASH example<br>    function testBlobHash(uint256 blobIndex) public view returns (bytes32) {<br>        bytes32 res = blobhash(blobIndex);<br>        require(res == bytes32(0), &quot;BLOBHASH failed&quot;);<br>        return res;<br>    }<br><br>    // BLOBBASEFEE example<br>    function testBlobBaseFee() public view returns (uint256) {<br>        uint256 res = block.blobbasefee;<br>        require(res == 0, &quot;BLOBBASEFEE failed&quot;);<br>        return res;<br>    }<br><br>    // transient storage (TSTORE/TLOAD) example<br>    function testTransientStorage(bytes32 value) public returns (bytes32) {<br>        bytes32 res = 0;<br>        assembly {<br>            res := tload(1)<br>        }<br>        require(res == bytes32(0), &quot;TLOAD failed&quot;);<br><br>        assembly {<br>        // Store the value in transient storage slot 1<br>            tstore(1, value)<br>            res := tload(1)<br>        }<br>        require(res == value, &quot;TSTORE failed&quot;);<br>        // Clear the transient storage at the end of the function<br>        assembly {<br>            tstore(1, 0)<br>        }<br>        return res;<br>    }<br><br>    // memory copy (MCOPY) example<br>    function testMemoryCopy(bytes32 data) public pure returns (bytes32) {<br>        bytes32 value;<br>        assembly {<br>            let memPtr := mload(0x40)<br>            mstore(memPtr, data)<br>            let memPtr2 := mload(0x40)<br>            mcopy(memPtr2, memPtr, 32)<br>            value := mload(memPtr2)<br>        }<br><br>        require(data == value, &quot;Memory copy failed&quot;);<br>        return value;<br>    }<br><br>    function validateInputLengths(<br>        bytes calldata version,<br>        bytes calldata commitment,<br>        bytes calldata z,<br>        bytes calldata y,<br>        bytes calldata proof<br>    ) internal pure {<br>        require(version.length == 32, &quot;Invalid versionhash length&quot;);<br>        require(commitment.length == 48, &quot;Invalid commitment length&quot;);<br>        require(z.length == 32, &quot;Invalid evaluation point length&quot;);<br>        require(y.length == 32, &quot;Invalid claimed value length&quot;);<br>        require(proof.length == 48, &quot;Invalid proof length&quot;);<br>    }<br>}</pre><h3>Impact</h3><p>The TRON implementation of Ethereum Cancun upgrade delivers substantial benefits by creating a powerful synergy between technical advancement and practical utility for its ecosystem participants.</p><p>For developers, these new features bring numerous advantages. For example, the introduction of transient storage opcodes significantly reduces gas costs for complex operations that previously required expensive storage manipulations, enabling the development of more sophisticated and cost-effective smart contracts. Additionally, the MCOPY instruction dramatically improves the efficiency of memory operations, allowing for optimized contract execution.</p><p>With the implementation of these EVM-compatible features, developers can now seamlessly port their Ethereum applications to TRON with minimal modifications. This cross-chain compatibility effectively expands the potential user base for dApps while leveraging TRON’s inherent advantages in throughput and cost-effectiveness.</p><h3>Conclusion</h3><p>This article has provided a comprehensive technical and practical examination of TRON’s Ethereum Cancun compatibility upgrade. We’ve explored the key technical implementations including enhanced VM compatibility and functional changes based on TRON’s characteristics. The Cancun upgrade marks a crucial milestone in TRON’s development, aligning it more closely with Ethereum’s capabilities while preserving TRON’s distinctive advantages in efficiency and cost.</p><h3>For more information</h3><p>GitHub: <a href="https://github.com/tronprotocol">https://github.com/tronprotocol</a><br>Telegram: <a href="https://t.me/troncoredevscommunity">https://t.me/troncoredevscommunity</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b84dff7ed6b8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/introduction-of-cancun-compatible-features-in-tron-b84dff7ed6b8">Introduction of Cancun Compatible Features in TRON</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mainnet Kant Announcement]]></title>
            <link>https://medium.com/tronnetwork/mainnet-kant-announcement-03022cb70350?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/03022cb70350</guid>
            <category><![CDATA[java-tron]]></category>
            <category><![CDATA[announcements]]></category>
            <category><![CDATA[tron]]></category>
            <category><![CDATA[java-tron-new-release]]></category>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Tue, 29 Apr 2025 09:43:04 GMT</pubDate>
            <atom:updated>2025-04-29T09:41:59.244Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lHjvkOMR3Y3ZlXRo3x5BJg.png" /></figure><p>The TRON network is preparing to release the GreatVoyage-v4.8.0 (Kant) version (hereafter referred to as “Kant” or the “Kant version”). This is a <strong>mandatory</strong> upgrade that introduces several key updates and governance proposals. Please find the details below.</p><h3>New Features</h3><h4><strong>Ethereum Cancun Upgrade Support</strong></h4><p><strong>1. TIP-650: Implement EIP-1153 Transient Storage Instructions</strong></p><p>The TRON Virtual Machine (TVM) will support the TLOAD and TSTORE opcodes, aligning with the Ethereum Cancun upgrade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*TJg3hGIafMv15ceU_zAjMA.png" /></figure><p>Transient storage is a temporary storage mechanism between persistent storage (storage) and memory. It offers a more gas-efficient storage solution that persists for the duration of a transaction. Data in transient storage is automatically cleared upon transaction completion.</p><p><strong>Note</strong>: This feature is governed by TRON network parameter #83. It is disabled by default (value: 0) post-Kant deployment and can be enabled through a governance proposal vote. Once enabled, it cannot be disabled.</p><ul><li><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-650.md">https://github.com/tronprotocol/tips/blob/master/tip-650.md</a></li><li><strong>Source Code</strong>: <br><a href="https://github.com/tronprotocol/java-tron/pull/6185">https://github.com/tronprotocol/java-tron/pull/6185</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6195">https://github.com/tronprotocol/java-tron/pull/6195</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6214">https://github.com/tronprotocol/java-tron/pull/6214</a></li></ul><p><strong>2. TIP-651: Implement EIP-5656 MCOPY — Memory Copying Instruction</strong></p><p>TVM will support the MCOPY instruction, aligning with the Ethereum Cancun upgrade.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*KmxcH03PWpwsUSZdJ092ww.png" /></figure><p>Memory copying is an operation that copies data from its original location to a target location in memory. It aims to reduce resource costs for memory area copying, thereby improving copying efficiency.</p><p><strong>Note</strong>: This feature is governed by TRON network parameter #83. It is disabled by default (value: 0) post-Kant deployment and can be enabled through a governance proposal vote. Once enabled, it cannot be disabled.</p><ul><li><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-651.md">https://github.com/tronprotocol/tips/blob/master/tip-651.md</a></li><li><strong>Source Code</strong>: <br><a href="https://github.com/tronprotocol/java-tron/pull/6185">https://github.com/tronprotocol/java-tron/pull/6185</a> <a href="https://github.com/tronprotocol/java-tron/pull/6194">https://github.com/tronprotocol/java-tron/pull/6194</a></li></ul><p><strong>3. TIP-745: Introduce EIP-4844 Instruction and EIP-7516 Instruction</strong></p><p>TVM will support the Ethereum Cancun upgrade’s BLOBHASH and BLOBBASEFEE instructions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w3gyDK5V4y-Goim743_U0w.png" /></figure><p>The BLOBHASH and BLOBBASEFEE instructions are associated with Ethereum Blob transactions. Currently, BLOBHASH and BLOBBASEFEE are implemented as stubs, both returning 0. The precompiled contracts verifying Zero-knowledge Proof (ZKP) are not implemented in Kant since blob transactions are not supported.</p><p><strong>Note</strong>: This feature is governed by TRON network parameter #89. It is disabled by default (value: 0) post-Kant deployment and can be enabled through a governance proposal vote. Once enabled, it cannot be disabled.</p><ul><li><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-745.md">https://github.com/tronprotocol/tips/blob/master/tip-745.md</a></li><li><strong>Source Code</strong>: <br><a href="https://github.com/tronprotocol/java-tron/pull/6232">https://github.com/tronprotocol/java-tron/pull/6232</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6247">https://github.com/tronprotocol/java-tron/pull/6247</a> <a href="https://github.com/tronprotocol/java-tron/pull/6270">https://github.com/tronprotocol/java-tron/pull/6270</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6283">https://github.com/tronprotocol/java-tron/pull/6283</a></li></ul><h3><strong>Core</strong></h3><h4><strong>1. Enhanced Consensus Layer Verification</strong></h4><p><strong>1.1 TIP-694: Enhance Verification of Transaction Limitations at Consensus Layer</strong></p><p>Prior to Kant, transaction validation was optimized at various points, but only focused on the transaction broadcast phase. The Kant version enhances transaction validation at the consensus layer, further improving transaction processing consistency and validity.</p><ul><li><strong>Strengthened Account Creation Transaction Size Check</strong>: Verifies that the transaction size, excluding its results and signatures, does not exceed the maximum byte limit allowed for account creation transactions (parameter #82).</li><li><strong>Enhanced Transaction Size Validation</strong>: Verifies whether the transaction body content exceeds the size limit.</li><li><strong>Transaction Result List Constraint</strong>: Ensures consistency with the contract count (currently limited to 1).</li><li><strong>Transaction Expiration Time Check</strong>: Verifies that the transaction expiration time is later than the next block’s slot time.</li></ul><p><strong>Note</strong>: This enhancement is governed by TRON network parameter #88. It is disabled by default post-Kant deployment and can be enabled through a governance proposal vote.</p><ul><li><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-694.md">https://github.com/tronprotocol/tips/blob/master/tip-694.md</a></li><li><strong>Source Code</strong>: <br><a href="https://github.com/tronprotocol/java-tron/pull/6172">https://github.com/tronprotocol/java-tron/pull/6172</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6221">https://github.com/tronprotocol/java-tron/pull/6221</a></li></ul><p><strong>1.2 Enhanced Validation of Block Production during Maintenance Periods</strong></p><p>Maintenance periods are designated for Super Representative (SR) elections and proposal processing. Therefore, SRs must not produce blocks during these periods. However, in prior versions, blocks produced by SRs during maintenance periods could potentially pass validation. The Kant version modifies block production and validation logic to prevent SRs from producing blocks during maintenance periods. Any block produced during this time will fail validation.</p><p><strong>Note</strong>: This enhancement is governed by TRON network parameter #88. It is disabled by default post-Kant deployment and can be enabled through a governance proposal vote.</p><ul><li><strong>Source Code: </strong><a href="https://github.com/tronprotocol/java-tron/pull/6187">https://github.com/tronprotocol/java-tron/pull/6187</a></li></ul><p><strong>1.3 Enhanced Block Header Validation</strong></p><p>Block time, recorded in the block header, represents the time a block is produced. Given that the TRON network’s block slot time is 3 seconds, the block time must be a strict multiple of 3 seconds.</p><p><strong>Note</strong>: This enhancement is governed by TRON network parameter #88. It is disabled by default post-Kant deployment and can be enabled through a governance proposal vote.</p><ul><li><strong>Source Code:</strong> <a href="https://github.com/tronprotocol/java-tron/pull/6186">https://github.com/tronprotocol/java-tron/pull/6186</a></li></ul><p><strong>1.4 Optimized Super Representative Election Ranking Algorithm</strong></p><p>In versions prior to Kant, when multiple SRs had identical vote counts, the system determined the ranking order based on the hash of the SR’s address. However, due to the risk of hash collisions and the potential for impacting ranking performance in extreme cases, the Kant version optimizes the SR ranking rules by implementing a more intuitive and stable <strong>lexicographical ordering of addresses</strong> (i.e., ranking by address alphanumerically). This approach eliminates hash collision-related performance issues and provides a more transparent and predictable ranking mechanism.</p><ul><li><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6173">https://github.com/tronprotocol/java-tron/pull/6173</a></li></ul><h3>TVM</h3><h4><strong>1. TIP-652: Deprecation of the SELFDESTRUCT Instruction</strong></h4><p><strong>Note</strong>: TIP-652 itself does not change how the SELFDESTRUCT instruction currently works, however, it officially announces that client developers will modify its behavior in future upgrades. Therefore, applications that expose SELFDESTRUCT to users should strongly warn them about the incoming semantic changes.</p><ul><li><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-652.md">https://github.com/tronprotocol/tips/blob/master/tip-652.md</a></li></ul><h3>Net</h3><h4><strong>1. Optimized Block Synchronization Logic</strong></h4><p>Kant introduces two key optimizations to the block synchronization logic, significantly improving synchronization efficiency:</p><p><strong>1.1 Optimized P2P Protocol: Discarding Solidified Block Lists to Conserve Network Bandwidth</strong></p><p>Kant optimizes the synchronization request mechanism by eliminating requests for solidified block data from remote nodes. This prevents redundant requests for existing data, reduces resource waste, and improves synchronization efficiency.</p><ul><li><strong>Source Code: </strong><a href="https://github.com/tronprotocol/java-tron/pull/6184">https://github.com/tronprotocol/java-tron/pull/6184</a></li></ul><p><strong>1.2 Faster Block Synchronization Task Scheduling for Enhanced Efficiency</strong></p><p>Kant adjusts the scheduling frequency of block synchronization tasks from once per second to once per 100 milliseconds. This accelerates block processing, further improving block synchronization efficiency.</p><ul><li><strong>Source Code</strong>: <a href="https://github.com/tronprotocol/java-tron/pull/6183">https://github.com/tronprotocol/java-tron/pull/6183</a></li></ul><h4><strong>2. Enhanced Transaction Validity Verification by Early Discarding Zero-Contract Transactions</strong></h4><p>Kant strengthens transaction validity verification. Upon receiving a transaction message, the node will discard transactions with zero contracts and disconnect from the sender.</p><ul><li><strong>Source Code:</strong> <a href="https://github.com/tronprotocol/java-tron/pull/6181">https://github.com/tronprotocol/java-tron/pull/6181</a></li></ul><h3><strong>Other Changes</strong></h3><h4><strong>1. Enhanced Event Service Framework (V2.0) Provision</strong></h4><p>The previous event service framework (V1.0) lacked support for processing events in historical blocks and coupled event processing tightly with block processing logic. Consequently, event service exceptions could lead to block processing failures, disrupting block broadcast and synchronization.</p><p>Kant introduces a new event service framework (V2.0) that decouples event services from block processing at the thread level. This prevents node disruptions caused by event service exceptions. V2.0 also supports event processing that begins from local historical blocks. Users can specify the starting block height for event synchronization using the event.subscribe.startSyncBlockNum configuration parameter. This feature is disabled if the parameter value is ≤ 0, and enabled otherwise.</p><p><strong>Note: </strong>Double-check the startSyncBlockNum configuration when restarting the node, since the node will synchronize historical events from the specified block height upon startup.</p><p>The original event service framework is retained to facilitate a gradual migration to the new framework. Post-Kant deployment, the V1.0 version remains the default. To utilize the V2.0 version, modify the following configuration parameter:</p><pre>event.subscribe.version = 1 // 1 means v2.0 , 0 means v1.0</pre><ul><li><strong>Source Code:<br></strong><a href="https://github.com/tronprotocol/java-tron/pull/6256">https://github.com/tronprotocol/java-tron/pull/6256</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6245">https://github.com/tronprotocol/java-tron/pull/6245</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6234">https://github.com/tronprotocol/java-tron/pull/6234</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6227">https://github.com/tronprotocol/java-tron/pull/6227</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6223">https://github.com/tronprotocol/java-tron/pull/6223</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6206">https://github.com/tronprotocol/java-tron/pull/6206</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6192">https://github.com/tronprotocol/java-tron/pull/6192</a></li></ul><h4><strong>2. Cross-Platform Consistent<em> java.lang.strictMath</em> Replacement for java.lang.math</strong></h4><p>The mathematical operation library is migrated from java.lang.Math to java.lang.StrictMath, to further enhance Java-tron’s cross-platform compatibility and establish a robust foundation for future support of diverse hardware architectures (including ARM). This ensures consistent computational results across different platforms.</p><ul><li><strong>TIP</strong>: <a href="https://github.com/tronprotocol/tips/blob/master/tip-697.md">https://github.com/tronprotocol/tips/blob/master/tip-697.md</a></li><li><strong>Source Code: <br></strong><a href="https://github.com/tronprotocol/java-tron/pull/6182">https://github.com/tronprotocol/java-tron/pull/6182</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6210">https://github.com/tronprotocol/java-tron/pull/6210</a></li></ul><h4><strong>3. Optimized Node Exit and Startup Logic</strong></h4><p><strong>3.1 Optimized Node Exit Logic</strong></p><p>Kant standardizes the code logic for process termination while preserving original functionalities, enhancing code consistency and system stability.</p><ul><li><strong>Source Code: <br></strong><a href="https://github.com/tronprotocol/java-tron/pull/6170">https://github.com/tronprotocol/java-tron/pull/6170</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6177">https://github.com/tronprotocol/java-tron/pull/6177</a> <a href="https://github.com/tronprotocol/java-tron/pull/6205">https://github.com/tronprotocol/java-tron/pull/6205</a></li></ul><p><strong>3.2 Optimized Node Startup Logic</strong></p><p>Kant introduces enhanced service integrity checks for the node startup process. To ensure operational stability, the node will <strong>immediately terminate</strong> if any core service (including API, P2P, Prometheus, and event plugins) fails to initialize. This prevents operation with incomplete critical services.</p><p>Additionally, the Kant version extends the API service with the following four configurable options (all enabled by default), providing node deployers the choice to selectively disable or enable these API service features:</p><pre>node.rpc.enable = true<br>node.rpc.solidityEnable = true<br>node.rpc.PBFTEnable = true<br>node.http.PBFTEnable = true</pre><ul><li><strong>Source Code: <br></strong><a href="https://github.com/tronprotocol/java-tron/pull/5857">https://github.com/tronprotocol/java-tron/pull/5857</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6228">https://github.com/tronprotocol/java-tron/pull/6228</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6233">https://github.com/tronprotocol/java-tron/pull/6233</a></li></ul><h4><strong>4. Dependency Library Security Upgrade</strong></h4><p>To enhance system security, Kant has updated several underlying dependency libraries and removed obsolete components. This includes updating the jcommander, pf4j, grpc, logback, and libp2p dependency libraries to secure and stable releases, and removing the deprecated library quartz for task scheduling.</p><ul><li><strong>Source Code: <br></strong><a href="https://github.com/tronprotocol/java-tron/pull/6180">https://github.com/tronprotocol/java-tron/pull/6180</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6207">https://github.com/tronprotocol/java-tron/pull/6207</a> <a href="https://github.com/tronprotocol/java-tron/pull/6257">https://github.com/tronprotocol/java-tron/pull/6257</a></li></ul><h4><strong>5. Gradle 7.6.4 Upgrade with Dependency Integrity Verification</strong></h4><p>Kant upgrades Gradle to version 7.6.4 and enables security verification of third-party dependency JAR packages. During JAR file packaging and generation, the system automatically validates all referenced external dependencies to ensure they originate from trusted sources and are free from tampering. This prevents the inclusion of potentially vulnerable JAR packages in the final product. This enhancement effectively mitigates supply chain attacks and bolsters the overall build security of the project.</p><ul><li><strong>Source Code: <br></strong><a href="https://github.com/tronprotocol/java-tron/pull/5869">https://github.com/tronprotocol/java-tron/pull/5869</a><br><a href="https://github.com/tronprotocol/java-tron/pull/5903">https://github.com/tronprotocol/java-tron/pull/5903</a> <a href="https://github.com/tronprotocol/java-tron/pull/6229">https://github.com/tronprotocol/java-tron/pull/6229</a></li></ul><h4><strong>6. Null Pointer Exception Fix During Startup</strong></h4><p>Kant resolves an intermittent <strong>null pointer exception</strong> that could occur during node startup. This ensures the <strong>consensus service</strong> initializes before the <strong>network service</strong>, preventing startup failures.</p><ul><li><strong>Source Code: </strong><a href="https://github.com/tronprotocol/java-tron/pull/6216">https://github.com/tronprotocol/java-tron/pull/6216</a></li></ul><h4><strong>7. Internal Transaction Details Logging for </strong>CANCELALLUNFREEZEV2<strong> Opcode</strong></h4><p>Nodes configured to save internal transactions, beginning with the Kant version, will log the unstaking amounts of various resources when processing transactions that include the CANCELALLUNFREEZEV2 opcode. For example: {“BANDWIDTH”:100,”ENERGY”:100,”TRON_POWER”:0}<strong>.</strong></p><ul><li><strong>Source Code: </strong><a href="https://github.com/tronprotocol/java-tron/pull/6191">https://github.com/tronprotocol/java-tron/pull/6191</a></li></ul><h3><strong>API</strong></h3><h4><strong>1. Enhanced Compatibility for Ethereum JSON-RPC Interface</strong></h4><p><strong>1.1 Support for Querying Solidified Data via finalized Block Parameter in JSON-RPC API</strong></p><p>Kant’s JSON-RPC interface now supports the “finalized” parameter. This allows certain interfaces that use a block number as a parameter to accept “finalized” for querying the latest solidified block information, further improving compatibility with the Ethereum JSON-RPC interface.</p><p>Interfaces supporting “finalized” as a parameter:</p><ul><li>eth_getBlockTransactionCountByNumber</li><li>eth_getBlockByNumber</li><li>eth_getTransactionByBlockNumberAndIndex</li><li>eth_getLogs</li></ul><p>Interfaces not supporting “finalized” as a parameter:</p><ul><li>eth_getBalance</li><li>eth_getCode</li><li>eth_getStorageAt</li><li>eth_call</li><li>eth_newFilter</li><li><strong>Source Code:<br></strong><a href="https://github.com/tronprotocol/java-tron/pull/6007">https://github.com/tronprotocol/java-tron/pull/6007</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6238">https://github.com/tronprotocol/java-tron/pull/6238</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6239">https://github.com/tronprotocol/java-tron/pull/6239</a></li></ul><p><strong>1.2 New Limits on Block Range and “Topics” Quantity for JSON-RPC Log Queries</strong></p><p>Kant introduces a query limit mechanism for JSON-RPC event query interfaces, controlled by the following two configuration parameters:</p><ul><li>maxBlockRange: Specifies the maximum block range allowed for log queries. The default value is 5000. The range between the starting block and the ending block cannot exceed this value when related interfaces are called.</li><li>maxSubTopics: Limits the maximum number of “sub topics” that can be set. The default value is 1000, meaning that a maximum of 1000 “sub topics” can be set during interface calls.</li></ul><p><strong>Note</strong>: The values of the above configuration parameters must be positive integers greater than 0. If a configured value is less than or equal to 0, the corresponding limit is considered disabled, and the relevant interfaces will not perform this validation.</p><pre>node.jsonrpc.maxBlockRange = 5000<br>node.jsonrpc.maxSubTopics = 1000</pre><p>Interfaces supporting maxBlockRange:</p><ul><li>eth_getLogs</li></ul><p>Interfaces supporting maxSubTopics:</p><ul><li>eth_getLogs</li><li>eth_newFilter</li><li><strong>Source Code:<br></strong><a href="https://github.com/tronprotocol/java-tron/pull/6271">https://github.com/tronprotocol/java-tron/pull/6271</a><br><a href="https://github.com/tronprotocol/java-tron/pull/6275">https://github.com/tronprotocol/java-tron/pull/6275</a></li></ul><p><strong>1.3 Optimized eth_getLogs to Resolve Data Retrieval Issue in Rare Hash Collisions</strong></p><p>Kant optimizes the eth_getLogs processing logic to resolve the issue where the interface failed to retrieve data in rare hash collision scenarios, thus increasing interface stability.</p><ul><li><strong>Source Code: </strong><a href="https://github.com/tronprotocol/java-tron/pull/6203">https://github.com/tronprotocol/java-tron/pull/6203</a></li></ul><h4><strong>2. Non-Null Payment Address Validation in Shielded Transaction Creation API</strong></h4><p>Kant adds validation to the shielded transaction creation API to ensure a payment address is not empty. If the validation fails, the API returns the reason for the failure, improving the user experience.</p><ul><li><strong>Source Code: </strong><a href="https://github.com/tronprotocol/java-tron/pull/6174">https://github.com/tronprotocol/java-tron/pull/6174</a></li></ul><blockquote>Science is organized knowledge. Wisdom is organized life. — Immanuel Kant</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=03022cb70350" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/mainnet-kant-announcement-03022cb70350">Mainnet Kant Announcement</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gas Optimization Guide for Smart Contracts]]></title>
            <link>https://medium.com/tronnetwork/smart-contract-gas-optimization-guide-22958db86ccb?source=rss----839d5c53e074---4</link>
            <guid isPermaLink="false">https://medium.com/p/22958db86ccb</guid>
            <dc:creator><![CDATA[TRON Core Devs]]></dc:creator>
            <pubDate>Tue, 01 Apr 2025 09:53:36 GMT</pubDate>
            <atom:updated>2025-04-02T04:24:02.196Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTYvqhHtYjj6Zrkc7g2bAw.png" /></figure><p>Effectively managing gas consumption is a critical aspect of smart contract development. This guide explores techniques and practical strategies for optimizing gas consumption, helping developers minimize costs and improve efficiency on the TRON blockchain.</p><h3><strong>1. Optimization on Variables and Storage Arrangement</strong></h3><h4><strong>1.1 Reduce State Variable Usage</strong></h4><p><strong>State variables</strong> are stored on-chain and therefore require Energy for every modification.</p><p>Define variables that are required only for function execution as <strong>memory variables</strong> or <strong>temporary variables</strong> on the stack to reduce Energy consumption caused by read/write (R/W) operations on state variables.</p><h4><strong>1.2 Arrange Storage based on Variable Types and Sizes</strong></h4><p>In theory, Solidity variables like unit8 and unit16 can consume less storage when packed. However, when used as individual variables, they occupy almost the same storage slot size as a unit256 variable.</p><p>Therefore, packing multiple smaller variable types into a single slot can <strong>effectively save storage space</strong>. For example, you can pack multiple unit128 and uint64 variables into the same slot following the “Place variables of the same type together in a wide-to-narrow sequence” principle.</p><h4><strong>1.3 Constant and Immutable Variables</strong></h4><p><strong>Constant Variable</strong>: This type of variables is determined during compilation, embedded within the bytecode, and remains immutable post-deployment. Reading constants does not consume additional energy associated with storage retrieval.</p><pre>uint256 constant FEE_RATE = 10;</pre><p><strong>Immutable Variable</strong>: This type of variables can be configured in construction functions and stay immutable once the contract is deployed. Immutable variables occupy less storage space than regular state variables, and reading immutable variables does not consume additional energy associated with storage retrieval.</p><pre>uint256 immutable START_TIME;<br><br>constructor(uint256 _start) {<br>    START_TIME = _start;<br>}</pre><p>Set variables that should remain unchanged to constant or immutable to minimize reading consumption.</p><h4><strong>1.4 Reduce Redundant Reads of Variables</strong></h4><p>In Solidity, each read operation on state variables consumes Energy. To optimize, <strong>assign the value to a local variable</strong> (stored on the stack or in memory) and reuse this local variable in your logic to minimize redundant state reads.</p><pre>uint256 value = stateVar; <br>// For later operations, keep using `value` instead of `stateVar`</pre><h3><strong>2. Optimization on Logic and Function Calls</strong></h3><h4><strong>2.1 Short-Circuit</strong></h4><p>In the case of conditional statements, such as if or require, arrange boolean expressions so that conditions that are <strong>most likely false/true are placed first</strong> to shorten the execution.</p><pre>// Assume that conditionA is more likely to be false<br>require(conditionA &amp;&amp; conditionB, &quot;Failed&quot;);<br>// When A is false, the fail result is returned. The computation on B is bypassed.</pre><h4><strong>2.2 Minimize Redundant Operations in Loops</strong></h4><p>In loops (e.g., for/while), if <strong>complex logics or R/W operations on state variables</strong> are involved, Energy consumption can soar with each iteration.</p><p>Where feasible, limit the number of loop iterations to <strong>an acceptable range</strong> or reduce the cost per iteration through <strong>batched operations</strong> and Events.</p><p>When accessing state variables within a loop, it is advisable to retrieve them once before the loop, store and modify them in memory variables during the loop, and then write the final values back to state storage after the loop completes.</p><p><strong>2.3 Minimize Function Call Depth</strong></p><p>Function calls themselves incur invocation gas costs. Inlining simple logic can reduce Energy consumption to some extent, but readability and maintainability must also be carefully considered.</p><p><strong>Internal </strong>vs. <strong>Public/External Functions</strong>: Internal function calls typically incur lower costs than external function calls. Therefore, declare functions that are used exclusively within a contract as internal.</p><h4><strong>2.4 Use calldata instead of memory</strong></h4><p>Declare external function parameters that are only read within the function body as calldata to minimize copy operations and therefore reduce Energy costs for memory allocation.</p><pre>function processData(uint256[] calldata data) external {<br>    // Here, `data` is stored as calldata instead of memory<br>}</pre><h3><strong>3. Optimization on Data Structures and Access Methods</strong></h3><h4><strong>3.1 Choose Suitable Data Structures</strong></h4><p><strong>Mapping</strong> vs. <strong>Array</strong>: If the data can be queried by key instead of traversal, mappings are generally more efficient than arrays. However, if extensive data traversal is required, arrays allow sequential access, whereas mappings cannot be directly traversed.</p><p><strong>Static </strong>vs. <strong>Dynamic Array</strong>: Static arrays consume less storage and Energy resources. However, the choice of array types should be based on your business requirements.</p><h4><strong>3.2 Minimize Storage Operations</strong></h4><p>If massive R/W operations to storage are needed within a contract, load the data in memory or the stack before the logic starts, and write the results to storage once processing is complete.</p><p>Implicit R/W operations can occur in the function body if reference types (e.g., dynamic arrays or structs) are conveyed as function parameters. In this case, determine whether to declare the reference types as memory or storage.</p><h4><strong>3.3 Use Events for Some Storage Scenarios</strong></h4><p>Data that only needs to be recorded or tracked can be covered in events for logging instead of being stored on-chain, especially for data not required by the contract logic in the following procedure. This method can dramatically cut storage costs.</p><p>For example, for a batch of user activity results, as long as these results are not required for later determinations in the smart contract, using events can reduce massive Energy consumption.</p><h3><strong>4. Advanced Optimization Methods</strong></h3><h4><strong>4.1 Inline Assembly</strong></h4><p>In scenarios where extremely high performance and massive Energy resources are required, assembly can be used to optimize logics such as batch processing, mathematical operations, or direct operations on storage slots.</p><p>However, <strong>readability, maintainability, and security</strong> must be prioritized, and developers should have a comprehensive understanding of the underlying logic of the Ethereum Virtual Machine (EVM).</p><h4><strong>4.2 Use Libraries instead of Inheritance or Repetition</strong></h4><p>This applies to features or modules that are generally and frequently called. Using libraries can reduce function duplication and minimize bytecode size.</p><p>However, costs of deploying and calling the libraries should be evaluated according to your actual needs.</p><h4><strong>4.3 Manage Contract Sizes</strong></h4><p>For contract deployment, the larger the bytecode size, the higher the Energy consumption. If a contract contains excessively redundant logic or resources, you can split the contract or use libraries to keep the contract in a smaller size.</p><p>For an enormously large contract, you can use upgradeable or proxy patterns to partition the logic into multiple segments for deployment, thereby reducing the size of individual contracts.</p><h4><strong>4.4 Moderate Use of Proxy to Reduce Energy Consumption of Application Iterations</strong></h4><p>If your application requirements change frequently, adopting <strong>an upgradable proxy pattern </strong>allows you to retain data and avoid redeploying massive logic code, thereby minimizing the cost of redeployment.</p><p>In this case, the storage layout must be carefully designed to prevent conflicts or disorders during upgrades.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22958db86ccb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tronnetwork/smart-contract-gas-optimization-guide-22958db86ccb">Gas Optimization Guide for Smart Contracts</a> was originally published in <a href="https://medium.com/tronnetwork">TRON</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>