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

[r2r] lock free avoid on account sequence problems #1694

Merged
merged 8 commits into from
Mar 14, 2023
Merged

Conversation

onur-ozkan
Copy link
Member

Currently, even we have using mutex to lock concurrency in mm2 instance for tendermint operations, it's still possible to get sequence issues by running multiple instances. Because the lock is on the application level not distributed one, there is no way to handle sequence problems which might fail transactions like in the swap tests.

The only way to overcome this problem is looping over the requests if there is an account sequence problem. And thats what this PR provides in a lock-free way.

Also resolves #1691 and #1569

Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan added enhancement New feature or request Refactoring labels Mar 3, 2023
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix! A few minor suggestions.

mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
@onur-ozkan onur-ozkan requested a review from shamardy March 6, 2023 18:43
Signed-off-by: ozkanonur <work@onurozkan.dev>
shamardy
shamardy previously approved these changes Mar 6, 2023
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

…ck-free-sequence-logic

Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
@ca333 ca333 merged commit 73d0492 into dev Mar 14, 2023
@onur-ozkan onur-ozkan deleted the lock-free-sequence-logic branch March 14, 2023 10:10
shamardy added a commit that referenced this pull request Mar 14, 2023
shamardy added a commit that referenced this pull request Mar 14, 2023
* add change logs for PRs merged to dev only

* remove {version} - {date} and add dev branch instead

* add ibc transfer change logs

* add lightning PR #1655 to change logs

* add changelog for #1706

* add changelog for #1694, #1665

---------

Reviewed-by: laruh, caglaryucekaya <caglaryucekaya@gmail.com>
@ca333 ca333 mentioned this pull request Mar 27, 2023
@laruh laruh mentioned this pull request Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants