Skip to content

Latest commit

 

History

History
74 lines (56 loc) · 2.56 KB

tip-207.md

File metadata and controls

74 lines (56 loc) · 2.56 KB
tip:207
title: A proposal to improve network resources model 
author: sean liu <liu.sean@tron.network> 
discussions to: https://github.com/tronprotocol/TIPs/issues/207
status: Draft
type: Standards Track
category: core
created: 2020-03-26

Simple Summary

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.

Motivation

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.

Specification

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();

Implementation

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.

Backward Compatibility

There are no backward compatibility concerns.

Test Cases

  1. Check the "old_tron_power" is correct after a freezing related operation.
  2. Check the "old_tron_power" is clear after an unfreeze operation.
  3. Check the vote power is the sum of "old_tron_power" and "tron_power".