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
e805ff1e
Commit
e805ff1e
authored
Sep 23, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move prefetch into statedb
parent
b7e2e8b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
database.go
minigeth/core/state/database.go
+5
-2
statedb.go
minigeth/core/state/statedb.go
+2
-0
secure_trie.go
minigeth/trie/secure_trie.go
+0
-4
No files found.
minigeth/core/state/database.go
View file @
e805ff1e
...
...
@@ -46,8 +46,11 @@ func (db *Database) CopyTrie(trie Trie) Trie {
// OpenTrie opens the main account trie at a specific root hash.
func
(
db
*
Database
)
OpenTrie
(
root
common
.
Hash
)
(
Trie
,
error
)
{
//tr, err := trie.NewSecure(root, db.db)
return
trie
.
NewSecure
(
root
,
db
.
db
)
tr
,
err
:=
trie
.
NewSecure
(
root
,
db
.
db
)
if
err
!=
nil
{
return
nil
,
err
}
return
tr
,
nil
}
// OpenStorageTrie opens the storage trie of an account.
...
...
minigeth/core/state/statedb.go
View file @
e805ff1e
...
...
@@ -29,6 +29,7 @@ import (
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/oracle"
"github.com/ethereum/go-ethereum/rlp"
)
...
...
@@ -512,6 +513,7 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
if
metrics
.
EnabledExpensive
{
defer
func
(
start
time
.
Time
)
{
s
.
AccountReads
+=
time
.
Since
(
start
)
}(
time
.
Now
())
}
oracle
.
PrefetchAddress
(
s
.
db
.
BlockNumber
,
addr
)
enc
,
err
:=
s
.
trie
.
TryGet
(
addr
.
Bytes
())
if
err
!=
nil
{
s
.
setError
(
fmt
.
Errorf
(
"getDeleteStateObject (%x) error: %v"
,
addr
.
Bytes
(),
err
))
...
...
minigeth/trie/secure_trie.go
View file @
e805ff1e
...
...
@@ -21,7 +21,6 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/oracle"
)
// SecureTrie wraps a trie with key hashing. In a secure trie, all
...
...
@@ -77,9 +76,6 @@ func (t *SecureTrie) Get(key []byte) []byte {
// The value bytes must not be modified by the caller.
// If a node was not found in the database, a MissingNodeError is returned.
func
(
t
*
SecureTrie
)
TryGet
(
key
[]
byte
)
([]
byte
,
error
)
{
oracle
.
PrefetchAddress
(
t
.
trie
.
db
.
BlockNumber
,
common
.
BytesToAddress
(
key
))
//t.trie.db.Fetch(common.BytesToAddress(key))
return
t
.
trie
.
TryGet
(
t
.
hashKey
(
key
))
}
...
...
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