paritytech / paritytech/subxt

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

Open
#1,313 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
489
Forks
293
Avg merge
18h 35m
Merged PRs (30d)
3

Description

# 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 (https://github.com/paritytech/subxt/pull/1278#discussion_r1406345412) 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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the CLI tool's chain-spec-pruning feature declaration and how the smoldot dependencies enter the chain-spec pruning path. Compare removing the flag with enabling it by default, including dependency and compile-time effects; done means the project has selected and implemented one consistent CLI behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.