diff --git a/sandbox/tx_handler.go b/sandbox/tx_handler.go index a6048bf94ebd574aee5f8a954a0779bfdd1d8d5e..58323b43f9cd3e43e6e520abc1b9b8b78ff00b0b 100644 --- a/sandbox/tx_handler.go +++ b/sandbox/tx_handler.go @@ -195,6 +195,12 @@ func (h *TxHandler) handleTxRequest(msg *protogo.DockerVMMessage) error { txResponse.Events = responseEvents } else { + // If tx failed, we don't need to return wset and rset: + // - wset: wset is always dropped for fail + // - rset: rset can not be dropped for fail + // - from simContext: simContext already has such keys, value is not important + // - from wset: simContext don't have such keys, but it will not cause conflict for applying simContext, + // because even if other txs are written first, the read set here will eventually be dropped txResponse.Code = protogo.DockerVMCode_FAIL txResponse.Result = []byte(response.Message) txResponse.Message = "Fail"