added check to suppress unnecessary log warning#123
Conversation
- Add make_ methods to reduce constructor issues - - Remove InitVar - Add deserialization for ElementModP and ElementModQ
Remove the camelcase (and accompanying snakecase) conversion due to issues with jsons library
| log_warning( | ||
| f"missing nonce for ballot {self.object_id} could not derive from null nonce" | ||
| ) | ||
| if not isinstance(self, CiphertextAcceptedBallot): |
There was a problem hiding this comment.
why dont we just get rid of the error message entirely? or change it to log_debug? i think that's preferable over checking the subclassed type, right?
There was a problem hiding this comment.
I'm fine with nuking this entirely. If you're going to keep any sort of logging here, it should only happen with dealing with CiphertextBallots in other states. A CiphertextAcceptedBallot will never have a nonce in it.
…give a useful answer
|
So I had an a-ha moment. This particular method doesn't actually care if the nonce is absent. We're computing a hash value over various things. If the nonce isn't there, we can still compute a hash value. Anyway, I pushed a change that gets rid of the warning check altogether. I think this is fine. |
|
Food for thought: should the nonce actually be included in this particular computation? I don't know exactly where we're calling this method, but if we want the same result for a CiphertextBallot and its corresopnding CiphertextAcceptedBallot, then the nonce should not be included in what's being passed to |
Issue
Fixes #122
Description
Makes the warning conditional on the instance type of the CiphertextBallot. If it's a CiphertextAcceptedBallot, then no warning is generated. Otherwise, behavior is identical.
(This patch is only relevant to the
fix/deserialization-issuesbranch, where it's -3+4 lines. If you compare it tomain, it's much bigger.)Testing
In regular use, should have no effect on testing. But logs will be cleaner, easier to read.
Checklist
🚨Please review the guidelines for contributing to this repository.
💚Thank you!