Gas Fees & Priority Gas Auction

Gas fees and transaction prioritization are essential components of the Celestium network’s transaction processing system. They determine the cost of computational operations and influence the order in which transactions are included in blocks.


1. What Is Gas?

Gas is a unit that measures computational work required to execute operations on the Celestium blockchain. Every transaction and smart contract execution consumes gas based on the complexity of the operation.

Purpose of Gas

  • Prevents spam and inefficient computation.

  • Aligns computational effort with economic cost.

  • Incentivizes validators to process transactions.

Gas Units

Each Ethereum Virtual Machine (EVM) opcode has a predefined gas cost. Celestium inherits these gas costs from Ethereum, ensuring compatibility.


2. Gas Fees

Gas fees represent the amount a user is willing to pay to execute a transaction. They are calculated as:

Gas Fee = Gas Used × Gas Price

Where:

  • Gas Used: Total gas consumed during transaction execution.

  • Gas Price: Amount the user is willing to pay per gas unit, denominated in CLT (native token).

EIP-1559 Fee Model

Celestium supports the EIP-1559 fee model, comprising:

  • Base Fee: Minimum fee per gas unit, dynamically adjusted based on network congestion.

  • Priority Fee (Tip): Additional fee paid to validators to prioritize transaction processing.

  • Max Fee: Maximum total fee the user is willing to pay per gas unit.

Effective gas fee is determined as:

Effective Gas Price = Base Fee + Priority Fee

Example

Component
Value

Gas Used

21,000

Base Fee

2 gwei

Priority Fee

1 gwei

Max Fee

5 gwei

Effective Gas Price

3 gwei

Transaction Fee

21,000 × 3 gwei = 63,000 gwei


3. Gas Limit

Gas limit represents the maximum gas units a user is willing to spend for a transaction. If a transaction exceeds this limit, it fails, and the gas is still consumed.

Best Practice

  • Estimate gas consumption using tools like estimateGas() from libraries such as Web3.js.


4. Priority Gas Auction (PGA)

Celestium utilizes a Priority Gas Auction (PGA) mechanism to prioritize transactions. Validators order transactions based on Priority Fee (Tip) in descending order. Transactions offering higher tips are processed first.

How PGA Works:

  1. Users submit transactions with varying gas prices (priority fees).

  2. Validators select transactions offering the highest priority fees.

  3. High-demand periods lead to users competing by increasing tips.

  4. Transactions with lower tips may experience delays or fail to be included.

Key Implications:

  • Users can expedite transaction processing by increasing the priority fee.

  • PGA fosters a dynamic fee market, ensuring optimal resource allocation.


5. Transaction Fee Market Behavior

  • Low Network Congestion: Base fee remains low, and minimal priority fees are required.

  • High Network Congestion: Base fee increases, and users must pay higher priority fees to secure transaction inclusion.


6. Gas Fee Optimization Tips

  • Monitor network conditions to avoid overpaying during low congestion.

  • Use EIP-1559 transactions with an appropriate max fee and priority fee to balance cost and speed.

  • Leverage tools like eth_gasPrice or third-party services to estimate current gas fees.


7. Gas Price Estimation (Web3.js Example)

Editconst Web3 = require('web3');
const web3 = new Web3('https://rpc-private-testnet.celestium.network');

async function getGasPrice() {
  const gasPrice = await web3.eth.getGasPrice();
  console.log('Current Gas Price:', web3.utils.fromWei(gasPrice, 'gwei'), 'gwei');
}

getGasPrice();

8. Summary

  • Gas fees ensure fair resource allocation and prevent spam.

  • Base Fee adapts dynamically; Priority Fee influences transaction speed.

  • Priority Gas Auction orders transactions by tips during congestion.

  • Users should adjust gas fees based on network conditions for cost efficiency.

Celestium’s gas model aligns with Ethereum standards, ensuring a familiar experience for developers and users transitioning from existing EVM-compatible networks.

Last updated