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

Fix race condition in read/write to block storage #35

Merged
merged 4 commits into from
Aug 21, 2023

Conversation

p-offtermatt
Copy link
Member

The block storage in CometMock has a race-condition, which manifested as random test failures in the e2e tests, see cosmos/interchain-security#1205

The race condition was that stores would be updated one after another, but there was no mutex around the update.
So it was possible that a store entry for height h is not present, even though cometmock already returns that the current height is h, because some other store already has an entry for height h.

This PR fixes this behaviour by putting all state updates into a share mutex. To do so, some mutexes are reworked and consolidated.

@p-offtermatt p-offtermatt merged commit aec594b into main Aug 21, 2023
1 check passed
@p-offtermatt p-offtermatt deleted the ph/fix-height-access branch September 18, 2023 11:36
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.

1 participant