Skip to content

Add delegation PIR precompute cache#31

Merged
greg0x merged 4 commits into
mainfrom
greg/zkp1-pir-prep
May 1, 2026
Merged

Add delegation PIR precompute cache#31
greg0x merged 4 commits into
mainfrom
greg/zkp1-pir-prep

Conversation

@greg0x
Copy link
Copy Markdown
Contributor

@greg0x greg0x commented May 1, 2026

Summary

  • add a cached IMT proof table and migration for pre-submit delegation PIR work
  • add precompute_delegation_pir for real-note and padded-note nullifier proofs
  • validate fetched PIR Merkle proofs against the requested nullifier and expected IMT root before caching
  • load cached proofs during ZKP Use Creator::build_from_parts for governance PCZT construction #1 so submit-time work can focus on proof generation

Testing

  • cargo check -p zcash_voting

Notes

This keeps the PIR proof validation added in #30 and applies it before cached proofs are persisted.

Copy link
Copy Markdown
Contributor

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you run cargo test --workspace, there are 20 failing storage tests from the db migration that was added.

As a drive by we should add this to our CI so we catch it

greg0x added 2 commits May 1, 2026 19:36
Migration to version 7 added imt_proofs to 001_init.sql, but the v3/v4/v5/v6
drop-all-recreate blocks didn't include it in their DROP TABLE list. On a fresh
DB migrating up through every version, v3 succeeded (creating imt_proofs from
the new init.sql), then v4's re-run of init.sql collided on CREATE TABLE
imt_proofs and panicked all 20 storage tests that go through the test_db helper.

Add the drop and a comment on v3 noting that future drop-all migrations have to
cover every table currently in 001_init.sql.
The repo only had a lockfile guard workflow, so the v7 migration regression
that broke 20 storage tests went undetected on the PR. Add a minimal test job
that runs cargo test --workspace --locked on push and PR.
@greg0x greg0x requested a review from czarcas7ic May 1, 2026 17:36
@greg0x greg0x merged commit a0abc20 into main May 1, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants