Guidance on selecting pre-images

Hi Everyone!

We at Polkassembly have been working on an exciting new feature. We want to enable users to create OpenGov proposals from Polkassembly itself.

Unfortunately, we have hit a roadblock in our endeavour.

Issue

  • The preimage form has options for creating preimages for Gov1, OpenGov and much more. We are unable to identify a mapping pattern for preimages to OpenGov referenda.
    Which means, if a user wants to create a referendum for a specific track, how can they identify preimages relevant to that track.

What we need help with

  • We would love to make the process for identification of the correct pre-images easier.
    For this, we would need a mapping of which pre-images are accepted across the different tracks in OpenGov. This would help in creating a custom form for users, where they can only see the relevant options.

It would be super helpful, it someone could help us with this information or direct us to a place where we can find it.

Cheers!

3 Likes

I don’t get your question.

I would image the user flow of creating a proposal is something like this:

  • Select a track and other parameters
  • Construct the proposal Call / i.e. preimage
  • Submit

The submit action will make a batch call to add the preimage and actually submit the proposal. It should also check if the preimage is already submitted and in that case skip the add preimage part.

hey @xlc, thank you for your response.

I will try phrasing my question in a slightly different way.

As per the user flow mentioned by you, how is the user expected to construct the proposal call / pre-image?

  • There are 52 options with more than 800 methods present in PolkadotJS, when a user attempts to create a pre-image.
  • Given that the user already knows which referendum origin they want to leverage, could we provide only relevant options to the user?
    For example,
    If I want to create a medium tipper proposal, probably referenda.submit or treasury.spend are the only options I may need. Most other pre-images like auction and staking may become irrelevant in this case

I see. This is going to help but unfortunately no one is willing to pick it up to implement it.

So the only option is hardcode the list.

Hard coding it seems problematic as there is more than one route that can exist in certain cases for OpenGov.

For example, referenda.submit (select origin and then medium spender) is one way to achieve the objective of creating a medium spender proposal while treasury.spend is another.
The user would not know which one is preferred or correct

It would be extremely helpful to receive some guidance regarding the preferred routes. This would help a user with very little context to create and submit a referenda, in a standardized manner

I am not aware of any existing work on this area so you will need to build your own solution to solve this problem.

I will suggest don’t make it generic and flexible. Instead, start with something simple and gradually add more proposal types. For example, in V1 you only support making spend proposal. The user will select the proposal type (the only option is spend), and enter amount and that’s it. The dApp will pick the track based on entered amount.

In later version you could then add more proposal type such as update parachain head/wasm etc.

2 Likes

Sure, that was our back up plan!

Thank you!

This would have definitely been helpful for a non-technical user like me.

I wanted to try my luck with Polkadot.js to create my first ever Small Tipper proposal for OpenGov but the UI got the best of me.

I created the pre-image following the instructions here:

Obviously, in retrospect, I should have not chosen the system.remark that is in the example. Now the proposal description says “Make some on-chain remark. ## Complexity - O(1)”. Is there any way to edit that since it’s on-chain? Probably not. Gosh, I’ve been a round a few years, yet I feel like such a noob.

Link to my amateurish proposal:

@tomi we are developing a solution at Polkassembly to solve this problem for all users in a single go! :slight_smile:

This should reach our users in the next week ideally, hope you will find it useful

You are awesome, keep up the good work!

1 Like

@xlc @tomi

A quick update on this thread.

We are live with Proposal creation on Polkassembly and make the pre-image as well as the proposal creation process much more easier.

We take the onus away from the user to figure stuff out and allow them to use a simple web2 like flow which makes proposal creation a simple three step process.

Simply click on the FAB or visit our docs to start creating your first proposal -