-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Feature: Subscription support #5458
Conversation
Addressing the "missing provider" test failures... |
Can we add "fixes #5425" to this PR? |
@kumavis and @danfinlay, does this change the way one has to write web3 code in a Dapp? I am using web3.js@v1.0.0-beta.36, and when I do this on Rinkeby: After this PR, the UI will show the error: And deeper, the RPC error when calling My PR #5283 depends on this functionality, and I thought possibly it's just that the web3 syntax has changed. |
@HowardBraham this has been fixed in MetaMask/eth-json-rpc-middleware#6 |
Ahah, thank you @tmashuang! |
So with this merged in, is Metamask now compatible with web3 1.0? |
This enables partial support for the experimental "web3 1.0 Ethereum JSON RPC subscriptions", covering the two most commonly used subscription types
newHeads
andlogs
.supported subscription types:
newHeads
new block headers https://github.com/ethereum/go-ethereum/wiki/RPC-PUB-SUB#newheadslogs
evm log filter results https://github.com/ethereum/go-ethereum/wiki/RPC-PUB-SUB#logsnewPendingTransactions
get pending txs as we hear about them (somewhat functional in provider-engine, but likely not compliant)syncing
whether the client is currently syncing blocks or not (not implemented in provider-engine either)changes in deps
Lionshare of the changes appears in the following deps:
testing and QA
While subscription support is tested in the
eth-json-rpc-filters
module, MetaMask is lacking dapp-level integration tests. It can be QA'd like this:metamask.io
and open the consolesubscribe to
newHeads
subscribe to a log filter (eg DAI txs)
subscribe to all logs (fire hose warning)
Relevant Issues and PRs
This PR replaces MetaMask/providers#3
Fixes #5425
Fixes #3642