forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Currently zkasm_runner::ExecutionResult looks the following way:
pub struct ExecutionResult {
/// Path to the main zkAsm file that was executed.
path: String,
/// Status of the execution.
pub status: ExecutionStatus,
/// Error message in case the execution failed.
pub error: Option<String>,
/// Profiling information about this execution.
/// Only populated for the successful executions.
counters: Option<Counters>,
}And I have a few questions about it:
- is it true that if and only if
statusisExecutionStatus::Success, thanerrorcontainsNoneandcounterscontainsSome? - is it true that if and only if
statusisExecutionStatus::RuntimeError, thanerrorcontainsSomeandcounterscontainsNone?
If answer for both questions above is "yes" does we really need status field? It sounds like we already have info about status in error and counters fields. And, keeping one more such field will need to add extra attention to keep this fields consistent (be sure answer for both questions above is always "yes"). Maybe it will be better to remove this field and add method:
impl ExecutionResult {
pub fn status(&self) -> ExecutionStatus {
match self.error {
Some(_) => ExecutionStatus::Success,
None => ExecutionStatus::RuntimeError,
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels