Skip to content

arithmetic: support modern and legacy dependency modes - #747

Merged
ebfull merged 4 commits into
tachyon-zcash:mainfrom
ebfull:dual-dependency-modes
Jun 2, 2026
Merged

arithmetic: support modern and legacy dependency modes#747
ebfull merged 4 commits into
tachyon-zcash:mainfrom
ebfull:dual-dependency-modes

Conversation

@ebfull

@ebfull ebfull commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator
  • use modern-deps feature to access the modern stack
  • use legacy-deps feature to access the legacy stack (old rand/ff/group/pasta/etc.)
  • intended to be temporary, legacy-deps will be deleted eventually
  • can't use both at the same time (see also Ensure --all-features works #746)

Comment thread justfile
ebfull and others added 2 commits June 1, 2026 12:09
Re-export ff, group, pasta_curves, and rand from ragu_arithmetic behind
the mutually-exclusive `modern-deps` and `legacy-deps` Cargo features, and
route all downstream crates through ragu_arithmetic::{ff,group,pasta_curves,rand}
instead of depending on those crates directly. This lets the workspace build
against either the modern (ff/group 0.14-pre, pasta_curves git, rand 0.10) or
legacy (ff/group 0.13, pasta_curves 0.5.1, rand 0.8) dependency sets.

Add a DeferredField trait that delegates to pasta_curves deferred reduction in
modern mode and falls back to eager accumulation in legacy mode, and a
CryptoRngCore trait abstracting the rng bound across both modes. The derive
macros now resolve a RaguArithmeticPath and emit ragu_arithmetic::ff::Field.

CI gains a legacy-check job (library-only, since tests use rand-0.10 APIs).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ebfull
ebfull force-pushed the dual-dependency-modes branch from 787d274 to 44c2fd4 Compare June 1, 2026 18:39
@TalDerei
TalDerei self-requested a review June 1, 2026 18:46

@TalDerei TalDerei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

left some observations, nothing strictly blocking.

Comment thread qa/fuzz/Cargo.toml Outdated
Comment thread Cargo.toml
Comment thread Cargo.toml
Comment on lines +85 to +101
legacy-check:
name: legacy dependency check
needs: changes
if: needs.changes.outputs.rust == 'true' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
- name: Setup Rust
uses: ./.github/actions/rust-setup
with:
cache-suffix: legacy-deps
- name: Check runtime crates with legacy dependencies
run: cargo check -p ragu_arithmetic -p ragu_pasta -p ragu_core -p ragu_primitives -p ragu_circuits -p ragu_pcd --lib --locked --no-default-features --features "alloc legacy-deps"
- name: Check root crate with legacy dependencies
run: cargo check -p ragu --lib --locked --no-default-features --features legacy-deps

@TalDerei TalDerei Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know the legacy feature flag is a temporary shim, but there's a CI gap here where it basically only does cargo check --lib and doesn't run test coverage.

Comment thread crates/ragu_testing/Cargo.toml
@ebfull
ebfull merged commit 28a2f4a into tachyon-zcash:main Jun 2, 2026
22 checks passed
@ebfull
ebfull deleted the dual-dependency-modes branch June 2, 2026 03:23
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