web3.js expects newBlockHeaders call in some cases
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
as a solution we can just not use websockets anymore, the error won't happen with http provider. Also fixes https://github.com/leapdao/leap-core/pull/101