Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Duplicate transaction error #384

Closed
pavybez opened this issue Sep 8, 2017 · 7 comments · Fixed by #422
Closed

Duplicate transaction error #384

pavybez opened this issue Sep 8, 2017 · 7 comments · Fixed by #422

Comments

@pavybez
Copy link

pavybez commented Sep 8, 2017

When I attempt to do the following twice it throws up a duplicate transaction error:

./eosc --wallet-port 7777 transfer inita currency 10000

If I run the same command with a different amount it works fine but only once.

./eosc --wallet-port 7777 transfer inita currency 10001

The error output is as below:

2274982ms thread-0 main.cpp:768 main ] Failed with error: 10 assert_exception: Assert Exception
status_code == 200: Error
: 3030011 tx_duplicate: duplicate transaction
Transaction is not unique
{}
thread-0 chain_controller.cpp:828 validate_uniqueness

@pavybez
Copy link
Author

pavybez commented Sep 8, 2017

You have to enter the commands quickly to reproduce error.

@learnforpractice
Copy link
Contributor

learnforpractice commented Sep 8, 2017 via email

@pavybez
Copy link
Author

pavybez commented Sep 11, 2017

I debugged code and found that we generate a digest using transaction details. Hence if we have two similar transactions in the same block the message digest turns out to be the same and the hash function produces the same ID for both transactions. I think we should have a unique identifier for transaction besides just the block reference number.

@bytemaster
Copy link
Contributor

bytemaster commented Sep 12, 2017

This isn't a bug per-say, you can resend the transaction after the expiration of the original.

You can update the TAPOS every 3 seconds (or use older tapos)
You can update the expiration if you really need to
You can add a dummy message to the transaction as well.

@bytemaster
Copy link
Contributor

Alternatively, you can put multiple transfers in a single transaction.
The wallet could implement the "naggle" algorithm if this double-sending occurs frequently

@bytemaster
Copy link
Contributor

bytemaster commented Sep 12, 2017

This issue should be resolved in the following way:

  • add a print message explaining why a duplicate was created and indicating ways to fix it
  • implement a flag on CLI wallet to specify a longer expiration window
  • implement a flag on CLI wallet to add a "random" no-op message to force uniqueness, documentation of flag should warn user that it will consume extra bandwidth

@wanderingbort wanderingbort self-assigned this Sep 13, 2017
@wanderingbort wanderingbort added this to the EOS Dawn 1.0 milestone Sep 13, 2017
@wanderingbort
Copy link
Contributor

@bytemaster Instead of a "noop" message which would need to be recognized by the producer code so that it doesn't try to load some wasm code account and execute it, how do you feel about pushing 1-4 extraneous bytes to the end of a single messages data? Currently we are not enforcing that every byte of a message is read and this would ultimately save the overhead of an additional message header.

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

Successfully merging a pull request may close this issue.

4 participants