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: Sufficient charged gas check before XVM execution. #1073

Merged
merged 2 commits into from
Oct 31, 2023

Conversation

shaunxw
Copy link
Member

@shaunxw shaunxw commented Oct 30, 2023

Pull Request Summary

Closes #1070

I tried to add an integration test to cover the checks, but the out-of-gas check in pallet-contracts has a big margin. i.e. it requires the weight limit to be much higher than the actual used weight, or the OutOfGas error is returned. @PierreOssun might have some info on this?

In addition to the issue above, the charged weight at the beginning of the CE is updated to all the gas left, instead of the gas left with a 30KB dummy value.

Check list

  • added or updated unit tests
  • updated Astar official documentation
  • added OnRuntimeUpgrade hook for precompile revert code registration
  • updated spec version
  • updated semver

@shaunxw shaunxw added shibuya related to shibuya XVM Related to XVM other PR/issue is related to third-party, scripts or other things which don't have definite label. labels Oct 30, 2023
Copy link
Contributor

@gitofdeepanshu gitofdeepanshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
chain-extensions/xvm/src 0% 0%
primitives/src 63% 0%
pallets/dapps-staking/src/pallet 85% 0%
pallets/unified-accounts/src 79% 0%
pallets/collator-selection/src 69% 0%
pallets/xvm/src 40% 0%
primitives/src/xcm 66% 0%
precompiles/xvm/src 75% 0%
pallets/dapps-staking/src 81% 0%
chain-extensions/types/unified-accounts/src 0% 0%
pallets/block-reward/src 85% 0%
chain-extensions/unified-accounts/src 0% 0%
precompiles/sr25519/src 79% 0%
precompiles/utils/src 55% 0%
pallets/ethereum-checked/src 48% 0%
chain-extensions/types/assets/src 0% 0%
chain-extensions/types/xvm/src 0% 0%
precompiles/assets-erc20/src 76% 0%
chain-extensions/types/dapps-staking/src 0% 0%
precompiles/substrate-ecdsa/src 78% 0%
pallets/xc-asset-config/src 53% 0%
precompiles/utils/src/testing 38% 0%
chain-extensions/dapps-staking/src 0% 0%
precompiles/xcm/src 75% 0%
pallets/contracts-migration/src 0% 0%
precompiles/utils/macro/src 0% 0%
precompiles/dapps-staking/src 93% 0%
pallets/dynamic-evm-base-fee/src 81% 0%
chain-extensions/pallet-assets/src 0% 0%
Summary 56% (2201 / 3935) 0% (0 / 0)

Minimum allowed line rate is 50%

Copy link
Member

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@shaunxw shaunxw merged commit 95e5d9f into master Oct 31, 2023
10 checks passed
@shaunxw shaunxw deleted the feat/xvm-ce-fix branch October 31, 2023 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other PR/issue is related to third-party, scripts or other things which don't have definite label. shibuya related to shibuya XVM Related to XVM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XVM CE: make sure sufficient gas left before proceeding execution
4 participants