evmdasm icon indicating copy to clipboard operation
evmdasm copied to clipboard

invalid opcode logs an error, which could be too severe

Open bsztankovacs opened this issue 2 years ago • 0 comments

there is an error-level log message in evmdasm/disassembler.py L:36

the problem is that this error level log could create high severity noise in logging / output, whereas it does not result in general derailing of the function, just a skipped opcode.

to reduce output noise, I would suggest two approaches:

  1. change the log level to logger.warning() because it's not a showstopper, but it is still irregular and it is not the expected operation

  2. if we deem this as a serious error (which isn't currently, because currently it do not stop operation just skip the erroneous opcode) then raise an exception. However, for backward compatibility it should not be the default solution (in case someone already decided to let these happen), but rather as an option to raise an exception if an invalid opcode is encountered. however, the logging severity should still be lowered in case someone does not want to get exceptions for invalid opcodes - again, to reduce noise

bsztankovacs avatar Jun 09 '23 08:06 bsztankovacs