feat: add isolations primitive to v1 state - #13
Open
parithosh wants to merge 2 commits into
Open
Conversation
An isolation cuts every container matched by its target selector off from every other container in the enclave. The counterparty group is computed at apply time as the complement of the target, so callers never enumerate it — a partition cannot express this because its groups must be disjoint and there is no negation selector. Resolution expands each isolation into a symmetric two-group ResolvedPartition (target vs rest), so the iptables and conntrack backends need no isolation-specific code paths. Also exposed in the web UI: isolations table + add modal on the Partitions page, dashboard count card, remove/clear-all wiring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A target matching multiple containers is isolated as a group: its members share one partition group, so traffic among them keeps flowing. Document this in the schema, README, and type comment, and add a test so the semantics can't silently change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
Adds a top-level
isolationslist to the v1 state, alongsidepartitionsandshaping:{ "isolations": [ { "name": "blackout-node-1", "target": { "node-index": 1, "client-type": "beacon" }, "scope": ["cl_p2p", "el_p2p", "include_control"] } ] }An isolation cuts every container matched by
targetoff from every other container in the enclave. The counterparty group is computed at apply time as the complement of the target's match set, so it never needs to be enumerated — and the same request keeps working when the enclave topology changes.Why
"Isolate one node" is listed as a target scenario in the design doc, but partitions can't express it:
ResolveGroupsrejects overlapping groups and there is no negation selector, so "target vs all" is unwritable. Callers (e.g. assertoor's single-node-blackout playbook, ethpandaops/assertoor#218) had to fake it with two partitions plus client-side enumeration of every other participant.How
internal/state: newIsolation{Name, Target, Scope}type; validation rejects missing/"all"targets (isolating everything leaves nothing to isolate from) and enforces the shared name namespace across partitions/isolations/shaping.internal/api:resolveIsolationsresolves the target, resolvesall, subtracts by container ID, and emits a symmetric two-groupResolvedPartition— zero changes to the iptables/conntrack backends, and conntrack teardown comes for free. Clear errors when the target matches nothing or everything.schemas/v1-state.json),--configfile loading, ETag, and deep-copy semantics all covered.examples/disruption.yaml.Testing
go test -race ./...green;golangci-lint run --new-from-rev=origin/masterreports 0 issues.Companion assertoor PR (new
run_network_disruptiontask consuming this): follows separately.🤖 Generated with Claude Code