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

Explain how race-conditions might affect programs. #117

Open
johnnymatthews opened this issue Jun 10, 2024 · 0 comments
Open

Explain how race-conditions might affect programs. #117

johnnymatthews opened this issue Jun 10, 2024 · 0 comments

Comments

@johnnymatthews
Copy link
Collaborator

Explain how race-conditions might affect programs.

A discussion popped up within the core Entropy team recently (paraphrased):

It doesn't matter how much time passes. When a user like Alice asks for a signature, there is a delay (D) between asking for the signature and putting it on the chain.

For example, if Alice requests a transaction with nonce = 1, but during the time delta, Bob also requests a transaction, he checks the chain and also sees a nonce of 1. So, he creates the transaction. After time D, we end up with two transactions both having nonce 1. Then, when Alice submits the nonce as now = 2, all transactions with nonce 1 become invalid. Similarly, when Bob submits his transaction, it's also invalid. In essence, it becomes a competition between anyone requesting a transaction within the time delta D.

User-developers should be aware of race-conditions like this, and should design their programs around them. Let's give user-developers some pointers on how they can mitigate situations like this.

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