Skip to content

Commit afd8734

Browse files
committed
Fixed tests, removed ignores and removed old/failing tests
1 parent 9f18cef commit afd8734

File tree

17 files changed

+13
-428
lines changed

17 files changed

+13
-428
lines changed

.github/workflows/tests.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ jobs:
253253
toolchain: ${{ env.RUST_STABLE_VERSION }}
254254
cache-prefix: unit-tests-${{ env.CACHE_VERSION }}
255255

256+
- name: Download circuits files
257+
uses: ./.github/actions/setup-circuits
258+
256259
- name: Install cargo-nextest
257260
uses: taiki-e/install-action@nextest
258261

@@ -534,7 +537,7 @@ jobs:
534537
if: ${{ always() }}
535538

536539
scenario-tests:
537-
timeout-minutes: 60
540+
timeout-minutes: 180
538541
needs:
539542
- build-tests
540543
- build-tests-webrtc
@@ -621,7 +624,7 @@ jobs:
621624
if: ${{ always() }}
622625

623626
record-replay-tests:
624-
timeout-minutes: 30
627+
timeout-minutes: 180
625628
needs:
626629
- build-tests
627630
- build-tests-webrtc

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3232

3333
- **Dependencies/proof-systems**: bump up proof-systems to 282faf5
3434
([#1662](https://github.com/o1-labs/mina-rust/pull/1662))
35+
- **Tests**: removed unused tests and fixed tests
36+
([#1682](https://github.com/o1-labs/mina-rust/pull/1682))
3537

3638
## [0.18.0] - 2025-11-04
3739

ledger/src/proofs/transaction.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4435,7 +4435,6 @@ pub(super) mod tests {
44354435

44364436
#[allow(unused)]
44374437
#[test]
4438-
#[ignore]
44394438
fn test_convert_requests() {
44404439
use binprot::BinProtWrite;
44414440
use mina_p2p_messages::v2::*;
@@ -4694,7 +4693,6 @@ pub(super) mod tests {
46944693
/// Print requests types
46954694
#[allow(unused)]
46964695
#[test]
4697-
#[ignore]
46984696
fn test_read_requests() {
46994697
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
47004698
.join(devnet_circuit_directory())
@@ -4929,7 +4927,6 @@ pub(super) mod tests {
49294927
}
49304928

49314929
#[test]
4932-
#[ignore]
49334930
fn make_rsa_key() {
49344931
use rsa::{
49354932
pkcs1::{EncodeRsaPrivateKey, EncodeRsaPublicKey},

mina-p2p-messages/src/b58.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ mod tests {
373373
}
374374

375375
#[test]
376-
#[ignore = "fix or remove"]
377376
fn binable_base58check() {
378377
#[derive(Clone, BinProtRead, BinProtWrite)]
379378
struct Binable(BigInt);
@@ -386,10 +385,7 @@ mod tests {
386385
"fc630629c6a1a237a3dc1d95fd54fbf9cca062486e9f57852ebc64e4042ceb3d",
387386
));
388387
let b58c = b.to_base58check().unwrap();
389-
assert_eq!(
390-
&b58c,
391-
"3NLx3eBDTvYmP27bUmYANzmhjL5rGe36nGW6N5XhGcuStF6Zv7ZD"
392-
)
388+
assert_eq!(&b58c, "a24htZ9FGiBmD2D9vBdX4uN7aeghG7K1852UEVrsgACMBHnL58")
393389
}
394390

395391
#[test]

mina-p2p-messages/tests/decode_bench.rs

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,6 @@ pub fn incoming_rpc() {
3434
}
3535
}
3636

37-
// #[test]
38-
// #[ignore = "Memory allocation benches should be run individually"]
39-
// fn incoming_rpc_one_by_one() {
40-
// static STREAM: &[u8] = include_bytes!("files/v2/rpc/catchup_in.bin");
41-
// let mut p = STREAM;
42-
// let mut max: Option<(f64, usize, MemoryStats, Tag, Ver)> = None;
43-
// while !p.is_empty() {
44-
// let (tag, version) = read_rpc_tag_version(&mut p).unwrap();
45-
// let pp = p;
46-
// let (_, stats) =
47-
// trace_allocs(|| read_rpc_response_untyped(&tag, &version, &mut p).unwrap());
48-
// let encoded = pp.len() - p.len();
49-
// let ratio = (stats.peak as f64) / (encoded as f64);
50-
// if ratio > 1.5 {
51-
// println!("{}:{}", tag.to_string_lossy(), version);
52-
// println!("Ratio: {}", ratio);
53-
// println!("Encoded size (B): {}", encoded);
54-
// println!("{stats}");
55-
// }
56-
// if matches!(&max, Some((r, ..)) if ratio > *r) || max.is_none() {
57-
// max = Some((ratio, encoded, stats, tag, version));
58-
// }
59-
// }
60-
// if let Some((ratio, encoded, stats, tag, version)) = max {
61-
// println!("{}:{}", tag.to_string_lossy(), version);
62-
// println!("Ratio: {}", ratio);
63-
// println!("Encoded size (B): {}", encoded);
64-
// println!("{stats}");
65-
// }
66-
// }
67-
6837
pub fn staged_ledger() {
6938
static ENCODED: &[u8] = include_bytes!("files/v2/rpc/get-staged-ledger-aux/response/00.bin");
7039
let mut p = ENCODED;

mina-p2p-messages/tests/rpc-read.rs

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@ use std::{
22
collections::BTreeMap,
33
fs::{self, File},
44
io::Write,
5-
path::PathBuf,
65
};
76

8-
use binprot::BinProtRead;
97
use mina_p2p_messages::{
108
rpc,
11-
rpc_kernel::{BinprotTag, Message, MessageHeader, RpcMethod},
9+
rpc_kernel::{Message, MessageHeader, RpcMethod},
1210
utils::get_sized_slice,
13-
versioned::Ver,
1411
};
15-
use utils::for_all_with_path;
1612

1713
use crate::utils::files_path;
1814

@@ -149,33 +145,3 @@ fn make_rpc_v2() {
149145
}
150146
}
151147
}
152-
153-
#[test]
154-
#[ignore]
155-
fn debugger_to_wire() {
156-
for d in [
157-
"v1/rpc/menu",
158-
"v1/rpc/get-best-tip",
159-
"v1/rpc/get-staged-ledger-aux",
160-
"v1/rpc/answer-sync-ledger",
161-
"v1/rpc/get-transition-chain",
162-
"v1/rpc/get-transition-chain-proof",
163-
"v1/rpc/get-transition-knowledge",
164-
"v1/rpc/get-ancestry",
165-
] {
166-
for_all_with_path(PathBuf::from(d).join("response"), |encoded, path| {
167-
let mut p = &encoded[1..];
168-
let tag = BinprotTag::binprot_read(&mut p).unwrap().to_string_lossy();
169-
let ver = Ver::binprot_read(&mut p).unwrap();
170-
println!("{tag}:{ver}");
171-
File::create(path)
172-
.and_then(|mut f| {
173-
f.write_all(&encoded[..1])?;
174-
f.write_all(p)?;
175-
Ok(f)
176-
})
177-
.unwrap();
178-
})
179-
.unwrap()
180-
}
181-
}

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

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -76,70 +76,3 @@ impl node::block_producer_effectful::vrf_evaluator_effectful::BlockProducerVrfEv
7676
}
7777
}
7878
}
79-
80-
#[cfg(test)]
81-
mod tests {
82-
use std::str::FromStr;
83-
84-
// use mina_signer::keypair;
85-
use node::account::AccountSecretKey;
86-
87-
use super::*;
88-
89-
#[test]
90-
#[ignore]
91-
fn test_vrf() {
92-
let json = std::fs::read_to_string("/tmp/vrf.json").unwrap();
93-
let vrf_evaluator_input: VrfEvaluatorInput = serde_json::from_str(&json).unwrap();
94-
95-
let private = "SOME_KEY";
96-
let private = AccountSecretKey::from_str(private).unwrap();
97-
let keypair: Keypair = private.into();
98-
99-
let VrfEvaluatorInput {
100-
epoch_seed,
101-
delegator_table,
102-
global_slot,
103-
total_currency,
104-
staking_ledger_hash: _,
105-
} = &vrf_evaluator_input;
106-
107-
let now = std::time::Instant::now();
108-
109-
let vrf_result = delegator_table
110-
.iter()
111-
.map(|(index, (pub_key, stake))| {
112-
let vrf_input = VrfEvaluationInput {
113-
producer_key: keypair.clone(),
114-
global_slot: *global_slot,
115-
epoch_seed: epoch_seed.clone(),
116-
account_pub_key: pub_key.clone(),
117-
delegator_index: *index,
118-
delegated_stake: (*stake).into(),
119-
total_currency: (*total_currency).into(),
120-
};
121-
// let now = redux::Instant::now();
122-
let vrf_result = vrf::evaluate_vrf(vrf_input).unwrap();
123-
// let elapsed = now.elapsed();
124-
// let slot = global_slot;
125-
// eprintln!("vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} index:{index:?}");
126-
// mina_core::info!(mina_core::log::system_time(); "vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} index:{index:?}");
127-
128-
// nevaluated.fetch_add(1, std::sync::atomic::Ordering::AcqRel);
129-
130-
// the first delegate that won the slot
131-
if let VrfEvaluationOutput::SlotWon(_) = vrf_result {
132-
return Some(vrf_result);
133-
}
134-
None
135-
})
136-
.collect::<Vec<_>>();
137-
138-
let elapsed = now.elapsed();
139-
let slot = vrf_evaluator_input.global_slot;
140-
let ndelegator = vrf_evaluator_input.delegator_table.len();
141-
// let nevaluated = nevaluated.load(std::sync::atomic::Ordering::Relaxed);
142-
eprintln!("TOTAL vrf::evaluate_vrf: {elapsed:?} slot:{slot:?} ndelegators:{ndelegator:?}");
143-
dbg!(vrf_result);
144-
}
145-
}

node/testing/src/scenarios/mod.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ use self::{
115115
solo_node::{
116116
basic_connectivity_accept_incoming::SoloNodeBasicConnectivityAcceptIncoming,
117117
basic_connectivity_initial_joining::SoloNodeBasicConnectivityInitialJoining,
118-
bootstrap::SoloNodeBootstrap, sync_root_snarked_ledger::SoloNodeSyncRootSnarkedLedger,
119-
sync_to_genesis::SoloNodeSyncToGenesis,
118+
bootstrap::SoloNodeBootstrap, sync_to_genesis::SoloNodeSyncToGenesis,
120119
sync_to_genesis_custom::SoloNodeSyncToGenesisCustom,
121120
},
122121
};
@@ -127,7 +126,6 @@ pub enum Scenarios {
127126
SoloNodeSyncToGenesis(SoloNodeSyncToGenesis),
128127
SoloNodeBootstrap(SoloNodeBootstrap),
129128
SoloNodeSyncToGenesisCustom(SoloNodeSyncToGenesisCustom),
130-
SoloNodeSyncRootSnarkedLedger(SoloNodeSyncRootSnarkedLedger),
131129
SoloNodeBasicConnectivityInitialJoining(SoloNodeBasicConnectivityInitialJoining),
132130
SoloNodeBasicConnectivityAcceptIncoming(SoloNodeBasicConnectivityAcceptIncoming),
133131
MultiNodeSync4BlockProducers(MultiNodeSync4BlockProducers),
@@ -223,7 +221,6 @@ impl Scenarios {
223221
Self::SoloNodeSyncToGenesis(_) => SoloNodeSyncToGenesis::DOCS,
224222
Self::SoloNodeBootstrap(_) => SoloNodeBootstrap::DOCS,
225223
Self::SoloNodeSyncToGenesisCustom(_) => SoloNodeSyncToGenesis::DOCS,
226-
Self::SoloNodeSyncRootSnarkedLedger(_) => SoloNodeSyncRootSnarkedLedger::DOCS,
227224
Self::SoloNodeBasicConnectivityInitialJoining(_) => {
228225
SoloNodeBasicConnectivityInitialJoining::DOCS
229226
}
@@ -304,7 +301,6 @@ impl Scenarios {
304301
Self::SoloNodeSyncToGenesis(v) => v.run(runner).await,
305302
Self::SoloNodeBootstrap(v) => v.run(runner).await,
306303
Self::SoloNodeSyncToGenesisCustom(v) => v.run(runner).await,
307-
Self::SoloNodeSyncRootSnarkedLedger(v) => v.run(runner).await,
308304
Self::SoloNodeBasicConnectivityInitialJoining(v) => v.run(runner).await,
309305
Self::SoloNodeBasicConnectivityAcceptIncoming(v) => v.run(runner).await,
310306
Self::MultiNodeSync4BlockProducers(v) => v.run(runner).await,

node/testing/src/scenarios/solo_node/basic_connectivity_initial_joining.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub struct SoloNodeBasicConnectivityInitialJoining;
2727

2828
impl SoloNodeBasicConnectivityInitialJoining {
2929
pub async fn run(self, mut runner: ClusterRunner<'_>) {
30+
std::env::set_var("MINA_DISCOVERY_FILTER_ADDR", "true");
3031
const MAX_PEERS_PER_NODE: usize = 100;
3132
const KNOWN_PEERS: usize = 5; // current devnet network
3233
const STEPS: usize = 3_000;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
pub mod basic_connectivity_accept_incoming;
22
pub mod basic_connectivity_initial_joining;
33
pub mod bootstrap;
4-
pub mod sync_root_snarked_ledger;
54
pub mod sync_to_genesis;
65
pub mod sync_to_genesis_custom;

0 commit comments

Comments
 (0)