Skip to content

feat: Expose proposer transfer event during end of block#376

Closed
haiyanghe wants to merge 2 commits into0xPolygon:developfrom
haiyanghe:hh/emit-proposer-payment-event
Closed

feat: Expose proposer transfer event during end of block#376
haiyanghe wants to merge 2 commits into0xPolygon:developfrom
haiyanghe:hh/emit-proposer-payment-event

Conversation

@haiyanghe
Copy link
Copy Markdown

@haiyanghe haiyanghe commented Jul 15, 2025

Description

This PR adds fee distribution event emission to the Heimdall EndBlocker. The implementation includes proper event emission for tracking fee transfers and comprehensive test coverage. This should allow easier tracking of block proposal rewards from indexing events.

Changes

  • New feature (non-breaking change that adds functionality)

Breaking changes

N/A - This is a non-breaking change that adds new functionality without modifying existing behavior.

Node audience

N/A - This change applies to all nodes uniformly.

Checklist

  • I have added at least two reviewers or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments — if any — by pushing each fix in a separate commit and linking the commit hash in the comment reply

Cross-repository changes

  • This PR requires changes to bor
  • This PR requires changes to matic-cli

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on the local environment
  • I have tested this code manually on a remote devnet using express-cli
  • I have tested this code manually on amoy/mumbai
  • I have created new e2e tests into express-cli

Manual tests

  • Verified fee transfer functionality by running unit tests that simulate:
  1. Setting up a block proposer
  2. Adding fees to the fee collector module
  3. Running EndBlocker to trigger fee distribution
  4. Confirming fees are transferred to the proposer
  5. Validating proper event emission with correct attributes

Additional comments

Implementation Details:

  • Implemented event emission with EventTypeFeeTransfer including proposer address, token denomination, and amount attributes
  • Added corresponding event constants in types/events.go
  • Created unit test TestEndBlockerEmitsTransferEvent to verify event emission and fee transfer functionality

Key Features:

  • Event-based tracking for transparency and monitoring
  • Zero-fee handling (no transfer occurs if no fees collected)

@haiyanghe haiyanghe force-pushed the hh/emit-proposer-payment-event branch 3 times, most recently from 27af590 to f98d696 Compare July 17, 2025 10:15
@haiyanghe haiyanghe force-pushed the hh/emit-proposer-payment-event branch from f98d696 to ac311a6 Compare July 17, 2025 14:19
@github-actions
Copy link
Copy Markdown

This PR is stale because it has been open 21 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@marcello33
Copy link
Copy Markdown
Collaborator

Thanks @haiyanghe.
Closing in favour of #427

@marcello33 marcello33 closed this Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants