Cronos EVM Docs
  • Getting Started
    • Getting Started
    • Background
    • Architecture
    • Cronos roadmap
  • FOR USERS
    • ๐Ÿ’ณCrypto.com Card Top Up
    • ๐Ÿ”ฅCrypto Wallets
    • ๐ŸฆŠMetaMask Configuration
    • ๐ŸฆBrave Wallet
    • ๐ŸŒ‰Bridges
      • From the Crypto.com App and Exchange
        • From the Crypto.com App
        • From the Crypto.com Exchange
      • IBC (Cronos POS Chain, other Cosmos chains)
        • Cronos Bridge Web App
      • Independent bridges
      • FAQs for Bridge transfers
      • FAQs for transactions from/to centralized exchanges
    • ๐ŸšฐTestnet Faucet
    • ๐Ÿ’กTips & FAQs
    • ๐Ÿ‘ฎKey Principles for Wallet Security
    • GasTracker
  • FOR DAPP DEVELOPERS
    • ๐Ÿ’กFounder FAQs
    • ๐Ÿ…Hacker's Getting Started Resources
    • ๐Ÿ“ƒSmart Contracts
      • Contract Development on Testnet
      • Contract Deployment and Verification
      • Contract Verification Export: Cronoscan To Cronos Explorer
      • Best Practices
      • Token Contract Addresses
    • ๐Ÿ’ปdApp Creation
      • Free and commercial RPC endpoints
      • Wallet integrations
      • Web3-wallet
      • JSON-RPC methods
      • Address Conversion
      • Swagger Playground
    • โš™๏ธDev Tools & Integrations
      • All dev tools & integrations
      • Account Abstraction
      • Band Protocol
      • Banxa
      • GoldRush
      • Cronos Safe
      • Flair
      • Google Bigquery
      • Moralis
      • Pyth
      • Secret Network
      • SubQuery
      • Witnet
    • Crypto.com AI Agent SDK
  • FOR NODE HOSTS
    • Running nodes
      • Cronos Mainnet
        • Quicksync
        • State-sync
        • Public Node Sync
        • KSYNC
        • The "Huygen" upgrade guide (v0.6.* to v0.7.*)
        • The "v0.7.0-hotfix" upgrade guide (v0.7.* to v0.8.*)
        • The "Galileo" upgrade guide (v0.8.* to v1.0.*)
        • The "Titan" upgrade guide (v1.0.* to v1.1.0)
        • The "v1.2" upgrade guide (v1.1.* to v1.2.0)
        • The "v1.3" upgrade guide (v1.2.* to v1.3.0)
        • The "v1.4" Pallene upgrade guide (v1.3.* to v1.4.1)
        • Patching Unlucky & Duplicate Tx
      • Cronos Testnet
      • Devnet
      • Best Practices
      • Cronosd build with Nix
      • VersionDB
      • MemIAVL
      • Local State Sync
    • Cronosd
  • CRONOS PLAY
    • Introduction
    • Unity Engine
      • Current Version
      • Legacy Version
        • EVM
        • Login Example
        • Custom RPC
        • ERC20
        • ERC721
        • ERC1155
      • Useful Links
    • Unreal Engine
      • Installation and Enabling
      • Working with Blueprint
        • Actors and Blueprint Classes
        • Cronos Configuration
        • Connect Defi Desktop/Onchain Wallet with URI
        • Connect Wallets with QR Code
        • Connect WalletConnect Step by Step
        • WalletConnect 2.0 and Unreal Engine 5: Hello World Example
        • Wallet
        • ERC20
        • ERC721
        • ERC1155
        • Broadcast Transactions
        • Get Tokens or Transactions
      • Working with C++
        • Creating a C++ Project
        • Creating a child DefiWalletCoreActor
        • Querying a contract
        • Customizing Network
      • Demo
    • Cronos Play C++ SDK
    • Crypto.com Pay Integration
    • Cronos Play FAQ
  • Block Explorers
    • Block Explorer and API Keys
    • Cronos Explorer
    • Cronoscan
  • CRONOS CHAIN PROTOCOL
    • Chain ID and Address Format
    • Cronos General FAQ
    • Genesis
    • Modules
      • module_bank
      • module_distribution
      • module_slashing
      • module_feemarket
    • Chain Details
      • List of parameters
      • Technical glossary
      • Protocol Documentation
    • Common IBC Commands
  • Cronos zkEVM
    • Cronos zkEVM
  • Resources
    • Media / brand kit
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. CRONOS CHAIN PROTOCOL
  2. Modules

module_feemarket

feemarket module

Introduction

The Huygen upgrade v0.7.0 on Cronos Mainnet introduced the Feemarket module and EIP-1559 implementation. The new feemarket module allows a dynamic fee structure to be applied to the network. It allows for defining a common base fee for the network, and this base fee is calculated dynamically in each block for the next block allowing it to reflect the activity of the network.

