Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
Ubuntu 22.04 for test binary artifacts to ensure compatibility with Debian
Bullseye container environment ([#1249](https://github.com/o1-labs/openmina/pull/1249))
- **Build System**: Enhanced Makefile with documentation-related targets and comprehensive formatting commands ([#1234](https://github.com/o1-labs/openmina/pull/1234))
- Use consistent `use` statements for fields. Replace `mina_hasher::Fp` with
`mina_curves::pasta::Fp`.
([#1269](https://github.com/o1-labs/openmina/pull/1269/)).

### Fixed

- **Documentation**: Resolved broken links and bare URL warnings in Rust
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ graphannis-malloc_size_of_derive = { workspace = true }
ark-ff = { workspace = true }
hex = "0.4.3"
libp2p-identity = { version = "=0.2.7", features = ["serde", "peerid"] }
mina-curves = { workspace = true }
mina-hasher = { workspace = true }
mina-p2p-messages = { workspace = true }
poseidon = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion core/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use binprot_derive::BinProtWrite;
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_p2p_messages::{bigint, number, v2};

pub const GENESIS_PRODUCER_SK: &str = "EKFKgDtU3rcuFTVSEpmpXSkukjmX4cKefYREi6Sdsk7E7wsT7KRw";
Expand Down
4 changes: 2 additions & 2 deletions core/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl NetworkConfig {
pub mod devnet {
use super::{CircuitsConfig, NetworkId};
use crate::constants::{ConstraintConstants, ForkConstants};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;

pub const NETWORK_ID: NetworkId = NetworkId::TESTNET;
pub const NAME: &str = "devnet";
Expand Down Expand Up @@ -194,7 +194,7 @@ pub mod devnet {
pub mod mainnet {
use super::{CircuitsConfig, NetworkId};
use crate::constants::{ConstraintConstants, ForkConstants};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;

pub const NETWORK_ID: NetworkId = NetworkId::MAINNET;
pub const NAME: &str = "mainnet";
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/account/account.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{io::Cursor, str::FromStr, sync::Arc};

use ark_ff::{BigInteger256, One, UniformRand, Zero};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_p2p_messages::{
binprot::{BinProtRead, BinProtWrite},
v2,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/account/common.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::str::FromStr;

use ark_ff::{UniformRand, Zero};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use o1_utils::{field_helpers::FieldHelpersError, FieldHelpers};
use serde::{Deserialize, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion ledger/src/account/conv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use ark_ec::short_weierstrass_jacobian::GroupAffine;
use ark_ff::{fields::arithmetic::InvalidBigInt, Field, PrimeField};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_p2p_messages::{
bigint::BigInt,
binprot,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
sync::atomic::AtomicU64,
};

use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_signer::CompressedPubKey;
use serde::{Deserialize, Serialize};

Expand Down
3 changes: 1 addition & 2 deletions ledger/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ mod tests {

#[test]
fn test_cache() {
use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};

static COUNTER: AtomicUsize = AtomicUsize::new(0);

Expand Down
2 changes: 1 addition & 1 deletion ledger/src/database/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
sync::{Arc, Mutex},
};

use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_signer::CompressedPubKey;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/database/database_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
path::PathBuf,
};

use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_signer::CompressedPubKey;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/ffi/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{

use ark_ff::BigInteger256;
use binprot::BinProtWrite;
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_p2p_messages::{
bigint::BigInt,
binprot,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/ffi/mask.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{borrow::Borrow, cell::RefCell, rc::Rc, str::FromStr};

use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_p2p_messages::v2::NonZeroCurvePointUncompressedStableV1;
use ocaml_interop::{
impl_to_ocaml_polymorphic_variant, impl_to_ocaml_variant, ocaml_export, DynBox, OCaml,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/generators/zkapp_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
};

use ark_ff::{UniformRand, Zero};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_signer::{CompressedPubKey, Keypair, Signature};
use rand::{
rngs::ThreadRng,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/hash.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_signer::CompressedPubKey;

use crate::{proofs::witness::Witness, scan_state::currency};
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/mask/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
sync::{Arc, Mutex},
};

use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_signer::CompressedPubKey;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/mask/mask_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
path::PathBuf,
};

use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_signer::CompressedPubKey;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/port_ocaml/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::hash::Hasher;

use ark_ff::{BigInteger, BigInteger256};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;

use crate::AccountId;

Expand Down
14 changes: 7 additions & 7 deletions ledger/src/poseidon/fp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ mod tests {
.collect::<Vec<_>>();
let mina_fps = CONSTANTS
.iter()
.map(|s| mina_hasher::Fp::from_str(s).unwrap())
.map(|s| mina_curves::pasta::Fp::from_str(s).unwrap())
.collect::<Vec<_>>();

let mut fp = fps[0].clone();
Expand All @@ -545,7 +545,7 @@ mod tests {
assert_eq!(fp.0, mina_fp.0 .0);

// let fp = Fp::from_str(CONSTANTS[0]).unwrap();
// let mina_fp = mina_hasher::Fp::from_str(CONSTANTS[0]).unwrap();
// let mina_fp = mina_curves::pasta::Fp::from_str(CONSTANTS[0]).unwrap();

// for s in CONSTANTS {
// fp.mul_assign(s);
Expand All @@ -554,12 +554,12 @@ mod tests {

#[test]
fn test_fp() {
assert_eq!(Fp::zero().0, mina_hasher::Fp::zero().0 .0);
assert_eq!(Fp::from(10).0, mina_hasher::Fp::from(10).0 .0);
assert_eq!(Fp::zero().0, mina_curves::pasta::Fp::zero().0 .0);
assert_eq!(Fp::from(10).0, mina_curves::pasta::Fp::from(10).0 .0);

for s in CONSTANTS {
let fp = Fp::from_str(s).unwrap();
let mina_fp = mina_hasher::Fp::from_str(s).unwrap();
let mina_fp = mina_curves::pasta::Fp::from_str(s).unwrap();
assert_eq!(fp.0, mina_fp.0 .0);

assert_eq!(fp.into_repr(), mina_fp.into_repr().0)
Expand All @@ -571,8 +571,8 @@ mod tests {

let mut fp1 = Fp::from_str(s1).unwrap();
let fp2 = Fp::from_str(s2).unwrap();
let mut mina_fp1 = mina_hasher::Fp::from_str(s1).unwrap();
let mina_fp2 = mina_hasher::Fp::from_str(s2).unwrap();
let mut mina_fp1 = mina_curves::pasta::Fp::from_str(s1).unwrap();
let mina_fp2 = mina_curves::pasta::Fp::from_str(s2).unwrap();

fp1.mul_assign(&fp2);
mina_fp1.mul_assign(mina_fp2);
Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/accumulator_check.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ark_ff::fields::arithmetic::InvalidBigInt;
use mina_curves::pasta::Vesta;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Vesta};
use mina_p2p_messages::{bigint::BigInt, v2::PicklesProofProofsVerified2ReprStableV2};
use poly_commitment::{commitment::CommitmentCurve, srs::SRS};

Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use std::{rc::Rc, sync::Arc};
use anyhow::Context;
use ark_ff::fields::arithmetic::InvalidBigInt;
use consensus::ConsensusState;
use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};
use mina_p2p_messages::v2;
use openmina_core::constants::{constraint_constants, ForkConstants};
use poseidon::hash::{
Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/constants.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ark_ff::{One, Zero};
use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};

use super::{
field::Boolean,
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/proofs/conv.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use ark_ff::fields::arithmetic::InvalidBigInt;
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_p2p_messages::v2;

use crate::scan_state::{
Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ use ark_ff::{
};
use kimchi::curve::KimchiCurve;
use mina_curves::pasta::{
Fq, PallasParameters, ProjectivePallas, ProjectiveVesta, VestaParameters,
Fp, Fq, PallasParameters, ProjectivePallas, ProjectiveVesta, VestaParameters,
};
use mina_hasher::Fp;
use mina_poseidon::{constants::PlonkSpongeConstantsKimchi, sponge::DefaultFqSponge};

use poseidon::SpongeParamsForField;
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/proofs/group_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub mod bw19 {
}

use ark_ff::{FpParameters, One};
use mina_hasher::Fp;
use mina_curves::pasta::Fp;

use self::tock::Conic;

Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use crate::proofs::{
wrap::{wrap, WrapParams},
};
use ark_ff::fields::arithmetic::InvalidBigInt;
use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};
use mina_p2p_messages::v2;

use crate::{
Expand Down
6 changes: 3 additions & 3 deletions ledger/src/proofs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ pub type ProverProof<F> = kimchi::proof::ProverProof<
pub fn generate_tx_proof(
params: transaction::TransactionParams,
) -> anyhow::Result<wrap::WrapProof> {
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use witness::Witness;
let mut w: Witness<Fp> = Witness::new::<constants::StepTransactionProof>();
transaction::generate_tx_proof(params, &mut w)
}
pub fn generate_merge_proof(params: merge::MergeParams) -> anyhow::Result<wrap::WrapProof> {
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use witness::Witness;
let mut w: Witness<Fp> = Witness::new::<constants::StepMergeProof>();
merge::generate_merge_proof(params, &mut w)
}
pub fn generate_block_proof(params: block::BlockParams) -> anyhow::Result<wrap::WrapProof> {
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use witness::Witness;
let mut w: Witness<Fp> = Witness::new::<constants::StepBlockProof>();
block::generate_block_proof(params, &mut w)
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/proofs/numbers/nat.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use mina_hasher::Fp;
use mina_curves::pasta::Fp;

use crate::{
proofs::{
Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ use kimchi::{
poly_commitment::PolyComm,
proof::{PointEvaluations, ProofEvaluations, ProverCommitments, RecursionChallenge},
};
use mina_curves::pasta::Pallas;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Pallas};
use once_cell::sync::Lazy;
use poly_commitment::{commitment::CommitmentCurve, evaluation_proof::OpeningProof};

Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/provers.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::{collections::HashMap, path::Path, sync::Arc};

use kimchi::circuits::gate::CircuitGate;
use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};
use once_cell::sync::OnceCell;
use openmina_core::network::CircuitsConfig;

Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/public_input/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use crate::proofs::{
};
use ark_ec::short_weierstrass_jacobian::GroupAffine;
use ark_ff::{BigInteger256, PrimeField};
use mina_curves::pasta::{Fq, Pallas};
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq, Pallas};
use poly_commitment::PolyComm;

use poseidon::hash::hash_fields;
Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/public_input/plonk_checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use kimchi::{
curve::KimchiCurve,
proof::{PointEvaluations, ProofEvaluations},
};
use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};

use crate::{
proofs::{
Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/public_input/prepared_statement.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use ark_ff::{BigInteger256, Zero};
use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};
use mina_p2p_messages::v2::{
CompositionTypesBranchDataStableV1, PicklesBaseProofsVerifiedStableV1,
};
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/proofs/public_input/protocol_state.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use mina_hasher::Fp;
use mina_curves::pasta::Fp;
use mina_p2p_messages::v2::MinaBaseProtocolConstantsCheckedValueStableV1;

use crate::{
Expand Down
3 changes: 1 addition & 2 deletions ledger/src/proofs/public_input/scalar_challenge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ mod tests {

use super::*;

use mina_curves::pasta::Fq;
use mina_hasher::Fp;
use mina_curves::pasta::{Fp, Fq};

#[cfg(target_family = "wasm")]
use wasm_bindgen_test::wasm_bindgen_test as test;
Expand Down
Loading
Loading