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

fix(rpc-fns): Fix bug with calculate_gas returning block gas limit #2943

Merged
merged 9 commits into from
Jul 14, 2023

Conversation

breathx
Copy link
Member

@breathx breathx commented Jul 13, 2023

While calculating gas there is getter for current gas limit of the main node, that will be none if some error occurs in gas tree (e.g. node not found). Same should be for query of its balance (even in other functionality).
That affected calculating that way: we check balance of already consumed node that has 0 balance, so calculator means that execution burned all gas from the node, which initially equals block gas limit.

@breathx breathx added the A0-pleasereview PR is ready to be reviewed by the team label Jul 13, 2023
pallets/gear/src/runtime_api.rs Outdated Show resolved Hide resolved
@breathx breathx added A2-mergeoncegreen PR is ready to merge after CI passes and removed A0-pleasereview PR is ready to be reviewed by the team labels Jul 13, 2023
@breathx breathx merged commit 8fa04fc into master Jul 14, 2023
19 checks passed
@breathx breathx deleted the dn-fix-calculate-gas branch July 14, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-mergeoncegreen PR is ready to merge after CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants