Skip to content
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

handle excessive fee deduction during simulation #518

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

StrathCole
Copy link
Collaborator

Summary of changes

As we need to deduct the fees and tax to be able to handle the gas estimations correctly, there is a deviation from the normal upstream behavior where only sent fees are deducted. This PR addresses that.
It is an endpoint change only (simulation mode only) and not relevant for consensus.

Copy link
Collaborator

@lbunproject lbunproject left a comment

Choose a reason for hiding this comment

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

This code ensures that during transaction simulations, fees and taxes are accurately accounted for without causing deduction errors. If the provided fee doesn't cover the required taxes, it adjusts the fees within the simulation to meet the necessary amounts. These adjustments are only applied in the simulation environment, so real account balances remain unaffected. This approach helps reliably predict transaction outcomes and prevents failures when executing transactions for real.

@StrathCole StrathCole merged commit 1ea5b88 into main Sep 25, 2024
22 checks passed
@StrathCole StrathCole deleted the strath/fee-simulation-mint branch September 25, 2024 04:54
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.

2 participants