Skip to content

feat(precompiles): add BalanceHandler to handle native balance change #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

cloudgray
Copy link
Contributor

Description

By tracking native balance changes from SDK events, native balance changes that occur during the execution of a precompile method are accurately handled.

  • Add balance handler that records native balance change events and calls stateDB.AddBalance / stateDB.SubBalance.
  • Call balance handler methods (BeforeBalanceChange / AfterBalanceChange) before and after precompile execution.

Closes: #185


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

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

@cloudgray cloudgray self-assigned this Jun 10, 2025
@cloudgray cloudgray added the enhancement New feature or request label Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Native Balance Handling Enhancement
1 participant