Skip to content

Commit d8bab31

Browse files
authored
Merge pull request #1037 from DMRobertson/dmr/state-res-bold-defs
Stateres v2: Use bold to introduce definitions.
2 parents 6146806 + 05da3dc commit d8bab31

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Improve readability of definitions in the state resolution v2 algorithm.
2+

content/rooms/fragments/v2-state-res.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,33 @@ The state resolution algorithm for version 2 rooms uses the following
2323
definitions, given the set of room states
2424
{*S*<sub>1</sub>, *S*<sub>2</sub>, …}:
2525

26-
Power events
26+
**Power events.**
2727
A *power event* is a state event with type `m.room.power_levels` or
2828
`m.room.join_rules`, or a state event with type `m.room.member` where
2929
the `membership` is `leave` or `ban` and the `sender` does not match the
3030
`state_key`. The idea behind this is that power events are events that
3131
might remove someone's ability to do something in the room.
3232

33-
Unconflicted state map and conflicted state set
33+
**Unconflicted state map and conflicted state set.**
3434
The *unconflicted state map* is the state where the value of each key
3535
exists and is the same in each state *S*<sub>*i*</sub>. The *conflicted
3636
state set* is the set of all other state events. Note that the
3737
unconflicted state map only has one event per `(event_type, state_key)`,
3838
whereas the conflicted state set may have multiple events.
3939

40-
Auth difference
40+
**Auth difference.**
4141
The *auth difference* is calculated by first calculating the full auth
4242
chain for each state *S*<sub>*i*</sub>, that is the union of the auth
4343
chains for each event in *S*<sub>*i*</sub>, and then taking every event
4444
that doesn't appear in every auth chain. If *C*<sub>*i*</sub> is the
4545
full auth chain of *S*<sub>*i*</sub>, then the auth difference is
4646
 ∪ *C*<sub>*i*</sub> −  ∩ *C*<sub>*i*</sub>.
4747

48-
Full conflicted set
48+
**Full conflicted set.**
4949
The *full conflicted set* is the union of the conflicted state set and
5050
the auth difference.
5151

52-
Reverse topological power ordering
52+
**Reverse topological power ordering.**
5353
The *reverse topological power ordering* of a set of events is the
5454
lexicographically smallest topological ordering based on the DAG formed
5555
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
7171
selecting, among all the candidate vertices, the smallest vertex using
7272
the above comparison relation.
7373

74-
Mainline ordering
74+
**Mainline ordering.**
7575
Given an `m.room.power_levels` event *P*, the *mainline of* *P* is the
7676
list of events generated by starting with *P* and recursively taking the
7777
`m.room.power_levels` events from the `auth_events`, ordered such that
@@ -96,7 +96,7 @@ events: for events *x* and *y*, *x* &lt; *y* if
9696
same `origin_server_ts`, but *x*'s `event_id` is *less* than *y*'s
9797
`event_id`.
9898

99-
Iterative auth checks
99+
**Iterative auth checks.**
100100
The *iterative auth checks algorithm* takes as input an initial room
101101
state and a sorted list of state events, and constructs a new room state
102102
by iterating through the event list and applying the state event to the

0 commit comments

Comments
 (0)