Documentation ¶
Index ¶
- Constants
- Variables
- func GetRecoveryEpochID(epochID uint64) uint64
- func SlsInit()
- type Pack
- type SLS
- func (s *SLS) GenerateDefaultSlotLeaders() error
- func (s *SLS) GetAllSlotLeaders(epochID uint64) (slotLeader []*ecdsa.PublicKey)
- func (s *SLS) GetChainReader() consensus.ChainReader
- func (s *SLS) GetCurrentStateDb() (stateDb *state.StateDB, err error)
- func (s *SLS) GetEpochDefaultLeadersPK(epochID uint64) []*ecdsa.PublicKey
- func (s *SLS) GetEpochLeadersPK(epochID uint64) []*ecdsa.PublicKey
- func (s *SLS) GetInfoFromHeadExtra(epochID uint64, input []byte) ([]*big.Int, []*ecdsa.PublicKey, error)
- func (s *SLS) GetLocalPublicKey() (*ecdsa.PublicKey, error)
- func (s *SLS) GetPreEpochLeadersPK(epochID uint64) (pks []*ecdsa.PublicKey, isDefault bool)
- func (s *SLS) GetSlotCreateStatusByEpochID(epochID uint64) bool
- func (s *SLS) GetSlotLeader(epochID uint64, slotID uint64) (slotLeader *ecdsa.PublicKey, err error)
- func (s *SLS) GetSma(epochID uint64) (ret []*ecdsa.PublicKey, isGenesis bool, err error)
- func (s *SLS) Init(blockChain *core.BlockChain, rc *rpc.Client, key *keystore.Key)
- func (s *SLS) IsLocalPkInEpochLeaders(pks []*ecdsa.PublicKey) bool
- func (s *SLS) Loop(rc *rpc.Client, key *keystore.Key, epochID uint64, slotID uint64)
- func (s *SLS) PackSlotProof(epochID uint64, slotID uint64, prvKey *ecdsa.PrivateKey) ([]byte, error)
- func (s *SLS) ValidateBody(block *types.Block) error
- func (s *SLS) ValidateState(block, parent *types.Block, state *state.StateDB, receipts types.Receipts, ...) error
- func (s *SLS) VerifySlotProof(block *types.Block, epochID uint64, slotID uint64, Proof []*big.Int, ...) bool
- type SendTxFn
Constants ¶
View Source
const ( LenProof = 2 LenProofMeg = 3 )
View Source
const ( StageTwoProofCount = 2 EpochLeaders = "epochLeaders" SecurityMsg = "securityMsg" CR = "cr" SlotLeader = "slotLeader" )
Variables ¶
View Source
var APkiCache *lru.ARCCache
View Source
var RndCache *lru.ARCCache
Functions ¶
func GetRecoveryEpochID ¶
GetRecoveryEpochID used to get the recovery default epochID
Types ¶
type SLS ¶
type SLS struct {
// contains filtered or unexported fields
}
func GetSlotLeaderSelection ¶
func GetSlotLeaderSelection() *SLS
func (*SLS) GenerateDefaultSlotLeaders ¶
func (*SLS) GetAllSlotLeaders ¶
func (*SLS) GetChainReader ¶
func (s *SLS) GetChainReader() consensus.ChainReader
GetChainReader can get a simple reader interface of blockchain
func (*SLS) GetCurrentStateDb ¶
GetCurrentStateDb use to get stateDB instance of current state.
func (*SLS) GetEpochDefaultLeadersPK ¶
func (*SLS) GetInfoFromHeadExtra ¶
func (*SLS) GetPreEpochLeadersPK ¶
func (*SLS) GetSlotCreateStatusByEpochID ¶
func (*SLS) GetSlotLeader ¶
func (*SLS) IsLocalPkInEpochLeaders ¶
func (*SLS) Loop ¶
Loop check work every Slot time. Called by backend loop. It's all slotLeaderSelection's main workflow loop. It does not loop at all, it is loop called by the backend.
func (*SLS) PackSlotProof ¶
func (*SLS) ValidateState ¶
Click to show internal directories.
Click to hide internal directories.