matrix-org / matrix-org/matrix-spec
Clarify sha1 representation in state resolution sort
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
The room version 1 spec says of state resolution:
> Sort the list by ascending depth then descending sha1(event_id)
We should clarify if it matters what sha1 representation we are using in our comparison. A lexicographic sort of the hash as a hex string or a decimal string, a numeric sort an integer, as a memcmp of bytes, etc. Presumably the goal is to achieve a stable ordering of events in the DAG, but does the ordering have to be consistent across all servers?
Contributor guide
Research direction
Start with the room version 1 specification’s state-resolution rule: “Sort the list by ascending depth then descending sha1(event_id).” Determine whether the SHA-1 comparison representation affects the intended ordering and whether servers must produce the same order. Done means the specification clearly states the comparison rule.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100