Skip to content

feat(config): wire startup through resolveConfig#23409

Open
spypsy wants to merge 5 commits into
spy/resolve-configfrom
spy/config-resolution-wiring
Open

feat(config): wire startup through resolveConfig#23409
spypsy wants to merge 5 commits into
spy/resolve-configfrom
spy/config-resolution-wiring

Conversation

@spypsy
Copy link
Copy Markdown
Member

@spypsy spypsy commented May 19, 2026

Wires the aztec start startup path through resolveConfig, replacing the legacy process.env-as-merged-blob path now that the resolver and adapters from A-989/A-990 exist.

Summary

  • Build cli / env / network layers in the action handler and call resolveConfig.
  • Stop registering Commander defaults from env/mappings at registration time; argv → cliToTypedresolveConfig.
  • Drop the manual --network pre-parse and remote-network env enrichment in bin/index.ts; remove enrichEnvironmentWithNetworkConfig, enrichEnvironmentWithChainName, enrichVar.
  • Replace getConfigEnvVars() + extractRelevantOptions() merges in start_node, start_prover_broker, start_prover_agent, start_bot, start_p2p_bootstrap with per-component resolveConfig(mappings, namespace).
  • Extract OwnLocalNetworkConfig + localNetworkConfigMappings into a light local-network/config.ts and auto-generate --localNetwork.* flags via getOptions('localNetwork', localNetworkCliConfigMappings). Genesis state config (testAccounts, sponsoredFPC, prefundAddresses) is exposed there since it only matters during fresh-chain init.
  • Add resolvedToConfig<T> foundation helper and put ConfigLayerName.DEFAULT directly into ORDERED_CONFIG_LAYERS so layer extraction is uniform.
  • Rename getConfigFromMappingsbuildConfigFromEnv everywhere; it now reflects what it actually does (env + mapping defaults, no CLI / no network).

Notable change

  • Network config is no longer mutated into process.env; remote NetworkConfig is passed through networkConfigToTyped as an explicit NETWORK layer.

Fixes A-991

Test plan

  • Unit tests in aztec_start_options.test.ts, config_resolver.test.ts, cli/src/config/network_config.test.ts, foundation config.test.ts.
  • CI: e2e suites exercise aztec start --local-network and node startup.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant