Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
use RuntimeGenesisConfig in genesis config presets #451
base: main
Are you sure you want to change the base?
use RuntimeGenesisConfig in genesis config presets #451
Changes from 14 commits
1ccb486
3f12e7c
0e9243d
dcd050a
fbf97c6
a09b416
83a9076
529a574
d6cca64
098bac9
ac021d9
79a3d5b
1354b29
c3210cf
c4c5f35
4140168
6736951
f725e7a
ef78c8e
b83513a
e1fe0c2
de27440
ceedebb
76cf067
824f46c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dharjeezy Is it intentional to name all the genesis fields here? Could we just use
..Default::default(),
for them? Every time we add a new pallet to the runtime, we would also need to addxyz = Default::default()
here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalkucharczyk wdyt here also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..Default::default()
shall be used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also adding link to related discussion: paritytech/polkadot-sdk#5327 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dharjeezy I think that we don't need to remove anything here, e.g. these phantoms... so I would revert
remove_phantom_fields
stuff. It is not enough justphantom
, e.g. some of the pallets use_config
orconfig
or_phantom
. The pallet'sGeneisConfig
should not serialize those, e.g. paritytech/polkadot-sdk@6226e84There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michalkucharczyk wdyt here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[#serde(skip)]
shall be used for phantom fields.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means i have to open a PR in polkadot-sdk to include the
[#serde(skip)]
annotation for these pallets because they don't actually have them example is thepallet-bridge-messages
pallet? @michalkucharczyk @bkonturThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, PR shall be opened. In that case, IMO we could keep this function until clean-up PR is merged (some annotations would be nice).
As alternative (and probably better solution) you could experiment with removing the fields that were not customized from the final JSON (see this discussion).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dharjeezy actually, this pallet was fixed already in the master: https://github.com/paritytech/polkadot-sdk/blob/master/bridges/modules/messages/src/lib.rs#L539-L540, but if you have there any others, please feel free to open PR to polkadot-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just saw that it is now added, we will have to wait for a new release.