diff --git a/events/db_update.go b/events/db_update.go index a6865b8707..1d802d3e3a 100644 --- a/events/db_update.go +++ b/events/db_update.go @@ -22,12 +22,24 @@ type UpdateChannel = immutable.Option[Channel[Update]] // EmptyUpdateChannel is an empty UpdateChannel. var EmptyUpdateChannel = immutable.None[Channel[Update]]() -// UpdateEvent represents a new DAG node added to the append-only MerkleCRDT Clock graph -// of a document or sub-field. +// UpdateEvent represents a new DAG node added to the append-only composite MerkleCRDT Clock graph +// of a document. +// +// It must only contain public elements not protected by ACP. type Update struct { - DocID string - Cid cid.Cid + // DocID is the unique immutable identifier of the document that was updated. + DocID string + + // Cid is the id of the composite commit that formed this update in the DAG. + Cid cid.Cid + + // SchemaRoot is the root identifier of the schema that defined the shape of the document that was updated. SchemaRoot string - Block ipld.Node - Priority uint64 + + // Block is the contents of this composite commit, it contains the Cids of the field level commits that + // also formed this update. + Block ipld.Node + + // Priority is used to determine the order in which concurrent updates are applied. + Priority uint64 }