Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

feat: log warning on legacy-style eth_getTransactionReceipt calls #779

Merged
merged 10 commits into from
Feb 19, 2021

Conversation

eggplantzzz
Copy link
Contributor

In Ganache v7, instamining will be enabled by default but implemented in a different way than v6.

In v6, a transaction is sent, Ganache mines the transaction, and then returns the transaction hash. This enables the user to immediately request the transaction receipt via eth_getTransactionReceipt. This is, however, not how nodes in the wild behave. In the wild, the transaction hash is returned to the user and then the user will need to wait until the transaction is mined before requesting the receipt. If they request the receipt before it is mined, they will receive a null response.

For v7, this behavior is modified to more accurately reflect what a user will experience from a node in the wild. This may be problematic for some folks upgrading as tests will probably break etc. In order to help them upgrade with more ease, a warning message is implemented here to help them understand the situation.

Copy link
Member

@davidmurdoch davidmurdoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work on this! Thanks for not being afraid to just dive in to these ganache internals. I'm made some suggestions and requested some changes. We should probably talk about some of them... though I know you aren't a huge fan of bikeshedding... so i can always find someone else to be pedantic with if you'd prefer 😁!

@davidmurdoch davidmurdoch changed the title Add instamine warning feat: log warning on legacy-style eth_getTransactionReceipt calls Feb 12, 2021
@eggplantzzz
Copy link
Contributor Author

Do note @davidmurdoch that I am not against bikeshedding in general. But when I don't feel strongly, I just let others that do decide :)

@davidmurdoch davidmurdoch merged commit 55fe020 into develop Feb 19, 2021
@davidmurdoch davidmurdoch deleted the add-instamine-warning branch February 19, 2021 21:24
sambacha pushed a commit to contractshark/ganache-core that referenced this pull request Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants