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

feat: refactor gas charging to remove "borrowing" #527

Merged
merged 2 commits into from
May 4, 2022
Merged

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented May 4, 2022

Basically:

  1. On entering wasm, we call update_gas_available to update the available gas for the actor.
  2. On exiting wasm, we call charge_for_exec to charge for execution gas.

Unlike the previous code:

  1. We can handle this the same way in both the CallManager and the syscalls.
  2. We never "borrow" or "return" the gas from/to the gas tracker.

fvm/src/syscalls/mod.rs Outdated Show resolved Hide resolved
Co-authored-by: Łukasz Magiera <[email protected]>
@Stebalien Stebalien enabled auto-merge (squash) May 4, 2022 22:20
@Stebalien Stebalien merged commit 090f838 into master May 4, 2022
@Stebalien Stebalien deleted the steb/gas-tweak branch May 4, 2022 22:39
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