mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 02:48:03 +00:00
Storage Layer for All FRAME Extrinsics (#11431)
* add new trait * implement DispatchableWithStorageLayer * at least one transactional * all dispatch is at least transactional * storage_layer api * add test * storage layer tests * deprecate transactional tag * i guess no reason to deprecate * remove transactional from batch_all * update tests * extend trait * cargo run --quiet --profile=production --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs * cargo run --quiet --profile=production --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_balances --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/balances/src/weights.rs --template=./.maintain/frame-weight-template.hbs * cargo run --quiet --profile=production --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs * fix copy paste name * cargo run --quiet --profile=production --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark pallet --chain=dev --steps=50 --repeat=20 --pallet=pallet_utility --extrinsic=* --execution=wasm --wasm-execution=compiled --output=./frame/utility/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Create run_all_benchmarks.sh * uncomment build * update number of steps and repeats * add skip build * Update run_all_benchmarks.sh * Update run_all_benchmarks.sh * new benchmarks * Update frame/support/src/traits/dispatch.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/support/src/traits/dispatch.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/support/test/tests/storage_layers.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/support/test/tests/storage_layers.rs * weights * Update dispatch.rs * doc link * decl_macro support Co-authored-by: Parity Bot <admin@parity.io> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,8 @@ pub use crate::{
|
||||
result,
|
||||
},
|
||||
traits::{
|
||||
CallMetadata, GetCallMetadata, GetCallName, GetStorageVersion, UnfilteredDispatchable,
|
||||
CallMetadata, DispatchableWithStorageLayer, GetCallMetadata, GetCallName,
|
||||
GetStorageVersion, UnfilteredDispatchable,
|
||||
},
|
||||
weights::{
|
||||
ClassifyDispatch, DispatchInfo, GetDispatchInfo, PaysFee, PostDispatchInfo,
|
||||
@@ -1469,7 +1470,11 @@ macro_rules! decl_module {
|
||||
$ignore:ident
|
||||
$mod_type:ident<$trait_instance:ident $(, $instance:ident)?> $fn_name:ident $origin:ident $system:ident [ $( $param_name:ident),* ]
|
||||
) => {
|
||||
<$mod_type<$trait_instance $(, $instance)?>>::$fn_name( $origin $(, $param_name )* ).map(Into::into).map_err(Into::into)
|
||||
// We execute all dispatchable in at least one storage layer, allowing them
|
||||
// to return an error at any point, and undoing any storage changes.
|
||||
$crate::storage::in_storage_layer(|| {
|
||||
<$mod_type<$trait_instance $(, $instance)?>>::$fn_name( $origin $(, $param_name )* ).map(Into::into).map_err(Into::into)
|
||||
})
|
||||
};
|
||||
|
||||
// no `deposit_event` function wanted
|
||||
|
||||
Reference in New Issue
Block a user