Commit 38a2fc2d authored by George Hotz's avatar George Hotz

oracle notes

parent 8fa24ff0
...@@ -4,3 +4,22 @@ Stubbed files are: ...@@ -4,3 +4,22 @@ Stubbed files are:
core/blockchain.go core/blockchain.go
core/state/statedb.go core/state/statedb.go
consensus/ethash/fake_ethash.go consensus/ethash/fake_ethash.go
// See https://medium.com/@eiki1212/ethereum-state-trie-architecture-explained-a30237009d4e
// Or better picture https://i.stack.imgur.com/afWDt.jpg
Types needed for the oracle:
// Account is the Ethereum consensus representation of accounts.
// These objects are stored in the main account trie.
type Account struct {
Nonce uint64
Balance *big.Int
Root common.Hash // merkle root of the storage trie
CodeHash []byte
}
// TODO: oracle for
// getProvedAccountBytes(blockNumber, addr) -> rlpAccount
// getProvedCodeBytes(blockNumber, addr, codehash) -> []byte
// getProvedStorage(blockNumber, addr, root, key) -> uint256
// These functions access the backend oracle, and will assert if the proof is bad
...@@ -231,6 +231,8 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject { ...@@ -231,6 +231,8 @@ func (s *StateDB) getDeletedStateObject(addr common.Address) *stateObject {
fmt.Printf("getDeleteStateObject (%x) error: %v\n", addr.Bytes(), err) fmt.Printf("getDeleteStateObject (%x) error: %v\n", addr.Bytes(), err)
return nil return nil
}*/ }*/
// TODO: call eth_getProof
// In a higher level, write getProvedAccountBytes(addr)
enc := []byte("12") enc := []byte("12")
if len(enc) == 0 { if len(enc) == 0 {
return nil return nil
......
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