Skip to content

Commit b41436e

Browse files
committed
Add mina-vrf and mina-snark workspace dependencies to crates
Update Cargo.toml files to use mina-vrf and mina-snark as workspace dependencies instead of path-only references. Fix imports in source files to use the correct external crate names (mina_vrf, mina_snark) while preserving internal module re-exports (node::snark, node::vrf).
1 parent 3bb0452 commit b41436e

File tree

29 files changed

+48
-37
lines changed

29 files changed

+48
-37
lines changed

Cargo.lock

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

crates/cli/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ mina-node-account = { workspace = true }
2323
mina-node-native = { path = "../node/native" }
2424
mina-p2p-messages = { workspace = true }
2525
mina-signer = { workspace = true }
26+
mina-snark = { workspace = true }
27+
mina-vrf = { workspace = true }
2628
nix = { workspace = true, features = ["signal"] }
2729
node = { path = "../node", features = ["replay"], package = "mina-node" }
2830
num_cpus = { workspace = true }
@@ -37,7 +39,6 @@ shellexpand = { workspace = true }
3739
time = { workspace = true }
3840
tokio = { workspace = true }
3941
tracing = { workspace = true }
40-
vrf = { path = "../vrf", package = "mina-vrf" }
4142

4243
[target.'cfg(not(target_family = "wasm"))'.dependencies]
4344
redux = { workspace = true, features = ["serializable_callbacks"] }

crates/node/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ mina-hasher = { workspace = true }
2424
mina-node-account = { workspace = true }
2525
mina-p2p-messages = { workspace = true }
2626
mina-signer = { workspace = true }
27+
mina-snark = { workspace = true }
28+
mina-vrf = { workspace = true }
2729
multihash = { workspace = true }
2830
num_enum = { workspace = true }
2931
p2p = { path = "../p2p", package = "mina-p2p" }
@@ -37,14 +39,12 @@ serde_json = { workspace = true, features = [
3739
"arbitrary_precision",
3840
] }
3941
serde_with = { workspace = true, features = ["time_0_3"] }
40-
snark = { path = "../snark", package = "mina-snark" }
4142
static_assertions = { workspace = true }
4243
strum = { workspace = true }
4344
strum_macros = { workspace = true }
4445
thiserror = { workspace = true }
4546
time = { workspace = true, features = ["parsing"] }
4647
tokio = { workspace = true }
47-
vrf = { path = "../vrf", package = "mina-vrf" }
4848

4949
[build-dependencies]
5050
regex = { workspace = true }

crates/node/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ ledger = { workspace = true }
1515
mina-core = { workspace = true }
1616
mina-p2p-messages = { workspace = true }
1717
mina-signer = { workspace = true }
18+
mina-vrf = { workspace = true }
1819
node = { path = "..", features = ["replay"], package = "mina-node" }
1920
rand = { workspace = true }
2021
rayon = { workspace = true }
@@ -25,7 +26,6 @@ sha3 = { workspace = true }
2526
thiserror = { workspace = true }
2627
tokio = { workspace = true, features = ["time", "macros"] }
2728
tracing = { workspace = true }
28-
vrf = { path = "../../vrf", package = "mina-vrf" }
2929

3030
[target.'cfg(target_family = "wasm")'.dependencies]
3131
redux = { workspace = true }