With EIP-1559, the transaction fee itself is calculated with fee = (baseFee + priorityTip)*gasLimit, where baseFee is the fixed-per-block network fee per gas and priorityTip is an optional fee per gas added on extra to accelerate the transaction. However, Cronos chain is based on Cosmos SDK which does not have a prioritization mechanism by nature, and transactions are first in and first out (FIFO) basis on the Cronos chain. Thus, different from the regular EIP-1559 design, Cronos feemarket module design does not have any โ€œprioritization feeโ€ mechanism than the Ethereum EIP-1559 design.

Therefore, on Cronos at the current stage, fee = gasFeeCap * gasLimit, where the gasFeeCap is the maximum gas price and gasLimit is the gas amount. Increasing the total fee does not accelerate the transaction processing time on Cronos, while the transaction still possibly can be rejected if you set up a too low-value arbitrary.

Overview

Parameters

Below are the parameters for the x/feemarket module:

Key
Type
Default Values
Description

NoBaseFee

bool

false

control the base fee adjustment

BaseFeeChangeDenominator

uint32

300

bounds the amount the base fee that can change between blocks

ElasticityMultiplier

uint32

4

bounds the threshold which the base fee will increase or decrease depending on the total gas used in the previous block

BaseFee

uint32

3750000000000

base fee for EIP-1559 blocks

EnableHeight

uint32

0

height which enable fee adjustment

MinGasPrice

sdk.Dec

3750000000000

global minimum gas price that needs to be paid to include a transaction in a block

min_gas_multiplier

sdk.Dec

0.500000000000000000

bounds the minimum gasUsed to be charged to senders based on the GasLimit

Base Fee

baseFee is a module param and works as the global state. It affects the amount of gas a transaction costs, not the gasPrice. The base fee is a global base fee defined at the consensus level. It is stored as a module parameter and is adjusted at the end of each block based on the total gas used in the previous block and gas target (block gas limit/elasticity multiplier):

  • It increases when blocks are above the gas target;

  • It decreases when blocks are below the gas target.

Effective Gas price

For EIP-1559 transactions (dynamic fee transactions) the effective gas price describes the maximum gas price that a transaction is willing to provide. It is derived from the transaction arguments and the base fee parameter. The effective gas price is either the baseFee + tip or the gasFeeCap. Since gasTipCap is not applicable on Cronos, effectiveGasPrice = min(baseFee, gasFeeCap) where gasFeeCap >= baseFee.

Minimum Gas Price

minimum-gas-price is a config param per node that only affects that specific node, minimum-gas-prices effect is a setting at the Cosmos level and only affects Cosmos-based transactions. In general, Ethereum users won't be affected because they will use the json-rpc endpoint to send the transaction. For an Ethereum transaction, the ante handler has been overwritten to ignore the minimum-gas-prices setting and only taking into consideration the global base-fee Minimum-gas-prices is a mandatory setting for node operators and should not be 0 for security reasons and it only affects low-level cosmos transactions (delegations, ibc relay messages etc).

Queries

The query commands allow users to query feemarket state:

./conosd query feemarket --help

The base-fee command allows users to query the block base fee by height.

./cronosd query feemarket base-fee [height] [flags]

The block-gas command allows users to query the block gas by height.

./cronosd query feemarket block-gas [height] [flags]

The params command allows users to query the module parameters.

./cronosd query params subspace [subspace] [key] [flags]

The query with params command allows users to query the feemarket parameters.

./cronosd query feemarket params [flags]

REST endpoint

The parameters can also be checked by browsing to the following REST endpoint

{
  "params": {
    "no_base_fee": false,
    "base_fee_change_denominator": 300,
    "elasticity_multiplier": 4,
    "enable_height": "0",
    "base_fee": "3750000000000",
    "min_gas_price": "3750000000000.000000000000000000",
    "min_gas_multiplier": "0.500000000000000000"
  }
}

{
  "params": {
    "no_base_fee": false,
    "base_fee_change_denominator": 300,
    "elasticity_multiplier": 4,
    "enable_height": "0",
    "base_fee": "3750000000000",
    "min_gas_price": "3750000000000.000000000000000000",
    "min_gas_multiplier": "0.500000000000000000"
  }
}

JSON-RPC

We can query the eth_feeHistory by JSON-RPC, the result will return the transaction base fee per gas and effective priority fee per gas for the requested/supported block range.

curl --location --request POST 'https://evm.cronos.org' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_feeHistory",
    "params": [
        "0x1",
        "latest",
        []
    ],
    "id": 44
}'

For example returns

{
  "id": 44,
  "result": {
    "oldestBlock": "0x11c6885",
    "baseFeePerGas": [
      "0x3691d6afc00",
      "0x3691d6afc00"
    ],
    "gasUsedRatio": [
      0.00677545
    ]
  },
  "jsonrpc": "2.0"
}

Previousmodule_slashingNextChain Details

Last updated 2 months ago

Was this helpful?

https://rest.cronos.org/ethermint/feemarket/v1/paramsrest.cronos.org
https://rest-t3.cronos.org/ethermint/feemarket/v1/paramsrest-t3.cronos.org