Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch(v5.0.0): create a fresh instance of Web3Provider with this.provider every time #79

Open
wants to merge 1 commit into
base: v5.0.0
Choose a base branch
from

Conversation

dbrans
Copy link

@dbrans dbrans commented Jun 14, 2024

No description provided.

Copy link
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

What problem does this solve, and can we add a test to prevent the problem from occurring again?

@dbrans
Copy link
Author

dbrans commented Jul 12, 2024

@mcmire, from the PR description of MetaMask/metamask-extension#25342:

The original patch was introduced 7 months ago by @matthewwalsh0 "because the underlying proxy stopped working, meaning it would no longer send calls to the latest chain but be stuck on the original one. The quick fix was to patch it to create a fresh a Web3Provider for each call."
@jiexi and @shanejonas have since identified the root cause of the issue this patch fixes: ethersjs.Web3Provider is not Proxy-friendly because it stores a reference to the sendAsync method of the provider.

@mcmire
Copy link
Contributor

mcmire commented Jul 12, 2024

Thanks @dbrans. I see that this is backporting a change that's already in main, so perhaps not as important to add a test here, but can we add a blurb in the PR description for future reference/context at least? Or perhaps just link to that comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants