func (s *Store) GetEpochRules() (opera.Rules, idx.Epoch) {
	es := s.GetEpochState()
	return es.Rules, es.Epoch
}
GetEpochRules retrieves current network rules and epoch atomically
package gossip
import (
	"github.com/Fantom-foundation/lachesis-base/inter/idx"
	"github.com/Fantom-foundation/lachesis-base/inter/pos"
	"github.com/ethereum/go-ethereum/log"
	"github.com/Fantom-foundation/go-opera/gossip/blockproc"
	"github.com/Fantom-foundation/go-opera/opera"
)
const sKey = "s"
type BlockEpochState struct {
	BlockState *blockproc.BlockState
	EpochState *blockproc.EpochState
}
func (s *Store) SetBlockEpochState(bs blockproc.BlockState, es blockproc.EpochState) {
	bs, es = bs.Copy(), es.Copy()
	s.cache.BlockEpochState.Store(&BlockEpochState{&bs, &es})
}
func (s *Store) getBlockEpochState() BlockEpochState {
	if v := s.cache.BlockEpochState.Load(); v != nil {
		return *v.(*BlockEpochState)
	}
	v, ok := s.rlp.Get(s.table.BlockEpochState, []byte(sKey), &BlockEpochState{}).(*BlockEpochState)
	if !ok {
		log.Crit("Epoch state reading failed: genesis not applied")
	}
	s.cache.BlockEpochState.Store(v)
	return *v
}
func (s *Store) FlushBlockEpochState() {
	s.rlp.Set(s.table.BlockEpochState, []byte(sKey), s.getBlockEpochState())
}
func (s *Store) GetBlockState() blockproc.BlockState {
	return *s.getBlockEpochState().BlockState
}
func (s *Store) GetEpochState() blockproc.EpochState {
	return *s.getBlockEpochState().EpochState
}
func (s *Store) GetBlockEpochState() (blockproc.BlockState, blockproc.EpochState) {
	bes := s.getBlockEpochState()
	return *bes.BlockState, *bes.EpochState
}
func (s *Store) GetEpoch() idx.Epoch {
	return s.GetEpochState().Epoch
}
func (s *Store) GetValidators() *pos.Validators {
	return s.GetEpochState().Validators
}
func (s *Store) GetEpochValidators() (*pos.Validators, idx.Epoch) {
	es := s.GetEpochState()
	return es.Validators, es.Epoch
}
func (s *Store) GetLatestBlockIndex() idx.Block {
	return s.GetBlockState().LastBlock.Idx
}
func (s *Store) GetRules() opera.Rules {
	return s.GetEpochState().Rules
}