Skip to content

Conversation

@luchenqun
Copy link
Contributor

@luchenqun luchenqun commented Feb 5, 2026

Implement gas fee distribution for EVM transactions:

  • 40% sent to burn address (mud1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq4sx9vz)
  • 40% to validators (kept in FeeCollector)
  • 20% to core team (mud1d58wfeq0re6awm7t3qynu6dz5cwk787phgl0f9)

Features:

  • Add gas fee distribution logic in state_transition.go
  • Add cumulative statistics for burned, validator and core team fees
  • Add gRPC query endpoint for gas fee statistics
  • Add precompiled contract method gasFeeStatistics() in IDistribution
  • Add unit tests for distribution and statistics

Description


Closes #XXX


Note

High Risk
Changes the core EVM transaction accounting flow by moving collected fees to fixed addresses and persisting new state, which can impact chain economics and tx execution if misconfigured or buggy.

Overview
Implements a gas fee distribution mechanism for EVM transactions: on successful execution, gas fees are split 40% burned, 20% sent to a hardcoded core-team address, and 40% left in FeeCollector for validator distribution, emitting a gas_fee_distribution event.

Adds persistent tracking of cumulative totals (burned/core team/validator) under new EVM store key prefixes, initializes these counters via a new v2.0.0 upgrade handler, and exposes the stats via a new EVM gRPC/REST query GET /evmos/evm/v1/gas_fee_statistics and a new gasFeeStatistics() method on the distribution precompile/IDistribution interface.

Includes unit tests covering fee splitting behavior and statistics getters/setters.

Written by Cursor Bugbot for commit 56abc39. This will update automatically on new commits. Configure here.

Implement gas fee distribution for EVM transactions:
- 40% sent to burn address (mud1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq4sx9vz)
- 40% to validators (kept in FeeCollector)
- 20% to core team (mud1d58wfeq0re6awm7t3qynu6dz5cwk787phgl0f9)

Features:
- Add gas fee distribution logic in state_transition.go
- Add cumulative statistics for burned, validator and core team fees
- Add gRPC query endpoint for gas fee statistics
- Add precompiled contract method gasFeeStatistics() in IDistribution
- Add unit tests for distribution and statistics
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 12

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

return
}
store.Set(types.KeyPrefixTotalBurnedFee, bz)
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silent failure in statistics Set functions loses updates

Medium Severity

The SetTotalBurnedFee, SetTotalCoreTeamFee, and SetTotalValidatorFee functions silently return without persisting data when Marshal fails. Since AddTotal*Fee methods call these setters after computing current.Add(amount), a marshal failure causes the accumulated statistics update to be silently lost. Callers like DistributeGasFee have no indication the statistics weren't updated, leading to cumulative statistics drift over time. The functions log an error but don't return it to callers.

Additional Locations (2)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant