mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 02:08:02 +00:00
grandpa: don't require justification of consensus changes on full node (#3540)
* grandpa: don't request justification for consensus changes on full node * sync: finalize justification/finality proof requests in-order * sync: ignore result of try_finalize_root on justification import
This commit is contained in:
committed by
Robert Habermeier
parent
9dc9e51063
commit
ae8bc414ab
@@ -497,6 +497,8 @@ impl<B, E, Block: BlockT<Hash=H256>, RA, PRA, SC> BlockImport<Block>
|
||||
"Imported unjustified block #{} that enacts authority set change, waiting for finality for enactment.",
|
||||
number,
|
||||
);
|
||||
|
||||
imported_aux.needs_justification = true;
|
||||
}
|
||||
|
||||
// we have imported block with consensus data changes, but without justification
|
||||
@@ -504,8 +506,6 @@ impl<B, E, Block: BlockT<Hash=H256>, RA, PRA, SC> BlockImport<Block>
|
||||
if enacts_consensus_change {
|
||||
self.consensus_changes.lock().note_change((number, hash));
|
||||
}
|
||||
|
||||
imported_aux.needs_justification = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -815,12 +815,7 @@ impl<B: BlockT> ChainSync<B> {
|
||||
/// with or without errors.
|
||||
pub fn on_justification_import(&mut self, hash: B::Hash, number: NumberFor<B>, success: bool) {
|
||||
let finalization_result = if success { Ok((hash, number)) } else { Err(()) };
|
||||
if !self.extra_justifications.try_finalize_root((hash, number), finalization_result, true) {
|
||||
debug!(target: "sync", "Got justification import result for unknown justification {:?} {:?} request.",
|
||||
hash,
|
||||
number,
|
||||
)
|
||||
}
|
||||
self.extra_justifications.try_finalize_root((hash, number), finalization_result, true);
|
||||
self.is_idle = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ impl<B: BlockT> ExtraRequests<B> {
|
||||
}
|
||||
|
||||
if best_finalized_number > self.best_seen_finalized_number {
|
||||
match self.tree.finalize_with_ancestors(
|
||||
match self.tree.finalize(
|
||||
best_finalized_hash,
|
||||
best_finalized_number,
|
||||
&is_descendent_of,
|
||||
|
||||
Reference in New Issue
Block a user