core: initial version of state snapshots

This commit is contained in:
Péter Szilágyi
2020-02-25 12:51:04 +02:00
parent 2a5ed1a1d3
commit 542df8898e
30 changed files with 1635 additions and 85 deletions
+2 -2
View File
@@ -149,7 +149,7 @@ func odrAccounts(ctx context.Context, db ethdb.Database, bc *core.BlockChain, lc
st = NewState(ctx, header, lc.Odr())
} else {
header := bc.GetHeaderByHash(bhash)
st, _ = state.New(header.Root, state.NewDatabase(db))
st, _ = state.New(header.Root, state.NewDatabase(db), nil)
}
var res []byte
@@ -189,7 +189,7 @@ func odrContractCall(ctx context.Context, db ethdb.Database, bc *core.BlockChain
} else {
chain = bc
header = bc.GetHeaderByHash(bhash)
st, _ = state.New(header.Root, state.NewDatabase(db))
st, _ = state.New(header.Root, state.NewDatabase(db), nil)
}
// Perform read-only call.
+1 -1
View File
@@ -30,7 +30,7 @@ import (
)
func NewState(ctx context.Context, head *types.Header, odr OdrBackend) *state.StateDB {
state, _ := state.New(head.Root, NewStateDatabase(ctx, head, odr))
state, _ := state.New(head.Root, NewStateDatabase(ctx, head, odr), nil)
return state
}