-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat: introduces verbose actionable error messaging #592
base: main
Are you sure you want to change the base?
Conversation
…c into db/handle-errors
if let ExecutionResult::Halt { reason } = result.result { | ||
// Halt means that something went really bad with the transaction execution (in most cases invalid signature, | ||
// but it could also be bootloader panic etc). | ||
// In such case, we should not persist the VM data, and we should pretend that transaction never existed. | ||
anyhow::bail!("Transaction HALT: {reason}"); | ||
let reason_clone = reason.clone(); | ||
|
||
let halt_error = tokio::runtime::Handle::current().block_on(async { | ||
tokio::task::spawn_blocking(move || { | ||
// Create a new multi-threaded runtime explicitly. | ||
let rt = tokio::runtime::Builder::new_multi_thread() | ||
.enable_all() | ||
.build() | ||
.expect("Failed to create multi-threaded runtime"); | ||
rt.block_on(reason_clone.to_halt_error()) | ||
}) | ||
.await | ||
.expect("spawn_blocking failed") | ||
}); | ||
|
||
print_execution_error(&halt_error, Some(&l2_tx)); |
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.
Could use some guidance here, this fails the unit tests due to runtime error. It would be ideal if we can still handle halt reasons and provide users with an informative error message here rather than just bailing with halt reason.
Any insight on how I can handle the threading issue? I suppose I can make the unit tests multi-threaded (e.g. #[tokio::test(flavor = "multi_thread")]
) but that seems like a workaround.
Closed #571 in favour of this PR given all the changes since then.
The following
etc/errors/anvil.json
json file outlines the errors that could be hit based on the errors defined here. To make it easier to review and have discussion please refer to this Notion page where the json schema and display are also present for easier dialogue. Feedback would be appreciated, especially as many error cases I am unfamiliar with so assistance in properly defining cause / fixes would be helpful.cc: @sayon @itegulov @popzxc
What 💻
zksync-error
to define Halt and Revert errors to be displayed to usersCallErrorTracer
Logging and Update Revert/Halt Handling #436 and [FEAT] Integrateerror-codegen
for insightful and actionable debugging #537Why ✋
Evidence 📷
Include screenshots, screen recordings, or
console
output here demonstrating that your changes work as intendedPrevious errors shown
Note: We print gas estimation details implying its a gas issue even though this error is the account having insufficient funds.
Defined structured errors shown
Note: same error.