mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-26 13:04:10 +01:00
Note a more efficient computation of the auth difference.
This commit is contained in:
parent
10615c5385
commit
30f6dc2293
|
|
@ -45,15 +45,19 @@ whereas the conflicted state set may associate multiple events to the same key.
|
||||||
The *auth chain* of an event *E* is the set containing all of *E*'s auth events,
|
The *auth chain* of an event *E* is the set containing all of *E*'s auth events,
|
||||||
all of *their* auth events, and so on recursively, stretching back to the
|
all of *their* auth events, and so on recursively, stretching back to the
|
||||||
start of the room. Put differently, these are the events reachable by walking
|
start of the room. Put differently, these are the events reachable by walking
|
||||||
the graph induced by an event's `auth_events` links.
|
the graph induced by an event's `auth_events` links. If *S* is a collection of
|
||||||
|
events, the *full auth chain of S* is the union of the auth chains of every
|
||||||
|
event *E* in *S*.
|
||||||
|
|
||||||
**Auth difference.**
|
**Auth difference.**
|
||||||
The *auth difference* is calculated by first calculating the full auth
|
The *auth difference* is calculated by first calculating the full auth
|
||||||
chain for each state *S*<sub>*i*</sub>, that is the union of the auth
|
chain for each state *S*<sub>*i*</sub>, and then discarding the events
|
||||||
chains for each event in *S*<sub>*i*</sub>, and then taking every event
|
belonging to each full auth chain. In symbols: if *C*(*S*) is the full auth
|
||||||
that doesn't appear in every auth chain. If *C*<sub>*i*</sub> is the
|
chain of a collection of events *S*, the auth difference is
|
||||||
full auth chain of *S*<sub>*i*</sub>, then the auth difference is
|
∪<sub>*i*</sub> *C*(*S<sub>i*</sub>) - ∩<sub>*i*</sub> *C*(*S<sub>i</sub>*).
|
||||||
∪ *C*<sub>*i*</sub> − ∩ *C*<sub>*i*</sub>.
|
This can be [computed more efficiently](https://github.com/matrix-org/matrix-spec/issues/1118) as
|
||||||
|
*C*(*F*) - ∩<sub>*i*</sub> *C*(*S<sub>i* - *F*) ,
|
||||||
|
where *F* is the full conflicted set.
|
||||||
|
|
||||||
**Full conflicted set.**
|
**Full conflicted set.**
|
||||||
The *full conflicted set* is the union of the conflicted state set and
|
The *full conflicted set* is the union of the conflicted state set and
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue