-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dbf449c
commit 7e4f6e0
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,7 @@ TRON Improvement Proposals (TIPs) describe standards for the TRON platform, incl | |
| TIP 592 | [Supplement Disconnect Reasons in Java-tron](https://github.com/tronprotocol/tips/blob/master/tip-592.md) | <[email protected]> | Standards Track | Networking | false | Final | | ||
| TIP 621 | [Add code version column to HelloMessage](https://github.com/tronprotocol/tips/blob/master/tip-621.md) | <[email protected]> | Standards Track | Networking | false | Final | | ||
| TIP 635 | [Optimize Reward Withdrawal To Improve TPS](https://github.com/tronprotocol/tips/blob/master/tip-635.md) | <[email protected]> | Standards Track | Core | true | Final | | ||
| TIP 653 | [Review and adjust energy cost of TVM opcodes](https://github.com/tronprotocol/tips/blob/master/tip-653.md) | <[email protected]> | Standards Track | VM | true | Draft | | ||
| TIP 712 | [TRON typed structured data hashing and signing](https://github.com/tronprotocol/tips/blob/master/tip-712.md) | <[email protected]> | Standards Track | Interface | false | Final | | ||
| TIP 721 | [TRC-721 Non-Fungible Token Standard](https://github.com/tronprotocol/tips/blob/master/tip-721.md) | <[email protected]> | Standards Track | TRC | true | Final | | ||
| TIP 1102 | [TIP-1102: Opt-in account exposure](https://github.com/tronprotocol/tips/blob/master/tip-1102.md) | <[email protected]> | Standards Track | Interface | false | Final | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
``` | ||
tip: 653 | ||
title: Review and adjust energy cost of TVM opcodes | ||
author: [email protected] | ||
status: Draft | ||
type: Standards Track | ||
category: VM | ||
created: 2024-04-30 | ||
``` | ||
|
||
## Simple Summary | ||
This TIP aims to review & adjust the energy cost of TVM opcodes based on actual resource consumption. | ||
|
||
## Abstract | ||
Adjust the energy cost for several opcodes (such as `SUICIDE`) in TVM to better reflect the actual resource consumption of opcode execution and to ensure that the costs are reasonable. | ||
|
||
## Motivation | ||
The `SUICIDE` opcode is used to destroy smart contracts and release related resources. However, the current energy cost mechanism may have some deficiencies, failing to effectively reflect the resources and time costs required for `SUICIDE` opcode execution, potentially leading to unreasonable costs. | ||
|
||
1. **Adjustment of Energy Cost:** The current energy cost for the `SUICIDE` opcode may be comparatively low compared to other opcodes, failing to adequately consider the resources and time costs required for execution. It is proposed to adjust the energy cost for the `SUICIDE` opcode appropriately to better reflect the actual costs. | ||
|
||
2. **Consideration of Execution Time:** The execution of the `SUICIDE` opcode may involve complex operations and require a certain amount of time to complete. Therefore, the impact of opcode execution time on energy cost should be considered to ensure that the cost is proportional to the execution time. | ||
|
||
3. **Reasonability:** When adjusting energy costs, it should be ensured that the costs reflect the consumption of resources by the opcodes to avoid the possibility of potential DDoS attacks. | ||
|
||
## Specification | ||
|
||
After the `getAllowEnergyAdjustment(81th)` proposal takes effect, the `suicide` opcode will charge an additional `25,000` energy cost, if the recipient does not exist. | ||
|
||
## Rationale | ||
|
||
The rationale behind proposing an adjustment to the energy cost for the `SUICIDE` opcode in TVM stems from several key considerations: | ||
|
||
- **Efficiency**: Aligning the cost with actual resource consumption encourages developers to optimize contracts, leading to more efficient resource allocation. | ||
- **Security**: A more accurate cost reduces the risk of abuse and network disruptions, enhancing overall security and stability. | ||
- **Community Involvement**: Engaging the TRON community ensures support and alignment with network interests, promoting transparency and accountability. | ||
|
||
## Backwards Compatibility | ||
These energy cost increases may potentially break contracts that depend on fixed energy costs. |