tronprotocol / tips

TRON Improvement Proposals
229 stars 203 forks source link

Synchronization packet processing failed,item not fund #439

Closed xxo1shine closed 1 year ago

xxo1shine commented 2 years ago

Simple Summary

item not fund error was reported when synchronizing the block, and then the connection was disconnected. The log is as follows.

image

Motivation

To increase the stability of the network, it is necessary to eliminate these abnormal disconnections.

Implementation

This problem caused by multi-threaded concurrency. When processing the sync block chain message, the headblock is updated to 41958141, but the block is not stored in the DB. At this time, when 41958163 is queried, an exception is thrown.

image

The solution is to handle the headblock specially. When querying the headblock, do not query the database.

image
xxo1shine commented 2 years ago

refer to PR: https://github.com/tronprotocol/java-tron/pull/4540