Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 25, 2025

This PR addresses the issue where mina_hasher::Fp was being used inconsistently throughout the codebase when mina_curves::pasta::Fp should be used instead, creating unnecessary dependencies between crates.

Changes Made

  • Unified Fp type usage: Replaced all instances of mina_hasher::Fp with mina_curves::pasta::Fp across 60+ files
  • Updated dependencies: Added mina_curves dependency to core and node Cargo.toml files where needed
  • Maintained compatibility: Updated tests that were validating compatibility between the two types to use the unified type

Files Updated

The changes span across multiple modules:

  • core: constants.rs, network.rs
  • ledger: All proof-related files, scan state, zkapps, accounts, database layers
  • snark: SRS retrieval function
  • vrf: VRF message handling
  • node: Block producer, ledger service, JSON handling
  • mina-p2p-messages: Hashing functions and type conversions
  • tools: Fuzzing utilities

Verification

  • ✅ All affected modules compile successfully
  • ✅ Test execution confirms field operations work correctly with unified type
  • ✅ No remaining mina_hasher::Fp references in codebase
  • ✅ Compatibility maintained with existing functionality

This refactoring eliminates redundant type usage and reduces inter-crate dependencies while maintaining full backward compatibility.

Fixes #1267.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@dannywillems dannywillems self-requested a review July 25, 2025 20:17
@Copilot Copilot AI changed the title [WIP] Unify the usage of Fp, Fq and curves Unify the usage of Fp, Fq and curves by replacing mina_hasher::Fp with mina_curves::pasta::Fp Jul 25, 2025
Copilot finished work on behalf of dannywillems July 25, 2025 20:44
@dannywillems dannywillems marked this pull request as ready for review July 25, 2025 21:07
@dannywillems dannywillems disabled auto-merge July 26, 2025 00:18
@dannywillems dannywillems merged commit 6549b07 into develop Jul 26, 2025
54 checks passed
@dannywillems dannywillems deleted the copilot/fix-1267 branch July 29, 2025 14:54
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.

Unify the usage of Fp, Fq and curves

2 participants