bug: Extremities referenced by soft-failed/rejected events are never culled until trailed by a dummy event #2123

Closed
opened 2026-08-10 15:06:38 +00:00 by nex · 4 comments
Owner

Rejected and soft-failed events do not count towards referencing, per the spec, however this means servers can incorrectly build up an extremity list of events that have actually been referenced. For example:

A -> B -> C -> D

In this case, if B soft-fails on only some servers, both A and D will become forward extremities, despite B being indirectly referenced via B <- C <- D. However, on servers B did not soft-fail on, it will not be a forward extremity, and only D will correctly be.

The result of this is servers are incorrectly building up extremities that are not actually extremities due to a circumstantial view of the room. These extremities are then only culled when enough are built up for the server to start a squash, which might then mean the server references events from ages ago, which can even cause state resets.

Rejected and soft-failed events do not count towards referencing, per the spec, however this means servers can incorrectly build up an extremity list of events that have actually been referenced. For example: `A -> B -> C -> D` In this case, if `B` soft-fails on only some servers, both `A` and `D` will become forward extremities, despite `B` being indirectly referenced via `B <- C <- D`. However, on servers `B` did not soft-fail on, it will not be a forward extremity, and only `D` will correctly be. The result of this is servers are incorrectly building up extremities that are not actually extremities due to a circumstantial view of the room. These extremities are then only culled when enough are built up for the server to start a squash, which might then mean the server references events from ages ago, which can even cause state resets.
Author
Owner

Related: #2016 can exacerbate this issue by erroneously rejecting memberships and consequently every subsequent event depending on those memberships

Related: #2016 can exacerbate this issue by erroneously rejecting memberships and consequently every subsequent event depending on those memberships
Author
Owner

Technically speaking, soft-fails SHOULD affect references (whereas rejections never do), but soft-failed events cannot themselves become extremities. This is a problem, because historically we did this correctly, but that caused the extremity table to organically drain itself. And when there's no extremities, you can't create new events.

Technically speaking, soft-fails SHOULD affect references (whereas *rejections* never do), but soft-failed events cannot themselves become extremities. This is a problem, because historically we did this correctly, but that caused the extremity table to organically drain itself. And when there's no extremities, you can't create new events.
Author
Owner

A possible solution here is to do a topological walk of extremities to determine which ones are actually reachable in the tree even through soft-failed events, but this would be expensive, and would probably be best performed before starting a squash process. That's still uncomfortable though as we default to allowing 10 extremities to build up before considering a squash

A possible solution here is to do a topological walk of extremities to determine which ones are actually reachable in the tree even through soft-failed events, but this would be expensive, and would probably be best performed before starting a squash process. That's still uncomfortable though as we default to allowing 10 extremities to build up before considering a squash
Author
Owner

A potential fix for soft-fails specifically is nex/continuwuity@59ebd1719b. Rejections will be harder, so see above I guess

A potential fix for soft-fails specifically is https://forgejo.ellis.link/nex/continuwuity/commit/59ebd1719b83bb80e3f71c81c2972730168d2c85. Rejections will be harder, so see above I guess
nex closed this issue 2026-08-22 19:19:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
continuwuation/continuwuity#2123
No description provided.