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

Duplicate transaction error #384

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

Comments

@pavybez
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Sep 8, 2017

You have to enter the commands quickly to reproduce error.

@learnforpractice

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2017

@pavybez

This comment has been minimized.

Copy link
Contributor Author

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.

@wanderingbort wanderingbort added the bug label Sep 12, 2017

@bytemaster

This comment has been minimized.

Copy link
Contributor

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 bytemaster closed this Sep 12, 2017

@bytemaster

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

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

@bytemaster

This comment has been minimized.

Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2017

@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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.