Skip to content

Conversation

@AryaLanjewar3005
Copy link
Collaborator

@AryaLanjewar3005 AryaLanjewar3005 commented Dec 10, 2025

Description

Base Fee Burn

Previously, the baseFee was collected in the ante-handler and later distributed by the Cosmos SDK distribution module.

This PR changes that behavior to burn the base fee, aligning the mechanism more closely with Ethereum’s EIP-1559 model.

New Logic

After a transaction is executed:

  1. During refundGas, the sender is refunded:
    • baseFee * gasUsed
    • Any leftover gas amount
  2. Once the refund is completed, the protocol burns baseFee * gasUsed from the sender’s account.

This effectively removes the base fee from circulation instead of redistributing it.


Fixes

Issue 1: TxEthereum Test Failure

Problem:
The TxEthereum test case was failing because the feeCollector had zero funds.
This happened because the test bypassed the ante-handler, where fees are normally collected.

Solution:
Funded the feeCollector account before executing TxEthereum in the test setup.


Issue 2: Bank Extension Integration Test Failures

Problem:
After introducing the burnBaseFee feature, integration tests started failing.

Previously:

  • Transaction fees remained in the system.
  • Fees were distributed to validators or the fee collector.

With the new logic:

  • Transaction fees are burned.
  • Total supply decreases after each transaction (similar to Ethereum EIP-1559).

Failure Scenario

During test setup:

  1. Network initializes with a fixed total supply.
  2. BeforeEach deploys a contract, consuming gas (~0.337 tokens).
  3. Fees are burned, reducing total supply.
  4. Tests expected hardcoded supply values, causing failures.

Solution

Updated tests to query the total supply dynamically instead of using hardcoded values.

// Before: Hardcoded values
cosmosEVMTotalSupply, _ = new(big.Int).SetString("200003000000000000000000", 10)
xmplTotalSupply, _      = new(big.Int).SetString("200000000000000000000000", 10)

// After: Dynamic query
totSupplRes, err := is.grpcHandler.GetTotalSupply()
cosmosEVMTotalSupply = totSupplRes.Supply.AmountOf(is.bondDenom).BigInt()
xmplTotalSupply = totSupplRes.Supply.AmountOf(is.tokenDenom).BigInt()

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days-before-close if no further activity occurs.

@github-actions github-actions bot added the tests label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants