Assessment reports>Spectral Modelers>Low findings>Properties ,ipfsChallenge, and ,ipfsResponse, should be updated in ,updateModel
Category: Coding Mistakes

Properties ipfsChallenge and ipfsResponse should be updated in updateModel

Low Severity
Low Impact
Low Likelihood

Description

The updateModel function in the provided contract is intended to update the model commitment of a registered modeler. However, this function does not adequately handle the ipfsChallenge and ipfsResponse properties associated with the modeler. It only resets ipfsGraded, performanceResult, and medianPerformanceResults to default values. This incomplete handling could lead to inconsistencies in tracking and validating the modeler's challenges and responses over the blockchain.

function updateModel(string calldata _modelCommitment) external {
    // ...
    modelerChallenges[msg.sender].ipfsGraded = "0";
    modelerChallenges[msg.sender].performanceResult = 0;
    modelers[msg.sender].medianPerformanceResults = 0;
    // ...
}

Impact

The lack of proper management for ipfsChallenge and ipfsResponse can lead to potential mismatches or outdated information being stored on the blockchain. This might not significantly impact the system's functionality but could cause data integrity issues over time.

Recommendations

It is recommended to include the proper handling of ipfsChallenge and ipfsResponse within the updateModel function.

Remediation

This issue has been acknowledged by Spectral Finance, and a fix was implemented in commit fbe68d35.

Zellic © 2024Back to top ↑