Skip to content

Latest commit

 

History

History
20 lines (20 loc) · 1.16 KB

tip-285.md

File metadata and controls

20 lines (20 loc) · 1.16 KB
tip: 285
title: Optimize transaction cache initialization logic
author: lucas.wu@tron.network
discussions to: https://github.com/tronprotocol/TIPs/issues/285
status: Final
category: Core
created: 2021-06-21

Simple Summary

This TIP is to optimize transaction cache initialization logic to improve the speed of node startup.

Abstract

The transaction cache is initialized during the node startup process. The initialization logic is like this. The system will load the transactions in the latest 65536 blocks into the cache. This will involve 65536 DB queries. The entire process will take three minutes. This article details the optimization of the transaction cache initialization logic.

Motivation

The node starts slowly, causing a lot of bad experience for users. In order to solve this problem, it is necessary to speed up the node startup speed.

Specifications

TODO

Implementation

When the node starts, the transaction cache data will be loaded, so there is no need to load from the block later, the initialization transaction cache code is as follows. image