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

XVM CE: make sure sufficient gas left before proceeding execution #1070

Closed
shaunxw opened this issue Oct 26, 2023 · 0 comments · Fixed by #1073
Closed

XVM CE: make sure sufficient gas left before proceeding execution #1070

shaunxw opened this issue Oct 26, 2023 · 0 comments · Fixed by #1073
Assignees
Labels
project Issue is part of an ongoing project XVM Related to XVM

Comments

@shaunxw
Copy link
Member

shaunxw commented Oct 26, 2023

Currently, there are two points that don't check whether there is sufficient gas charged to proceed:

  1. Before calling UA::to_h160

// `UA::to_h160` 1 DB read.
actual_weight.saturating_accrue(T::DbWeight::get().reads(1));

  1. Before claiming default EVM account for Wasm contracts

let weight_of_claim = <T as pallet_unified_accounts::Config>::WeightInfo::claim_default_evm_address();
actual_weight.saturating_accrue(weight_of_claim);

Fix: check if enough gas charged in advance. If not enough, return failure with out of gas error.

@shaunxw shaunxw self-assigned this Oct 26, 2023
@shaunxw shaunxw added XVM Related to XVM project Issue is part of an ongoing project labels Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project Issue is part of an ongoing project XVM Related to XVM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant