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

chain-spec-builder: Automatically cross check --para-id flag with ParachainInfo genesis state. #6861

Closed
skunert opened this issue Dec 12, 2024 · 1 comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I5-enhancement An additional feature request.

Comments

@skunert
Copy link
Contributor

skunert commented Dec 12, 2024

Currently we do no check for correctness of para IDs in the chain-spec-builder.

Example

Executing this command will create a simple chain spec.

chain-spec-builder create -p 300 -c polkadot --runtime my_runtime.compact.compressed.wasm named-preset development

Ecerpt from chain_spec.json:

{
   ...
   "para_id": 300
   "genesis": {
      ...
      "runtimeGenesis": {
         ...
         "parachainInfo": {
            "parachainId": 1000
         }
      }
   }
}

There is a clear mismatch between the genesis state of the parachain info pallet and the para id in the client spec. This is expected, as the genesis state is coming from the runtime.

Solution

The chain-spec-builder could make an exception for the ParachainInfo crate and automatically align the para ids. I can not think of a use-case where it makes sense to have a mismatch there. We can print out a log that highlights that the Id has been adjusted.

@skunert skunert added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. I5-enhancement An additional feature request. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. labels Dec 12, 2024
@skunert skunert added this to SDK Node Dec 12, 2024
@github-project-automation github-project-automation bot moved this to backlog in SDK Node Dec 12, 2024
@bkchr
Copy link
Member

bkchr commented Dec 12, 2024

The proper solution for the problem is this #2116 plus this #75.

No hacky solution around making the chain spec generator do things it should not be doing.

@bkchr bkchr closed this as completed Dec 12, 2024
@github-project-automation github-project-automation bot moved this from backlog to done in SDK Node Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I5-enhancement An additional feature request.
Projects
Status: done
Development

No branches or pull requests

2 participants