Skip to content

Commit

Permalink
func: add tip-653
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghang8612 committed May 29, 2024
1 parent dbf449c commit 7e4f6e0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ TRON Improvement Proposals (TIPs) describe standards for the TRON platform, incl
| TIP&nbsp;592 | [Supplement Disconnect Reasons in Java-tron](https://github.com/tronprotocol/tips/blob/master/tip-592.md) | <[email protected]> | Standards&nbsp;Track | Networking | false | Final |
| TIP&nbsp;621 | [Add code version column to HelloMessage](https://github.com/tronprotocol/tips/blob/master/tip-621.md) | <[email protected]> | Standards&nbsp;Track | Networking | false | Final |
| TIP&nbsp;635 | [Optimize Reward Withdrawal To Improve TPS](https://github.com/tronprotocol/tips/blob/master/tip-635.md) | <[email protected]> | Standards&nbsp;Track | Core | true | Final |
| TIP&nbsp;653 | [Review and adjust energy cost of TVM opcodes](https://github.com/tronprotocol/tips/blob/master/tip-653.md) | <[email protected]> | Standards&nbsp;Track | VM | true | Draft |
| TIP&nbsp;712 | [TRON typed structured data hashing and signing](https://github.com/tronprotocol/tips/blob/master/tip-712.md) | <[email protected]> | Standards&nbsp;Track | Interface | false | Final |
| TIP&nbsp;721 | [TRC-721 Non-Fungible Token Standard](https://github.com/tronprotocol/tips/blob/master/tip-721.md) | <[email protected]> | Standards&nbsp;Track | TRC | true | Final |
| TIP&nbsp;1102 | [TIP-1102: Opt-in account exposure](https://github.com/tronprotocol/tips/blob/master/tip-1102.md) | <[email protected]> | Standards&nbsp;Track | Interface | false | Final |
Expand Down
39 changes: 39 additions & 0 deletions tip-653.md
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.

0 comments on commit 7e4f6e0

Please sign in to comment.