Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable pallet ids #45

Closed
sander2 opened this issue May 23, 2022 · 6 comments
Closed

Configurable pallet ids #45

sander2 opened this issue May 23, 2022 · 6 comments

Comments

@sander2
Copy link

sander2 commented May 23, 2022

Currently the prefixes used to calculate AuthorizeUpgrade hashes are hardcoded. In our case, they are incorrect. It would be great if there were some way to customize this.

@chevdor
Copy link
Owner

chevdor commented May 23, 2022

Hello @sander2,
How do you imagine a solution that would work for you ? What prefixes are you using ?
Could you give me a sample call and result hash as well as one of your runtimes for instance ?

As option, I could leave the current prefixes as default but allow you overriding them with ENVs. Would that be enough for your usecase ?

@sander2
Copy link
Author

sander2 commented May 27, 2022

Our ParachainSystem pallet is at index 32 so I guess our used prefix would be [32, 3] instead of the default [1, 3]. I think using ENV to overwrite the default as you suggested would work well

@chevdor
Copy link
Owner

chevdor commented May 30, 2022

Could you check if this PR would solve your problem ?

Just set PARACHAIN_PALLET_ID_ENV=0x32 before running subwasm as usual.

chevdor added a commit that referenced this issue May 30, 2022
@sander2
Copy link
Author

sander2 commented May 31, 2022

Thanks for the PR! It doesn't fully address my problem yet - apparently the version of ParachainSystem that we use has authorizeUpgrade at method index 2. So I need to set the prefix to [32, 2]. So I would propose to make PARACHAIN_PALLET_ID a two-byte prefix, so in my case I would set PARACHAIN_PALLET_ID_ENV=0x2002

@chevdor
Copy link
Owner

chevdor commented May 31, 2022

ok, I see what you want, I am not sure I like the naming you suggest and the aggregation of the 2 IDs. It may be better to have simply a second ENV for the call. That will scale better if people need other calls as well so pallet id and call id are separated.

@sander2
Copy link
Author

sander2 commented May 31, 2022

I agree that the naming I used wasn't appropriate - AUTHORIZE_UPGRADE_PREFIX would be better. Having two separate env variables would also be ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants