zemse / hardhat-tracer

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

Tracing of network-helpers.mine() event #77

Open graygt opened 1 month ago

graygt commented 1 month ago

I'm trying to simulate multiple txs in the same block. I send txs to "mempool" consequently and finally run network-helpers.mine() to mine the block. On the event of sending, I see logs like:

Hardhat Tracer wanted to print trace, but lastTrace is undefined. 
This only works on hardhat network, if you are running your script over RPC provider then VM data is not available.

I'd like to trace txs on the mining event. How can I do it?

One way is to run debug_traceTransaction for every mined txs and then convert them to readable format. Can I use this module to do it?

zemse commented 1 month ago

Thanks for reporting. This plugin wasn't tracing when block was being authored through evm_mine, just tried to fix this behaviour.

Now the trace should be printed when you mine the block.

Please try hardhat-tracer@3.1.0.