Skip to content

Generate message and group IDs in a forward-compatible way

akwizgran requested to merge forward-compatible-message-ids into master

This branch changes the way message and group IDs are calculated to allow compatibility with future versions of the sync protocol:

  • Include the message/group format version in the ID calculation, instead of the sync protocol version. This allows the sync protocol to be upgraded independently of the message/group formats. (When we add support for multi-block messages we'll need a new version of the sync protocol that syncs blocks instead of messages, but the message and group formats don't need to change.)
  • Calculate the ID of a message from its group ID, timestamp and root hash, rather than by including the message body in the ID hash. This will allow us to calculate the IDs of multi-block messages without re-hashing the whole message. The cost is an extra hash calculation for single-block messages.

Merge request reports