paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.com/
1.88k stars 688 forks source link

Consideration about `TransactionSource` in validate unsigned, maybe removal #5395

Closed gui1117 closed 2 months ago

gui1117 commented 2 months ago

Context, in the extrinsic horizon https://github.com/paritytech/polkadot-sdk/issues/2415 unsigned transactions are deprecated in favor of "General" transactions. A "General" transaction is a transaction which contains extensions (formely signed extensions) but are not signed, instead some payload may contain the signature of the transaction and the extensions, or the validity is ensure in some way (like claim for example).

We might not want to bring the concept of transaction source in the "general" transaction.

Currently TransactionSource is used to have transaction from the offchain worker put into the block while at the same time blocking the same transaction if it comes from external source.

This is used for unsigned equivocation in babe, beefy and grandpa, also to provide an election solution in an unsigned way, and also unsigned slashing report for disputes.

Instead of transactions those extrinsics really looks like inherent to me, but there is no way to submit some information from the offchain worker to the inherent data to convert this information into some inherent. Also the inherent data has no concept of longevity, provide, require, nor resubmition in case of uncle-block.

I think touching the inherent architecture is difficult.

So to move into "general" transaction we can:

gui1117 commented 2 months ago

(4) is probably the solution, I guess digests contain the block author in validate, it can be used to trust an extrinsic.