Currently, I am trying to test how frame-executive is working in this repo

I add some logs in executive interface impl_runtime_apis! : https://github.com/paritytech/substrate/blob/master/bin/node/runtime/src/lib.rs#L1811


impl sp_api::Core<Block> for Runtime {

    fn execute_block(block: Block) {
        log::info!("RUNTIME : GO IN EXECUTE BLOCK");

    fn initialize_block(header: &<Block as BlockT>::Header) {
        log::info!("RUNTIME : GO IN INITIALIZE BLOCK");


impl sp_block_builder::BlockBuilder<Block> for Runtime {
    fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {
        log::info!("RUNTIME : GO IN APPLY EXTRINSIC");

    fn finalize_block() -> <Block as BlockT>::Header {
        log::info!("RUNTIME : GO IN FINALIZE BLOCK");


enter image description here


Executive::execute_block(block); API doesn't trigger and display in the terminal (although I executed a simple transfer extrinsic)

How should I understand? How do I trigger this execute_block() API?

1 Answer 1


I assume you are running a one-validator network. execute_block is only called when importing blocks from the network. Blocks that the node builds itself are directly imported into the database and will not use execute_block. This should explain what you see.

When you start a second node that syncs from your first node, you should see your log message.

  • Yes, I am running a one-validator, it's working when I am running 2 validators. Thanks
    – CocDap
    Nov 18, 2022 at 2:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.