[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Feature: Add remark_call extrinsic to pallet-utilities #14727

Closed
2 tasks done
lemunozm opened this issue Aug 7, 2023 · 2 comments
Closed
2 tasks done

Feature: Add remark_call extrinsic to pallet-utilities #14727

lemunozm opened this issue Aug 7, 2023 · 2 comments
Labels
J0-enhancement An additional feature request.

Comments

@lemunozm
Copy link
Contributor
lemunozm commented Aug 7, 2023

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

We are in a situation where we want to tie some calls to some specific value/hash. There is a pallet-remark, but this only allows storing marks, without any relation to a call.

Using a batch, we could get that association. Supposing we want to tie ExtrinsicA to MarkA, we could do something like batch(ExtrinsicA, pallet_remark::store(MarkA)). Nevertheless, a possible indexer (i.e. Subscan) would need to inspect all extrinsic nested in batches in order to get the associations between the mark and the calls. We would want a fast solution to identify such relations.

Request

We need a more powerful extrinsic that allows us to remark a call. Something like:

fn remark_call(origin, call: RuntimeCall, remark: Remark) {
    call.dispatch()
    dispatch_event(remark)
}

This call should not be nested by batches to avoid an indexer going through all calls of a batch. An indexer would only need to identify those remark_call extrinsic at the top level.

Solution

We think we can add that remark_call to pallet-utilities, ensuring the batching method does not contain such extrinsic.

Are you willing to help with this request?

Yes!

@lemunozm lemunozm added the J0-enhancement An additional feature request. label Aug 7, 2023
@ggwpez
Copy link
Member
ggwpez commented Aug 7, 2023

Nevertheless, a possible indexer (i.e. Subscan) would need to inspect all extrinsic nested in batches in order to get the associations between the mark and the calls. We would want a fast solution to identify such relations.

What is the problem of this? You only need to inspect the batches that emitted a remark(Mark*) event and can ignore the other ones. It wont get faster than this (maybe write it in Rust 😆).

This call should not be nested by batches to avoid an indexer going through all calls of a batch. An indexer would only need to identify those remark_call extrinsic at the top level.

I dont think it makes sense to change the runtime to optimize for such nieche off-chain use-cases. You could already look only at top-level remarks.

@lemunozm
Copy link
Contributor Author
lemunozm commented Aug 9, 2023

Make sense, probably too niche a use case. Thanks for the suggestions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

2 participants