This repository has been archived by the owner on Sep 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dinonard
force-pushed
the
feature/xvm-gas-handling
branch
from
September 13, 2022 14:00
c4c8899
to
7543e31
Compare
0x7CFE
reviewed
Sep 14, 2022
Dinonard
force-pushed
the
feature/xvm-gas-handling
branch
from
September 19, 2022 14:07
f637668
to
61a6f1a
Compare
Dinonard
changed the base branch from
polkadot-v0.9.28
to
feature/xvm-pallet-v2
September 19, 2022 14:09
0x7CFE
reviewed
Sep 20, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more grumbles
@@ -21,5 +21,5 @@ members = [ | |||
"precompiles/xcm", | |||
"precompiles/xvm", | |||
|
|||
"contracts/*", | |||
# "contracts/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintentionally left edit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment.
It seems that after latest updates, compilation with cargo check
fails.
cargo contract check
should work but it also fails for me with another error so I'll have to check that in more detail.
Perhaps this also indicates that we shouldn't keep contracts under root .toml
file 🤔
Minimum allowed line rate is |
akru
approved these changes
Sep 21, 2022
akru
added a commit
that referenced
this pull request
Oct 25, 2022
* Init commit * Small fixes * Chain extension & precompile modifications * TODO handling * Traces, improved gas tracking, fixed issues * Doc to placeholder weight * Doc & typos * Change base * Fix UT * Update TODOs, cleanup * Fix contract issues
akru
added a commit
that referenced
this pull request
Nov 8, 2022
* XVM interface refactoring * Switch precompiles & chain-extension to XVMv2 * XVM gas handling prototype (#94) * Init commit * Small fixes * Chain extension & precompile modifications * TODO handling * Traces, improved gas tracking, fixed issues * Doc to placeholder weight * Doc & typos * Change base * Fix UT * Update TODOs, cleanup * Fix contract issues * Remove chain-extension-trait package (#109) * Remove chain-extension-trait package * Dapps Staking CE optimizations * Dapps Staking CE optimizations * Rename dapps-staking CE in general way * Derive Default for chain extension structs * Implement Default trait for CEs * Fix typo * XVM types cargo deps fix * Build fixes * Compilation fixes * Fix formatting * Fix formatting * Fix compilation issues * Fix cargo fmt * Fix clippy errors * Fix weight estimation
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Summary
The purpose of this PR is to provide a prototype implementation for gas handling in XVM.
Description
When executing a contract within the context of XVM, different VMs and gas handling schemas will be present.
E.g. the most basic example is EVM and Partity's WASM - gas vs. native weight. Each unit of these measures represents
a different concept, although similar. However, both are encapsulated by substrate's native way of handling weight (or gas).
So it's natural to keep the handling of gas in XVM context tied to the native weight system.
Current Solution
We rely on native weight handling for XVM gas handling.
To take an example when EVM contract calls WASM contract:
max_weight
via an XVM callmax_weight
value to WASM handlermax_weight
, and in the return value returns how much weight was actually spentSame goes for
WASM --> EVM
direction.Open Issues, Questions & Suggestions
Call
isn't good enough if we want to have a return value..Check list