Repository navigation
feat(cli)!: run every network from its stack descriptor - #1944
Conversation
Bundle size reportCompared with
WebAssembly modules
Changed files (3)
Commit: 4f00b09 |
|
CI Status: 24 required jobs green, 21 passed and 3 skipped by path filter. All job results
Signing credentials: valid as of 2026-11-06 Commit |
pgherveou
left a comment
There was a problem hiding this comment.
Suggestion, here or in a follow-up: make the stack descriptor the CLI's only network source. The same fields now live in four shapes (Descriptor, StackProjection, NetworkConfig, LocalNetwork), the CLI decodes descriptor hex that trinity-stack already decoded while validating, and Network::id() repeats each bundled descriptor's id.
Rough shape:
- trinity-stack gets parsed accessors:
Chain::genesis(),Descriptor::service(kind),Descriptor::dotns_address(key). NetworkConfigandStackProjectionbecome oneStacknewtype that owns the descriptor, is built once the host checks pass (includingdubanddotns.popController), and exposes infallible accessors.- Drop
HOST_CLI_*_WS,HOST_CLI_IDENTITY_BACKEND_BASEandHOST_CLI_DOTNS_POP_CONTROLLER: since #1885--stackcovers forks and local networks, and polkadot-pop-e2e can pass the stack it already reads asHOST_CLI_STACK.HOST_CLI_LOCAL_NETWORK_CONFIGstays for now, applied as an edit to the descriptor.
Details, risks and a commit plan: https://gist.github.com/pgherveou/de670d60ac70da6d1d4c177b52eb7d17
Did it all in this PR, except two things. HOST_CLI_LOCAL_NETWORK_CONFIG is gone too instead of becoming a descriptor edit, since the CLI needs a DUB and the rest of a stack anyway, so a local network is just a |
Check the flag combinations once at startup in NetworkSource::new, so a source with both cannot exist. Covers --network and --stack given on opposite sides of the subcommand, which clap's conflicts_with misses for global args.
A fork or a local network now runs from its stack descriptor alone, for example
truapi-host --stack ./local-stack.json signing-hostHOST_CLI_PEOPLE_WS,HOST_CLI_ASSET_HUB_WS,HOST_CLI_BULLETIN_WS,HOST_CLI_IDENTITY_BACKEND_BASE,HOST_CLI_DOTNS_POP_CONTROLLERandHOST_CLI_LOCAL_NETWORK_CONFIGare removedlocal-network-checkcommand is removedws://andhttp://URLsdubservice ordotns.popControlleris refused for every commanddotns.popControllerinstead of looking the controller up on chainidor TLD, or that the CLI cannot run, is rejected with a warning, and the bundled copy is usedstack bundlenow also refuses a copy that changes theid, and a built-in network's copy the CLI cannot run on--network pcf-devnetruns on PCF's devnet from its signed descriptor, as a test network like paseo-next-v2 and previewnet--network polkadotis removed--stackchain with one of Polkadot's genesis hashes now runs when it is a fork of Polkadot--stackmay now use thedotTLD, so a Polkadot fork with the idpolkadot-forkruns under its own namespaceChain::genesis,Descriptor::serviceandDescriptor::dotns_addressreturn a validated descriptor's values as bytesE2E_LIVE_CHAINis removedUnlike RFC 2, where only a host build may introduce a stack on Polkadot's genesis hashes or
dot, this CLI runs any fork and refuses only chains that are Polkadot itself, since its accounts are throwaway test accounts and a fork's own blocks keep its signatures off mainnet.Part of #1312