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

consortium/v2: protect the contract interaction under mutex #339

Conversation

minh-bq
Copy link
Contributor

@minh-bq minh-bq commented Aug 10, 2023

The contract field in consortium v2 consensus engine is written under the call to Authorize. The Authorize function is called only once in startup and can run concurrently with other funtions that read the contract field which leads to data race. We move this write under the mutex lock and the read of this field into readSignerAndContract function to avoid data race.

The contract field in consortium v2 consensus engine is written under the call
to Authorize. The Authorize function is called only once in startup and can run
concurrently with other funtions that read the contract field which leads to
data race. We move this write under the mutex lock and the read of this field
into readSignerAndContract function to avoid data race.
@minh-bq minh-bq merged commit e498fcc into axieinfinity:feat/optimistic_fast_finality Aug 14, 2023
1 check passed
@minh-bq minh-bq deleted the fix/contract-data-race branch August 14, 2023 06:26
minh-bq added a commit to minh-bq/ronin that referenced this pull request Aug 29, 2023
…nity#339)

The contract field in consortium v2 consensus engine is written under the call
to Authorize. The Authorize function is called only once in startup and can run
concurrently with other funtions that read the contract field which leads to
data race. We move this write under the mutex lock and the read of this field
into readSignerAndContract function to avoid data race.
minh-bq added a commit to minh-bq/ronin that referenced this pull request Sep 7, 2023
…nity#339)

The contract field in consortium v2 consensus engine is written under the call
to Authorize. The Authorize function is called only once in startup and can run
concurrently with other funtions that read the contract field which leads to
data race. We move this write under the mutex lock and the read of this field
into readSignerAndContract function to avoid data race.
minh-bq added a commit that referenced this pull request Sep 7, 2023
The contract field in consortium v2 consensus engine is written under the call
to Authorize. The Authorize function is called only once in startup and can run
concurrently with other funtions that read the contract field which leads to
data race. We move this write under the mutex lock and the read of this field
into readSignerAndContract function to avoid data race.
andicrypt pushed a commit to andicrypt/ronin that referenced this pull request Nov 1, 2023
…nity#339)

The contract field in consortium v2 consensus engine is written under the call
to Authorize. The Authorize function is called only once in startup and can run
concurrently with other funtions that read the contract field which leads to
data race. We move this write under the mutex lock and the read of this field
into readSignerAndContract function to avoid data race.
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.

2 participants