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 access error when tracing blocks #1822

Merged
merged 6 commits into from
Feb 28, 2022

Conversation

piersy
Copy link
Contributor

@piersy piersy commented Jan 26, 2022

Description

This PR fixes the concurrent map access error in the ticket linked below.

The problem was that state.StateDB instances were being accessed from multiple go-routines, and they are not safe for concurrent use.

Tested

Added an e2e test to ensure that the fix is working.

Related issues

The logging from these tests slowed them down and cluttered the output
of test runs.
Ensure state.StateDB instances are not accessed concurrently.
@piersy piersy requested a review from a team as a code owner January 26, 2022 12:23
@piersy piersy requested review from hbandura, gastonponti, mcortesi and a team and removed request for a team, hbandura and gastonponti January 26, 2022 12:23
@piersy
Copy link
Contributor Author

piersy commented Jan 26, 2022

Coverage from tests in ./e2e_test/... for ./consensus/istanbul/... at commit 750b710

coverage: 51.8% of statements across all listed packages
coverage:  65.2% of statements in consensus/istanbul
coverage:  43.1% of statements in consensus/istanbul/announce
coverage:  56.0% of statements in consensus/istanbul/backend
coverage:   0.0% of statements in consensus/istanbul/backend/backendtest
coverage:  24.3% of statements in consensus/istanbul/backend/internal/replica
coverage:  70.6% of statements in consensus/istanbul/core
coverage:  50.0% of statements in consensus/istanbul/db
coverage:   0.0% of statements in consensus/istanbul/proxy
coverage:  75.3% of statements in consensus/istanbul/uptime
coverage: 100.0% of statements in consensus/istanbul/uptime/store
coverage:  51.8% of statements in consensus/istanbul/validator
coverage:  79.2% of statements in consensus/istanbul/validator/random
CommentID: 13240928d1

@codecov
Copy link

codecov bot commented Feb 28, 2022

Codecov Report

Merging #1822 (750b710) into master (c78a51f) will decrease coverage by 0.02%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1822      +/-   ##
==========================================
- Coverage   54.24%   54.21%   -0.03%     
==========================================
  Files         673      673              
  Lines       88989    88991       +2     
==========================================
- Hits        48269    48245      -24     
- Misses      37079    37106      +27     
+ Partials     3641     3640       -1     
Impacted Files Coverage Δ
eth/tracers/api.go 27.33% <50.00%> (+0.09%) ⬆️
p2p/simulations/mocker.go 35.92% <0.00%> (-4.86%) ⬇️
p2p/discover/v4_udp.go 76.00% <0.00%> (-4.25%) ⬇️
...nsensus/istanbul/core/roundstate_save_decorator.go 91.37% <0.00%> (-3.45%) ⬇️
core/state/trie_prefetcher.go 76.00% <0.00%> (-3.34%) ⬇️
miner/block.go 52.15% <0.00%> (-2.16%) ⬇️
eth/downloader/queue.go 78.85% <0.00%> (-1.61%) ⬇️
miner/worker.go 67.29% <0.00%> (-1.43%) ⬇️
les/distributor.go 78.62% <0.00%> (-1.38%) ⬇️
core/rawdb/chain_iterator.go 61.84% <0.00%> (-1.16%) ⬇️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c78a51f...750b710. Read the comment docs.

@piersy piersy merged commit 503f156 into master Feb 28, 2022
@piersy piersy deleted the piersy/fix-tracing-panic branch February 28, 2022 14:16
piersy added a commit that referenced this pull request Feb 28, 2022
Fixes  #1799

This commit ensures that state.StateDB instances are not
accessed concurrently when tracing blocks and also adds
an e2e test to verify the fix.

It also disables logging from the e2e tests, because the logs
slowed the tests down and cluttered the output of test runs.

It also updates test node instances to ensure that all rpc api
modules are enabled.
piersy added a commit that referenced this pull request Feb 28, 2022
Fixes  #1799

This commit ensures that state.StateDB instances are not
accessed concurrently when tracing blocks and also adds
an e2e test to verify the fix.

It also disables logging from the e2e tests, because the logs
slowed the tests down and cluttered the output of test runs.

It also updates test node instances to ensure that all rpc api
modules are enabled.
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.

BREAKING BUG - Panic in Celo 1.5.0
2 participants