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

Print OpCode on partial exec failure #525

Merged
merged 5 commits into from
Aug 29, 2024
Merged

Print OpCode on partial exec failure #525

merged 5 commits into from
Aug 29, 2024

Conversation

msooseth
Copy link
Collaborator

Description

Before:

     - Unexpected Symbolic Arguments to Opcode
       msg: "trying to access a symbolic address that isn't already present in storage"
       program counter: 73
       arguments:
         (SymAddr "caller")

Now:

     - Unexpected Symbolic Arguments to Opcode
       msg: "trying to access a symbolic address that isn't already present in storage"
       opcode: CALL
       program counter: 73
       arguments:
         (SymAddr "caller")

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@msooseth msooseth changed the title [DERAFT] Print OpCode on partial exec failure [DRAFT] Print OpCode on partial exec failure Aug 12, 2024
@msooseth msooseth marked this pull request as ready for review August 28, 2024 10:50
@msooseth msooseth requested a review from blishko August 28, 2024 10:50
@msooseth msooseth changed the title [DRAFT] Print OpCode on partial exec failure Print OpCode on partial exec failure Aug 28, 2024
src/EVM.hs Outdated
@@ -230,6 +230,17 @@ isCreation = \case
next :: (?op :: Word8) => EVM t s ()
next = modifying (#state % #pc) (+ (opSize ?op))

getOpName :: forall (t :: VMType) s . FrameState t s -> [Char]
getOpName state = intToOpName $ fromEnum $ (?op)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
getOpName state = intToOpName $ fromEnum $ (?op)
getOpName state = intToOpName $ fromEnum (?op)

I also don't understand why do you call it ?op.
From what I read question mark at the beginning is used for implicit parameters, but that is not the case here, no?
Why not call it just op?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch! Let me try to fix...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you re-review? I cleaned up everything :)

@msooseth msooseth force-pushed the better-partial-warning branch from b66cf46 to 63e0d0f Compare August 28, 2024 14:56
Copy link
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

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

LGTM!

@blishko blishko merged commit c41c7fe into main Aug 29, 2024
9 checks passed
@blishko blishko deleted the better-partial-warning branch August 29, 2024 08:51
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