ganache icon indicating copy to clipboard operation
ganache copied to clipboard

fix: ensure `COINBASE` instruction is correct in `debug_traceTransaction`

Open robmcl4 opened this issue 2 years ago • 2 comments

Previously, the instruction COINBASE was returning the address of the prior block's miner, which resulted in an incorrect debug trace. This corrects it to the miner of the traced transaction's block.

robmcl4 avatar Jun 13 '22 18:06 robmcl4

Actually, it's also necessary to change the difficulty as well -- or else the DIFFICULTY instruction will run incorrectly. For example, it causes this transaction to debug_traceTransaction incorrectly: 0x4fdc0efb59dbc47759bb23069eb5eec83079068818ade9578f57c13adb2b6290

robmcl4 avatar Jun 14 '22 04:06 robmcl4

Awesome. Thanks for finding these issues and proposing fixes. I'd like to add some tests for this before merging. We might want to update this PR to fix DIFFICULTY as well.

davidmurdoch avatar Jun 22 '22 18:06 davidmurdoch