Logical Clocks for Optimistic Replication