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

Verify perf #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Verify perf #4

wants to merge 13 commits into from

Conversation

NDobrev
Copy link
Contributor

@NDobrev NDobrev commented Feb 7, 2025

No description provided.

Copy link
Collaborator

@smanilov smanilov left a comment

Choose a reason for hiding this comment

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

Preliminary review; interrupted by other tasks.

src/main.rs Outdated
@@ -80,7 +130,7 @@ fn main() {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This check will be triggered only if someone passes an empty string as the file name.

Clap has checks for missing flags included, so you could just remove this, unless you want exactly this behavior (to catch --input-file "").

# ./target/release/dvt_prover_host --input-file 
error: a value is required for '--input-file <INPUT_FILE>' but none was supplied

For more information, try '--help'.
# ./target/release/dvt_prover_host --input-file "" --type share
No file name provided after '--input-file'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reworked

src/main.rs Outdated
}

fn read_text_file(filename: &str) -> Result<String, Box<dyn Error>> {
fn read_text_file(filename: &str) -> Result<String, Box<dyn Error>> {
let mut file = File::open(filename).map_err(|e| format!("Error opening file: {}", e))?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The error currently looks like this:

# ./target/release/dvt_prover_host --input-file examples/dvt_bad_share.json --type share --json-schema-file foo
Error opening file: No such file or directory (os error 2)

In my opinion, this is a shortcoming of std::io: the name of the file is not printed. I would add it in the error message manually:

let mut file = File::open(filename).map_err(|e| format!("Error opening file {filename}: {e}"))?;

Also, note that you can interpolate variables directly. (But not expressions; format!("{x}"); works, but format!("{call_me()}"); does not.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reworked

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see this change in the current code. Did you forget to add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now should be there

Copy link
Collaborator

@smanilov smanilov left a comment

Choose a reason for hiding this comment

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

Finished review of the share_exchange_prove guest program.

Let me know if you would like me to review more of this code (the other guest programs).

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.

2 participants