Skip to content

feat(cli)!: hand the core the stack the CLI resolved - #1965

Draft
Mikelle wants to merge 7 commits into
feat/stack-2-corefrom
feat/stack-3-cli
Draft

Mikelle wants to merge 7 commits into
feat/stack-2-corefrom
feat/stack-3-cli

Conversation

@Mikelle

@Mikelle Mikelle commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

The CLI hands the core the stack of the network it resolved. That stack has:

  • the descriptor's network, which get_chain_info reports as an app bundling the same stack does,
  • the descriptor's TLD,
  • the People, Bulletin and Asset Hub the CLI serves. The CLI serves no Relay, so the stack names none.

The descriptor's id stays the product namespace and state directory. feature_supported answers from the served roles.

The core allows the stack Polkadot's reserved values, because the CLI vouches for them itself. No stack runs under the polkadot namespace, and a host command runs the chain checks before it starts the core. Those checks refuse a chain with one of Polkadot's genesis hashes until it shows it is a fork. Without that, the core would refuse pcf-devnet, which runs on dot, and every Polkadot fork. This differs from #1564, where only a stack the build ships and marks may use reserved values: the CLI keeps running Polkadot forks from --stack, as #1944 chose.

Testing

  • the_core_stack_reports_what_an_app_bundling_it_reports checks that for every built-in network the CLI's stack equals what Stack::bundled resolves from the same signed copy, minus the Relay.
  • a_polkadot_fork_starts_the_core checks that a stack on Polkadot's People genesis still builds a core stack.
  • CLI unit and integration tests pass, except script_runner::tests::managed_scripts_use_their_project_directory_when_selected_explicitly. That test fails on macOS from a /private/var vs /var temp-path mismatch outside this change.
  • Workspace clippy on the pinned nightly and the CLI's rustdoc are clean.

Stack

These six PRs are stack #1969. Review bottom up. Layer 1 can merge to main by itself. Layers 2 to 6 land together through GitHub's stack merge, which merges every layer up to the one chosen in a single all-or-nothing operation, so no host on main is left on the old configuration. CI on layers 2 to 5 fails for the hosts that a later layer adopts. If that blocks the stack merge, merge 6 into 5, and so on down to 3 into 2, then squash 2 into main. The stack replaces #1960.

  1. feat(truapi): resolve a Trinity stack from a signed descriptor #1963 the Stack type
  2. feat(truapi)!: take chain config from the Trinity stack #1964 the core takes its chain configuration from the stack
  3. feat(cli)!: hand the core the stack the CLI resolved #1965 CLI (this PR)
  4. feat(truapi-host)!: take the stack in ProductRuntimeConfig #1966 @parity/truapi-host and the test host
  5. feat(ios)!: bundle each build's Trinity stack #1967 iOS
  6. feat(android)!: bundle each build's Trinity stack #1968 Android

The CLI builds the core's stack from the network it resolved: the descriptor's
network, which get_chain_info reports as an app bundling the same stack does,
its TLD, and the People, Bulletin and Asset Hub it serves. The descriptor's
id stays the product namespace and state directory, and feature_supported
answers from the served roles.

The core allows the stack Polkadot's reserved values, since the CLI vouches
for them itself: no stack runs under the polkadot namespace, and a chain with
one of Polkadot's genesis hashes runs only once the chain checks show it is a
fork. That is what lets pcf-devnet run on `dot`.
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

CI Status: not green, 4 items need attention.

  • ts-host: failure
  • host-wasm: failure
  • bundle-size: failure
  • changeset-guard: failure
All job results
job result
android-app skipped
android-bindings skipped
bundle-size failure
changes success
changeset-guard failure
cli-package success
codegen success
e2e skipped
explorer success
headless-install success
host-wasm failure
ios-app skipped
ios-bindings success
licenses success
playground success
provider-android-bindings skipped
release-guard success
rust success
ts-client success
ts-debugger success
ts-host failure
ts-trinity-stack success
wasm-provider success
workflow-lint skipped

Signing credentials: valid as of 2026-11-06

Commit 33cf7604 · run log

@Mikelle
Mikelle added this pull request to stack #1969 November 6, 2026 18:57
`CliPlatform` keeps the network's `Roles` of genesis hashes and answers
`feature_supported` from them, so `served_roles`, which only tests read
with its chain identifiers, moves to the test-only `network::testing`.
The test that guarded the served set against a dropped role goes, since
`Roles` holds all three by type. `core_stack` says it relies on
`NetworkSource::resolve_checked` having checked Polkadot's reserved
values. Rewraps the namespace doc, the `feature_supported` test doc and
the SPEC paragraph.
It states what the core stack holds and that it is only for a stack from
`NetworkSource::resolve_checked`, and links there instead of restating
the checks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100 to 499 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant