-
Notifications
You must be signed in to change notification settings - Fork 249
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
block.body
definitly exists unless it's a light client or using fast sync in storage chain mode
#153
Conversation
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.
Can we guarantee that it is impossible to run a light client node or use fast sync? Light client mode is not working/not available so that is fair I guess, but I'm not 100% sure what fast sync is.
Since we have customized struct for CLI arguments, maybe we should start stripping things down from it such that we don't allow configurations that are not working in the first place? There are quite a few arguments which are not applicable to Subspace in default flags.
The main idea of fast sync can be visited at paritytech/substrate#8884. I don't think it works in our case.
Yes, definitely possible, but it also has to be a quite dirty trick. I used it to support the CLI config file by first filtering the raw CLI argument list and then feeding them into the internal CLI constructor in ChainX but really not a fan of it. Based on my experience, basically, no one will run into this trap as long as it's not the default behavior and you don't show the way to do it. So we could save some energy for now. Can be another PR if you'd like to prune the flags incompatible with subspace seriously. |
fb9b8e1
to
c4649e4
Compare
… in storage chain mode
c4649e4
to
edb1a71
Compare
I think there is a better way:
We should be able to include some subcommands and skip others to get just the list we need. |
That works for the subcommands, but not for the inner params like |
We should still be able to copy-paste those structs, customize them and map to whatever Substrate expects before moving forward. We just need to make sure that someone who is typing |
Yeah, reassembling the subcommand can be less a dirty way. |
From what I see, there are two cases that
block.body
can be omitted otherwise it should always exist:light client
https://github.com/paritytech/substrate/blob/3f657a56b3c9bfe14613d213efc6570292ffaf86/client/network/src/protocol/sync.rs#L572
fast sync in storage chain mode
https://github.com/paritytech/substrate/blob/3f657a56b3c9bfe14613d213efc6570292ffaf86/client/network/src/protocol/sync.rs#L575