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

Pessimistic gas price goes beyond maximum gas price #7477

Open
jakmeier opened this issue Aug 25, 2022 · 0 comments
Open

Pessimistic gas price goes beyond maximum gas price #7477

jakmeier opened this issue Aug 25, 2022 · 0 comments
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc)

Comments

@jakmeier
Copy link
Contributor

When charging gas pessimistically, we currently do not take into consideration that there is a cap for how expensive gas can be. At the moment, the cap is at 20x minimum gas price.

For examples, say we are at the highest gas price due to congestion. In this case, there is no possible way that gas price will go up more. But we still apply the pessimistic factor, charging at a higher price than possible.

The extra tokens spent are still refunded later, so there is no loss to the user. But it seems odd that the user has to pay unreasonably high gas costs.

In transaction HChUL7NjF5xwZEHULexnymy99BdYPHnsUyKktmiXHxWE in shardnet, we observe that 2.4N are paid for 120Tgas, at the configured cap for shardnet of 0.02 NEAR / Tgas. The refund for the remaining 180Tgas was 35.45 NEAR. That means the user had to pay upfront almost 38 NEAR, even though it could really only cost 6 NEAR in the absolute worst case.

It's not clear to me if we should fix this. Doing so would be a protocol change.

@jakmeier jakmeier added the A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) label Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc)
Projects
None yet
Development

No branches or pull requests

1 participant