Skip to content

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

Merged
ca333 merged 8 commits intodevfrom
lock-free-sequence-logic
Mar 14, 2023
Merged

[r2r] lock free avoid on account sequence problems#1694
ca333 merged 8 commits intodevfrom
lock-free-sequence-logic

Conversation

@onur-ozkan
Copy link
Copy Markdown

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>
Copy link
Copy Markdown
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.

Comment thread mm2src/coins/tendermint/tendermint_coin.rs Outdated
Comment thread mm2src/coins/tendermint/tendermint_coin.rs Outdated
Comment thread mm2src/coins/tendermint/tendermint_coin.rs Outdated
Comment thread mm2src/coins/tendermint/tendermint_coin.rs Outdated
@onur-ozkan onur-ozkan requested a review from shamardy March 6, 2023 18:43
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the lock-free-sequence-logic branch from 952ae02 to 4334746 Compare March 6, 2023 19:02
shamardy
shamardy previously approved these changes Mar 6, 2023
Copy link
Copy Markdown
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!

@onur-ozkan onur-ozkan force-pushed the lock-free-sequence-logic branch from 4008284 to 4334746 Compare March 9, 2023 15:57
…ck-free-sequence-logic

Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the lock-free-sequence-logic branch from 21c19de to da58257 Compare March 9, 2023 18:03
Signed-off-by: ozkanonur <work@onurozkan.dev>
Signed-off-by: ozkanonur <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the lock-free-sequence-logic branch from fdba177 to e253d07 Compare March 10, 2023 09:23
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants