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
ae45c97d
Unverified
Commit
ae45c97d
authored
Jan 21, 2022
by
rjl493456442
Committed by
GitHub
Jan 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trie: fix range prover (#24266)
parent
c029cdc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
proof.go
trie/proof.go
+3
-3
No files found.
trie/proof.go
View file @
ae45c97d
...
...
@@ -406,7 +406,7 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error
}
// hasRightElement returns the indicator whether there exists more elements
//
i
n the right side of the given path. The given path can point to an existent
//
o
n the right side of the given path. The given path can point to an existent
// key or a non-existent one. This function has the assumption that the whole
// path should already be resolved.
func
hasRightElement
(
node
node
,
key
[]
byte
)
bool
{
...
...
@@ -505,7 +505,7 @@ func VerifyRangeProof(rootHash common.Hash, firstKey []byte, lastKey []byte, key
if
val
!=
nil
||
hasRightElement
(
root
,
firstKey
)
{
return
false
,
errors
.
New
(
"more entries available"
)
}
return
hasRightElement
(
root
,
firstKey
)
,
nil
return
false
,
nil
}
// Special case, there is only one element and two edge keys are same.
// In this case, we can't construct two edge paths. So handle it here.
...
...
@@ -563,7 +563,7 @@ func VerifyRangeProof(rootHash common.Hash, firstKey []byte, lastKey []byte, key
if
tr
.
Hash
()
!=
rootHash
{
return
false
,
fmt
.
Errorf
(
"invalid proof, want hash %x, got %x"
,
rootHash
,
tr
.
Hash
())
}
return
hasRightElement
(
root
,
keys
[
len
(
keys
)
-
1
]),
nil
return
hasRightElement
(
tr
.
root
,
keys
[
len
(
keys
)
-
1
]),
nil
}
// get returns the child of the given node. Return nil if the
...
...
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