Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
exchain
nebula
Commits
5f7684bd
Commit
5f7684bd
authored
Sep 25, 2021
by
han0110
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove redundant storage fetch and fetch absense proof of account to handle same issue
parent
6842f478
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
state_object.go
minigeth/core/state/state_object.go
+2
-3
statedb.go
minigeth/core/state/statedb.go
+2
-0
No files found.
minigeth/core/state/state_object.go
View file @
5f7684bd
...
@@ -354,11 +354,10 @@ func (s *stateObject) updateTrie(db Database) Trie {
...
@@ -354,11 +354,10 @@ func (s *stateObject) updateTrie(db Database) Trie {
s
.
originStorage
[
key
]
=
value
s
.
originStorage
[
key
]
=
value
var
v
[]
byte
var
v
[]
byte
oracle
.
PrefetchStorage
(
db
.
BlockNumber
,
s
.
address
,
key
)
// Get absense proof of current key in case the deletion make the extension node to short node.
oracle
.
PrefetchStorage
(
big
.
NewInt
(
db
.
BlockNumber
.
Int64
()
+
1
),
s
.
address
,
key
)
if
(
value
==
common
.
Hash
{})
{
if
(
value
==
common
.
Hash
{})
{
//fmt.Println("delete", s.address, key)
//fmt.Println("delete", s.address, key)
// Get absense proof of key in case the deletion needs the sister node.
oracle
.
PrefetchStorage
(
big
.
NewInt
(
db
.
BlockNumber
.
Int64
()
+
1
),
s
.
address
,
key
)
s
.
setError
(
tr
.
TryDelete
(
key
[
:
]))
s
.
setError
(
tr
.
TryDelete
(
key
[
:
]))
}
else
{
}
else
{
//fmt.Println("update", s.address, key, value)
//fmt.Println("update", s.address, key, value)
...
...
minigeth/core/state/statedb.go
View file @
5f7684bd
...
@@ -456,6 +456,8 @@ func (s *StateDB) deleteStateObject(obj *stateObject) {
...
@@ -456,6 +456,8 @@ func (s *StateDB) deleteStateObject(obj *stateObject) {
}
}
// Delete the account from the trie
// Delete the account from the trie
addr
:=
obj
.
Address
()
addr
:=
obj
.
Address
()
// Get absense proof of account in case the deletion needs the sister node.
oracle
.
PrefetchAccount
(
big
.
NewInt
(
s
.
db
.
BlockNumber
.
Int64
()
+
1
),
addr
)
if
err
:=
s
.
trie
.
TryDelete
(
addr
[
:
]);
err
!=
nil
{
if
err
:=
s
.
trie
.
TryDelete
(
addr
[
:
]);
err
!=
nil
{
s
.
setError
(
fmt
.
Errorf
(
"deleteStateObject (%x) error: %v"
,
addr
[
:
],
err
))
s
.
setError
(
fmt
.
Errorf
(
"deleteStateObject (%x) error: %v"
,
addr
[
:
],
err
))
}
}
...
...
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