Skip to content

feat(comid): enforce acyclic constraint on dependency-triples#260

Merged
thomas-fossati merged 1 commit intoveraison:mainfrom
rsampaio:feature/dependency-triple-acyclic
Mar 29, 2026
Merged

feat(comid): enforce acyclic constraint on dependency-triples#260
thomas-fossati merged 1 commit intoveraison:mainfrom
rsampaio:feature/dependency-triple-acyclic

Conversation

@rsampaio
Copy link
Copy Markdown
Contributor

Per draft-ietf-rats-corim 5.1.11.2, a domain-id MUST NOT appear in its trustees list. Add the check to DomainDependencyTriple.Valid() and extend the test suite accordingly.

Copy link
Copy Markdown
Contributor

@thomas-fossati thomas-fossati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much! LGTM.

I have a couple of comments which could be addressed either in this PR or in a future changeset:

  1. The DomainDependencyTriple::Valid function could also check for duplicate trustees
  2. DomainDependencyTriples::Valid could do more than call the Valid function for individual triples; it could also check the overall consistency of the dependency graph expressed by all the DDTs present and flag cycles across triples.

@rsampaio rsampaio force-pushed the feature/dependency-triple-acyclic branch from 5d8183d to 37de8b1 Compare March 26, 2026 19:28
@rsampaio
Copy link
Copy Markdown
Contributor Author

@thomas-fossati good call on the second validation, I added here since it is open and relevant to recent changes! Thanks for the feedback!

Extend DomainDependencyTriple.Valid() to reject direct self-references
and duplicate trustees. Extend DomainDependencyTriples.Valid() with DFS
cycle detection across the full dependency graph (§5.1.11.2).

Signed-off-by: Rodrigo Sampaio Vaz <rvaz@nvidia.com>
@rsampaio rsampaio force-pushed the feature/dependency-triple-acyclic branch from 37de8b1 to 572b665 Compare March 26, 2026 19:30
Copy link
Copy Markdown
Contributor

@thomas-fossati thomas-fossati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you again!

Your cycle-detection choice is an interesting one. Personally, I’d have used topo sorting and, because I am a lazy individual, I’d have pilfered one of the existing packages (e.g., stevenle/topsort/v2 or similar) :-)

@rsampaio
Copy link
Copy Markdown
Contributor Author

Thank you again!

Your cycle-detection choice is an interesting one. Personally, I’d have used topo sorting and, because I am a lazy individual, I’d have pilfered one of the existing packages (e.g., stevenle/topsort/v2 or similar) :-)

I went with DFS because it was compact enough for this use case, agree that topo sorting would also work :)

@thomas-fossati thomas-fossati merged commit 182146a into veraison:main Mar 29, 2026
5 checks passed
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.

2 participants