-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor drive-by state res clarifications #1042
Changes from 5 commits
9455e69
4b5cc45
44b4bd3
a25c769
2950681
8c4c09f
8ab0634
8c49f00
b573c95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Clarify the meaning of "unconflicted state map" and "auth chain" in state res v2. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,11 +31,20 @@ the `membership` is `leave` or `ban` and the `sender` does not match the | |
might remove someone's ability to do something in the room. | ||
|
||
**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*<sub>*i*</sub>. 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. | ||
The key-value pairs across all state maps *S<sub>i</sub>* can be divided into | ||
two collections. If a given key *K* is present in every *S<sub>i</sub>* with the | ||
same value *V* in each state map, then the pair (*K*, *V*) belongs to the | ||
*unconflicted state map*. Otherwise (*K*, *V*) belongs to the | ||
*conflicted state set*. | ||
|
||
Note that the unconflicted state map only has one event per `(event_type, state_key)`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... switching from K to |
||
whereas the conflicted state set may associate multiple events to the same key. | ||
|
||
**Auth chain.** | ||
The *auth chain* of an event *E* is the set containing all of *E*'s auth events, | ||
all of *their* authorising events, and so on recursively, stretching back to the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. possibly we should stick to the term "auth events" rather than switching to "authorising events" ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is 8c49f00 |
||
start of the room. Put differently, these are the events reachable by walking | ||
the graph induced by an event's `auth_events` links. | ||
|
||
**Auth difference.** | ||
The *auth difference* is calculated by first calculating the full auth | ||
|
@@ -112,9 +121,9 @@ the auth event is not rejected. | |
|
||
The *resolution* of a set of states is obtained as follows: | ||
|
||
1. Take all *power events* and any events in their auth chains, | ||
recursively, that appear in the *full conflicted set* and order them | ||
by the *reverse topological power ordering*. | ||
1. Select all *power events* that appear in the *full conflicted set*. Compute | ||
the union of their auth chains. Sort the union using the | ||
DMRobertson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
*reverse topological power ordering*. | ||
DMRobertson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
2. Apply the *iterative auth checks algorithm*, starting from the | ||
*unconflicted state map*, to the list of events from the previous | ||
step to get a partially resolved state. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it obvious that K is a
(event_type, state_key)
pair, or is there a way we can make that obvious?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be helpful if there was a phrase which meant
(event_type, state_key)
. How about 8ab0634?