From 7d96ff1909af5083aa8b59f71c39445716288414 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 20 Dec 2024 11:06:56 +0100 Subject: [PATCH] TargetX creation header is now latest finalized, not latest --- app-libs/stf/src/trusted_call.rs | 1 - .../block-import-dispatcher/src/triggered_dispatcher.rs | 3 ++- core/parentchain/block-importer/src/block_importer.rs | 6 ++++-- service/src/main_impl.rs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app-libs/stf/src/trusted_call.rs b/app-libs/stf/src/trusted_call.rs index a1e13e1c0..8c5dc8904 100644 --- a/app-libs/stf/src/trusted_call.rs +++ b/app-libs/stf/src/trusted_call.rs @@ -60,7 +60,6 @@ use sp_core::{ crypto::{AccountId32, UncheckedFrom}, ed25519, }; -use sp_io::hashing::blake2_256; use sp_runtime::{traits::Verify, MultiAddress, MultiSignature}; use std::{format, prelude::v1::*, sync::Arc, vec}; diff --git a/core/parentchain/block-import-dispatcher/src/triggered_dispatcher.rs b/core/parentchain/block-import-dispatcher/src/triggered_dispatcher.rs index 9d4a6ae5e..dea1aa2ca 100644 --- a/core/parentchain/block-import-dispatcher/src/triggered_dispatcher.rs +++ b/core/parentchain/block-import-dispatcher/src/triggered_dispatcher.rs @@ -190,10 +190,11 @@ where let latest_imported_block = blocks_to_import.last().map(|b| (*b).clone()); let parentchain_id = self.block_importer.parentchain_id(); trace!( - "[{:?}] Import of parentchain blocks and events has been triggered, importing {} blocks and {} events from queue", + "[{:?}] Import of parentchain blocks and events has been triggered, importing {} blocks and {} events of {} blocks from queue", parentchain_id, blocks_to_import.len(), events_to_import.len(), + depth ); self.block_importer diff --git a/core/parentchain/block-importer/src/block_importer.rs b/core/parentchain/block-importer/src/block_importer.rs index 5681ec6a9..f22d06fd5 100644 --- a/core/parentchain/block-importer/src/block_importer.rs +++ b/core/parentchain/block-importer/src/block_importer.rs @@ -148,7 +148,8 @@ impl< if let Some(creation_block) = self.shard_creation_info.for_parentchain(id) { if signed_block.block.header().number < creation_block.number { trace!( - "fast-syncing block import, ignoring any invocations before block {:}", + "[{:?}] fast-syncing block import, ignoring any invocations before block {:}", + id, creation_block.number ); continue @@ -180,7 +181,8 @@ impl< }; calls.push((opaque_call, mortality)); }, - Ok(None) => trace!("omitting confirmation call to non-integritee parentchain"), + Ok(None) => + trace!("[{:?}] omitting confirmation call to non-integritee parentchain", id), Err(e) => error!("[{:?}] Error executing relevant extrinsics: {:?}", id, e), }; diff --git a/service/src/main_impl.rs b/service/src/main_impl.rs index dcfe99549..6cec42244 100644 --- a/service/src/main_impl.rs +++ b/service/src/main_impl.rs @@ -815,7 +815,7 @@ where }); // we attempt to set shard creation for this parentchain in case it hasn't been done before - let api_head = node_api.get_header(None).unwrap().unwrap(); + let api_head = node_api.get_header(node_api.get_finalized_head().unwrap()).unwrap().unwrap(); // TODO: #1451: Fix api-client type hacks let head = Header::decode(&mut api_head.encode().as_slice()) .expect("Can decode previously encoded header; qed");