-
Notifications
You must be signed in to change notification settings - Fork 298
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
Handle additional panics #1250
Handle additional panics #1250
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
evm/src/generation/mod.rs
Outdated
let mut state = GenerationState::<F>::new(inputs.clone(), &KERNEL.code) | ||
.map_err(|_| anyhow!("Failed to parse all the initial prover inputs"))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Could also do
.map_err(|err| anyhow!("Failed to parse all the initial prover inputs: {:?}", err))?;
to get more info on which ProgramError was thrown. Also applies elsewhere in this PR.
evm/src/util.rs
Outdated
if TryInto::<usize>::try_into(u256).is_err() { | ||
return Err(ProgramError::IntegerTooLarge); | ||
} | ||
|
||
Ok(u256.as_usize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
if TryInto::<usize>::try_into(u256).is_err() { | |
return Err(ProgramError::IntegerTooLarge); | |
} | |
Ok(u256.as_usize()) | |
u256.try_into().map_err(|_| ProgramError::IntegerTooLarge) |
This PR partly addresses #1247. More specifically, it handles (on the EVM crate):
as_usize()
callsexpect()
callsU256
methods with implicit internal panic (from_big_endian
/from_big_endian
/div_mod
).I haven't changed (unless required from cascade changes) the kernel / tests + interpreter files as those don't matter as much (panic in testing is fine, and the kernel risks of panic would arise during the offline preprocessing phase which would be caught ahead).