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

Reading from pallet-parameters doesn't work with the default value. #11049

Open
kianenigma opened this issue Oct 30, 2024 · 5 comments
Open

Reading from pallet-parameters doesn't work with the default value. #11049

kianenigma opened this issue Oct 30, 2024 · 5 comments
Labels
Compatibility Ensures SDK compatibility with ecosystem updates and major dependency changes. P4 - Needs Investigation Requires analysis to determine cause or feasibility. Not fully understood, needs research first.

Comments

@kianenigma
Copy link

As per for example:

Screenshot 2024-10-30 at 12 44 50

The default values are specified in the code, and I would hope that they are somewhere present in the metadata. cc @ggwpz

@TarikGul
Copy link
Member

I'll need to check this with the API itself and see if it poses issues from there as a sanity check.

@kianenigma
Copy link
Author

Oh yeah, likely an api issue, not an apps one. Feel free to move to the other repo if need be.

@ggwpez
Copy link

ggwpez commented Oct 30, 2024

I think this boils down to this issue: paritytech/polkadot-sdk#3238

The parameters storage map can only have one default for all keys - not one default per key.
And the scale-info type system does not seem to provide defaults for generic types either.
So either we change the metadata stuff or add a runtime API to query the params.

@kianenigma
Copy link
Author

The parameters storage map can only have one default for all keys - not one default per key.

This is only at the metadata level right? In the runtime, we can indeed have a default per parameter item?

@ggwpez
Copy link

ggwpez commented Oct 30, 2024

This is only at the metadata level right? In the runtime, we can indeed have a default per parameter item?

Yea, if you query them from within the runtime then it works. But from the outside this is not transparent.

@TarikGul TarikGul added P4 - Needs Investigation Requires analysis to determine cause or feasibility. Not fully understood, needs research first. Compatibility Ensures SDK compatibility with ecosystem updates and major dependency changes. labels Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compatibility Ensures SDK compatibility with ecosystem updates and major dependency changes. P4 - Needs Investigation Requires analysis to determine cause or feasibility. Not fully understood, needs research first.
Projects
Status: P4 - Needs Investigation
Development

No branches or pull requests

3 participants