mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 01:41:03 +00:00
Add Unchecked Header Writes to Bridge Pallet (#672)
* Add method for unchecked header imports * Update docs for importing unchecked headers * Import unchecked headers in HeaderChain implementation * Fix Clippy warnings * Move unchecked header import out of Verifier struct * Clean up unchecked import tests * Change HeaderChain API to accept iterator of headers * Use chains of headers in tests * Remove unused Result return type when appending finalized headers * Add test which shows that genesis changes are not enacted * Use initial header's hash for unchecked authority set changes * Appease Clippy * Check ancestry before making unchecked writes * Fix typo * Fix Clippy warning * Add note about `ancestry_proof` structure * Use best hash storage item directly Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
This commit is contained in:
committed by
Bastian Köcher
parent
acee5580ca
commit
b921a485fb
@@ -242,9 +242,13 @@ where
|
||||
&proof.0,
|
||||
)
|
||||
.map_err(|_| FinalizationError::InvalidJustification)?;
|
||||
frame_support::debug::trace!(target: "sub-bridge", "Received valid justification for {:?}", header);
|
||||
frame_support::debug::trace!("Received valid justification for {:?}", header);
|
||||
|
||||
frame_support::debug::trace!(target: "sub-bridge", "Checking ancestry for headers between {:?} and {:?}", last_finalized, header);
|
||||
frame_support::debug::trace!(
|
||||
"Checking ancestry for headers between {:?} and {:?}",
|
||||
last_finalized,
|
||||
header
|
||||
);
|
||||
let mut finalized_headers =
|
||||
if let Some(ancestors) = headers_between(&self.storage, last_finalized, header.clone()) {
|
||||
// Since we only try and finalize headers with a height strictly greater
|
||||
@@ -335,7 +339,7 @@ where
|
||||
Some(ancestors)
|
||||
}
|
||||
|
||||
fn find_scheduled_change<H: HeaderT>(header: &H) -> Option<sp_finality_grandpa::ScheduledChange<H::Number>> {
|
||||
pub(crate) fn find_scheduled_change<H: HeaderT>(header: &H) -> Option<sp_finality_grandpa::ScheduledChange<H::Number>> {
|
||||
let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID);
|
||||
|
||||
let filter_log = |log: ConsensusLog<H::Number>| match log {
|
||||
|
||||
Reference in New Issue
Block a user