Skip to content
Snippets Groups Projects
Commit 3b5d9f02 authored by Anthony GRAIGNIC's avatar Anthony GRAIGNIC
Browse files

Add debug logs for VDF duration

parent d1811001
No related branches found
No related tags found
1 merge request!102Resolve "Remove VDF circuit-breaker"
Pipeline #6355 passed
use std::time::{Duration, Instant};
use ethereum_types::H256;
use ethnum::U256;
use tracing::log::debug;
use vdf::{InvalidIterations, InvalidProof, VDFParams, WesolowskiVDFParams, VDF};
use crate::h256_to_u256;
......@@ -38,7 +41,19 @@ pub async fn vdf<'a>(
if difficulty_check.is_err() {
return Err(difficulty_check.err().unwrap());
}
wesolowski_vdf.solve(&*challenge, vdf_difficulty)
debug!(
"Solving wesolowski_vdf, estimated time: {:?} (={:?}min)",
Duration::from_secs(vdf_difficulty / VDF_DIFFICULTY_PER_SEC),
vdf_difficulty / VDF_DIFFICULTY_PER_SEC / 60
);
let start = Instant::now();
let result = wesolowski_vdf.solve(&*challenge, vdf_difficulty);
debug!(
"Solved wesolowski_vdf in {:?} (estimated: {:?})",
start.elapsed(),
Duration::from_secs(vdf_difficulty / VDF_DIFFICULTY_PER_SEC)
);
result
})
.await
.unwrap()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment