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

Can we improve on the chain-spec-pruning feature flag from the CLI tool? #1313

Open
jsdw opened this issue Dec 7, 2023 · 1 comment
Open

Comments

@jsdw
Copy link
Collaborator

jsdw commented Dec 7, 2023

# Compute the state root hash from the genesis entry.
# Enable this to create a smaller chain spec file.
chain-spec-pruning = ["smoldot"]

This non-default feature is used to provide an additional flag to let users prune the returned chainSpec. The reason that we have a feature here is because we have to pull in a number of additional dependencies in order to do this pruning (ie smoldot).

One issue that Tadeo pointed out (#1278 (comment)) is that this feature flag suddenly means that different users can have different "variants" of the CLI tool.

I think there are a couple of options:

  1. Just remove the feature flag and suck up the extra dependencies. Primarily this will slow compile times a bit when building the CLI tool, but I hope wouldn't have much impact on the overall CI workflows since smoldot is a part of the dependency tree anyway.
  2. Make the feature flag be enabled by default. This means that everybody will get all functionality by default, but if people have a specific reason to want to opt out of certain features, then there is a way to do so. This is different from having to tell people to enable specific functionality by using feature flags, and by default having a less capable CLI tool.

With either of these, we could also try to reduce the number of dependencies needed for this chain spec trimming. Perhaps we can avoid needing to depend on so many things with a bit of work in Smoldot? This is orthoganol to 1 and 2 but makes them a little more appealing :)

I'm torn, but either 1 or 2 would suit me! What do you guys thing @tadeohepperle @lexnv @niklasad1?

@niklasad1
Copy link
Member

niklasad1 commented Dec 7, 2023

Option 3) is to extract the light-sync-state stuff to a separate binary such subxt-cli-lightclient because it's
fundamentally different from the existing subxt-cli which is used to generate a subxt codegen from the metadata.

This is on the other hand is used to generate a chainspec.... by calling lightSyncState and AFAIU is that the chainspec may be "outdated" more often then the metadata itself because some bootnodes disappears or something similar.

I think it would be neat to support everything in a single binary without feature flags... if the number of deps are not extreme

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