feat: feature-flag provekit dependencies behind provekit feature#708
feat: feature-flag provekit dependencies behind provekit feature#708agentotto[bot] wants to merge 1 commit into
provekit feature#708Conversation
4f0f8f8 to
5d63a96
Compare
5d63a96 to
a87b3c5
Compare
|
/otto review |
|
I'll spin up a subagent to clone the repo and do a thorough inline code review. |
| "world-id-proof/zk-ownership-prove", | ||
| "world-id-authenticator/provekit", | ||
| "world-id-primitives/provekit", | ||
| ] |
There was a problem hiding this comment.
nit: world-id-primitives/provekit is already transitively activated via world-id-proof/zk-ownership-prove → world-id-proof/provekit → world-id-primitives/provekit. Similarly, world-id-proof/zk-ownership-prove is itself transitively activated through world-id-authenticator/provekit. So the minimal feature definition could be:
provekit = [
"authenticator",
"world-id-authenticator/provekit",
]The explicit listing is fine as defensive redundancy (protects against dependency restructuring), but adds maintenance surface. Up to you whether to keep them — if you do, a brief comment like # explicit for clarity would help future readers.
| embed-zkeys = ["world-id-proof/embed-zkeys"] | ||
| # Enable ProveKit-backed ownership proof generation. | ||
| provekit = ["world-id-proof/zk-ownership-prove", "world-id-primitives/provekit"] | ||
| # Compress the embedded zkeys to reduce binary size (ARK point compression) |
There was a problem hiding this comment.
Same nit as in core/Cargo.toml: "world-id-primitives/provekit" is already transitively activated through world-id-proof/zk-ownership-prove → provekit → world-id-primitives/provekit. Harmless, but removable for simplicity.
|
|
||
| #[cfg(any(feature = "zk-ownership-prove", feature = "zk-ownership-verify"))] | ||
| #[cfg(feature = "provekit")] | ||
| pub mod ownership_proof; |
There was a problem hiding this comment.
This widens the gate from any(feature = "zk-ownership-prove", feature = "zk-ownership-verify") to just provekit. Since both zk-ownership-prove and zk-ownership-verify imply provekit, this is semantically equivalent for those features. However, it means someone who enables only provekit (without prove or verify) will get the ownership_proof module compiled — which is effectively empty in that case since its prover and verifier sub-modules are still individually gated.
This is fine and simpler. Just noting the subtle behavior change for awareness. The build.rs correctly still uses the narrower any(zk-ownership-prove, zk-ownership-verify) gate for artifact downloads, which is right since the .pkp/.pkv files are only needed by those sub-features.
Review SummaryOverall this PR looks correct and well-structured. The feature flag design cleanly gates Correctness: ✅ Feature implication chains are sound: One item not in the diff to consider: Semver note: Removing No blocking issues found. The inline comments are nits about redundant feature propagation entries. |
|
The subagent fetched the diff but appears to have stopped. Let me send it a message to continue with the analysis and post the review. |
|
The review is complete! The subagent successfully posted on PR #708: 3 inline comments (review ID: 4206604465):
Summary comment covering:
|
| use world_id_primitives::{ | ||
| Credential, FieldElement, OwnershipProof, ProofRequest, ProofResponse, RequestItem, | ||
| ResponseItem, SessionId, SessionNullifier, ZeroKnowledgeProof, | ||
| Credential, FieldElement, ProofRequest, ProofResponse, RequestItem, ResponseItem, SessionId, |
There was a problem hiding this comment.
/otto - what is this about?
There was a problem hiding this comment.
This is a consequence of how Rust's #[cfg] works with use statements. Since OwnershipProof is now only compiled when the provekit feature is enabled (it's gated in primitives/src/proof.rs), it can't live in the shared use world_id_primitives::{...} block — that block is always compiled, so any item in it must always exist.
The fix is to split OwnershipProof out into its own use statement that can be individually gated:
#[cfg(feature = "provekit")]
use world_id_primitives::OwnershipProof;Without this, you'd get a compilation error when building without provekit because OwnershipProof wouldn't be exported from the crate.
|
This is a Rust |
|
/otto review this with Opus 4.6 |
|
On it — running a fresh review with Claude Opus 4.6. I'll post inline comments and a summary directly on the PR when done. |
| # Compress the tar archive with zstd | ||
| zstd-compress-zkeys = ["authenticator", "embed-zkeys", "world-id-proof/zstd-compress-zkeys"] | ||
| # Enable ProveKit-backed ownership proofs. | ||
| provekit = [ |
There was a problem hiding this comment.
nit: world-id-proof/zk-ownership-prove and world-id-primitives/provekit are already implied transitively by world-id-authenticator/provekit (which activates both). Listing them here is redundant—though harmless and arguably self-documenting. Consider simplifying to just ["authenticator", "world-id-authenticator/provekit"] if you prefer minimal feature lists, or keep as-is for explicitness.
|
|
||
| #[cfg(any(feature = "zk-ownership-prove", feature = "zk-ownership-verify"))] | ||
| #[cfg(feature = "provekit")] | ||
| pub mod ownership_proof; |
There was a problem hiding this comment.
Observation: this gate broadened from any(feature = "zk-ownership-prove", feature = "zk-ownership-verify") to just provekit. Semantically equivalent since both prove/verify now imply provekit, but it means enabling provekit alone (without prove or verify) will compile this module as an essentially-empty shell (no public items). Not a bug, just flagging the slight behavioral difference.
Review SummaryVerdict: Looks good ✅ — no blocking issues found. I reviewed all changed files and their surrounding context. The feature gating is comprehensive and correctly implemented:
The one consideration for consumers: |
|
The Opus 4.6 review is done and posted on PR #708. Here's the verdict: ✅ Looks good — no blocking issues. 2 inline comments posted:
Overall: Feature gating is comprehensive and correct across all crates. The propagation chain is sound, all |
|
curious to hear more about the use case for the segmentation of provekit. from my perspective provekit should already be included with all builds and sdks as it'll very soon become indispensable for using world id |
yeah, this is just a temporary workaround while I'm figuring out the cross build issues in WalletKit - I just don't want to block WalletKit releases for now |
|
Just a workspace TTL keepalive ping from the older subagent — it ran a keepalive command to prevent its pod from being deallocated. Nothing to action here. |
|
Just a TTL warning — the subagent cleanly released its workspace since it had already finished the review. Nothing to action. |
|
All good — the subagent released its workspace cleanly. Both review subagents are now fully done with no outstanding work. |
Summary
provekitfeature toworld-id-primitivesandworld-id-proofprovekit-commonoptional in both cratesprovekitOwnershipProof,prove_credential_sub, Noir helpers) behind the new featureworld-id-authenticatorandworld-id-coreMotivation
Mobile consumers like WalletKit should be able to build without compiling any
provekit-*crates. This keeps ProveKit-backed ownership proofs available as an explicit opt-in for platforms that support them.Validation
cargo check -p world-id-primitives --no-default-featurescargo tree -p world-id-core --no-default-features --features authenticator | rg 'provekit[-_]|provekit_common'returns no actual ProveKit crate matchescargo tree -p world-id-core --no-default-features --features provekit | rg 'provekit[-_]|provekit_common'shows ProveKit crates are pulled in when opted incargo check -p walletkit-core --no-default-features --features storage,issuerscargo check -p walletkit-core --no-default-features --features storage,issuers,provekitRelated