Introduction
Gas facilitates transactions by measuring each transaction in terms of computation and storage units, which determine the cost of gas fees required for processing and executing transactions. The Gas Budget sets a cap on how much users will pay in gas fees, and validators play a role in deciding it. When validators submit a Gas Budget, all transactions must also be submitted. The storage units, which contribute to the overall gas fees, are managed by the storage fund, bringing stability to gas fees that encompass computation and storage costs.
The Sui gas mechanism aims to achieve three key outcomes: providing users with low and predictable transactional fees, incentivizing validators to optimize transaction processing, and preventing denial of service attacks. The mechanism follows a three-step process to determine execution gas prices. First, validators participate in the Gas Price Survey, submitting low-price quotes. Validators who process transactions above their self-declared prices receive rewards, while those who submit high-price quotes or fail to honor their self-declared prices face penalties in the form of reduced rewards. The Tallying Rule evaluates validators subjectively and objectively to determine stake rewards at the end of an epoch, enforced by the Incentivized Distribution Rule. Rewards and penalties incentivize desirable behavior, such as competitive and fair pricing, and discourage undesirable behavior, such as cartel-like pricing.
Storage Fund and Gas
The Storage Fund model allows users to pay upfront for the cost of storing data in perpetuity and can get a rebate on previously stored data if it's deleted. This model ensures that high gas prices will not be a problem that is kicked down the road for newer validators and users to deal with by subsidizing them. The rewards for newer validators are a small percentage of each transaction being staked separately. The storage price is set through governance and should change infrequently (generally a few months at a time). When it does, it will be due to technological improvements and price action. This is significantly different when compared to the gas prices because those change frequently and are decided by validators through the Gas Survey, Tallying Rule, and Incentivized Reward Distribution Rule.
Gas Price Survey
More specifically, there is a Gas Price Survey every validator must participate in to set the reference gas price to coordinate on a price point at the beginning of each epoch, an epoch lasts around 24 hours. Each validator can come up with their method to determine the price they would like to submit to the survey. They must take into account the token price, network congestion, their expenses, and the competition to find the optimal price. Sui's gas price mechanism provides reference points for end-users to submit transactions. It incentivizes validators to quote their true reservation prices and honor them, resulting in transactions being processed promptly. The mechanism ensures that validators have no incentive to charge users more or less than the reference gas price, and users submitting transactions with gas prices within the reference range face a good user experience. The gas mechanism also enables Sui to scale horizontally by allowing validators to add more workers and process transactions at low gas prices. During times of severe network congestion, tips serve as a market-driven mechanism that discourages additional demand spikes by raising the transaction costs on Sui. Validators are encouraged to optimize their hardware and operations to honor lower gas prices and obtain a reward boost.
Tallying Rule
The Tallying Rule is a Sui gas concept that provides a means of determining the distribution of stake rewards at the end of each epoch. Validators review each other to determine if they honored the reference gas price throughout the epoch. The rule has three parts: the executed gas price distribution, which is a common and objective measure of the gas prices used in all transactions during the epoch; the reasonable execution metric, which is a subjective measure that each validator uses to evaluate the performance of every other validator during the epoch relative to the gas price they quoted in the survey; and the punishment mechanism, which penalizes validators who did not honor their quoted gas prices.
The Tallying Rule uses gas as a coordination mechanism by encouraging validators to be honest and transparent about their gas prices and to process transactions promptly. It also incentivizes validators to improve their performance and efficiency.
Incentivized Reward Distribution Rule
The Incentivized Stake Reward Distribution Rule is a Sui gas concept that combines the usage of the Gas Survey and the Tallying Rule. This rule distributes rewards based on the outcomes of the gas survey and the tallying rule. Validators and their delegators can receive optimal rewards if they submit low enough gas quotes and honor them through this stake distribution rule. They do not receive the optimal amount of rewards if the price quote is too high because attentive delegators would not support that as it signals that they want to increase fees. If they do not honor the gas prices submitted not only will the system penalize them but other validators will call out this behavior when rating them using the Tallying Rule which will further decrease the Validator's rewards. This aims to keep gas prices low and prevent validators from gaming the system.
Conclusion
Hopefully, this primer clarifies how gas works on the Sui network. The storage fund exists to regulate the price of storage for the long term. The gas survey calculates fees to bring users something cheap enough to use the network but considers a validator's cost of operation and their search for sustainability. The Tallying Rule considers tokenomics and human nature while attempting to be a coordination mechanism for validators. Lastly, the Incentivized Reward Distribution rule ties everything together by adjusting the rewards distributed to Validators based on the outcome of the other gas concepts. In this article, it should be apparent how the gas survey, tallying rule, and stake reward distribution rule all work and affect each other. Ultimately, the goal is to create a system that is fair and reliable for all users of the blockchain.
P.S. If you'd like to support our work as an independent Sui validator, please consider delegating to us.
We appreciate all delegations, no matter how small or big. All delegators are created equally in our eyes, and we don't cut backroom deals with larger stakeholders.
Sources
