AxiomLedger is similar to Ethereum’s.
Basic Description
Gas is a common mechanism in blockchains. The original intention of Gas is to prevent users from DDoS attacks on the blockchain system. The Gas model is similar to cloud computing, except that cloud computing charges by time units, while Gas charges based on the computational resources consumed: whereGas Fee is the total cost that a user need to pay for the transaction, Gas Used is the computational resources
consumed during execution, Gas Price is the price per Gas unit.
Gas Limit
Some smart contracts may have infinite loop by accident. To prevent costing too much Gas, users can set Gas limit manually, otherwiseAxiomLedger will automatically set Gas limit to .
Dynamic Gas Price
In our system, Gas can not only prevent DDoS attacks, but also dynamically adjust for network conditions. We call this model the dynamic Gas price model. The dynamic algorithm is as follows:
The basic idea of this algorithm is that the Gas price in the current block will change based on the situation of the parent block. Specifically, it will linearly fluctuate based on the proportion of transactions packed in the parent block to the maximum allowed number of transactions in the block, with a maximum fluctuation of 12.5%.
Gas Price Bound
To keep the Gas price fluctuating within a reasonable range, we have set upper and lower bounds for the Gas price. In testnet, the upper bound is 10000GMol, and the lower bound is 1000 GMol.
As for initial state, Gas price is set to 5000 GMol.