The first GAS design of the MOVE language is out: a comprehensive analysis of on-chain resource consumption calculation.

The First GAS Design of MOVE Language: Analysis of On-Chain GAS Cost Calculation Method

The previous version of the MOVE language was originally planned to run without GAS, and therefore did not prepare for the GAS plan. Recently, a blockchain project established a GAS plan for it, becoming the first GAS design for the MOVE language, referred to as "an adventure".

This GAS plan outlines the principles, processes, calculation methods, adjustments in the later stages, and the attitude towards accepting community suggestions for formulating GAS. GAS measurement is a fundamental concept of this blockchain and many others, defining the abstract calculation of the amount of computational and storage resources required to execute and store on-chain transactions. The GAS plan determines the costs incurred for all executions on-chain, used to calculate the GAS expenditure during transaction execution.

process

To execute effectively, the processes on this blockchain include:

  1. Definition Principles
  2. Prepare the evaluation framework and determine the price for each execution.
  3. Establish a GAS measurement system and secure GAS algebra for MOVE
  4. Import the upstream GAS framework
  5. Make the GAS framework storage-aware
  6. Further refine the GAS plan

principle

The defined principles include:

  1. The operating cost should be directly related to the network's available resources and decrease with improvements in technology and processes.
  2. GAS should be set by on-chain governance and can be configured seamlessly.
  3. GAS can prevent DoS attacks on fixed network resources and needs to be adjusted quickly based on network conditions.
  4. The GAS price reflects the desire to accelerate growth and maintain the popularity of the blockchain.
  5. Encourage making good choices in design, such as prioritizing security, modularity, and assertions.

Calculate GAS

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

  • Maximum GAS amount: The maximum number of GAS units that the user is willing to spend to execute the transaction.
  • GAS price: calculated in octal per unit of GAS, 1 octal = 0.00000001 APT.

During execution, the transaction will be charged:

  1. Fixed Costs
  2. Execution Cost
  3. Read Cost
  4. Writing Cost

Final transaction fee = Total amount of GAS consumed × GAS unit price

Establish GAS schedule

  1. Basic Configuration: Includes transaction size and maximum GAS units.
  2. Transaction size: Currently set to 64KB.
  3. Maximum GAS unit: set to 1,000,000.
  4. Execution: Evaluate execution costs through benchmark frameworks and analytical tools.
  5. Storage: Consider the bandwidth, IOPS capacity, and permanence cost of the storage devices.

read, create, and write

Access to state items is divided into three types: read, create, and write, each with different fee calculation methods.

stable GAS unit cost

Maintaining a fixed GAS unit cost helps to decouple the GAS plan from the market value of cryptocurrencies.

Community Participation

Community members can:

  1. Identify the unreasonable aspects of the GAS plan.
  2. Participate in community discussions
  3. Vote on relevant governance proposals

How to adjust GAS costs

The GAS plan can be modified through governance proposals and is designed to be scalable.

future work

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

This is the first viable GAS framework of the MOVE language, laying the foundation for future work. The team is exploring further optimization and improvement methods to enhance efficiency and address potential issues.

MOVE-2.86%
GAS-3.76%
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
  • Comment
  • Share
Comment
0/400
No comments
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)