From f96c668bafb11566ba0a5001667a460a627f415d Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 6 Jun 2023 21:36:36 -0700 Subject: [PATCH] Disable reverted tx optimization in block-stm validation (#891) A reverted transaction, X, can incorrectly write to a slot, which might be read by another transaction, Y. If we skip checking states written by X, then Y might end up with reading the wrong value and we won't be able to detect this error. --- core/blockstm/mvhashmap.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/core/blockstm/mvhashmap.go b/core/blockstm/mvhashmap.go index fdaece261f..2a517bcc84 100644 --- a/core/blockstm/mvhashmap.go +++ b/core/blockstm/mvhashmap.go @@ -269,13 +269,6 @@ func ValidateVersion(txIdx int, lastInputOutput *TxnInputOutput, versionedData * mvResult := versionedData.Read(rd.Path, txIdx) switch mvResult.Status() { case MVReadResultDone: - // Having a write record for a path in MVHashmap doesn't necessarily mean there is a conflict, because MVHashmap - // is a superset of the actual write set. - // Check if the write record is actually in write set. If not, skip the key. - if mvResult.depIdx >= 0 && !lastInputOutput.HasWritten(mvResult.depIdx, rd.Path) { - continue - } - valid = rd.Kind == ReadKindMap && rd.V == Version{ TxnIndex: mvResult.depIdx, Incarnation: mvResult.incarnation,