It's slowly becoming more apparent that the sid concept isn't very useful compared to having separate node_id and sequence_id fields:
We've removed gateway sequence ID's, so there's much less potential for confusion between local and remote sequence ID's
We're using a separate uint32 node ID field in various places already, including target_originator, publisher_node_id and inside EnvelopesQuery
Updating and manipulating vector clocks are now a lot more important on both server and client, and using a map<node_id, sequence_id> type is more ergonomic compared to a list of sids.
Protobufs use a varint under the hood, so there shouldn't be much size difference, exactly as @neekolas pointed out originally. This should also make the spec easier to understand and explain, and gives us more bits to work with for both node ID's and sequence ID's.
One con:
With the current server implementation using postgres, which only understands int32 and int64, there is some potential for error converting between signed and unsigned types. I'll make sure to add server code to check for overflows, with the idea that we would be migrating long before we use up the entire bit-space.
It's slowly becoming more apparent that the
sid
concept isn't very useful compared to having separatenode_id
andsequence_id
fields:uint32
node ID field in various places already, includingtarget_originator
,publisher_node_id
and insideEnvelopesQuery
map<node_id, sequence_id>
type is more ergonomic compared to a list of sids.Protobufs use a
varint
under the hood, so there shouldn't be much size difference, exactly as @neekolas pointed out originally. This should also make the spec easier to understand and explain, and gives us more bits to work with for both node ID's and sequence ID's.One con: