fix lints
This commit is contained in:
parent
14cefed23b
commit
2ee606c951
@ -44,7 +44,7 @@ pub fn track(
|
||||
let client = reqwest::Client::new();
|
||||
let _ = client
|
||||
.post("https://api.mixpanel.com/track?ip=1")
|
||||
.body(format!("[{}]", body.to_string()))
|
||||
.body(format!("[{}]", body))
|
||||
.header(ACCEPT, "text/plain")
|
||||
.header(CONTENT_TYPE, "application/json")
|
||||
.send()
|
||||
|
@ -1,7 +1,7 @@
|
||||
#[cfg(debug_assertions)]
|
||||
pub fn analytics_token(_ws_addr_string: &str) -> String {
|
||||
// Use one of the tokens in the release version if debugging analytics
|
||||
return "".into();
|
||||
"".into()
|
||||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
|
@ -118,7 +118,7 @@ async fn main() {
|
||||
contents: Some(prover_request::Contents::Registration(
|
||||
ProverRequestRegistration {
|
||||
prover_type: ProverType::Volunteer.into(),
|
||||
prover_id: prover_id.clone().into(),
|
||||
prover_id: prover_id.clone(),
|
||||
estimated_proof_cycles_hertz: None,
|
||||
},
|
||||
)),
|
||||
@ -127,29 +127,25 @@ async fn main() {
|
||||
let mut retries = 0;
|
||||
let max_retries = 5;
|
||||
|
||||
loop {
|
||||
if let Err(e) = client
|
||||
.send(Message::Binary(registration.encode_to_vec()))
|
||||
.await
|
||||
{
|
||||
eprintln!(
|
||||
"Failed to send message: {:?}, attempt {}/{}",
|
||||
e,
|
||||
retries + 1,
|
||||
max_retries
|
||||
);
|
||||
while let Err(e) = client
|
||||
.send(Message::Binary(registration.encode_to_vec()))
|
||||
.await
|
||||
{
|
||||
eprintln!(
|
||||
"Failed to send message: {:?}, attempt {}/{}",
|
||||
e,
|
||||
retries + 1,
|
||||
max_retries
|
||||
);
|
||||
|
||||
retries += 1;
|
||||
if retries >= max_retries {
|
||||
eprintln!("Max retries reached, exiting...");
|
||||
break;
|
||||
}
|
||||
|
||||
// Add a delay before retrying
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(u64::pow(2, retries))).await;
|
||||
} else {
|
||||
retries += 1;
|
||||
if retries >= max_retries {
|
||||
eprintln!("Max retries reached, exiting...");
|
||||
break;
|
||||
}
|
||||
|
||||
// Add a delay before retrying
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(u64::pow(2, retries))).await;
|
||||
}
|
||||
|
||||
track(
|
||||
@ -188,7 +184,7 @@ async fn main() {
|
||||
);
|
||||
|
||||
let mut vm: NexusVM<MerkleTrie> =
|
||||
parse_elf(&elf_bytes.as_ref()).expect("error loading and parsing RISC-V instruction");
|
||||
parse_elf(elf_bytes.as_ref()).expect("error loading and parsing RISC-V instruction");
|
||||
vm.syscalls.set_input(&input);
|
||||
|
||||
// TODO(collinjackson): Get outputs
|
||||
@ -252,10 +248,10 @@ async fn main() {
|
||||
completed_fraction = steps_proven as f32 / steps_to_prove as f32;
|
||||
let progress = ProverRequest {
|
||||
contents: Some(prover_request::Contents::Progress(Progress {
|
||||
completed_fraction: completed_fraction,
|
||||
completed_fraction,
|
||||
steps_in_trace: total_steps as i32,
|
||||
steps_to_prove: steps_to_prove as i32,
|
||||
steps_proven: steps_proven as i32,
|
||||
steps_proven,
|
||||
})),
|
||||
};
|
||||
let progress_duration = SystemTime::now().duration_since(progress_time).unwrap();
|
||||
|
Loading…
Reference in New Issue
Block a user