-
Notifications
You must be signed in to change notification settings - Fork 791
fix: remove OpCode
enum and update VMOperation
's op
field type
#1904
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.
imo this is probably easier to maintain than an enum, so I'm supportive of this,
OpCode
enum and update VMOperation
's op
fieldOpCode
enum and update VMOperation
's op
field type
Should we instead do |
This route looks like a valid solution to unwanted serialization errors - I will work on implementing it, and we can test how it works. |
Unsure whether it is necessary to test deserializing unknown opcodes, can remove the test if not needed |
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.
typo on the type, lgtm otherwise
Co-authored-by: Georgios Konstantopoulos <[email protected]>
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.
Good catch, typo has been fixed
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.
forgot to add files to prev comment
Motivation
Addresses #1902
Ensures that tracing with VmTrace enabled will continue to be future proof in the presence of any opcodes added/renamed when ethereum undergoes a new hardfork.
Solution
Removed the ethers::core::types::OpCode enum by deleting it's source fileChanged VMOperation's op field to be of type string.Create new enum
ExecutedInstruction
that deserializes opcodes from VmTrace into eitherExectutedInstruction::Known(Opcode)
orExecutedInstruction::Unknown(String)
PR Checklist