Imagine there is an unsigned extrinsic call.
#[pallet::call]
fn call(something, ..) -> DispatchResult {
ensure_none()?;
// verify(something)?;
Ok(())
}
#[pallet::validate_unsigned]
impl .. {
fn validate_unsigned(call, ..) {
match call {
call(something, ..) => verify(something),
_ => return Err
}
return Ok
}
}
We already do the verification in the validate_unsigned
.
- Should we?
To my understanding, we should.
If any validator/collator modifies their node to remove the
validate_unsigned
part. Then he could skip that. - Why? How will the extrinsic be executed and broadcast in the network in this case?
I found the Polkadot did the first verification here https://github.com/paritytech/polkadot/blob/d57049f1e4e5b00309cdd0297235a8de821f601d/runtime/common/src/claims.rs#L475.
And second here https://github.com/paritytech/polkadot/blob/d57049f1e4e5b00309cdd0297235a8de821f601d/runtime/common/src/claims.rs#L317.
Why the second one is necessary?
If we remove the second one. What would happen? How does the attacker make a successful attack in this case?