zemse / hardhat-tracer

🕵️ allows you to see internal calls, events and storage operations in the console
MIT License
341 stars 35 forks source link

Missing OPCODES that can be enabled #58

Closed rori4 closed 11 months ago

rori4 commented 11 months ago

I've been trying to enable "MSTORE", "MLOAD", "MLOAD8", "MSTORE8" on the latest version of the extension but without any success. I know that it was possible before to see them at least in version 1.2.1 so I have been stuck on using an older version.

I also don't see any support in the files for those right now but previously it seems we had them. Any reason for removing them?

image

zemse commented 11 months ago

Hey @rori4, sorry for the inconvenience. I think MLOAD, MSTORE was added to v1 after branching out v2 and I missed re-adding those features to v2.

I've just added them back. Can you try hardhat-tracer@2.6.0 if it works as expected?

rori4 commented 11 months ago

yes it works nicely in that version!

One last thing that I see a difference between the last version and the current is that the gas cost was shown for each OPCODE. I have enabled hre.tracer.gasCost = true and I don't see that

I think this was a really amazing feature that helps a lot with gas optimisation

also the different coloring of storing and reading memory or state was quite helpful but that's just cosmetics.

image

image

EDIT: If I need to open another issue for that let me know

zemse commented 11 months ago

Displaying gas cost could be lil tricky since in v2 im using the underlying ethereum vm. I can look into it though.

It is easy to change colours through this file, colours of MSTORE and SSTORE seem to be same in v1 so they might be confusing. Do you have any recommendations? (also feel free if you want to play around with some colors and make a quick PR)

rori4 commented 11 months ago

Ou thanks a lot! I will check and play around with it!

Btw I see the colors should be the same as in v1 but magenta has been applied, maybe its a bug or something. Anyway that's not big of an issue but I will check it when I have time and make a PR if I come up with something cool or find a bug.

I will also try to add back the gas cost if I can.

Anyway thanks for being responsive and for adding back the other OPCODES. I will close this issue now as its been resolved :)

zemse commented 11 months ago

Btw I see the colors should be the same as in v1 but magenta has been applied, maybe its a bug or something

Oh I actually pushed a commit with the fix, it's unreleased.