-
Notifications
You must be signed in to change notification settings - Fork 22
[review] MIP-52: Aptos Gas Pool #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
l-monninger
wants to merge
9
commits into
main
Choose a base branch
from
l-monninger/aptos-gas-pool
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a807646
feat: aptos governed gas pool.
l-monninger 7a68f25
filename and codeowners
apenzk 6d2550e
Merge branch 'main' into l-monninger/aptos-gas-pool
apenzk b8978fe
minor changes
apenzk 8bc41b3
fix: aptos gas pool.
l-monninger 30ed586
Merge branch 'main' into l-monninger/aptos-gas-pool
apenzk de4722c
edits
apenzk 5138acb
fix: merge.
l-monninger 2204779
Update MIP/mip-52/README.md
apenzk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,43 @@ | ||
| # MIP-52: Aptos Gas Pool | ||
| - **Description**: Introduces implementation specification for the Gas Pool in Aptos. | ||
| - **Authors**: [Liam Monninger](mailto:liam@movementlabs.xyz) | ||
| - **Reviewer**: Andreas Penzkofer | ||
| - **Desiderata**: [MD-38](https://github.com/movementlabsxyz/MIP/pulls) | ||
|
|
||
| ## Abstract | ||
|
|
||
| We propose a means of implementing a Gas Pool in Aptos to satisfy the token recirculation requirements indicated in [MD-38](https://github.com/movementlabsxyz/MIP/pulls). This solution will allow for gas used to be stored in the pool. The re-use of said gas is not a subject of this MIP. However, [MIP-44](https://github.com/movementlabsxyz/MIP/pull/44), [MIP-41](https://github.com/movementlabsxyz/MIP/pull/41), et al. provide suggestions to this end. | ||
|
|
||
| ## Motivation | ||
|
|
||
| The introduction of a Gas Pool in Aptos will allow for the recirculation of gas used in the Aptos ecosystem. This ensures the supply can remain fixed and the gas can be re-used for purposes such as rewarding. | ||
|
|
||
| ## Specification | ||
|
|
||
| Aptos pays gas in the [epilogue](https://github.com/movementlabsxyz/aptos-core/blob/70be3926ff79ff4cdb0cee928f717fafcd41ecdd/aptos-move/aptos-vm/src/transaction_validation.rs#L194) of a transaction [dispatching](https://github.com/movementlabsxyz/aptos-core/blob/70be3926ff79ff4cdb0cee928f717fafcd41ecdd/aptos-move/aptos-vm/src/transaction_validation.rs#L34) to [`epilogue_gas_payer`](https://github.com/movementlabsxyz/aptos-core/blob/70be3926ff79ff4cdb0cee928f717fafcd41ecdd/aptos-move/framework/aptos-framework/sources/transaction_validation.move#L274). Depending on the [validator reward setting](https://github.com/movementlabsxyz/aptos-core/blob/70be3926ff79ff4cdb0cee928f717fafcd41ecdd/aptos-move/framework/aptos-framework/sources/transaction_validation.move#L305), [`epilogue_gas_payer`](https://github.com/movementlabsxyz/aptos-core/blob/70be3926ff79ff4cdb0cee928f717fafcd41ecdd/aptos-move/framework/aptos-framework/sources/transaction_validation.move#L274) will either call `transaction_fee::collect_fee` or `transaction_fee::burn_fee`. | ||
|
|
||
| At the time of writing the `transaction_fee::collect_fee` path is still experimental. | ||
|
|
||
| [`transaction_fee::burn_fee`](https://github.com/movementlabsxyz/aptos-core/blob/70be3926ff79ff4cdb0cee928f717fafcd41ecdd/aptos-move/framework/aptos-framework/sources/transaction_fee.move#L218) internally calls [`coin::burn_from`](https://github.com/movementlabsxyz/aptos-core/blob/70be3926ff79ff4cdb0cee928f717fafcd41ecdd/aptos-move/framework/aptos-framework/sources/transaction_fee.move#L229C17-L233C19) which can be replaced with a transfer. | ||
|
|
||
| We thus suggest two paths to implement the Gas Pool in Aptos: | ||
| - **Custom Rewards Collection** | ||
| - **Burn Replacement** | ||
|
|
||
| ### Custom Rewards Collection | ||
| The custom rewards collection approach replaces Aptos' experimental `transaction_fee::collect_fee` with a custom rewards collection mechanism. This mechanism calls `coin::transfer_from` to move the gas to the Gas Pool at a known address. | ||
|
|
||
| Coin burning logic can be kept in place and a similar features-based approach can be used to determine ensure the `transaction_fee::collect_fee` approach is used. | ||
|
|
||
| ### Burn Replacement | ||
| The burn replacement approach replaces the `coin::burn_from` call in `transaction_fee::burn_fee` with a `coin::transfer_from` call to the Gas Pool. | ||
|
|
||
| ## Verification | ||
| **Outstanding**: | ||
| - Verify that the AptosVM does not validate burns. Otherwise, there may be logic outside of the framework `epilogue_gas_payer` path which needs to be updated. | ||
| - Identify any sponsorship or other gas payment mechanisms which may need to be updated to use the Gas Pool. | ||
|
|
||
| ## Errata | ||
|
|
||
|
|
||
| ## Appendix | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.