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

Assets Call Runtime #963

Closed
wants to merge 13 commits into from
Closed

Assets Call Runtime #963

wants to merge 13 commits into from

Conversation

PierreOssun
Copy link
Member

@PierreOssun PierreOssun commented Jun 22, 2023

Pull Request Summary

This PR removes chain extensions from the runtime.
Add assets_pallet transfer & transfer_approved in call filter to allow call_runtime in ink! contracts.

Note: call_runtime host function has been stabilized recently #13901 but we need to allow unstable interface in the meantime.

Check list

  • Remove chain-extensions (local & shibuya) NOTE: Agree we keep chain-extension from now (see comment below)
  • Allow transfer & transfer_approved in local & shibuya
  • updated spec version
  • updated semver

@ashutoshvarma ashutoshvarma added the runtime This PR/Issue is related to the topic “runtime”. label Jun 26, 2023
@ashutoshvarma
Copy link
Member

ashutoshvarma commented Jun 26, 2023

Remove chain-extensions (local & shibuya)

That would be a breaking change in Shibuya, even though it's a testnet, I'm not sure we should just remove it.
Let's keep it for shibuya and wait for CE deprecation from Parity's side and decide.

@PierreOssun PierreOssun changed the title [Dratf] Assets Call Runtime [Draft] Assets Call Runtime Jun 26, 2023
@PierreOssun PierreOssun changed the title [Draft] Assets Call Runtime Assets Call Runtime Jul 13, 2023
runtime/local/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines +775 to +820
pub struct CallRuntimeFilter;
impl Contains<RuntimeCall> for CallRuntimeFilter {
fn contains(c: &RuntimeCall) -> bool {
match *c {
RuntimeCall::Assets(pallet_assets::Call::transfer { .. }) => true,
RuntimeCall::Assets(pallet_assets::Call::transfer_approved { .. }) => true,
_ => false,
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't you also need approve in this case?

PierreOssun and others added 12 commits August 3, 2023 16:08
* Add value param to 'XvmCall'.

* Fix precompile tests.

* Update types in CE & precompiles.

* Add EVM call tests for XVM.

* New type idiom for EthereumTxInput.

* Add XVM integration tests.

* More XVM integration tests.

* Fix runtime tests.

* Move contract deploy helpers to setup.rs.

* Update value adjustment for wasm payable calls.

* More pallet-xvm unit tests.

* Update pallet-xvm weight info.

* Apply review suggestions.

* Fix runtime tests.

* Calling WASM payable from EVM fails if caller contract balance below ED.

* Update weight info.

* Fix unit tests.
* pallet-xvm max weight limit config.

* Fix runtime tests.

* Forbid XVM re-entrancy.

* XVM Re-entrance tests.

* Naming consistency.

* XVM precompile: respect caller's gas limit setting.

* Remove max weight limit config from pallet-xvm.

* Remove unused XVM call error.

* Add tests for XVM precompile gas limit.
* feat: add batch precompile

* typo

* add tests

* minor fixes and updates

* refactor, add batch to local

* fix expect_arguments

* add logs

* update license

* taplo fix

* more refactor, remote evm crate

* remove evm crate, update utils version, add std in dappsstaking

* update pallet_balances::config in mock

* update pallet_evm config

* update license

* add to std-feature

* utils: rectify  patch to minor update

* remove pub from logs function

* fix typos

* remove comments

* refactor

* fmt
* Automatic EVM revert code registration for XC20

* Add negative test

* Fmt fix

* Add EVM module

* Asset benchmarks

* Cleanup xc asset config

* Update asset benchmarks

* Fix tests features
@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
primitives/src/xcm 71% 0%
chain-extensions/dapps-staking/src 0% 0%
chain-extensions/types/dapps-staking/src 0% 0%
pallets/xvm/src 46% 0%
precompiles/sr25519/src 79% 0%
precompiles/utils/src 68% 0%
chain-extensions/types/assets/src 0% 0%
chain-extensions/pallet-assets/src 0% 0%
pallets/pallet-xcm/src 53% 0%
chain-extensions/types/xvm/src 0% 0%
pallets/block-reward/src 85% 0%
pallets/custom-signatures/src 51% 0%
precompiles/batch/src 80% 0%
precompiles/utils/macro/src 0% 0%
precompiles/utils/src/testing 62% 0%
pallets/contracts-migration/src 0% 0%
precompiles/xcm/src 84% 0%
precompiles/xvm/src 83% 0%
precompiles/dapps-staking/src 93% 0%
primitives/src 68% 0%
pallets/xc-asset-config/src 53% 0%
pallets/ethereum-checked/src 48% 0%
pallets/dapps-staking/src/pallet 85% 0%
pallets/dapps-staking/src 81% 0%
precompiles/assets-erc20/src 76% 0%
chain-extensions/xvm/src 0% 0%
pallets/collator-selection/src 69% 0%
precompiles/substrate-ecdsa/src 78% 0%
Summary 57% (2552 / 4451) 0% (0 / 0)

Minimum allowed line rate is 50%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime This PR/Issue is related to the topic “runtime”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants