fix(tally): fix shared default ciphertext in tally selection#810
fix(tally): fix shared default ciphertext in tally selection#810mdevolde wants to merge 7 commits intoElection-Tech-Initiative:mainfrom
Conversation
|
@lprichar @jungshadow hey, sorry for tagging you, I just wanted to know if you're still maintaining this repository? |
|
Hi @mdevolde! Thanks for the PR and the flag, and sorry I didn't see this earlier. You probably followed that ElectionGuard moved from Microsoft to the Election Technology Initiative, and we're currently trying to determine where our resources should go. The .NET implementation recently received an update and is currently being used by US election tech providers. My heart is always with Python, and I'd personally like to maintain this version, too, but we need both a business need and funding for it. Give me a few days to check with @JDziurlaj on what it would take to set up PR validation here, and I'll see if we can at least merge this in. Thanks again! |
|
Hi @jungshadow! |
|
@mdevolde, I hear you, and I agree. We had high hopes that this project and its goals would attract significant financial support. Sadly, it hasn't worked out that way, so we're trying to be as strategic as possible with the support we have. |
|
I apologize for the noise on this PR, I have to close and reopen the PR to force GitHub actions. |
No problem ! on:
workflow_dispatch: |
Issue
Fixes #809
Description
This change updates
CiphertextTallySelection.ciphertextto usedefault_factoryinstead of a sharedElGamalCiphertextinstance as a dataclass field default. That ensures eachCiphertextTallySelectiongets its own ciphertext value rather than sharing the same default object across instances.The behavior avoids unintended shared state if the default ciphertext is ever mutated in place, and also resolves the dataclass validation error raised by Python 3.11 for mutable defaults.
I ran the tests locally:
poetry run pytest tests/unit,poetry run pytest tests/property,poetry run pytest tests/integration(on python 3.9.21, on windows 11). I built the project withpoetry buildon the same environment.Testing
Run the relevant tally-related test suites with:
These validate that
CiphertextTallySelectionstill behaves correctly.