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

[RPC] Error while generating receipt of transactions: Transaction with the same hash was already imported. #8237

Closed
AyushyaChitransh opened this issue Mar 27, 2018 · 4 comments
Labels
M6-rpcapi 📣 RPC API. Z0-unconfirmed 🤔 Issue might be valid, but it’s not yet known.

Comments

@AyushyaChitransh
Copy link

I'm running:

  • Which Parity version?: Parity//v1.10.0-unstable-66755be8f-20180206/x86_64-linux-gnu/rustc1.23.0
    --
  • Which operating system?: Linux
  • How installed?: from source
  • Are you fully synchronized?: Yes
  • Which network are you connected to?: On private/custom network
  • Did you try to restart the node?: yes

I'm trying to send many transactions from a account rapidly. It works to some extent. I am able to successfully send ~200 txns(transfer eth from one EOA to another). But when I try to send more txns, I get an error response from the client stating that

Transaction with the same hash was already imported.

or

Error: Invalid JSON RPC response: ""

But when I check the explorer, I see that all txns have gone through. Even the ones which said Transaction with the same hash was already imported.

To elaborate, I am confident that this is not the case, all txns have different hash. The script I am using to send transactions gets the account nonce, and then prepare the txns with incremental nonce and send signed txns.

@tomusdrw
Copy link
Collaborator

Do you mind running with -lrpc=trace,txqueue=debug,miner=debug?

Could you check if the behaviour occurs as well when running with --jsonrpc-threads 0

@AyushyaChitransh
Copy link
Author

Yes sure, I'll update more details on this by tomorrow.

@AyushyaChitransh
Copy link
Author

Check if the behaviour occurs as well when running with --jsonrpc-threads 0

Yes. The issue still exists. Out of 700 txns, 341 txns were mined in first block 354 were mined a block later. The issue was that I received error response Error: Invalid JSON RPC response: "" from RPC for 331 txns.

Running with --jsonrpc-threads 0 -lrpc=trace,txqueue=debug,miner=debug

  • For the first run, all 700 txns were mined without error.
  • Then I sent again. Out of that, I received error in 41/700 txns. But all 700 were mined.
  • Then I sent again. Now I got error in 493/700 txns. But all 700 were mined.
  • Then I sent again. Now I recieved error in 66/700 txns. But all 700 were mined.

I have posted the trace, debug logs in gist.

@tomusdrw
Copy link
Collaborator

tomusdrw commented Mar 28, 2018

@AyushyaChitransh Error: Invalid JSON RPC response: "" is a different error than Transaction with the same hash was already imported.

The first one is generated by web3 and it's most likely caused by your request timeing out (since you are spamming a lot of requests at the node, some of them might be processed out of order and with significant delay). Please increase the timeout period, or send requests in waves (generate 10k, submit and wait for all before submitting next 10k) to make sure you are receiving all the responses.

The second error is interesting, would be awesome to get a log that actually contains this.

@5chdn 5chdn added Z0-unconfirmed 🤔 Issue might be valid, but it’s not yet known. M6-rpcapi 📣 RPC API. labels Mar 28, 2018
@5chdn 5chdn added this to the 1.11 milestone Mar 28, 2018
@5chdn 5chdn closed this as completed Apr 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
M6-rpcapi 📣 RPC API. Z0-unconfirmed 🤔 Issue might be valid, but it’s not yet known.
Projects
None yet
Development

No branches or pull requests

3 participants