Skip to content

spike(environment): topology → upstream LocalNet feasibility PoC - #345

Closed
srikanth-bitdynamics wants to merge 2 commits into
mainfrom
spike/env-topology
Closed

srikanth-bitdynamics wants to merge 2 commits into
mainfrom
spike/env-topology

Conversation

@srikanth-bitdynamics

Copy link
Copy Markdown
Collaborator

Draft / spike — not for merge. A Phase-0 feasibility probe for the environment topology compiler (the big "network-of-networks" plan): can DevKit compile a developer-described multi-validator / multi-synchronizer topology into the upstream Splice LocalNet via generated config + a compose override, without forking the stack?

Verdict: feasible

The upstream LocalNet is built for this. Evidence (from canton-network/splice cluster/compose/localnet/, interface identical 0.6–0.8):

  • The single canton container bind-mounts its config (${LOCALNET_DIR}/conf/canton/app.conf) — nothing baked. app.conf assembles the topology from reusable _participant/_storage anchors via include, so each participant is just canton.participants.<name> = ${_participant} { db, ports }.
  • Postgres provisions DBs from CREATE_DATABASE_* env.
  • A multi-sync bootstrap already exists upstream (multi-sync-startup/multi-sync-ready + conf/console/app-synchronizer.sc) — to generalize, not invent.

What's here

  • internal/environment/ — model + generator that emits participant HOCON and a compose.override.yaml (ports + DBs) from a topology. Not wired to any CLI yet.
  • docs/design/env-topology-spike.md — the mechanism, chosen injection strategy (generated env dir + override, upstream compose used unmodified via -f), and open risks.
  • examples/environments/consortium-lab.yaml — the flagship target topology (schema doc; parser not built).

Validated

docker compose config merges the generated override over the real upstream compose.yaml + resource-constraints.yaml and carries the injected participant's ports, DB env, and generated app.conf mount — upstream cache untouched. Proven by TestComposeConfigValidates (gated behind DEVKIT_ENV_SPIKE_DOCKER=1; normal go test runs only hermetic render assertions). gofmt + build + tests green.

NOT yet validated (next)

docker compose config checks the compose layer only. Still to prove: HOCON parses + Canton boots with generated participants; generated sequencer/mediator + app-synchronizer.sc bootstrap; connect + enable multi-sync; type: base resolution; and Validator App onboarding assumptions (the highest risk). See the design note's Milestone-A list.

🤖 Generated with Claude Code

…ated config + override

Phase-0 feasibility spike for the environment topology compiler — multiple
validators / synchronizers, compiled into an upstream Splice LocalNet without
forking the stack.

internal/environment generates, from a hard-coded topology: participant HOCON
reusing upstream's `_participant` anchor, and a compose.override.yaml that
publishes ports and provisions per-participant databases via CREATE_DATABASE_*.
Layered over the real upstream compose.yaml + resource-constraints.yaml,
`docker compose config` validates and carries the injected participant with the
upstream cache untouched. Confirmed by a gated end-to-end test
(DEVKIT_ENV_SPIKE_DOCKER=1 go test ./internal/environment/...).

Not wired to any CLI command; this seeds the module structure and records the
mechanism, the chosen injection strategy, and the open risks (Validator App
onboarding, synchronizer bootstrap) in docs/design/env-topology-spike.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…lNet

Publish the generated participant's gRPC health port in the compose override
(the canton image ships grpc-health-probe), and add TestGate1_Boot: a gated
integration test that boots the pinned upstream LocalNet with the generator's
participant HOCON + override applied and asserts the Gate-1 condition — canton
+ splice reach healthy (so the generated HOCON parsed and all participants
instantiated), the generated Postgres databases exist, and each generated
participant's gRPC health reports SERVING.

Verified against real Splice 0.6.12: canton/splice healthy with project-a and
project-b added, both databases present, both participants SERVING on their
gRPC health ports, clean teardown. Gate 1 proves only that arbitrary generated
participants load without breaking Canton; validator onboarding is Gate 2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@srikanth-bitdynamics
srikanth-bitdynamics deleted the spike/env-topology branch September 22, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant