Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

[Light] Bad response on request: [ TransactionIndex ] on eth_getTransactionReceipt #10444

Closed
Tbaut opened this issue Mar 3, 2019 · 6 comments
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M6-rpcapi 📣 RPC API. P2-asap 🌊 No need to stop dead in your tracks, however issue should be addressed as soon as possible.
Milestone

Comments

@Tbaut
Copy link
Contributor

Tbaut commented Mar 3, 2019

  • Parity Ethereum version: 2.3.4
  • Operating system: Linux
  • Installation:one-line installer
  • Fully synchronized: yes
  • Network: kovan, mainnet
  • Restarted: yes

In the following trace I send a eth_sendRawTransaction and then eth_getTransactionReceipt. I'll subsequently get the Bad response on request.

Below is a -l rpc log (I removed non useful info, just in case here is the full log).

2019-03-01 15:21:51   TRACE rpc  Request: {"id":166,"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xf86780048252089400dfc93112abd2578503b667b95491b101281f2b880162f9129760c0008077a05f863fde35960d1fae563f117681b84f1e8e1070c6e7c5f13f6d1a17468b7151a04f2d8953b5f14b268be0e1a4d665940e3cf7fed7cd4d45b7babe7fca871fe329"]}.
2019-03-01 15:21:51  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","result":"0x80fa64f09b8488fccfcbd4b57bc248adf03950e489674e83fbe43ee1f10ec363","id":166}.
2019-03-01 15:21:51   TRACE rpc  Request: {"id":167,"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x80fa64f09b8488fccfcbd4b57bc248adf03950e489674e83fbe43ee1f10ec363"]}.
2019-03-01 15:21:51   TRACE rpc  Request: {"id":168,"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x002adbe79bf04f0e42f1b949bb369936a65248bd","latest"]}.
2019-03-01 15:21:51   TRACE rpc  Request: {"id":169,"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x002adbe79bf04f0e42f1b949bb369936a65248bd","latest"]}.
2019-03-01 15:21:51  jsonrpc-eventloop-0 DEBUG rpc  [Some(Num(169))] Took 16ms
2019-03-01 15:21:51  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","result":"0x0","id":169}.
2019-03-01 15:21:51  jsonrpc-eventloop-0 DEBUG rpc  [Some(Num(168))] Took 617ms
2019-03-01 15:21:51  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","result":"0x0","id":168}.
2019-03-01 15:21:54  IO Worker #1 INFO import  Syncing #10458213 0xe61d…7fd4     0.1 hdr/s      0+    0 Qed  15/50 peers   2 MiB cache 0 bytes queue  RPC:  1 conn,    2 req/s,  140 µs
2019-03-01 15:21:54  Verifier #3 INFO import  Imported #10458214 0x7eb4…7e27 (1.64 Mgas)
2019-03-01 15:22:01  Verifier #2 INFO import  Imported #10458215 0x98df…29c6 (0.57 Mgas)
2019-03-01 15:22:01   TRACE rpc  Request: {"id":182,"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x002adbe79bf04f0e42f1b949bb369936a65248bd","latest"]}.
2019-03-01 15:22:01  jsonrpc-eventloop-0 DEBUG rpc  [Some(Num(182))] Took 32ms
2019-03-01 15:22:01  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","result":"0x0","id":182}.
2019-03-01 15:22:03  jsonrpc-eventloop-0 DEBUG rpc  [Some(Num(167))] Took 12072ms
2019-03-01 15:22:03  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","error":{"code":-32042,"message":"Bad response on request: [ TransactionIndex ]. Error cause was EmptyResponse, (majority count: 25 / total: 25)"},"id":167}.
2019-03-01 15:22:04   TRACE rpc  Request: {"id":186,"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x80fa64f09b8488fccfcbd4b57bc248adf03950e489674e83fbe43ee1f10ec363"]}.
2019-03-01 15:22:09  Verifier #0 INFO import  Imported #10458216 0x0645…f197 (1.23 Mgas)
2019-03-01 15:22:15  jsonrpc-eventloop-1 DEBUG rpc  [Some(Num(186))] Took 10800ms
2019-03-01 15:22:15  jsonrpc-eventloop-1 DEBUG rpc  Response: {"jsonrpc":"2.0","error":{"code":-32042,"message":"Bad response on request: [ TransactionIndex ]. Error cause was EmptyResponse, (majority count: 48 / total: 48)"},"id":186}.
2019-03-01 15:22:17   TRACE rpc  Request: {"id":203,"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x80fa64f09b8488fccfcbd4b57bc248adf03950e489674e83fbe43ee1f10ec363"]}.
2019-03-01 15:22:24  IO Worker #3 INFO import    18/50 peers   2 MiB cache 0 bytes queue  RPC:  1 conn,    1 req/s,  143 µs
2019-03-01 15:22:27  jsonrpc-eventloop-0 DEBUG rpc  [Some(Num(203))] Took 10157ms
2019-03-01 15:22:27  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","error":{"code":-32042,"message":"Bad response on request: [ TransactionIndex ]. Error cause was EmptyResponse, (majority count: 75 / total: 75)"},"id":203}.
2019-03-01 15:22:29  Verifier #1 INFO import  Imported #10458217 0xce13…08aa (1.55 Mgas)
2019-03-01 15:22:31   TRACE rpc  Request: {"id":221,"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x80fa64f09b8488fccfcbd4b57bc248adf03950e489674e83fbe43ee1f10ec363"]}.
2019-03-01 15:22:41  jsonrpc-eventloop-0 DEBUG rpc  [Some(Num(221))] Took 10052ms
2019-03-01 15:22:41  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","error":{"code":-32042,"message":"Bad response on request: [ TransactionIndex ]. Error cause was EmptyResponse, (majority count: 24 / total: 24)"},"id":221}.
2019-03-01 15:22:43  Verifier #0 INFO import  Imported #10458218 0xb851…2251 (0.52 Mgas)
2019-03-01 15:22:45  Verifier #1 INFO import  Imported #10458219 0x0b88…3bfb (1.55 Mgas)
2019-03-01 15:22:49   TRACE rpc  Request: {"id":243,"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x80fa64f09b8488fccfcbd4b57bc248adf03950e489674e83fbe43ee1f10ec363"]}.
2019-03-01 15:22:54  IO Worker #1 INFO import    19/50 peers   2 MiB cache 0 bytes queue  RPC:  1 conn,    1 req/s,  149 µs
2019-03-01 15:22:59  jsonrpc-eventloop-1 DEBUG rpc  [Some(Num(243))] Took 10005ms
2019-03-01 15:22:59  jsonrpc-eventloop-1 DEBUG rpc  Response: {"jsonrpc":"2.0","error":{"code":-32042,"message":"Bad response on request: [ TransactionIndex ]. Error cause was EmptyResponse, (majority count: 41 / total: 41)"},"id":243}.
2019-03-01 15:23:04  Verifier #2 INFO import  Imported #10458220 0x9cef…b4c3 (1.34 Mgas)
2019-03-01 15:23:04   TRACE rpc  Request: {"id":262,"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0x002adbe79bf04f0e42f1b949bb369936a65248bd","latest"]}.
2019-03-01 15:23:04  jsonrpc-eventloop-0 DEBUG rpc  [Some(Num(262))] Took 33ms
2019-03-01 15:23:04  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","result":"0x0","id":262}.
2019-03-01 15:23:15   TRACE rpc  Request: {"id":276,"jsonrpc":"2.0","method":"eth_getTransactionReceipt","params":["0x80fa64f09b8488fccfcbd4b57bc248adf03950e489674e83fbe43ee1f10ec363"]}.
2019-03-01 15:23:20   TRACE rpc  Request: {"id":284,"jsonrpc":"2.0","method":"eth_syncing","params":[]}.
2019-03-01 15:23:20  jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","result":{"currentBlock":"0x9f946c","highestBlock":"0x9f946e","startingBlock":"0x9f9441","warpChunksAmount":null,"warpChunksProcessed":null},"id":284}.
2019-03-01 15:23:20  Verifier #0 INFO import  Imported #10458221 0x00db…4826 (0.18 Mgas)
2019-03-01 15:23:24  IO Worker #1 INFO import    19/50 peers   2 MiB cache 0 bytes queue  RPC:  1 conn,    1 req/s,  146 µs
2019-03-01 15:23:28  jsonrpc-eventloop-1 DEBUG rpc  [Some(Num(276))] Took 12916ms
2019-03-01 15:23:28  jsonrpc-eventloop-1 DEBUG rpc  Response: {"jsonrpc":"2.0","error":{"code":-32042,"message":"Bad response on request: [ TransactionIndex ]. Error cause was EmptyResponse, (majority count: 21 / total: 21)"},"id":276}.
2019-03-01 15:23:41  Verifier #2 INFO import  Imported #10458223 0x082f…188e (4.52 Mgas)

edit: I can confirm that the problem doesn't exist on full nodes.

@Tbaut Tbaut added P2-asap 🌊 No need to stop dead in your tracks, however issue should be addressed as soon as possible. F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M6-rpcapi 📣 RPC API. labels Mar 3, 2019
@Tbaut Tbaut added this to the 2.5 milestone Mar 3, 2019
@gituser
Copy link

gituser commented Mar 7, 2019

It is indeed an issue on light client.
Because eth_getTransactionReceipt returns nothing or limit error (when transaction is in the pool) until transaction is mined.

It also breaks web3 implementation of transaction sending.

@donamk
Copy link

donamk commented Mar 19, 2019

I am suffering from this issue lot. I hope this issue fix it soon.

@Tbaut Tbaut changed the title [Light] Bad response on request: [ TransactionIndex ] after eth_sendRawTransaction [Light] Bad response on request: [ TransactionIndex ] on eth_getTransactionReceipt Mar 19, 2019
@Tbaut
Copy link
Contributor Author

Tbaut commented Mar 19, 2019

@donamk and @gituser can you tell us more about your use case?

FWIW, here is a possible explanation for this behavior.
There's no receipt available if the Tx isn't run.
For full nodes it works because a pending block is created and the transaction is run and actually ends up in the pending block (even if the node isn't a miner). Many fields of the eth_getTransactionReceipt response can't be filled without running the transaction (like cumulative gas used, logs, blooms, etc), which only full nodes do.

Now a better way to avoid this error is to poll eth_getTransactionByHash and look for the blockNumber, which will be null until the Tx is included into a block. We found the follow-up problem though as it seems that Tx aren't included into a block: #10490

@gituser
Copy link

gituser commented Mar 19, 2019

@Tbaut if you use standard web3 method for sending transaction https://web3js.readthedocs.io/en/1.0/web3-eth.html?highlight=sendtransaction#id72 the error will occur on eth_getTransactionReceipt. This method uses by default eth_getTransactionReceipt after sending the transaction.

So parity in this case returns this (because the reply from parity light node is empty on this particular transaction when it's still pending and not mined):

{"jsonrpc":"2.0","error":{"code":-32042,"message":"On demand query limit reached on query #0"},"id":1} when all query occured so there is probably no results (for instance wrong hash).

Yes, I understand that the error is because light client isn't storing anything locally and once transaction is mined the error is gone.

@soc1c soc1c modified the milestones: 2.5, 2.6 Apr 2, 2019
@nevillegrech
Copy link

I confim that this happens with other API calls such as getBlock, parity 2.4.6 light.

@adria0
Copy link

adria0 commented Jul 27, 2020

Closing issue due to its stale state.

@adria0 adria0 closed this as completed Jul 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F3-annoyance 💩 The client behaves within expectations, however this “expected behaviour” itself is at issue. M6-rpcapi 📣 RPC API. P2-asap 🌊 No need to stop dead in your tracks, however issue should be addressed as soon as possible.
Projects
None yet
Development

No branches or pull requests

7 participants