pub type Executive = Executive<Runtime, Block, ChainContext<Runtime>, Runtime, AllPalletsWithSystem>;
Expand description
Executive: handles dispatch to the various modules.
Aliased Type§
struct Executive(/* private fields */);
Implementations
Source§impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
System: Config + EnsureInherentsAreFirst<Block>,
Block: Block<Header = <<System as Config>::Block as HeaderProvider>::HeaderT, Hash = <System as Config>::Hash>,
Context: Default,
AllPalletsWithSystem: OnRuntimeUpgrade + BeforeAllRuntimeMigrations + OnInitialize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnIdle<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnFinalize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OffchainWorker<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnPoll<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + TryState<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + TryDecodeEntireStorage,
COnRuntimeUpgrade: OnRuntimeUpgrade,
<Block as Block>::Extrinsic: Checkable<Context> + Codec,
<<Block as Block>::Extrinsic as Checkable<Context>>::Checked: Applyable + GetDispatchInfo,
<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call as Dispatchable>::RuntimeOrigin: From<Option<<System as Config>::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = <<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call>,
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
System: Config + EnsureInherentsAreFirst<Block>,
Block: Block<Header = <<System as Config>::Block as HeaderProvider>::HeaderT, Hash = <System as Config>::Hash>,
Context: Default,
AllPalletsWithSystem: OnRuntimeUpgrade + BeforeAllRuntimeMigrations + OnInitialize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnIdle<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnFinalize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OffchainWorker<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnPoll<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + TryState<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + TryDecodeEntireStorage,
COnRuntimeUpgrade: OnRuntimeUpgrade,
<Block as Block>::Extrinsic: Checkable<Context> + Codec,
<<Block as Block>::Extrinsic as Checkable<Context>>::Checked: Applyable + GetDispatchInfo,
<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call as Dispatchable>::RuntimeOrigin: From<Option<<System as Config>::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = <<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call>,
Sourcepub fn try_execute_block(
block: Block,
state_root_check: bool,
signature_check: bool,
select: Select,
) -> Result<Weight, &'static str>
pub fn try_execute_block( block: Block, state_root_check: bool, signature_check: bool, select: Select, ) -> Result<Weight, &'static str>
Execute given block, but don’t as strict is the normal block execution.
Some checks can be disabled via:
state_root_check
signature_check
Should only be used for testing ONLY.
Sourcepub fn try_runtime_upgrade(
checks: UpgradeCheckSelect,
) -> Result<Weight, DispatchError>
pub fn try_runtime_upgrade( checks: UpgradeCheckSelect, ) -> Result<Weight, DispatchError>
Execute all Migrations of this runtime.
The checks
param determines whether to execute pre/post_upgrade
and try_state
hooks.
frame_system::LastRuntimeUpgrade
is set to the current runtime version after
migrations execute. This is important for idempotency checks, because some migrations use
this value to determine whether or not they should execute.
Source§impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
System: Config + EnsureInherentsAreFirst<Block>,
Block: Block<Header = <<System as Config>::Block as HeaderProvider>::HeaderT, Hash = <System as Config>::Hash>,
Context: Default,
AllPalletsWithSystem: OnRuntimeUpgrade + BeforeAllRuntimeMigrations + OnInitialize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnIdle<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnFinalize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OffchainWorker<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnPoll<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>,
COnRuntimeUpgrade: OnRuntimeUpgrade,
<Block as Block>::Extrinsic: Checkable<Context> + Codec,
<<Block as Block>::Extrinsic as Checkable<Context>>::Checked: Applyable + GetDispatchInfo,
<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call as Dispatchable>::RuntimeOrigin: From<Option<<System as Config>::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = <<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call>,
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade> Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
System: Config + EnsureInherentsAreFirst<Block>,
Block: Block<Header = <<System as Config>::Block as HeaderProvider>::HeaderT, Hash = <System as Config>::Hash>,
Context: Default,
AllPalletsWithSystem: OnRuntimeUpgrade + BeforeAllRuntimeMigrations + OnInitialize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnIdle<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnFinalize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OffchainWorker<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnPoll<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>,
COnRuntimeUpgrade: OnRuntimeUpgrade,
<Block as Block>::Extrinsic: Checkable<Context> + Codec,
<<Block as Block>::Extrinsic as Checkable<Context>>::Checked: Applyable + GetDispatchInfo,
<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call as Dispatchable>::RuntimeOrigin: From<Option<<System as Config>::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = <<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call>,
Sourcepub fn execute_on_runtime_upgrade() -> Weight
pub fn execute_on_runtime_upgrade() -> Weight
Execute all OnRuntimeUpgrade
of this runtime, and return the aggregate weight.
Sourcepub fn initialize_block(
header: &<<System as Config>::Block as HeaderProvider>::HeaderT,
) -> ExtrinsicInclusionMode
pub fn initialize_block( header: &<<System as Config>::Block as HeaderProvider>::HeaderT, ) -> ExtrinsicInclusionMode
Start the execution of a particular block.
Sourcepub fn execute_block(block: Block)
pub fn execute_block(block: Block)
Actually execute all transitions for block
.
Sourcepub fn inherents_applied()
pub fn inherents_applied()
Logic that runs directly after inherent application.
It advances the Multi-Block-Migrations or runs the on_poll
hook.
Sourcepub fn finalize_block() -> <<System as Config>::Block as HeaderProvider>::HeaderT
pub fn finalize_block() -> <<System as Config>::Block as HeaderProvider>::HeaderT
Finalize the block - it is up the caller to ensure that all header fields are valid except state-root.
Sourcepub fn apply_extrinsic(
uxt: <Block as Block>::Extrinsic,
) -> Result<Result<(), DispatchError>, TransactionValidityError>
pub fn apply_extrinsic( uxt: <Block as Block>::Extrinsic, ) -> Result<Result<(), DispatchError>, TransactionValidityError>
Apply extrinsic outside of the block execution function.
This doesn’t attempt to validate anything regarding the block, but it builds a list of uxt hashes.
Sourcepub fn validate_transaction(
source: TransactionSource,
uxt: <Block as Block>::Extrinsic,
block_hash: <Block as Block>::Hash,
) -> Result<ValidTransaction, TransactionValidityError>
pub fn validate_transaction( source: TransactionSource, uxt: <Block as Block>::Extrinsic, block_hash: <Block as Block>::Hash, ) -> Result<ValidTransaction, TransactionValidityError>
Check a given signed transaction for validity. This doesn’t execute any side-effects; it merely checks whether the transaction would panic if it were included or not.
Changes made to storage should be discarded.
Sourcepub fn offchain_worker(
header: &<<System as Config>::Block as HeaderProvider>::HeaderT,
)
pub fn offchain_worker( header: &<<System as Config>::Block as HeaderProvider>::HeaderT, )
Start an offchain worker and generate extrinsics.
Trait Implementations
Source§impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade> ExecuteBlock<Block> for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
System: Config + EnsureInherentsAreFirst<Block>,
Block: Block<Header = <<System as Config>::Block as HeaderProvider>::HeaderT, Hash = <System as Config>::Hash>,
Context: Default,
AllPalletsWithSystem: OnRuntimeUpgrade + BeforeAllRuntimeMigrations + OnInitialize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnIdle<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnFinalize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OffchainWorker<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnPoll<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>,
COnRuntimeUpgrade: OnRuntimeUpgrade,
<Block as Block>::Extrinsic: Checkable<Context> + Codec,
<<Block as Block>::Extrinsic as Checkable<Context>>::Checked: Applyable + GetDispatchInfo,
<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call as Dispatchable>::RuntimeOrigin: From<Option<<System as Config>::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = <<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call>,
impl<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade> ExecuteBlock<Block> for Executive<System, Block, Context, UnsignedValidator, AllPalletsWithSystem, COnRuntimeUpgrade>where
System: Config + EnsureInherentsAreFirst<Block>,
Block: Block<Header = <<System as Config>::Block as HeaderProvider>::HeaderT, Hash = <System as Config>::Hash>,
Context: Default,
AllPalletsWithSystem: OnRuntimeUpgrade + BeforeAllRuntimeMigrations + OnInitialize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnIdle<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnFinalize<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OffchainWorker<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> + OnPoll<<<<System as Config>::Block as HeaderProvider>::HeaderT as Header>::Number>,
COnRuntimeUpgrade: OnRuntimeUpgrade,
<Block as Block>::Extrinsic: Checkable<Context> + Codec,
<<Block as Block>::Extrinsic as Checkable<Context>>::Checked: Applyable + GetDispatchInfo,
<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>,
<<<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call as Dispatchable>::RuntimeOrigin: From<Option<<System as Config>::AccountId>>,
UnsignedValidator: ValidateUnsigned<Call = <<<Block as Block>::Extrinsic as Checkable<Context>>::Checked as Applyable>::Call>,
Source§fn execute_block(block: Block)
fn execute_block(block: Block)
block
. Read more