Skip to content

refactor: drop legacy FixedPoint impls for NullifierK and ValueCommitV#20

Open
p0mvn wants to merge 7 commits into
adam/spend-auth-g-fixed-basefrom
valar/drop-legacy-fixed-point-impls
Open

refactor: drop legacy FixedPoint impls for NullifierK and ValueCommitV#20
p0mvn wants to merge 7 commits into
adam/spend-auth-g-fixed-basefrom
valar/drop-legacy-fixed-point-impls

Conversation

@p0mvn

@p0mvn p0mvn commented Apr 25, 2026

Copy link
Copy Markdown

Stacked on top of zcash/orchard#489 (adam/spend-auth-g-fixed-base). Addresses TalDerei's nit on src/constants/fixed_bases.rs:218 ("are impl FixedPoint for NullifierK / ValueCommitV blocks necessary anymore?").

Summary

After zcash#489's enum refactor, base-field and short-scalar fixed-base dispatch routes through OrchardBaseFieldBases / OrchardShortScalarBases. The standalone impl FixedPoint blocks for NullifierK and ValueCommitV are no longer on the in-circuit dispatch path, so this PR removes them.

  • Drops impl FixedPoint<pallas::Affine> for NullifierK and impl FixedPoint<pallas::Affine> for ValueCommitV (~34 LOC).
  • Symmetrizes value_commit_v_short_routes_correctly to compare against value_commit_v::generator() / value_commit_v::U_SHORT / value_commit_v::Z_SHORT directly, mirroring nullifier_k_base_field_routes_correctly. The test no longer relies on the (now removed) FixedPoint impl as its "ground truth"; both regression tests now anchor against the precomputed constants.
  • Adds a ### Removed entry to CHANGELOG.md under [Unreleased] documenting the breaking change and the migration path.

The pub struct NullifierK / pub struct ValueCommitV definitions and their From conversions into the new enums are retained, so NullifierK.into() and ValueCommitV.into() continue to work in caller code.

Why stacked on zcash#489 rather than against main

This is strictly cleanup of vestiges left behind by the enum refactor in zcash#489. Removal is a breaking change so I wanted to separate it to keep zcash#489 focused.

Verification

Run locally on top of adam/spend-auth-g-fixed-base:

  • cargo check --features circuit
  • cargo check --no-default-features
  • cargo check --all-features
  • cargo clippy --all-features -- -D warnings
  • cargo fmt --all --check
  • cargo test --features circuit --lib constants::fixed_bases:: (28 tests, including the symmetrized regression test)
  • cargo test --release --features circuit --lib circuit::tests::round_trip (pinned Orchard verification key unchanged)

ebfull and others added 7 commits April 26, 2026 12:15
…base

feat: add SpendAuthG fixed-base multiplication support
Introduces a public associated constant `orchard::value::NoteValue::ZERO`,
replacing the crate-private `NoteValue::zero()` associated function.
All internal call sites in the builder, bundle testing helpers, and note
dummy construction are rewired to use the new constant.

The new constant is usable in `const` contexts and gives downstream
consumers a direct name for the zero value without going through
`NoteValue::from_raw(0)`.

Co-Authored-By: Dev Ojha <dojha@berkeley.edu>
value: Replace `NoteValue::zero()` with `NOTE_VALUE_ZERO` const
After zcash#489's enum refactor, base-field and short-scalar fixed-base
dispatch routes through `OrchardBaseFieldBases` and
`OrchardShortScalarBases`. The standalone `impl FixedPoint` blocks for
`NullifierK` and `ValueCommitV` are no longer on the in-circuit dispatch
path.

This commit:

- Removes `impl FixedPoint<pallas::Affine> for NullifierK` and
  `impl FixedPoint<pallas::Affine> for ValueCommitV`.
- Symmetrizes `value_commit_v_short_routes_correctly` to compare against
  `value_commit_v::*` constants directly, mirroring the existing
  `nullifier_k_base_field_routes_correctly` test.
- Adds a `### Removed` entry to `CHANGELOG.md` documenting the breaking
  change and the migration path
  (`OrchardBaseFieldBases::NullifierK` /
  `OrchardShortScalarBases::ValueCommitV`).

The `pub struct NullifierK` / `pub struct ValueCommitV` definitions and
their `From` conversions into the new enums are retained, so
`NullifierK.into()` / `ValueCommitV.into()` continue to work in caller
code.

The pinned Orchard verification key is unchanged
(`circuit::tests::round_trip` still passes).
The 3-variant enum and its five `From<X>` impls had no readers —
`OrchardFixedBases` is only used as a type parameter to `EccChip` /
`MerkleConfig` / `SinsemillaConfig`, never as a value. The `.into()`
calls in `circuit::gadget` resolve to the per-slot enums.

All affected items live behind `unstable-voting-circuits`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ebfull
ebfull force-pushed the valar/drop-legacy-fixed-point-impls branch from dbacee3 to 53014be Compare April 27, 2026 18:06
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.

3 participants