Skip to content

Proposal: Enable new reward calculation algorithm #496

Closed
@bladehan1

Description

@bladehan1

Simple Summary

This proposal aims to activate the #67 network parameter to use a new reward calculation algorithm, speed up the execution of reward calculations related transactions, and improve the performance of the TRON network, for the new reward calculation algorithm, please refer to: TIP-465.

Motivation

The current reward algorithm time complexity 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 extract rewards-related transactions, which reduces the transaction volume of production blocks. The above problems can be resolved by recording the accumulated reward per ticket of each witness in the maintenance period, simplifying the cross-cycle calculation, and reducing the time complexity to O (number of vote witnesses).

Timeline

Any opinions or discussions about this proposal are welcomed.

The estimated timeline

  • Creation time of the voting request: January 17, 2023
  • The effective time of voting request: January 20, 2023

How to Initialize the Voting Request

  • Open the new reward calculation algorithm proposal.
    • createProposal 67 1

Performance Analyze

In order to quickly calculate the multi-maintenance period rewards, the cumulative per-ticket rewards are introduced to record the accumulated rewards per ticket during a maintenance period. The reward per ticket during the current maintenance period equals the witness reward during the maintenance period divided by the number of tickets, and the cumulative reward per ticket is the prefix sum of the reward per ticket during the maintenance period.

The interval per-ticket reward equals the sum of per-ticket rewards at the end of the maintenance period minus the sum of per-ticket rewards at the start of the maintenance period. The reward for a per witness equals the interval per ticket reward multiplied by the number of votes, so the calculation complexity of the reward is O (the number of voting witnesses).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions