-
Notifications
You must be signed in to change notification settings - Fork 103
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
[AIP-7][Discussion] Transaction fee distribution #23
Comments
Hi @georgemitenkov, can you speak to the effect this would have on potentially redirecting some transaction spend to smart contract writers? One way competing networks have encouraged developers to join their ranks is by redirecting a portion of Smart Contract execution gas directly into the wallet of the Smart Contract writer. My understanding is Aptos does not provide this currently (all tx fees are burnt, I believe?), and would benefit from this functionality as well. |
lol bump our minimal transaction fee cost go to up. |
closing due to inactivity |
AIP PR: #22
Summary
Currently, all transaction fees are burnt on Aptos. This design choice does not motivate validators to prioritise the highest value transactions, as well as use bigger blocks of transactions, leading to lower throughput of the system. For example, a validator can submit an empty block and still get rewarded. We would like to solve this issue by distributing transaction fees to validators. In particular, we want to collect transaction fees for each block, store them, and then redistribute at the end of each epoch.
Motivation
If transaction fees are redistributed to validators, we will be able to both 1) ensure that the highest value transactions have a priority 2) increase the throughput of the system to gain more performance advantages of the parallel execution.
Proposal
Enable collection and per-epoch distribution of transaction fees to validators.
Rationale
In order to keep the system configurable, we have an on-chain parameter which dictates what percentage of transaction fees should be burnt (called
burn_percentage
). This way, burning 100% of transaction fees would allow the system to have the same behaviour as it has now. Burning 0% would mean that all transaction fees are collected and distributed to validators. The formula deciding how much to burn and how much to collect is the following:Based on the discussion with the community, the initial burning percentage can be set and later upgraded via a governance proposal. While it seems like 0% burning would be a reasonable initial parameter value, one has to consider the effects on the tokenomics, e.g. inflation.
Alternatives
Alternative I: Distributing fees every transaction
Recall that we want to distribute transaction fee to the validator which proposed the block. Doing it per transaction has numerous disadvantages:
Updating the balances of validators per each transaction is a bottleneck for the parallel execution engine, as it creates a read-modify-write dependencies. While it can be alleviated by implementing balance as aggregator, it is not possible in the current system.
Validators obtain voting rewards on per-epoch basis, and certain smart contracts can rely on that fact. Having the balance of the validator change per transaction can break this logic and be not compatible.
Alternative II: Distributing fees every block
In order to solve the first disadvantage from Alternative I, we can instead collect into a special balance which uses aggregator to avoid read-modify-write conflicts in parallel execution. This way each transaction in the block updates the aggregator value with the fee, and when the block ends the total value is distributed to the proposer of the block.
Note that this approach does not solve the second disadvantage from Alternative I, which leads to our proposal.
Implementation
Draft PR: aptos-labs/aptos-core#4967
Algorithm overview
When executing a single transaction in the block, the epilogue puts the gas fees into a special aggregatable coin stored on the system account. In contrast to standard coin, changing the value of aggregatable coin does not cause conflicts during the parallel execution. Aggregatable coin can be "drained" to produce the standard coin.
In the first transaction of the next block (i.e.
BlockMetadata
), we process collected fees in the following way:Note: in the current implementation fees for governance proposals are simply burnt. This is subject to discussion and can change in the future
Risks and Drawbacks
Decentralization - no impact or changes.
Performance - the usage of aggregator avoids the conflicts in parallel executor.
Security - the added code will go through strict testing and auditing.
Tooling - no impact or changes.
Future Potential
The proposed change allows to control what fraction of the transaction fees is collected and what fraction is burnt. In the future it can be adjusted using a governance proposal.
Timeline
The change is currently being tested using e2e Move tests and smoke tests. Ideally, it should be enabled in the testnet soon.
The text was updated successfully, but these errors were encountered: