Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: panic app when cannot send prove #15

Merged
merged 7 commits into from
Oct 21, 2024
Merged

Conversation

toanbk
Copy link
Contributor

@toanbk toanbk commented Oct 17, 2024

  • Remove unused import
  • Fail gracefully during a temporary network disconnection.

Fixes #10

Copy link
Collaborator

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just a few minor comments, let me know if you agree and then I'll merge it

@@ -32,7 +32,7 @@ use nexus_core::{
init_circuit_trace, key::CanonicalSerialize, pp::gen_vm_pp, prove_seq_step, types::*,
},
};
use std::env;
// use std::env;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// use std::env;

}

// Optionally, add a delay before retrying
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do exponential backoff here? (Multiply sleep delay by 2 each time.)

}

// Optionally, add a delay before retrying
tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do exponential backoff here? (Multiply sleep delay by 2 each time.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, let me update

Copy link
Collaborator

@collinjackson collinjackson Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this, and remove the comment

-                    // Optionally, add a delay before retrying
-                    tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
+                    tokio::time::sleep(tokio::time::Duration::from_secs(u64::pow(2, retries))).await;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated, please help me check and merge.

Thank you

@collinjackson collinjackson changed the title FIx panic app when cannot send prove fix: panic app when cannot send prove Oct 18, 2024
@collinjackson collinjackson merged commit 0bff6e3 into nexus-xyz:main Oct 21, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

thread 'main' panicked at src/prover.rs:142:66:
2 participants