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: CallErrorTracer Logging and Update Revert/Halt Handling #436

Open
dutterbutter opened this issue Nov 26, 2024 · 1 comment
Open

Fix: CallErrorTracer Logging and Update Revert/Halt Handling #436

dutterbutter opened this issue Nov 26, 2024 · 1 comment

Comments

@dutterbutter
Copy link
Collaborator

dutterbutter commented Nov 26, 2024

Problem

The CallErrorTracer produces repetitive, unstructured logs (tracing::error!("!! Got error flags:")) without context, making them hard to interpret. Additionally, handling for ExecutionResult::Revert and ExecutionResult::Halt lacks actionable insights or proper structuring.

Solution

  1. Structured Logging
    Replace unstructured error logs with clear, context-rich messages:

    • Include VM error flags.
    • Add transaction revert reasons where applicable.
    • Ensure logs provide actionable insights.
  2. Update Handling for Revert/Halt Results
    Enhance ExecutionResult::Revert and ExecutionResult::Halt handling to:

    • Log meaningful context (e.g., transaction details, reason for revert/halt).
    • Structure messages to align with improved logging standards.

Action Items

  1. Refactor CallErrorTracer to:
    • Replace tracing::error!("!! Got error flags:") with structured logs.
    • Include VM error flags and relevant details.
  2. Update handling for ExecutionResult::Revert and ExecutionResult::Halt:
    • Extract and log transaction context and revert/halt reasons.
    • Ensure concise, actionable output.

Example of current output:

01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
01:49:17 ERROR !! Got error flags: 
01:49:17 ERROR NOT ENOUGH ERGS
@dutterbutter
Copy link
Collaborator Author

dutterbutter commented Nov 26, 2024

WIP and related work:

Also relevant are the error messages that we need to distinguish, they primarily made up of:

Ideally, we can even be more granular and distinguish TxRevertReason::ValidationFailed from incorrect signature to insufficient funds.

Initial view of errors:

Screenshot 2024-11-25 at 7 55 49 PM

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

No branches or pull requests

1 participant