The MOVE language pioneers the GAS design: an innovative on-chain resource computation method.

robot
Abstract generation in progress

The First GAS Design of MOVE Language: An Innovative On-Chain Resource Calculation Method

The latest version of the MOVE language was originally designed to run without GAS, and therefore was not adequately prepared for a GAS plan. To meet the needs of the blockchain ecosystem, a well-known public chain platform recently announced its unique GAS plan, which is the first GAS design for the MOVE language and is regarded as a bold attempt.

The GAS plan clarifies the principles, processes, calculation methods, and future adjustment mechanisms. The platform stated that it will actively adopt community suggestions to jointly improve this innovative mechanism.

GAS measurement is a fundamental concept of many blockchains, defining the abstract amount of computational and storage resources required to execute and store on-chain transactions. The GAS plan determines the cost of all executions on-chain, used to calculate resource consumption during transaction execution.

design process

To ensure effective execution, the platform has taken the following steps:

  1. Clarify design principles
  2. Establish an evaluation framework to determine the prices for each execution.
  3. Establish a GAS measurement system and secure GAS algebra for MOVE
  4. Integrate the upstream GAS framework into the platform
  5. Enhance the storage awareness capability of the GAS framework
  6. Continuously optimize the GAS plan

Core Principles

The GAS design follows the principles below:

  1. The operating costs should be directly related to the available resources of the network and decrease with technological advancements.
  2. GAS is set by on-chain governance and can be flexibly configured.
  3. GAS can prevent DoS attacks on the network's fixed resources and can quickly adjust according to network conditions.
  4. GAS prices reflect the platform's vision to promote growth and maintain the popularity of the blockchain.
  5. Encourage prioritizing good practices such as security and modularity in design.

GAS calculation method

When users submit a transaction, they need to specify two quantities:

  • Maximum GAS Amount: The maximum number of GAS units that a user is willing to pay for executing a transaction.
  • GAS price: calculated in octal per unit of GAS, 1 octal = 0.00000001 platform token

During the transaction execution process, the following will be charged:

  1. Fixed Costs: Basic fees plus additional fees for large transactions
  2. Execution Cost: Used to execute MOVE instructions
  3. Read cost: The cost of reading data from persistent storage.
  4. Write Cost: The fee for writing data to persistent storage.

Final transaction fee = Total GAS consumed × GAS unit price

If the transaction runs out of GAS during execution, the sender will be charged the maximum amount of GAS, and all changes will be reversed.

GAS Plan Construction

  1. Basic Configuration

The GAS plan includes some components that are unrelated to individual operations, such as transaction size and maximum GAS units.

  1. Trading Scale

Most transactions are at the KB level, but the released MOVE modules can reach several KB to tens of KB. The platform initially set the transaction size at 32KB, but later adjusted it to 64KB based on community feedback to facilitate application development.

  1. Maximum GAS Unit

The maximum GAS unit defined in the GAS plan specifies the maximum amount of operations that can be executed in a single transaction, currently set at 1,000,000. Even with the largest framework upgrades, it typically does not exceed 90% of this limit.

  1. Cost Assessment Execution

By building a benchmark framework and using analytical tools, the team estimated the relative costs of all MOVE instructions and native functions. Considering system robustness and security, the final number of machine instructions required for execution was determined.

  1. Storage Cost

The storage of GAS fees takes into account the bandwidth for data access, IOPS capacity, and the cost of permanent storage. Accessing any state item incurs costs associated with verifying the entire blockchain state.

Storage GAS fee = Project fee + ( byte fee × Number of bytes )

read, create and write operations

  • Read: The most common operation, calibrated based on disk IOPS and bandwidth capacity.
  • Create: Add a new item to the state storage, the cost is the highest.
  • Write: Update existing items, byte fee is the same as creation

stable GAS unit cost

Each operation and transaction itself has a relatively fixed unit cost, which helps to keep the GAS plan stable and decoupled from the market value of tokens.

Community Participation

The platform encourages community members:

  1. Point out the unreasonable aspects of the GAS plan.
  2. Participate in relevant discussions
  3. Vote on GAS-related governance proposals

GAS cost adjustment mechanism

The GAS plan serves as on-chain configuration storage and can be modified through governance proposals. It is designed to be scalable, allowing upgrades through governance proposals.

Future Outlook

As the first GAS framework of the MOVE language, this design lays the foundation for future work:

  1. Reduce execution costs
  2. Implement multi-dimensional GAS calculation
  3. Alleviate the issue of bloated state

The team is exploring the concept of TTL for each project to automatically delete unaccessed state projects when the TTL expires, thereby optimizing on-chain data management.

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 4
  • Share
Comment
0/400
TeaTimeTradervip
· 20h ago
Code will ultimately cost money to use.
View OriginalReply0
MissedAirdropBrovip
· 20h ago
The design really suits my taste.
View OriginalReply0
IfIWereOnChainvip
· 21h ago
The fuel fee is bullish.
View OriginalReply0
GovernancePretendervip
· 21h ago
Design worth following
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)