crates/node/common/src/service/block_producer/vrf_evaluator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use mina_signer::Keypair;
2+
use mina_vrf::{VrfEvaluationInput, VrfEvaluationOutput};
23
use node::{
34
block_producer::{
45
vrf_evaluator::{VrfEvaluationOutputWithHash, VrfEvaluatorInput},
@@ -7,7 +8,6 @@ use node::{
78
core::channels::mpsc::{TrackedUnboundedReceiver, UnboundedSender},
89
event_source::Event,
910
};
10-
use vrf::{VrfEvaluationInput, VrfEvaluationOutput};
1111

1212
use crate::NodeService;
1313

@@ -42,7 +42,7 @@ pub fn vrf_evaluator(
4242
total_currency: (*total_currency).into(),
4343
};
4444

45-
let vrf_result = vrf::evaluate_vrf(vrf_input).unwrap();
45+
let vrf_result = mina_vrf::evaluate_vrf(vrf_input).unwrap();
4646

4747
// the first delegate that won the slot
4848
if let VrfEvaluationOutput::SlotWon(_) = vrf_result {

crates/node/native/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ mina-core = { path = "../../core" }
2121
mina-node-common = { path = "../common" }
2222
mina-p2p-messages = { workspace = true }
2323
mina-signer = { workspace = true }
24+
mina-snark = { workspace = true }
25+
mina-vrf = { workspace = true }
2426
nix = { workspace = true, features = ["signal"] }
2527
node = { path = "..", features = ["replay"], package = "mina-node" }
2628
o1-utils = { workspace = true }
@@ -37,7 +39,6 @@ thiserror = { workspace = true }
3739
tokio = { workspace = true, features = ["process", "macros"] }
3840
tracing = { workspace = true }
3941
tracing-subscriber = { workspace = true }
40-
vrf = { path = "../../vrf", package = "mina-vrf" }
4142
warp = { workspace = true }
4243

4344
[features]

crates/node/src/block_producer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ mod block_producer_reducer;
1919
use ledger::AccountIndex;
2020
use mina_core::{block::ArcBlockWithHash, constants::constraint_constants};
2121
use mina_p2p_messages::{list::List, v2};
22+
use mina_vrf::output::VrfOutput;
2223
use poseidon::hash::params::MINA_EPOCH_SEED;
2324
use serde::{Deserialize, Serialize};
24-
use vrf::output::VrfOutput;
2525

2626
use self::vrf_evaluator::VrfWonSlotWithHash;
2727

crates/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_actions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use mina_p2p_messages::v2::{
99
ConsensusProofOfStakeDataEpochDataNextValueVersionedValueStableV1,
1010
ConsensusProofOfStakeDataEpochDataStakingValueVersionedValueStableV1, LedgerHash,
1111
};
12+
use mina_vrf::{VrfEvaluationOutput, VrfWonSlot};
1213
use serde::{Deserialize, Serialize};
13-
use vrf::{VrfEvaluationOutput, VrfWonSlot};
1414

1515
use super::{DelegatorTable, EpochData, InterruptReason, VrfEvaluatorInput};
1616

crates/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_reducer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use mina_core::bug_condition;
2-
use vrf::VrfEvaluationOutput;
2+
use mina_vrf::VrfEvaluationOutput;
33

44
use crate::{
55
block_producer::to_epoch_and_slot,
@@ -41,7 +41,7 @@ impl BlockProducerVrfEvaluatorState {
4141
staking_ledger_hash,
4242
} => {
4343
let global_slot_evaluated = match &vrf_output {
44-
vrf::VrfEvaluationOutput::SlotWon(won_slot_data) => {
44+
mina_vrf::VrfEvaluationOutput::SlotWon(won_slot_data) => {
4545
state.won_slots.insert(
4646
won_slot_data.global_slot,
4747
VrfWonSlotWithHash::new(
@@ -51,7 +51,7 @@ impl BlockProducerVrfEvaluatorState {
5151
);
5252
won_slot_data.global_slot
5353
}
54-
vrf::VrfEvaluationOutput::SlotLost(global_slot) => *global_slot,
54+
mina_vrf::VrfEvaluationOutput::SlotLost(global_slot) => *global_slot,
5555
};
5656
state.set_latest_evaluated_global_slot(&global_slot_evaluated);
5757

crates/node/src/block_producer/vrf_evaluator/block_producer_vrf_evaluator_state.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ mod test {
610610
UnsignedExtendedUInt64Int64ForVersionTagsStableV1,
611611
},
612612
};
613-
use vrf::VrfWonSlot;
613+
use mina_vrf::VrfWonSlot;
614614

615615
use crate::block_producer::vrf_evaluator::{
616616
BlockProducerVrfEvaluatorState, BlockProducerVrfEvaluatorStatus, EpochContext,
@@ -918,8 +918,10 @@ mod test {
918918
producer: AccountSecretKey::genesis_producer().public_key(),
919919
winner_account: AccountSecretKey::genesis_producer().public_key(),
920920
vrf_output: Box::new(
921-
vrf::genesis_vrf(EpochSeed::from(MinaBaseEpochSeedStableV1(BigInt::zero())))
922-
.unwrap(),
921+
mina_vrf::genesis_vrf(EpochSeed::from(MinaBaseEpochSeedStableV1(
922+
BigInt::zero(),
923+
)))
924+
.unwrap(),
923925
),
924926
global_slot: slot,
925927
account_index: AccountIndex(0),

0 commit comments

Comments
 (0)