From 45440197defab29b6ff408b3e5a7a51d49de7972 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Wed, 1 Jun 2022 15:02:31 +0100 Subject: [PATCH] Better description of the mainline of a PL event. --- content/rooms/fragments/v2-state-res.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/content/rooms/fragments/v2-state-res.md b/content/rooms/fragments/v2-state-res.md index e666d7f8..cd73e2ad 100644 --- a/content/rooms/fragments/v2-state-res.md +++ b/content/rooms/fragments/v2-state-res.md @@ -82,10 +82,15 @@ selecting, among all the candidate vertices, the smallest vertex using the above comparison relation. **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 -*P* is last. Given another event *e*, the *closest mainline event to* +Let *P* = *P*0 be an `m.room.power_levels` event. +Starting with *i* = 0, repeatedly fetch *P**i*+1, the +`m.room.power_levels` event in the `auth_events` of *Pi*. +Increment *i* and repeat until *Pi* has no `m.room.power_levels` +event in its `auth_events`. +The *mainline of P*0 is the list of events + [*P*n , ... , *P*1, *P*0]. + +Given another event *e*, the *closest mainline event to* *e* is the first event encountered in the mainline when iteratively descending through the `m.room.power_levels` events in the `auth_events` starting at *e*. If no mainline event is encountered when iteratively