Skip to content

Fee off by 1 #292

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

Closed
theeldermillenial opened this issue Jan 9, 2024 · 3 comments
Closed

Fee off by 1 #292

theeldermillenial opened this issue Jan 9, 2024 · 3 comments

Comments

@theeldermillenial
Copy link
Contributor

I'm running into a case where building a transaction with a script input is resulting in an incorrect fee calculation, which is off by 1.

Doing some debugging on pycardano.utils.fee, it looks like everything is rounded down with a cast to int. Would it make sense to add all raw values and round? In some cases, the values sum to a value with 0.5 ADA getting rounded down, and if we just rounded up this would resolve the issue.

@theeldermillenial
Copy link
Contributor Author

Upon further investigation, we may need to sum raw values and use math.ceil for final fee when scripts are involved. I've gotten one example of off by two.

This is occurring when trying to submit through Blockfrost.

@cffls
Copy link
Collaborator

cffls commented Jan 15, 2024

Makes sense to round up (using math.cell) in fee calculations.

@cffls
Copy link
Collaborator

cffls commented Feb 11, 2024

@theeldermillenial It would be great if you could provide a failing example so I can find where the root cause is and add it to test.

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

No branches or pull requests

2 participants