mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07: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:
@@ -77,9 +77,9 @@ pub enum InvalidTransaction {
|
||||
/// malicious validator or a buggy `provide_inherent`. In any case, it can result in
|
||||
/// dangerously overweight blocks and therefore if found, invalidates the block.
|
||||
BadMandatory,
|
||||
/// A transaction with a mandatory dispatch. This is invalid; only inherent extrinsics are
|
||||
/// allowed to have mandatory dispatches.
|
||||
MandatoryDispatch,
|
||||
/// An extrinsic with a mandatory dispatch tried to be validated.
|
||||
/// This is invalid; only inherent extrinsics are allowed to have mandatory dispatches.
|
||||
MandatoryValidation,
|
||||
/// The sending address is disabled or known to be invalid.
|
||||
BadSigner,
|
||||
}
|
||||
@@ -109,8 +109,8 @@ impl From<InvalidTransaction> for &'static str {
|
||||
"Inability to pay some fees (e.g. account balance too low)",
|
||||
InvalidTransaction::BadMandatory =>
|
||||
"A call was labelled as mandatory, but resulted in an Error.",
|
||||
InvalidTransaction::MandatoryDispatch =>
|
||||
"Transaction dispatch is mandatory; transactions may not have mandatory dispatches.",
|
||||
InvalidTransaction::MandatoryValidation =>
|
||||
"Transaction dispatch is mandatory; transactions must not be validated.",
|
||||
InvalidTransaction::Custom(_) => "InvalidTransaction custom error",
|
||||
InvalidTransaction::BadSigner => "Invalid signing address",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user