Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
c79fc209
Unverified
Commit
c79fc209
authored
4 years ago
by
Edgar Aroutiounian
Committed by
GitHub
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state/snapshot: fix data race in diff layer (#22540)
parent
73ed6898
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
difflayer.go
core/state/snapshot/difflayer.go
+12
-4
No files found.
core/state/snapshot/difflayer.go
View file @
c79fc209
...
...
@@ -296,13 +296,17 @@ func (dl *diffLayer) AccountRLP(hash common.Hash) ([]byte, error) {
if
!
hit
{
hit
=
dl
.
diffed
.
Contains
(
destructBloomHasher
(
hash
))
}
var
origin
*
diskLayer
if
!
hit
{
origin
=
dl
.
origin
// extract origin while holding the lock
}
dl
.
lock
.
RUnlock
()
// If the bloom filter misses, don't even bother with traversing the memory
// diff layers, reach straight into the bottom persistent disk layer
if
!
hit
{
if
origin
!=
nil
{
snapshotBloomAccountMissMeter
.
Mark
(
1
)
return
dl
.
origin
.
AccountRLP
(
hash
)
return
origin
.
AccountRLP
(
hash
)
}
// The bloom filter hit, start poking in the internal maps
return
dl
.
accountRLP
(
hash
,
0
)
...
...
@@ -358,13 +362,17 @@ func (dl *diffLayer) Storage(accountHash, storageHash common.Hash) ([]byte, erro
if
!
hit
{
hit
=
dl
.
diffed
.
Contains
(
destructBloomHasher
(
accountHash
))
}
var
origin
*
diskLayer
if
!
hit
{
origin
=
dl
.
origin
// extract origin while holding the lock
}
dl
.
lock
.
RUnlock
()
// If the bloom filter misses, don't even bother with traversing the memory
// diff layers, reach straight into the bottom persistent disk layer
if
!
hit
{
if
origin
!=
nil
{
snapshotBloomStorageMissMeter
.
Mark
(
1
)
return
dl
.
origin
.
Storage
(
accountHash
,
storageHash
)
return
origin
.
Storage
(
accountHash
,
storageHash
)
}
// The bloom filter hit, start poking in the internal maps
return
dl
.
storage
(
accountHash
,
storageHash
,
0
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment