[#1924] Add Android voting delegation proof and submission#1950
Merged
Conversation
noop-sk
reviewed
May 12, 2026
noop-sk
reviewed
May 12, 2026
greg0x
commented
May 12, 2026
nullcopy
reviewed
May 12, 2026
Finishes the typed-JNI cutover started by the prior fixups by removing the last JSON-serialized payload (governance PCZT result) and the helper module that supported it. With this commit no voting JNI surface uses serde_json — every input and output crosses the boundary as a typed Jni* model. - Convert buildGovernancePcztJsonNative -> buildGovernancePcztNative and return a typed JniGovernancePczt instead of a JSON string. - Drop voting/json.rs entirely; the typed builders in helpers.rs and the Jni* models in JniVotingModels.kt replace JsonGovernancePczt. - Drop the serde and serde_json dependencies from backend-lib's Cargo.toml; no Rust code under voting uses them anymore. - TypesafeVotingDbImpl no longer parses JSONObject — it consumes JniGovernancePczt directly via toGovernancePcztResult().
6ecc93d to
173060e
Compare
13 tasks
nullcopy
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of zodl-inc/zodl-android#2193.
Slice of #1924 (umbrella draft PR being split into reviewable pieces).
Stacked on #1942 (PR 4 — delegation setup + governance PCZT prep).
Resolves MOB-1109
Why
Fifth slice of the Android shielded-voting integration. PR 4 (#1942) lands the
delegation setup primitives, hotkey, and governance PCZT/sighash prep. This PR
finishes the delegation half of the workflow: enabling
client-pir, persistingwitnesses, running PIR precompute, generating the delegation proof with progress
reporting, and producing the signed submission payload (including the
Keystone-supplied-signature variant).
No public
Synchronizervoting API is added.What's in
client-pirfeature onzcash_votingis now enabled; lockfile delta is mostlythe PIR transport stack (
pir-client,pir-types,valar-ypir,valar-spiral-rs,hyper-rustls).proof + progress callback, signed submission, Keystone-signature submission.
voting/progress.rsmodule hostingJniProgressReporter; the onlyper-thread JNI attach pattern in the voting backend so far.
On the
VotingDbBackendseamThe typesafe Kotlin layer gains an internal
VotingDbBackendinterface and apass-through
RustVotingDbBackendwrapper soTypesafeVotingBackendImplisunit-testable without JNI. It lands here because PR 5 is the first slice with
byte-array-typed result models that need size/count validation; PR 6–8 will
extend the same surface as more typed FFI arrives, so introducing it now
avoids a retroactive horizontal refactor later. Happy to split into a tiny
infra PR if a reviewer prefers.
Not included
Review focus
Primary review track: core-dev. Secondary: mobile-app-dev.
zcash_votingclient-pirfeature transitive graph (Cargo.lockdelta).connect_pir_client) and SDK boundary for networkerrors.
progress.rsthreading and lifetime —attach_current_threadper callback,GlobalRefownership, exception-clear after failed Java call.verify_delegation_submission_sigsemantics for the Keystone variant:rkparsed as a
redpallasVerificationKey<SpendAuth>, identity rejected, sigre-verified over the supplied sighash.
require_witnesses_match_bundleinvariants (count, root, position, duplicatecommitments) before persisting to the voting DB.
VotingDb: progress callbacks must not call back into thesame handle while the access mutex is held.
DelegationProofResult/DelegationSubmissionResultbyte/list sizeinvariants enforced by the typesafe layer.
Note:
delegationProofResultFixtureNativeandstoreDelegationProofFixtureNativeare JNI fixtures used by androidTest. Open to moving these behind a debug-only
artifact if reviewers prefer.
Validation
cargo check --manifest-path backend-lib/Cargo.toml --lockedcargo fmt --manifest-path backend-lib/Cargo.toml --check./gradlew :backend-lib:compileReleaseKotlin :sdk-lib:compileReleaseKotlin./gradlew ktlint detektAll./gradlew checkPropertiesgit diff --checkAuthor
Reviewer