diff --git a/crates/primitives/src/block.rs b/crates/primitives/src/block.rs index 94dd578493c9..5c47c49f4375 100644 --- a/crates/primitives/src/block.rs +++ b/crates/primitives/src/block.rs @@ -69,7 +69,7 @@ impl Block { let senders = if self.body.transactions.len() == senders.len() { senders } else { - let Some(senders) = self.body.recover_signers() else { return Err(self) }; + let Some(senders) = self.body.recover_signers_unchecked() else { return Err(self) }; senders }; @@ -379,7 +379,7 @@ impl SealedBlock { let senders = if self.body.transactions.len() == senders.len() { senders } else { - let Some(senders) = self.body.recover_signers() else { return Err(self) }; + let Some(senders) = self.body.recover_signers_unchecked() else { return Err(self) }; senders }; @@ -616,6 +616,15 @@ impl BlockBody { TransactionSigned::recover_signers(&self.transactions, self.transactions.len()) } + /// Recover signer addresses for all transactions in the block body _without ensuring that the + /// signature has a low `s` value_. + /// + /// Returns `None`, if some transaction's signature is invalid, see also + /// [`TransactionSigned::recover_signer_unchecked`]. + pub fn recover_signers_unchecked(&self) -> Option> { + TransactionSigned::recover_signers_unchecked(&self.transactions, self.transactions.len()) + } + /// Returns whether or not the block body contains any blob transactions. #[inline] pub fn has_blob_transactions(&self) -> bool {