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
09d44e99
Unverified
Commit
09d44e99
authored
Apr 16, 2021
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/state/snapshot: avoid copybytes for stacktrie
parent
4f3ba674
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
generate.go
core/state/snapshot/generate.go
+1
-1
trie_test.go
trie/trie_test.go
+2
-2
No files found.
core/state/snapshot/generate.go
View file @
09d44e99
...
...
@@ -317,7 +317,7 @@ func (dl *diskLayer) proveRange(stats *generatorStats, root common.Hash, prefix
if
origin
==
nil
&&
!
diskMore
{
stackTr
:=
trie
.
NewStackTrie
(
nil
)
for
i
,
key
:=
range
keys
{
stackTr
.
TryUpdate
(
key
,
common
.
CopyBytes
(
vals
[
i
])
)
stackTr
.
TryUpdate
(
key
,
vals
[
i
]
)
}
if
gotRoot
:=
stackTr
.
Hash
();
gotRoot
!=
root
{
return
&
proofResult
{
...
...
trie/trie_test.go
View file @
09d44e99
...
...
@@ -830,8 +830,8 @@ func TestCommitSequenceStackTrie(t *testing.T) {
val
=
make
([]
byte
,
1
+
prng
.
Intn
(
1024
))
}
prng
.
Read
(
val
)
trie
.
TryUpdate
(
key
,
common
.
CopyBytes
(
val
)
)
stTrie
.
TryUpdate
(
key
,
common
.
CopyBytes
(
val
)
)
trie
.
TryUpdate
(
key
,
val
)
stTrie
.
TryUpdate
(
key
,
val
)
}
// Flush trie -> database
root
,
_
:=
trie
.
Commit
(
nil
)
...
...
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