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

fix: set the earliest block tag on startup when forking #3755

Merged
merged 9 commits into from
Jan 12, 2023

Conversation

adjisb
Copy link
Contributor

@adjisb adjisb commented Oct 3, 2022

This change updates Ganache's startup procedure when forking to retrieve the earliest block from the remote and cache this block as the earliest block in Ganache's block manager. This fixes a bug where calling eth_getBlockByNumber with the "earliest" block tag parameter yielded no result.

Copy link
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

Great stuff, thanks for the PR! Just a tiny change and a question from me. Would love to see what @davidmurdoch thinks.

Copy link
Contributor

@MicaiahReid MicaiahReid left a comment

Choose a reason for hiding this comment

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

Also, we use prettier for our linting. I just ran prettier on the files you changed and added some suggested changes accordingly.

src/chains/ethereum/ethereum/src/blockchain.ts Outdated Show resolved Hide resolved
@adjisb
Copy link
Contributor Author

adjisb commented Oct 6, 2022

Great stuff, thanks for the PR! Just a tiny change and a question from me. Would love to see what @davidmurdoch thinks.

To be honest the important stuff is in: PR3692, this PRs are just to simplify 3692

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.

Crazy that this bug has been in here for so long! Thanks so much for this PR!

I've requested a couple of changes, as well as pinged others for their opinions. If you don't want to make the changes yourself let me know and we can take over. Thanks again!

@MicaiahReid MicaiahReid changed the title fix: set the right value to earliest when forking fix: set the earliest block tag on startup when forking Jan 6, 2023
@MicaiahReid MicaiahReid merged commit 7ee7d4b into trufflesuite:develop Jan 12, 2023
@gitpoap-bot
Copy link

gitpoap-bot bot commented Jan 12, 2023

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2023 Ganache Contributor:

GitPOAP: 2023 Ganache Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

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.

4 participants