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
11bbc660
Unverified
Commit
11bbc660
authored
Aug 08, 2018
by
Péter Szilágyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth, trie: fix tracer GC which accidentally pruned the metaroot
parent
8051a076
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
api_tracer.go
eth/api_tracer.go
+6
-2
database.go
trie/database.go
+5
-0
No files found.
eth/api_tracer.go
View file @
11bbc660
...
@@ -297,7 +297,9 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
...
@@ -297,7 +297,9 @@ func (api *PrivateDebugAPI) traceChain(ctx context.Context, start, end *types.Bl
database
.
TrieDB
()
.
Reference
(
root
,
common
.
Hash
{})
database
.
TrieDB
()
.
Reference
(
root
,
common
.
Hash
{})
}
}
// Dereference all past tries we ourselves are done working with
// Dereference all past tries we ourselves are done working with
database
.
TrieDB
()
.
Dereference
(
proot
)
if
proot
!=
(
common
.
Hash
{})
{
database
.
TrieDB
()
.
Dereference
(
proot
)
}
proot
=
root
proot
=
root
// TODO(karalabe): Do we need the preimages? Won't they accumulate too much?
// TODO(karalabe): Do we need the preimages? Won't they accumulate too much?
...
@@ -526,7 +528,9 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*
...
@@ -526,7 +528,9 @@ func (api *PrivateDebugAPI) computeStateDB(block *types.Block, reexec uint64) (*
return
nil
,
err
return
nil
,
err
}
}
database
.
TrieDB
()
.
Reference
(
root
,
common
.
Hash
{})
database
.
TrieDB
()
.
Reference
(
root
,
common
.
Hash
{})
database
.
TrieDB
()
.
Dereference
(
proot
)
if
proot
!=
(
common
.
Hash
{})
{
database
.
TrieDB
()
.
Dereference
(
proot
)
}
proot
=
root
proot
=
root
}
}
nodes
,
imgs
:=
database
.
TrieDB
()
.
Size
()
nodes
,
imgs
:=
database
.
TrieDB
()
.
Size
()
...
...
trie/database.go
View file @
11bbc660
...
@@ -431,6 +431,11 @@ func (db *Database) reference(child common.Hash, parent common.Hash) {
...
@@ -431,6 +431,11 @@ func (db *Database) reference(child common.Hash, parent common.Hash) {
// Dereference removes an existing reference from a root node.
// Dereference removes an existing reference from a root node.
func
(
db
*
Database
)
Dereference
(
root
common
.
Hash
)
{
func
(
db
*
Database
)
Dereference
(
root
common
.
Hash
)
{
// Sanity check to ensure that the meta-root is not removed
if
root
==
(
common
.
Hash
{})
{
log
.
Error
(
"Attempted to dereference the trie cache meta root"
)
return
}
db
.
lock
.
Lock
()
db
.
lock
.
Lock
()
defer
db
.
lock
.
Unlock
()
defer
db
.
lock
.
Unlock
()
...
...
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