-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[R4R] Fix pipecommit active statedb #1002
[R4R] Fix pipecommit active statedb #1002
Conversation
if s.prefetcher != nil && len(addressesToPrefetch) > 0 { | ||
s.prefetcher.prefetch(s.originalRoot, addressesToPrefetch, emptyAddr) | ||
prefetcher := s.prefetcher | ||
if prefetcher != nil && len(addressesToPrefetch) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add some UTs to battle test the concurrence issue of statedb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pointer assignment is actually atomic, but would fail race detection.
e3fce87
to
ec28650
Compare
ec28650
to
9e53b1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4d92fd7
9e53b1d
to
4d92fd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
prefetcher
be accessed after non-nil condition as a field ofstatedb
is not safe.eg: as in
pipecommit
mode,statedb
might be used asactivestatedb
toStopPrefetcher
, which wouldpanic
during:Rationale
get
prefetcher
fromstatedb
before check nil conditionExample
N/A
Changes