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.
This commit is contained in:
Jerry 2023-06-06 21:36:36 -07:00 committed by GitHub
parent 47f8e8682a
commit f96c668baf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,