trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.31k forks source link

visual debugger highlighting is buggy for tx #6122

Closed eggplantzzz closed 1 year ago

eggplantzzz commented 1 year ago

Debug tx 0x1004a927d96191a309e080b24d3b80e642974d378bd642269a31d993f59815cc on mainnet and you'll se that when it loads, the code is not correctly highlighted.

eggplantzzz commented 1 year ago

When I attempt to debug this using the CLI debugger I get a message saying "location is past end of source, displaying end". See the image below.

Screenshot 2023-06-23 at 3 31 23 PM
haltman-at commented 1 year ago

Hm, looks like a bad source map. Not sure there's much we can do about that, other than file an issue with Solidity. (Well -- in the visual debugger I guess we can improve how we handle this error case, but we can't, like, make it correct.)

Actually, in truth we have filed an issue with Solidity, namely, this one: https://github.com/ethereum/solidity/issues/12915

So, you could comment on that issue to add this example.

The nasty thing is that when this came up previously we weren't able to find a good reproduction example. We could reproduce it, yes, but we couldn't find any way to simplify the reproduction to make it manageable. So, yeah. :-/ Still, likely you should let them know about this anyway, so they know it's come up a second time!

eggplantzzz commented 1 year ago

On visual-debug, there is a bit of a hacky "workaround" now implemented. For now, if we get a null value for the end of the source range, we'll currently just assume it is to the end of the source.