Skip to content

MSC4242: State DAGs (CSAPI)#19424

Merged
kegsay merged 38 commits intodevelopfrom
kegan/4242-csapi
Apr 16, 2026
Merged

MSC4242: State DAGs (CSAPI)#19424
kegsay merged 38 commits intodevelopfrom
kegan/4242-csapi

Conversation

@kegsay
Copy link
Copy Markdown
Contributor

@kegsay kegsay commented Feb 3, 2026

This implements MSC4242: State DAGs, without support for federation.

A general overview:

  • It adds a new room version and new event type.
  • It adds a new field calculated_auth_event_ids to internal metadata.
  • It stores the state DAG via new state DAG edges / forward extremities tables.
  • It adds new auth rules as per the MSC.
  • It uses the new prev_state_events field instead of prev_event_ids() when doing state resolution.

Complement tests: matrix-org/complement#841

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Code style is correct (run the linters)

This implements state DAGs, without support for federation.

A general overview:
 - It adds a new room version and new event type.
 - It adds a new field `calculated_auth_event_ids` to internal metadata.
 - It stores the state DAG via new state DAG edges / forward extremities tables.
 - It adds new auth rules as per the MSC.
 - It uses the new `prev_state_events` field instead of `prev_event_ids()` when doing state resolution.
@kegsay kegsay requested a review from a team as a code owner February 3, 2026 09:33
kegsay added a commit that referenced this pull request Feb 3, 2026
Builds off #19424

Adds federation compatibility for state DAG rooms. Overview:
 - Adds extra HTTP API fields as per the MSC.
 - Adds methods for walking and extracting the state DAG for a room (for `/get_missing_events` and `/send_join` respectively).
 - Adds impl for processing the federation requests, as well as `/send`.
@kegsay kegsay mentioned this pull request Feb 3, 2026
3 tasks
Comment thread synapse/api/room_versions.py Outdated
Comment thread synapse/events/__init__.py Outdated
Comment thread synapse/api/room_versions.py Outdated
Comment thread synapse/events/__init__.py
Comment thread synapse/events/__init__.py Outdated
Comment thread tests/storage/test_msc4242_state_dag.py Outdated
Comment thread tests/storage/test_msc4242_state_dag.py
Comment thread tests/storage/test_msc4242_state_dag.py
Comment thread tests/test_event_auth.py
Comment thread tests/test_event_auth.py Outdated
Comment thread synapse/handlers/message.py
Comment thread tests/storage/test_msc4242_state_dag.py Outdated
Comment thread synapse/events/__init__.py Outdated
Comment thread synapse/handlers/admin.py Outdated
Comment thread synapse/storage/controllers/persist_events.py
Comment thread synapse/storage/controllers/persist_events.py
Comment thread synapse/storage/controllers/persist_events.py Outdated
Comment thread synapse/event_auth.py Outdated
kegsay and others added 3 commits March 10, 2026 14:49
Co-authored-by: Eric Eastwood <erice@element.io>
Co-authored-by: Eric Eastwood <erice@element.io>
Comment thread synapse/event_auth.py Outdated
Comment thread synapse/event_auth.py
Comment thread tests/storage/test_msc4242_state_dag.py Outdated
Comment thread tests/storage/test_msc4242_state_dag.py Outdated
Comment thread tests/storage/test_msc4242_state_dag.py Outdated
Comment thread tests/storage/test_msc4242_state_dag.py Outdated
Comment thread tests/storage/test_msc4242_state_dag.py
Comment thread tests/test_event_auth.py
Comment thread tests/test_event_auth.py
Comment thread synapse/storage/controllers/persist_events.py
@kegsay kegsay requested a review from MadLittleMods March 18, 2026 07:58
MadLittleMods added a commit that referenced this pull request Mar 18, 2026
Comment thread synapse/event_auth.py Outdated
Comment thread synapse/api/room_versions.py Outdated
Comment thread tests/storage/test_msc4242_state_dag.py Outdated
Comment thread synapse/handlers/admin.py Outdated
Comment thread synapse/handlers/room.py Outdated
Comment thread synapse/state/__init__.py Outdated
Comment thread synapse/storage/controllers/persist_events.py Outdated
Comment thread synapse/storage/controllers/persist_events.py
Comment thread synapse/storage/schema/main/delta/93/04_state_dag_fwd_extrems.sql Outdated
Comment thread synapse/event_auth.py Outdated
Comment thread synapse/event_auth.py Outdated
Comment thread tests/federation/test_federation_server.py Outdated
Comment thread tests/federation/test_federation_server.py Outdated
@kegsay kegsay requested a review from MadLittleMods April 8, 2026 14:20
kegsay added 2 commits April 8, 2026 16:38
- /createRoom requests forcibly set m.federate=false
- /send_join requests forcibly bail out for state DAG rooms.
Comment thread rust/src/room_versions.rs Outdated
Comment thread changelog.d/19424.feature Outdated
Comment thread synapse/handlers/room_member.py Outdated
Comment thread rust/src/events/internal_metadata.rs Outdated
Comment thread synapse/storage/schema/main/delta/94/03_state_dag_fwd_extrems.sql Outdated
Comment thread changelog.d/19424.feature Outdated
@kegsay kegsay requested a review from MadLittleMods April 14, 2026 13:26
Comment thread synapse/handlers/room_member.py Outdated
Comment thread synapse/handlers/room_member.py Outdated
Comment thread synapse/config/experimental.py
@kegsay kegsay requested a review from MadLittleMods April 15, 2026 09:49
@kegsay kegsay enabled auto-merge (squash) April 16, 2026 15:28
@kegsay kegsay merged commit 15c03b9 into develop Apr 16, 2026
46 checks passed
@kegsay kegsay deleted the kegan/4242-csapi branch April 16, 2026 15:46
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.

3 participants