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: concurrent map writes #1176

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

pratikspatil024
Copy link
Member

Added lock to originStorage, pendingStorage and dirtyStorage in GetCommittedState() function to fix concurrent map writes

Description

Please provide a detailed description of what was done in this PR

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on mumbai
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

core/state/state_object.go Show resolved Hide resolved
core/state/state_object.go Show resolved Hide resolved
@pratikspatil024 pratikspatil024 force-pushed the psp-concurent-fix branch 2 times, most recently from 3ebab1d to 4de45b1 Compare March 5, 2024 09:13
…mmittedState function to fix 'concurrent map writes'
@pratikspatil024 pratikspatil024 changed the base branch from master to v1.2.7-candidate March 5, 2024 09:44
Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.94%. Comparing base (241af1f) to head (25a7908).
Report is 13 commits behind head on v1.2.7-candidate.

Additional details and impacted files
@@                 Coverage Diff                  @@
##           v1.2.7-candidate    #1176      +/-   ##
====================================================
+ Coverage             55.92%   55.94%   +0.02%     
====================================================
  Files                   658      658              
  Lines                114440   114442       +2     
====================================================
+ Hits                  63996    64029      +33     
+ Misses                46601    46561      -40     
- Partials               3843     3852       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ssandeep ssandeep requested a review from cffls March 5, 2024 15:32
@pratikspatil024 pratikspatil024 linked an issue Mar 5, 2024 that may be closed by this pull request
@pratikspatil024 pratikspatil024 merged commit de45e3f into v1.2.7-candidate Mar 5, 2024
13 of 14 checks passed
@pratikspatil024 pratikspatil024 deleted the psp-concurent-fix branch March 5, 2024 16:10
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.

state: Concurrent Map Writes
3 participants