ganache
ganache copied to clipboard
fix: ensure `COINBASE` instruction is correct in `debug_traceTransaction`
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.
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
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.