Optimal Record and Replay under Causal Consistency — arXiv2