func (sm *ShardStateManager) GetTipSlot() uint64 {
	sm.stateLock.Lock()
	defer sm.stateLock.Unlock()
	return sm.tipDB.slot
}
GetTipSlot gets the slot of the tip of the blockchain.
package state
import (
	"fmt"
	"sync"
	"github.com/phoreproject/synapse/bls"
	"github.com/phoreproject/synapse/chainhash"
	"github.com/phoreproject/synapse/csmt"
	"github.com/phoreproject/synapse/primitives"
	"github.com/prysmaticlabs/go-ssz"
	"github.com/sirupsen/logrus"
)
type stateInfo struct {
	db     csmt.TreeDatabase
	state  State
	parent *stateInfo
	slot   uint64
	hash chainhash.Hash
}
type ShardStateManager struct {
	stateLock *sync.RWMutex
	finalizedDB *stateInfo
	stateMap    map[chainhash.Hash]*stateInfo
	tipDB       *stateInfo
	shardInfo ShardInfo
}
func NewShardStateManager(stateDB csmt.TreeDatabase, stateSlot uint64, tipBlockHash chainhash.Hash, shardInfo ShardInfo) *ShardStateManager {
	stateHash, err := stateDB.Hash()
	if err != nil {
		panic(err)
	}
	tip := &stateInfo{
		db: stateDB,
		state: State{
			SmartContractRoot:   *stateHash,
			LastCrosslinkHash:   chainhash.Hash{},
			ProposerAssignments: []bls.PublicKey{},
		},
		hash: tipBlockHash,
		slot: stateSlot,
	}
	return &ShardStateManager{
		finalizedDB: tip,
		tipDB:       tip,
		shardInfo:   shardInfo,
		stateMap: map[chainhash.Hash]*stateInfo{
			tipBlockHash: tip,
		},
		stateLock: new(sync.RWMutex),
	}
}
func (sm *ShardStateManager) GetTip() (State, csmt.TreeDatabase) {
	sm.stateLock.Lock()
	defer sm.stateLock.Unlock()
	return sm.tipDB.state, sm.tipDB.db
}