1

Inherent transactions can only be inserted into a block by the block authoring node that calls them. Typically, this type of transaction is not gossiped to other nodes or stored in the transaction queue.

Since unsigned transactions (utx) and inherents are very similar (they are both unsigned), would it be technically possible to implement pallet_im_online entirely in terms of inherents rather than utx? I.E. are there any hard barriers that prevents an inherent from being introduced into the transaction queue?

1 Answer 1

0

Inherents are for passing information of the outside to the runtime, e.g. a timestamp. While unsigned extrinsics and inherents are the same, they serve different purposes. You could also gossip inherents to other nodes, if your runtime would have some UnsignedValidator so that the extrinsic is not directly rejected by validate_transaction.

As inherents and unsigned extrinsics are serving different purposes, you should keep them separated and not mix them.

5
  • I agree we shouldn't use inherents in place of utx, but just for the purpose of curiousity , let's say we had to do this and as per my understanding, all one would need to do to remodel pallet_im_online in terms of inherents is provide just one trait implementation of ProvideInherent instead of going the signed extension route. Since the trait provides methods for both checking and producing an inherent, all validators would eventually see, in case of AURA block production, heartbeats from all validators in a session which would satisfy the functionality of im_online. Commented Nov 10, 2022 at 15:44
  • 1
    The point of heartbeats is to send them when you are not being able to produce a block, to show that you were online. When you are producing a block, you can don't need to send a heartbeat.
    – bkchr
    Commented Nov 10, 2022 at 21:59
  • What do you mean by the runtime having a UnsignedValidator? Commented Nov 12, 2022 at 19:44
  • Some Pallet that implements ValidateUnsigned for a certain unsigned call.
    – bkchr
    Commented Nov 13, 2022 at 19:02
  • ``` The point of heartbeats is to send them when you are not being able to produce a block, to show that you were online. When you are producing a block, you can don't need to send a heartbeat.``` I think this was the answer I was looking for. An inherent is only meant to be included when authoring a block while a utx can be sent regardless. Thanks. Commented Feb 3, 2023 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.