build/devenv: toml config updates#1138
Merged
Merged
Conversation
This was referenced May 29, 2026
winder
commented
May 29, 2026
| use_legacy_configure_lane = false | ||
|
|
||
| ## Environment configuration define the topology. Eventually the topology should be the only config that is needed. | ||
| [protocol_contracts.environment_topology] |
Collaborator
Author
There was a problem hiding this comment.
Topology is now nested under the protocol_contracts config.
This was referenced May 29, 2026
makramkd
previously approved these changes
Jun 2, 2026
63e3470 to
d8b791a
Compare
env-phased.toml is a copy of env.toml without the monolith-only keys (cl_nodes_funding_eth, cl_nodes_funding_link, high_availability, [cldf]) that the phased runtime leaves unclaimed. The phased CI smoke test now boots from it and sets SMOKE_TEST_CONFIG to read its output (env-phased-out.toml).
NewEnvironmentWithRegistry now reads the top-level version schema marker, errors if it is missing an integer or is < 1, then logs and strips it so it is never dispatched to a component or flagged as an unclaimed key.
Consolidates the top-level [[aggregator]]/[[verifier]] keys under a single [committeeccv] section and moves [environment_topology] under [protocol_contracts.environment_topology], so each component reads from its own config section instead of the top-level raw config. Cfg embeds CommitteeCCVCfg/ProtocolContractsCfg with toml tags so fields still promote, keeping the ~115 existing in.Aggregator/in.Verifier/in.EnvironmentTopology call sites unchanged across monolith and e2e tests.
Restricts the nested [committeeccv] / [protocol_contracts.environment_topology] config layout to env-phased.toml, restoring the original flat top-level layout ([[aggregator]]/[[verifier]]/[environment_topology]) in env.toml and all -cl/env-one-exec configs so the non-phased monolith integration tests keep working. Cfg now accepts both shapes — monolith reads the flat fields unchanged, while NewPhasedEnvironment lifts the nested values into them after load. Also gives the committeeccv component a single typed Config + one decodeConfig (replacing the per-field decoders) and drops the redundant blockchainOutputs phase output in favor of deriving it from blockchains via the new blockchains.Outputs helper.
Each phased component declares an exported Version constant (currently 1) and verifies its config's decoded version after decode via devenvruntime.CheckConfigVersion, with third-party jd/blockchains configs versioned through a local embed-wrapper. NewPhasedEnvironment no longer decodes env-phased.toml into the transitional Cfg type, instead building an empty Cfg from the component outputs (topology from the runtime _topology), which drops the dual-layout Cfg and lenient loader.
Documents the new per-component version fields and the env-phased.toml split introduced across the last five commits.
|
Code coverage report:
|
makramkd
approved these changes
Jun 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the phased devenv configuration format by introducing explicit schema versioning and splitting the phased environment TOML into a dedicated env-phased.toml, with CI smoke tests updated to boot from the phased config.
Changes:
- Added per-component config
versionfields and centralized exact-match validation viadevenvruntime.CheckConfigVersion. - Introduced
build/devenv/env-phased.tomland adjusted phased environment bootstrapping to stop decoding phased TOML into the legacyCfgshape. - Updated phased smoke test workflow to use
env-phased.tomland readenv-phased-out.tomlviaSMOKE_TEST_CONFIG.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| changelog/2026-05-29_phased_devenv_toml_versioning.md | Documents phased TOML versioning and env-phased.toml split. |
| build/devenv/services/tokenVerifier.go | Adds version field to token verifier service input struct. |
| build/devenv/services/pricer.go | Adds version field to pricer service input struct. |
| build/devenv/services/indexer.go | Adds version field to indexer service input struct. |
| build/devenv/services/fake.go | Adds version field to fake service input struct. |
| build/devenv/services/executor/base.go | Adds version field to executor service input struct. |
| build/devenv/runtime/version.go | Adds CheckConfigVersion helper (exact-match policy). |
| build/devenv/runtime/version_test.go | Adds unit test coverage for CheckConfigVersion. |
| build/devenv/runtime/environment.go | Consumes top-level version and logs it during phased runtime startup. |
| build/devenv/runtime/environment_test.go | Adds tests for consuming/rejecting malformed top-level version. |
| build/devenv/environment_phased.go | Stops decoding phased TOML into Cfg; reconstructs from runtime outputs. |
| build/devenv/env-phased.toml | Adds dedicated phased-mode environment configuration (nested component layout + versions). |
| build/devenv/components/tokenverifier/component.go | Adds component Version constant, config validation, and version checks. |
| build/devenv/components/protocol_contracts/component.go | Adds component Version, validates/decodes nested topology config, and version checks. |
| build/devenv/components/pricer/component.go | Adds component Version and version check during decode. |
| build/devenv/components/jd/component.go | Adds component Version and wraps third-party JD config with version field. |
| build/devenv/components/indexer/component.go | Adds component Version and per-entry version checks. |
| build/devenv/components/fake/component.go | Adds component Version and version check during decode. |
| build/devenv/components/executor/component.go | Adds component Version, switches to blockchains output, and per-entry version checks. |
| build/devenv/components/committeeccv/version_test.go | Adds unit test for committeeccv config version decoding/rejection. |
| build/devenv/components/committeeccv/component.go | Unifies committee config under [committeeccv], adds Version, and updates decode/validation. |
| build/devenv/components/blockchains/component.go | Adds component Version, removes separate blockchainOutputs publication, and adds Outputs() helper. |
| build/devenv/components/blockchains/component_test.go | Updates tests to include per-entry version. |
| .github/workflows/test-smoke.yaml | Updates phased smoke test to use env-phased.toml and phased output path override. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+55
to
+68
| // version is a schema-version marker for the env file, not a component. | ||
| // Consume it here so it is never dispatched to a component or reported as | ||
| // an unclaimed key. | ||
| if v, ok := rawConfig["version"]; ok { | ||
| version, ok := v.(int64) | ||
| if !ok { | ||
| return nil, fmt.Errorf("config key %q must be an integer, got %T", "version", v) | ||
| } | ||
| if version < 1 { | ||
| return nil, fmt.Errorf("config key %q must be >= 1, got %d", "version", version) | ||
| } | ||
| logger.Info().Int64("version", version).Msg("phased environment config schema version") | ||
| delete(rawConfig, "version") | ||
| } |
Comment on lines
+40
to
+43
| ## New: top-level and per-component `version` validation | ||
|
|
||
| `env-phased.toml` must declare `version = 1` at the top level; each component section that supports versioning must also declare `version = 1`. Missing or mismatched values produce a clear startup error. | ||
|
|
| config: env.toml | ||
| config: env-phased.toml | ||
| flags: --env-mode phased | ||
| # env-phased.toml is the base config, so `ccv u` writes env-phased-out.toml. |
| version = 1 | ||
| use_legacy_configure_lane = false | ||
|
|
||
| ## Environment configuration define the topology. Eventually the topology should be the only config that is needed. |
huangzhen1997
approved these changes
Jun 2, 2026
4 tasks
winder
added a commit
that referenced
this pull request
Jun 2, 2026
Feedback for #1138 Tighten the phased runtime version check to required exact-match using CheckConfigVersion, update tests to supply version=1, and add tests for absent and wrong versions; also fix a stale topology path and grammar error in env-phased.toml and a ccv command typo in the CI workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Chain
There are multiple open pull requests that feed into each other:
Description
Testing
Checklist
changelogdirectory)just lint fix- no new lint errorsjust generate- mocks and protobufs are up to date