Skip to content

Commit 6fa94fd

Browse files
authored
Merge pull request #1383 from o1-labs/dw/remove-algebra-fork
Remove forks of arkworks and use o1labs/proof-systems
2 parents ef17996 + 3356bdc commit 6fa94fd

File tree

49 files changed

+212
-186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+212
-186
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
106106
([#1230](https://github.com/o1-labs/openmina/pull/1230))
107107
- bump itertools from 0.10.5 to 0.12.0 #1228
108108
([#1228](https://github.com/o1-labs/openmina/pull/1228))
109+
- Remove OpenMina forks of arkworks and proof-systems
110+
([#1383](https://github.com/o1-labs/mina-rust/pull/1383))
109111

110112
### Other
111113

Cargo.lock

Lines changed: 27 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 19 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -46,31 +46,28 @@ arithmetic_side_effects = "warn"
4646
indexing_slicing = "warn"
4747

4848
[workspace.dependencies]
49-
ledger = { path = "ledger", package = "mina-tree" }
50-
mina-p2p-messages = { path = "mina-p2p-messages" }
51-
poseidon = { path = "poseidon" }
52-
53-
# UNCOMMENTED_IN_CI mina-curves = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203", features = [ "32x9" ] }
54-
kimchi = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203" }
55-
mina-curves = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203" }
56-
mina-hasher = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203" }
57-
mina-poseidon = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203" }
58-
mina-signer = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203" }
59-
o1-utils = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203" }
60-
poly-commitment = { git = "https://github.com/openmina/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203" }
61-
62-
# kimchi.path = "../deps/proof-systems/kimchi"
63-
# mina-curves.path = "../deps/proof-systems/curves"
64-
# mina-hasher.path = "../deps/proof-systems/hasher"
65-
# mina-poseidon.path = "../deps/proof-systems/poseidon"
66-
# mina-signer.path = "../deps/proof-systems/signer"
67-
# o1-utils.path = "../deps/proof-systems/utils"
68-
# poly-commitment.path = "../deps/proof-systems/poly-commitment"
69-
49+
ark-ec = { version = "0.5.0", features = ["std"] }
50+
ark-ff = { version = "0.5.0", features = ["parallel", "asm", "std"] }
51+
ark-poly = { version = "0.5.0" }
52+
ark-serialize = { version = "0.5.0", features = ["std"] }
53+
graphannis-malloc_size_of = { git = "https://github.com/openmina/graphannis-malloc_size_of.git", rev = "f7da9f6" }
54+
graphannis-malloc_size_of_derive = { git = "https://github.com/openmina/graphannis-malloc_size_of_derive.git" }
7055
juniper = { version = "0.16" }
56+
kimchi = { git = "https://github.com/o1-labs/proof-systems", rev = "0b0fd5fe73964d2a3628c788e40ead819a8a806d" }
57+
ledger = { path = "ledger", package = "mina-tree" }
7158
libp2p = { git = "https://github.com/openmina/rust-libp2p", rev = "5c44c7d9", default-features = false }
7259
linkme = "0.3.22"
60+
mina-curves = { git = "https://github.com/o1-labs/proof-systems", rev = "0b0fd5fe73964d2a3628c788e40ead819a8a806d" }
61+
mina-hasher = { git = "https://github.com/o1-labs/proof-systems", rev = "0b0fd5fe73964d2a3628c788e40ead819a8a806d" }
7362
mina-node-account = { path = "node/account" }
63+
mina-p2p-messages = { path = "mina-p2p-messages" }
64+
mina-poseidon = { git = "https://github.com/o1-labs/proof-systems", rev = "0b0fd5fe73964d2a3628c788e40ead819a8a806d" }
65+
mina-producer-dashboard = { path = "producer-dashboard" }
66+
mina-signer = { git = "https://github.com/o1-labs/proof-systems", rev = "0b0fd5fe73964d2a3628c788e40ead819a8a806d" }
67+
num-bigint = { git = "https://github.com/openmina/num-bigint", branch = "rebase-onstack" } # branch: rebase-onstack
68+
o1-utils = { git = "https://github.com/o1-labs/proof-systems", rev = "0b0fd5fe73964d2a3628c788e40ead819a8a806d" }
69+
poly-commitment = { git = "https://github.com/o1-labs/proof-systems", rev = "0b0fd5fe73964d2a3628c788e40ead819a8a806d" }
70+
poseidon = { path = "poseidon" }
7471
redux = { git = "https://github.com/o1-labs/redux-rs.git", rev = "06c8366", features = [
7572
"serde",
7673
] }
@@ -80,29 +77,9 @@ serde_with = { version = "3.7.0", features = ["hex"] }
8077
static_assertions = "1.1.0"
8178
vrf = { path = "vrf" }
8279

83-
84-
ark-ec = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode", features = [
85-
"std",
86-
] }
87-
ark-ff = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode", features = [
88-
"parallel",
89-
"asm",
90-
"std",
91-
] }
92-
ark-poly = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode" }
93-
ark-serialize = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode", features = [
94-
"std",
95-
] }
96-
97-
num-bigint = { git = "https://github.com/openmina/num-bigint", branch = "rebase-onstack" } # branch: rebase-onstack
98-
80+
# UNCOMMENTED_IN_CI mina-curves = { git = "https://github.com/o1-labs/proof-systems", rev = "d1912bca54d2609296b9af9d09ad1ef78702e203", features = [ "32x9" ] }
9981
# UNCOMMENTED_IN_CI ark-ff = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode", features = ["parallel", "asm", "std", "32x9" ] }
10082

101-
graphannis-malloc_size_of = { git = "https://github.com/openmina/graphannis-malloc_size_of.git", rev = "f7da9f6" }
102-
graphannis-malloc_size_of_derive = { git = "https://github.com/openmina/graphannis-malloc_size_of_derive.git" }
103-
104-
mina-producer-dashboard = { path = "producer-dashboard" }
105-
10683
[profile.fuzz]
10784
inherits = "release"
10885
opt-level = 3
@@ -115,11 +92,6 @@ incremental = false
11592
codegen-units = 1
11693

11794
[patch.crates-io]
118-
ark-ff = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode" }
119-
ark-ec = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode" }
120-
ark-poly = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode" }
121-
ark-serialize = { git = "https://github.com/openmina/algebra", branch = "rebase-fix-openmina-webnode" }
122-
12395
num-bigint = { git = "https://github.com/openmina/num-bigint", branch = "rebase-onstack" } # branch: rebase-onstack
12496
num-rational = { git = "https://github.com/openmina/num-rational", branch = "rebase-onstack" } # branch: rebase-onstack
12597

core/src/block/block_with_hash.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
use ark_ff::fields::arithmetic::InvalidBigInt;
2-
use mina_p2p_messages::v2;
1+
use mina_p2p_messages::{bigint::InvalidBigInt, v2};
32
use redux::Timestamp;
43
use serde::{Deserialize, Serialize};
54

core/src/block/genesis.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
use ark_ff::fields::arithmetic::InvalidBigInt;
2-
use mina_p2p_messages::v2::{self, StateHash};
1+
use mina_p2p_messages::{
2+
bigint::InvalidBigInt,
3+
v2::{self, StateHash},
4+
};
35

46
use crate::constants::{constraint_constants, slots_per_window};
57

ledger/src/account/account.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,12 @@ impl TokenSymbol {
121121
}
122122

123123
pub fn to_field<F: FieldWitness>(&self) -> F {
124-
use ark_ff::FromBytes;
125-
126124
let mut s = <[u8; 32]>::default();
127125
self.to_bytes(&mut s);
128126

129-
let value = FromBytes::read(&s[..]).expect("Shoudn't fail");
130-
let bigint = BigInteger256::new(value);
131-
F::from(bigint) // Never fail, `self` contain 6 bytes at most
127+
// There is an assumption that a token symbol is on 6 bytes, therefore
128+
// it will be smaller than the order
129+
F::from_le_bytes_mod_order(&s)
132130
}
133131
}
134132

ledger/src/account/conv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![allow(clippy::type_complexity)]
22

33
use ark_ec::short_weierstrass::Affine;
4-
use ark_ff::{fields::arithmetic::InvalidBigInt, Field, PrimeField};
4+
use ark_ff::{Field, PrimeField};
55
use mina_curves::pasta::Fp;
66
use mina_p2p_messages::{
7-
bigint::BigInt,
7+
bigint::{BigInt, InvalidBigInt},
88
binprot,
99
pseq::PaddedSeq,
1010
v2::{

ledger/src/proofs/accumulator_check.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use ark_ff::fields::arithmetic::InvalidBigInt;
21
use mina_curves::pasta::{Fp, Vesta};
3-
use mina_p2p_messages::{bigint::BigInt, v2::PicklesProofProofsVerified2ReprStableV2};
2+
use mina_p2p_messages::{
3+
bigint::{BigInt, InvalidBigInt},
4+
v2::PicklesProofProofsVerified2ReprStableV2,
5+
};
46
use poly_commitment::{commitment::CommitmentCurve, ipa::SRS};
57

68
use super::{public_input::scalar_challenge::ScalarChallenge, urs_utils};

ledger/src/proofs/block.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
use std::{rc::Rc, sync::Arc};
22

33
use anyhow::Context;
4-
use ark_ff::fields::arithmetic::InvalidBigInt;
54
use consensus::ConsensusState;
65
use mina_core::constants::{constraint_constants, ForkConstants};
76
use mina_curves::pasta::{Fp, Fq};
8-
use mina_p2p_messages::v2;
7+
use mina_p2p_messages::{bigint::InvalidBigInt, v2};
98
use poseidon::hash::{
109
params::{MINA_PROTO_STATE, MINA_PROTO_STATE_BODY},
1110
Inputs,

ledger/src/proofs/caching.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use std::{
55
};
66

77
use ark_ec::{short_weierstrass::Affine, AffineRepr, CurveConfig};
8-
use ark_ff::fields::arithmetic::InvalidBigInt;
98
use ark_poly::{univariate::DensePolynomial, Radix2EvaluationDomain};
109
use kimchi::{
1110
alphas::Alphas,
@@ -21,7 +20,7 @@ use kimchi::{
2120
verifier_index::LookupVerifierIndex,
2221
};
2322
use mina_curves::pasta::Fq;
24-
use mina_p2p_messages::bigint::BigInt;
23+
use mina_p2p_messages::bigint::{BigInt, InvalidBigInt};
2524
use once_cell::sync::OnceCell;
2625
use poly_commitment::{
2726
commitment::CommitmentCurve, hash_map_cache::HashMapCache, ipa::SRS, PolyComm,

0 commit comments

Comments
 (0)