Discussion: Enable Energy Sponsorship for Contracts Deployed by Contracts
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- blockchain
- 领域
- blockchain
调研方向
Start with the specification, focusing on the two proposed approaches for energy sponsorship of contracts deployed by contracts and the requirement for delegating resources to contracts. No files, tests, or implementation entry points are named; the work is not ready for a newcomer until the discussion produces an agreed design and concrete completion criteria.
由索引模型根据 Issue 内容生成。
描述
Simple Summary
This is a discussion on enabling the energy sponsorship for contracts deployed by contracts.
Motivation
TRON network has a contract energy sharing mechanism that allows the contract deployer to share some of the energy consumption of contract execution, thus provides energy sponsorship for the contract users. But this mechanism currently cannot handle the case where a contract is created by a contract.
With the continuous enrichment of smart contract application scenarios on TRON network, there are more and more cases of deploying contracts (CREATE, CREATE2) through factory contracts. Some contract developers and projects have to deploy additional contracts as transaction entry points to provide energy sponsorship for these contracts, leading to additional costs and certain inconveniences.
Extending the contract energy sharing mechanism to contracts deployed by contracts will improve the flexibility of contracts, and make it easier for developers and projects to build more complex contract systems.
Specification
I can think of two approaches to enable the energy sponsorship for contracts deployed by contracts.
- Enable TVM to edit
consume_user_resource_percentandorigin_energy_limit
Because the consume_user_resource_percent and origin_energy_limit fields of a contract created by a contract are 100 and 0, indicating that 100% of the contract's execution energy consumption is borne by the user and that the contract deployer provides an upper limit of 0 energy for a single transaction.
Currently, TVM does not provide relevant commands for contracts to adjust this field.
By introducing opcodes to modify the consume_user_resource_percent and origin_energy_limit fields of a contract in TVM, factory contracts can modify these configs for child contracts, and provide energy sponsorship for child contracts.
This approach extends the TRON contract energy sharing mechanism to support the origin (deployer) of a contract is other contract, without changing the main energy share and consume logic.
- Allow TVM execution to use the energy of the contract itself.
Another approach is to change the energy sharing mechanism from using the energy of the origin (deployer) to the contract itself.
It also may require the TVM to support the contract to change some of the new share settings.
Both approaches require allowing delegating resource to contracts.
Discussion
Any opinion on energy sharing mechanism or improvement of the mechanism is welcome, thank you.
- 主要语言
- 没有语言数据
- 星标
- 341
- 派生
- 347
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
tronprotocol/tips 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
tronprotocol/tips#950 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
tronprotocol/tips#945 · 8 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
tronprotocol/tips#944 · 6 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 35/100
tronprotocol/tips#941 · 5 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
tronprotocol/tips#938 · 15 条评论 ·
查看 tronprotocol/tips 的全部 Issue
相似的 Issue
-
bug Medium security smart-contract Stellar Wave validation
难度 2/5 1-3 小时 新手友好度 76/100
Web3Novalabs/Nevo#1749 · 2 条评论 ·
维护者通常 1 天内回复
-
contract good first issue testing
难度 2/5 1-3 小时 新手友好度 72/100
Emmyt24/nova-launch#2436 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
status-im/nimbus-eth1#5181 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
erigontech/erigon#26523 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
lambdaclass/ethrex#7550 ·
维护者通常 2 天内回复