Move state summary cache to DB (#8101)

This commit is contained in:
terence tsao
2020-12-16 08:56:21 -08:00
committed by GitHub
parent 3fb49433a1
commit 20dede7532
99 changed files with 695 additions and 798 deletions

View File

@@ -11,7 +11,7 @@ import (
)
func TestHeadSlot_DataRace(t *testing.T) {
db, _ := testDB.SetupDB(t)
db := testDB.SetupDB(t)
s := &Service{
beaconDB: db,
}
@@ -22,11 +22,11 @@ func TestHeadSlot_DataRace(t *testing.T) {
}
func TestHeadRoot_DataRace(t *testing.T) {
db, sc := testDB.SetupDB(t)
db := testDB.SetupDB(t)
s := &Service{
beaconDB: db,
head: &head{root: [32]byte{'A'}},
stateGen: stategen.New(db, sc),
stateGen: stategen.New(db),
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))
@@ -36,11 +36,11 @@ func TestHeadRoot_DataRace(t *testing.T) {
}
func TestHeadBlock_DataRace(t *testing.T) {
db, sc := testDB.SetupDB(t)
db := testDB.SetupDB(t)
s := &Service{
beaconDB: db,
head: &head{block: &ethpb.SignedBeaconBlock{}},
stateGen: stategen.New(db, sc),
stateGen: stategen.New(db),
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))
@@ -50,10 +50,10 @@ func TestHeadBlock_DataRace(t *testing.T) {
}
func TestHeadState_DataRace(t *testing.T) {
db, sc := testDB.SetupDB(t)
db := testDB.SetupDB(t)
s := &Service{
beaconDB: db,
stateGen: stategen.New(db, sc),
stateGen: stategen.New(db),
}
go func() {
require.NoError(t, s.saveHead(context.Background(), [32]byte{}))