-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Extend SignedExtension
to include Origin
specification
#3419
Comments
I don't think that we should merge |
I imagine that we would disallow all transactions by default and I still think we would need one |
Hmm, currently the signature checking is part of the extrinsics itself. For a moment let's say we do it the way you propose. What do we do when two different As described in the issue you linked today, my idea was to stick to the current model of
By default |
Yeah, that's the hard part about aggregation mentioned earlier. I think the best would be to implement it in a way that BOTH origins are valid (see Gav comment on claims, where a signed extension can have it's own
I like the idea, looks really clean. I was also thinking about letting the enum ValidityResult {
Valid(TransactionValidity),
Invalid(TransactionValidityError),
None
}
type Origin: Origin + Into<RuntimeOrigin>;
fn validate_signed(&self) -> ValidityResult { ValidityResult::None }
fn validate_unsigned(&self) -> ValidityResult { ValidityResult::None }
// a working name, I don't have an idea yet.
fn validate(&self, origin: Self::Origin, previous: ValidityResult) -> (Self::Origin, ValidityResult) {
// a default implementation would just work as it works currently (i.e. merging validity results).
(origin, if origin.is_signed() { self.validate_signed() } else { self.validate_unsigned() }.merge(previous))
} A custom implementation would be able to inspect But it's not really well thought out, so beware of dragons. |
This issue has been stale since early 2020, has there been any progress on this? Or maybe a better way to do what I quoted? |
Currently the
Origin
has a special meaning in the code and signed and unsigned transactions follow different paths in the validation and execution phase.We could attempt to unify them and encapsulate all the logic in
Extra
. So thatSignedExtension
s would be allowed to return additionalOrigin
information that would then be passed todispatch
.That would make
ValidateUnsigned
and all_unsigned
functions ofSignedExtension
obsolete, since both signed and unsigned extrinsics would follow the same path.Possible simplifications in:
im-online
- we introduce anotherSignedExtra
which would check the signature inside the payload (not the signature of the transaction, since it's an unsigned transaction) and provide a specialOrigin
containing theAuthorityId
that signed that payload.claims
- details belowValidateUnsigned
trait orSignedExtension::validate_unsigned
.srml::executive
validation and dispatch.Original convo (from Gav):
The text was updated successfully, but these errors were encountered: