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

Duplications caused by http/proxy errors #3

Open
2 tasks
romantolkachyov opened this issue Dec 26, 2020 · 0 comments
Open
2 tasks

Duplications caused by http/proxy errors #3

romantolkachyov opened this issue Dec 26, 2020 · 0 comments

Comments

@romantolkachyov
Copy link
Owner

Why

It is possible that api response will get lost and the accounting client will retry request, so we will get a duplicated transaction.

What

Prevent possible duplications by introducing "nonce" for each transfer. The client should provide unique nonce for each request so we will catch duplicates described above.

How

The option I see is eth-like approach when the client retrieve last nonce from the node for his account, increment it and use incremented value for the next transaction. However, It requires additional api call.

The plan for this option:

  • receive and process nonce in transfer handler (+ handle errors)
  • add nonce field in the database with unique constraint
@romantolkachyov romantolkachyov added good first issue Good for newcomers and removed good first issue Good for newcomers labels Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant