Skip to content

Latest commit

 

History

History
22 lines (22 loc) · 1.69 KB

tip-276.md

File metadata and controls

22 lines (22 loc) · 1.69 KB
tip: 276
title: Optimize block verification logic
author: [email protected]
discussions to: https://github.com/tronprotocol/TIPs/issues/276
status: Final 
category: Core
created: 2021-06-03

Simple Summary

This TIP is to optimize the block verification logic to reduce block processing time.

Abstract

According to statistics, the verification of each transaction takes about 3ms on average. After analysis, the verification of the transaction takes up nearly one-third of the time during the entire block processing. This article details the optimization of the block verification.

Motivation

In order to improve the performance of the blockchain, increase the TPS, and reduce the block loss rate, it is necessary to reduce the block processing time.

Specifications

TODO

Implementation

After testing and analysis, most of the transactions packaged in the block are also in the pending queue, and the transactions in the pending queue are successfully verified. So whether it can be considered, if the transaction in the block also exists in the pending queue, it is not necessary to verify the signature. Of course, there is a special case that needs to be considered. In the scenario of a AccountUpdateContract transaction, the AccountUpdateContract transaction will change the account permissions, so the final logic can be implemented as follows:

  1. Extract the account list corresponding to the AccountUpdateContract transaction in the pending queue
  2. If the transaction in the block also exists in the pending queue, and the corresponding account is not in the list of multiple signature accounts, you can skip the verification
  3. Verify transaction signatures that have not skipped verification