Comparison of encrypted values with TFHE.min() returns error

In one project, I was trying to find all the elements smaller than the threshold value from a given array and push it into another smaller array. To compare the values, I used the following:

if(TFHE.decrypt(TFHE.eq(TFHE.min(encryptedThresholdValue, sumOfDifferenceSet[i]), sumOfDifferenceSet[i])))
{
smallerArray.push(sumOfDifferenceSet[i]);
}

It seemed to work fine, even like couple of days ago, but now it doesn’t seem to work. It shows this error everytime:

[block:252704 txIndex:0]from: 0xd7B...52505to: EncryptedHospitals.compareWithThresholdValue(uint32) 0x10a...42f1Cvalue: 0 weidata: 0x2d4...0001elogs: 0hash: 0x14d...15afd

Please tell me what’s wrong, and how do I fix it.

We’ve updated our stack to fhEVM 0.4.0, including the devnet. For example, decrypt is deprecated in favor of asynchronous decryption. See Decrypt and reencrypt | 0.4 | fhEVM

I recommend you to use our hardhat template to work locally because it also includes Oracle contracts for async decryption GitHub - zama-ai/fhevm-hardhat-template: fhEVM hardhat template