mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-01 03:21:02 +00:00
grandpa: reduce allocations when verifying multiple messages (#4693)
This commit is contained in:
@@ -132,14 +132,16 @@ impl<Block: BlockT> GrandpaJustification<Block> {
|
||||
}
|
||||
}
|
||||
|
||||
let mut buf = Vec::new();
|
||||
let mut visited_hashes = HashSet::new();
|
||||
for signed in self.commit.precommits.iter() {
|
||||
if let Err(_) = communication::check_message_sig::<Block>(
|
||||
if let Err(_) = communication::check_message_sig_with_buffer::<Block>(
|
||||
&finality_grandpa::Message::Precommit(signed.precommit.clone()),
|
||||
&signed.id,
|
||||
&signed.signature,
|
||||
self.round,
|
||||
set_id,
|
||||
&mut buf,
|
||||
) {
|
||||
return Err(ClientError::BadJustification(
|
||||
"invalid signature for precommit in grandpa justification".to_string()).into());
|
||||
|
||||
Reference in New Issue
Block a user