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
80e887d7
Unverified
Commit
80e887d7
authored
Jun 08, 2020
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state: avoid escape analysis fault when accessing cached state
parent
cf667453
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
state_object.go
core/state/state_object.go
+2
-2
statedb.go
core/state/statedb.go
+3
-3
No files found.
core/state/state_object.go
View file @
80e887d7
...
...
@@ -213,14 +213,14 @@ func (s *stateObject) GetCommittedState(db Database, key common.Hash) common.Has
if
_
,
destructed
:=
s
.
db
.
snapDestructs
[
s
.
addrHash
];
destructed
{
return
common
.
Hash
{}
}
enc
,
err
=
s
.
db
.
snap
.
Storage
(
s
.
addrHash
,
crypto
.
Keccak256Hash
(
key
[
:
]
))
enc
,
err
=
s
.
db
.
snap
.
Storage
(
s
.
addrHash
,
crypto
.
Keccak256Hash
(
key
.
Bytes
()
))
}
// If snapshot unavailable or reading from it failed, load from the database
if
s
.
db
.
snap
==
nil
||
err
!=
nil
{
if
metrics
.
EnabledExpensive
{
defer
func
(
start
time
.
Time
)
{
s
.
db
.
StorageReads
+=
time
.
Since
(
start
)
}(
time
.
Now
())
}
if
enc
,
err
=
s
.
getTrie
(
db
)
.
TryGet
(
key
[
:
]
);
err
!=
nil
{
if
enc
,
err
=
s
.
getTrie
(
db
)
.
TryGet
(
key
.
Bytes
()
);
err
!=
nil
{
s
.
setError
(
err
)
return
common
.
Hash
{}
}
...
...
core/state/statedb.go
View file @
80e887d7
...
...
@@ -513,7 +513,7 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
defer
func
(
start
time
.
Time
)
{
s
.
SnapshotAccountReads
+=
time
.
Since
(
start
)
}(
time
.
Now
())
}
var
acc
*
snapshot
.
Account
if
acc
,
err
=
s
.
snap
.
Account
(
crypto
.
Keccak256Hash
(
addr
[
:
]
));
err
==
nil
{
if
acc
,
err
=
s
.
snap
.
Account
(
crypto
.
Keccak256Hash
(
addr
.
Bytes
()
));
err
==
nil
{
if
acc
==
nil
{
return
nil
}
...
...
@@ -532,9 +532,9 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
if
metrics
.
EnabledExpensive
{
defer
func
(
start
time
.
Time
)
{
s
.
AccountReads
+=
time
.
Since
(
start
)
}(
time
.
Now
())
}
enc
,
err
:=
s
.
trie
.
TryGet
(
addr
[
:
]
)
enc
,
err
:=
s
.
trie
.
TryGet
(
addr
.
Bytes
()
)
if
err
!=
nil
{
s
.
setError
(
fmt
.
Errorf
(
"getDeleteStateObject (%x) error: %v"
,
addr
[
:
]
,
err
))
s
.
setError
(
fmt
.
Errorf
(
"getDeleteStateObject (%x) error: %v"
,
addr
.
Bytes
()
,
err
))
return
nil
}
if
len
(
enc
)
==
0
{
...
...
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