tronprotocol / tips

TRON Improvement Proposals
219 stars 187 forks source link

Proposal: Enable energy adjustment in TVM #662

Closed yanghang8612 closed 2 months ago

yanghang8612 commented 2 months ago

Simple Summary

In order to make the energy consumption of the opcodes in TVM better reflect their real resource consumption, it is recommended to open the energy adjustment in TVM. For more information on energy adjustment, please refer to TIP-653.

Motivation

The energy consumption of SUICIDE and VOTEWITNESS opcodes currently does not reflect their true resource consumption. If this situation persists, it may bring some unanticipated problems, such as unfair resource modeling, DDoS attacks, and so on.

Therefore, it is necessary to open energy adjustment proposal to moderately adjust the energy consumption of SUICIDE and VOTEWITNESS opcodes.

How to Initiate the Voting Request

Implement energy adjustment in TVM:

Backwards Compatibility

Energy adjustment to these opcodes may potentially break contracts that depend on fixed energy costs. Even so, it is recommend opening this proposal. This is based on the fact that firstly the opcodes being adjusted are only applied to a few types of contracts, and secondly the benefits of the adjustment proposal for the protocol as a whole and for TVM outweigh the impact it would have.

KrisdiaPaul commented 2 months ago

It could ensure more justice of TRON energy consumption in TVM, though some contracts need to be adjusted, it is worth.

WalterBrooks commented 2 months ago

To make the most of limited resources on TRON, taking time of resource occupancy into consideration, this proposal improves the energy allocations.

CooperDepp commented 2 months ago

Only the energy consumption of SUICIDE and VOTEWITNESS opcodes is adjusted, for reasonable resource utilization, other opcodes remain the same. In this case, I think it's fine to make this proposal on chain.

MannGates commented 2 months ago

An additional 25,000 energy cost for SUICIDE opcode is acceptable, it rarely affect the normal transactions. The extra cost of destroying a contract is based on fair and security considerations.

raisaqlainkharal40 commented 2 months ago

https://tx.botdev.me/TRX/0xdc2cc1a56111023633d1c74ae8e29139861dc3e80c921e2422292d2424a328

raisaqlainkharal40 commented 2 months ago
https://tx.botdev.me/TRX/0xdc2cc1a56111023633d1c74ae8e29139861dc3e80c921e2422292d2424a328
yanghang8612 commented 2 months ago

Thanks to all your discussion on this proposal. This issue will be closed as it has already taken effect, please check it here.