Committee Proposal 82

TRON Core Devs
TRON
Published in
3 min readJan 20, 2023

Committee proposal 82 is a voting request for modifying the №67 network parameter, optimizing the voting reward calculation performance. The №82 committee proposal is already in effect, please refer to here, this post is dedicated to provide more details and make it clearer.

Why need to optimize the voting reward calculation performance

The time complexity of current reward algorithm is O (maintenance period * vote witness number), which increases linearly with the number of maintenance period rounds. As a result, it sometimes takes more than 1s to execute extracting reward transactions, which reduces the transaction volume of production blocks.

This problem can be resolved by the new reward algorithm, it records the accumulated reward per ticket of each witness in the maintenance period, simplifies the cross-cycle calculation, and reduces the time complexity to O (number of vote witnesses), making it independent of the number of maintenance period rounds.

When a user unstake the balance, the voting rewards will be calculated. So we can illustrate the performance of the new algorithm by comparing the time-consuming of this type of transaction before and after activating the new reward algorithm. Please refer to the table below which is the statistics of unstake transactions on chain.

Figure 1 — Comparison of the average execution time of unstake transaction for the old and new algorithm

We can see that when the number of maintenance periods is 1000, the execution time of unstake transactions will be 100ms — 1000ms, as for the floating time, that depends on whether to query the disk database. For the transactions the data they need when executing can be obtained in memory, they will execute more quickly, but also need more than 100ms. For some transactions the data they need can only be obtained by querying the disk database; in this situation, the execution will be more time-consuming, even up to 1000ms. But after activating the new reward algorithm, the execution time of unstake transaction will be only 0.08ms. and the performance improvement rate will reach 99.9%.

From the statistics in the table above, as the number of maintenance periods increases, the execution speed of the unstake transactions is getting slower and slower when using the old algorithm. But after activating the new algorithm, the execution speed of the unstake transactions will be basically constant, it is independent of the number of maintenance periods.

So the new voting reward algorithm can speed up the execution of reward calculation related transactions, and improve the performance of the TRON network. For more details, please refer to: TIP-465.

How to adapt to this proposal?

Developers do not need to do anything for this change.

Summary

This proposal can realize finishing the calculation of the total number of the account’s voting rewards in a constant time. That will greatly improve the calculation efficiency of voting rewards, thereby speeding up the execution speed of reward calculations related transactions and improving the performance of the TRON network.

--

--