tip:207
title: A proposal to improve network resources model
author: sean liu <[email protected]>
discussions to: https://github.com/tronprotocol/TIPs/issues/207
status: Draft
type: Standards Track
category: core
created: 2020-03-26
This proposal proposes a new scheme to try to solve the problem of the low utilization rate of network frozen resources, reduce user usage costs, and improve resource models.
The core idea is that freezing TRX only get bandwidth, energy, or voting right.
In order to guarantee the stability of the network and the rights of users, the voting right and resources obtained before can be retained at the same time.
Currently, freezing TRX can obtain bandwidth or energy, while obtaining voting rights. Many accounts freeze a large amount of TRX for voting only but do not use resources. This results in accounts that really need resources only get a small part of resources and network resources are wasted.
There are two new parameters will be added into account data structure: "old_tron_power" and "tron_power".
"old_tron_power" is used to record the vote power before the proposal, which is the sum of frozen trx for the bandwidth and energy.
"tron_power" is used to record the vote power after the proposal.
message Account {
...
int64 old_tron_power = 46;
Frozen tron_power = 47;
}
In the FreezeBalanceContract, TRON_POWER is added into ResourceCode.
enum ResourceCode {
BANDWIDTH = 0x00;
ENERGY = 0x01;
TRON_POWER = 0x02;
}
There is a new chain parameter called TOTAL_TRON_POWER_WEIGHT, which is used to record the new vote power in the whole network.
private static final byte[] TOTAL_TRON_POWER_WEIGHT = "TOTAL_TRON_POWER_WEIGHT".getBytes();
After the proposal, the "old_tron_power" of this account will be calculated when an account performs a freezing related operation, include voting a witness and freezing new trx, and be clear when the account sent an unfreeze operation and will not set anymore.
And, accounts could obtain "tron_power" only by freezing trx for TRON_POWER.
This moment, the total vote power of an account is the sum of "old_tron_power" and "tron_power".
In addition, vote power is not allowed to delegate to other accounts.
There are no backward compatibility concerns.
- Check the "old_tron_power" is correct after a freezing related operation.
- Check the "old_tron_power" is clear after an unfreeze operation.
- Check the vote power is the sum of "old_tron_power" and "tron_power".