From 5181de4080bca02a26669883a98f567b287fbaf1 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 29 Apr 2022 15:34:44 +0100 Subject: [PATCH 1/2] Stateres v2: Use bold to introduce definitions. Otherwise they are inline into the paragraph without punctuation, and hard to read. I'm guessing that pandoc did a poor job of converting a LaTeX `begin{description}...\end{description}` or `\paragraph{...} ...` to Markdown. --- content/rooms/fragments/v2-state-res.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/rooms/fragments/v2-state-res.md b/content/rooms/fragments/v2-state-res.md index 508f9c1a8..b238e1d82 100644 --- a/content/rooms/fragments/v2-state-res.md +++ b/content/rooms/fragments/v2-state-res.md @@ -23,21 +23,21 @@ The state resolution algorithm for version 2 rooms uses the following definitions, given the set of room states {*S*1, *S*2, …}: -Power events +**Power events.** A *power event* is a state event with type `m.room.power_levels` or `m.room.join_rules`, or a state event with type `m.room.member` where the `membership` is `leave` or `ban` and the `sender` does not match the `state_key`. The idea behind this is that power events are events that might remove someone's ability to do something in the room. -Unconflicted state map and conflicted state set +**Unconflicted state map and conflicted state set.** The *unconflicted state map* is the state where the value of each key exists and is the same in each state *S**i*. The *conflicted state set* is the set of all other state events. Note that the unconflicted state map only has one event per `(event_type, state_key)`, whereas the conflicted state set may have multiple events. -Auth difference +**Auth difference.** The *auth difference* is calculated by first calculating the full auth chain for each state *S**i*, that is the union of the auth chains for each event in *S**i*, and then taking every event @@ -45,11 +45,11 @@ that doesn't appear in every auth chain. If *C**i* is the full auth chain of *S**i*, then the auth difference is  ∪ *C**i* −  ∩ *C**i*. -Full conflicted set +**Full conflicted set.** The *full conflicted set* is the union of the conflicted state set and the auth difference. -Reverse topological power ordering +**Reverse topological power ordering.** The *reverse topological power ordering* of a set of events is the lexicographically smallest topological ordering based on the DAG formed by auth events. The reverse topological power ordering is ordered from @@ -71,7 +71,7 @@ events using Kahn's algorithm for topological sorting, and at each step selecting, among all the candidate vertices, the smallest vertex using the above comparison relation. -Mainline ordering +**Mainline ordering.** Given an `m.room.power_levels` event *P*, the *mainline of* *P* is the list of events generated by starting with *P* and recursively taking the `m.room.power_levels` events from the `auth_events`, ordered such that @@ -96,7 +96,7 @@ events: for events *x* and *y*, *x* < *y* if same `origin_server_ts`, but *x*'s `event_id` is *less* than *y*'s `event_id`. -Iterative auth checks +**Iterative auth checks.** The *iterative auth checks algorithm* takes as input an initial room state and a sorted list of state events, and constructs a new room state by iterating through the event list and applying the state event to the From 05da3dc621bbbc455c93e86f519cb0e409c3ce01 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 29 Apr 2022 15:47:39 +0100 Subject: [PATCH 2/2] Changelog --- changelogs/room_versions/newsfragments/1037.clarification | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/room_versions/newsfragments/1037.clarification diff --git a/changelogs/room_versions/newsfragments/1037.clarification b/changelogs/room_versions/newsfragments/1037.clarification new file mode 100644 index 000000000..9ac53c6de --- /dev/null +++ b/changelogs/room_versions/newsfragments/1037.clarification @@ -0,0 +1,2 @@ +Improve readability of definitions in the state resolution v2 algorithm. +