func (sm *StateManager) DeleteStateBeforeFinalizedSlot(finalizedSlot uint64) error {
	sm.stateMapLock.Lock()
	defer sm.stateMapLock.Unlock()
	// once we finalize the block, we can get rid of any states before finalizedSlot
	for i := range sm.stateMap {
		// if it happened before finalized slot, we don't need it
		if sm.stateMap[i].firstSlot < finalizedSlot {
			delete(sm.stateMap, i)
		}
	}
	return nil
}
// DeleteStateBeforeFinalizedSlot deletes any states before the current finalized slot.
DeleteStateBeforeFinalizedSlot deletes any states before the current finalized slot.
// DeleteStateBeforeFinalizedSlot deletes any states before the current finalized slot .
func (sm *StateManager) DeleteStateBeforeFinalizedSlot(finalizedSlot uint64) error {
	sm.stateMapLock.Lock()
	defer sm.stateMapLock.Unlock()
	for i := range sm.stateMap {
		if sm.stateMap[i].firstSlot < finalizedSlot {
			delete(sm.stateMap, i)
		}
	}
	return nil
}
func ( sm * StateManager ) DeleteStateBeforeFinalizedSlot ( finalizedSlot uint64 ) error { sm . stateMapLock . Lock ( ) defer sm . stateMapLock . Unlock ( ) for i := range sm . stateMap { if sm . stateMap [ i ] . firstSlot < finalizedSlot { delete ( sm . stateMap , i ) } } return nil }
DeleteStateBeforeFinalizedSlot deletes any states before the current finalized slot.
DeleteStateBeforeFinalizedSlot deletes any states before the current finalized slot .
// once we finalize the block, we can get rid of any states before finalizedSlot // if it happened before finalized slot, we don't need it