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

web3.js expects newBlockHeaders call in some cases #255

Open
TimDaub opened this issue Apr 24, 2019 · 1 comment
Open

web3.js expects newBlockHeaders call in some cases #255

TimDaub opened this issue Apr 24, 2019 · 1 comment

Comments

@TimDaub
Copy link
Contributor

TimDaub commented Apr 24, 2019

We're initializing web3 with a websocket provider and sending a transaction with sendSignedTransaction. When a transaction is dropped by the node (e.g. because it is invalid) or when it is still pending, the node returns:

{"jsonrpc":"2.0","id":1,"result":null}

This triggers web3 to call web3.eth.subscribe("newBlockHeaders"). (docs here) It does this so it can check whether the transaction is included in one of the following blocks. So it periodically checks for the transaction receipt again when a new block is returned via the newBlockHeaders subscription service.

In the leap-node's case, however, web3.eth.subscribe("newBlockHeaders") returns a Method not found error, which causes sendSignedTransaction to throw and a dapp to crash.

It would hence be good if the leap-node would support the "newBlockHeaders".
Unfortunately, I wasn't able to find documentation in that call :(

Edit: This is the current work-around: https://github.com/leapdao/burner-wallet/pull/57/files#diff-14b1e33d5bf5649597cdc0e4f684daddR2142

@troggy
Copy link
Member

troggy commented May 1, 2019

as a solution we can just not use websockets anymore, the error won't happen with http provider. Also fixes leapdao/leap-core#101

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

No branches or pull requests

2 participants