Commit 1ffd01e1 authored by George Hotz's avatar George Hotz

PrefetchAccount

parent 0ea7d332
......@@ -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
......
......@@ -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.PrefetchAddress(s.db.BlockNumber, addr)
oracle.PrefetchAccount(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))
......
......@@ -110,7 +110,7 @@ func PrefetchStorage(blockNumber *big.Int, addr common.Address, skey common.Hash
}
}
func PrefetchAddress(blockNumber *big.Int, addr common.Address) {
func PrefetchAccount(blockNumber *big.Int, addr common.Address) {
key := fmt.Sprintf("proof_%d_%s", blockNumber, addr)
if cached[key] {
return
......
......@@ -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.PrefetchAddress(header.Number, common.Address{})
oracle.PrefetchAccount(header.Number, common.Address{})
//panic("preseed")
return triedb
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment