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
1ffd01e1
Commit
1ffd01e1
authored
Sep 23, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PrefetchAccount
parent
0ea7d332
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
README.md
README.md
+2
-2
statedb.go
minigeth/core/state/statedb.go
+1
-1
prefetch.go
minigeth/oracle/prefetch.go
+1
-1
database.go
minigeth/trie/database.go
+1
-1
No files found.
README.md
View file @
1ffd01e1
...
...
@@ -18,9 +18,9 @@ It's half geth, half of what I think truebit was supposed to be. When it's done,
## State Oracle API
hash -> value such that
hash(value) == hash
Preimage(hash) -> value #
hash(value) == hash
This works for the three types of state in ethereum, Accounts, Storage, and Code.
PrefetchAccount, PrefetchStorage, PrefetchCode can be NOP in the VM
## License
...
...
minigeth/core/state/statedb.go
View file @
1ffd01e1
...
...
@@ -513,7 +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
.
PrefetchA
ddress
(
s
.
db
.
BlockNumber
,
addr
)
oracle
.
PrefetchA
ccount
(
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/oracle/prefetch.go
View file @
1ffd01e1
...
...
@@ -110,7 +110,7 @@ func PrefetchStorage(blockNumber *big.Int, addr common.Address, skey common.Hash
}
}
func
PrefetchA
ddress
(
blockNumber
*
big
.
Int
,
addr
common
.
Address
)
{
func
PrefetchA
ccount
(
blockNumber
*
big
.
Int
,
addr
common
.
Address
)
{
key
:=
fmt
.
Sprintf
(
"proof_%d_%s"
,
blockNumber
,
addr
)
if
cached
[
key
]
{
return
...
...
minigeth/trie/database.go
View file @
1ffd01e1
...
...
@@ -34,7 +34,7 @@ func NewDatabase(header types.Header) Database {
triedb
:=
Database
{
BlockNumber
:
header
.
Number
,
Root
:
header
.
Root
}
//triedb.preimages = make(map[common.Hash][]byte)
fmt
.
Println
(
"init database"
)
oracle
.
PrefetchA
ddress
(
header
.
Number
,
common
.
Address
{})
oracle
.
PrefetchA
ccount
(
header
.
Number
,
common
.
Address
{})
//panic("preseed")
return
triedb
...
...
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