5

The frame_sysem pallet has an extrinsic called remark declared as such:

        #[pallet::weight(T::SystemWeightInfo::remark(_remark.len() as u32))]
        pub fn remark(origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
            ensure_signed_or_root(origin)?;
            Ok(().into())
        }

It's particularly interesting because it emits no events and makes no update to storage, yet a user can call it as a signed extrinsic with a Vec<u8> as an input.

I don't see a way to explicitly query the outcome of this call, there seems to be no tests for it too. So I'm curious: where does this Vec<u8> actually go and how can I verify it behaves as expected?

2 Answers 2

4

It goes into the block as a valid extrinsic. The data included in the remark will then forever be a part of the blockchain as an extrinsic that can be found in a block, and not part of some underlying state transition.

2
  • OK - so in other words, like any other extrinsic in a finalized block would do, it just gets put in the Vec<Extrinsic> in Block. But how would I extract the Vec<u8> that pertains to the users input just from the opaque extrinsic? Aug 2, 2022 at 0:00
  • 1
    The extrinsic is not "opaque" if you know the format. The data is just right in the extrinsic: kusama.subscan.io/extrinsic/13828271-5 Also nothing to do with finalization. Any block, even unfinalized ones or forks, will have extrinsics.
    – Shawn Tabrizi
    Aug 2, 2022 at 9:02
3

What happens?

Well essentially nothing

What really happens

When you submit system.remark extrinsic and pass some bytes in it, all those nice thing of validation, transmission etc goes on. Eventually, this call will be part of the blockchain. So what's the use case

Use case: There might be many use case but one that I found often myself using is to record something in the chain. For example, if some treasury transfer was done, it might make sense to store that info like 03-10-2023.Treasury Transfer: for -- usecase and once the extrinsic is included we can store this extrinsic hash and everyone can see such record anytime. Example: my sample system.remark call in rococo

So you get the idea. It is often handful to store some arbitrary data, sometime to just check if extrinsic call is successful and stuff.

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.