tip-366.md
April 3, 2025 · View on GitHub
tip: 366
title: TIP-366 Node startup optimization
author: halibobo1205@gmail.com
discussions to: https://github.com/tronprotocol/tips/issues/366
status: Final
type: Standards Track
category: Core
created: 2022-01-24
Abstract
Currently, it takes about 1 minute from node starts to block synchronization. Block synchronization depends on node tcp establishment.During the start-up,the current tcp connection establishment thread is delayed by 30s to wait neighbors discovery. However, when node.discovery.persist = true, the current discovered node will be stored persistently at regular intervals.
Specification
Change TCP initialDelay from 30s to 100ms, TCP connection using last persistent node information instead of waiting for 30s.
Motivation
Speed up TCP establishment for the purpose of fast node startup.
Implementation
SyncPool
public void init() {
//......
poolLoopExecutor.scheduleWithFixedDelay(() -> {
try {
//.... node discovery
} catch (Throwable t) {
logger.error("Exception in sync worker", t);
}
}, 100, 3600, TimeUnit.MILLISECONDS);
}
Rationale
TCP initialDelay take up much time(30s) during node start up(about 1min).
Copyright
Copyright and related rights waived via CC0.