mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 05:47:58 +00:00
frame-executive: Reject invalid inherents in the executive (#12365)
* frame-executive: Reject invalid inherents in the executive We already had support for making a block fail if an inherent returned, but it was part of the signed extension `CheckWeight`. Rejecting blocks with invalid inherents should happen on the `frame-executive` level without requiring any special signed extension. This is crucial to prevent any kind of spamming of the network that could may happen with blocks that include failing inherents. * FMT * Update frame/executive/src/lib.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * Update primitives/runtime/src/transaction_validity.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> Co-authored-by: parity-processbot <> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -359,13 +359,15 @@ where
|
||||
|
||||
/// Implementation for test extrinsic.
|
||||
#[cfg(feature = "std")]
|
||||
impl<Call: Encode, Extra: Encode> GetDispatchInfo for sp_runtime::testing::TestXt<Call, Extra> {
|
||||
impl<Call: Encode + GetDispatchInfo, Extra: Encode> GetDispatchInfo
|
||||
for sp_runtime::testing::TestXt<Call, Extra>
|
||||
{
|
||||
fn get_dispatch_info(&self) -> DispatchInfo {
|
||||
// for testing: weight == size.
|
||||
DispatchInfo {
|
||||
weight: Weight::from_ref_time(self.encode().len() as _),
|
||||
pays_fee: Pays::Yes,
|
||||
..Default::default()
|
||||
class: self.call.get_dispatch_info().class,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user