Documentation ¶
Index ¶
- Constants
- func GeneratePairsFromVrfHash(hash [32]byte, firstIndex, dictionarySize, pairCount int) (nums []int)
- func GetAuthorsDistribution(shards map[common.ShardId]*candidatesOfShard, seed []byte, shortFlipsCount int) map[common.ShardId]*shardAuthors
- func GetFlipsDistribution(candidatesCount int, authorsPerCandidate map[int][]int, ...) (shortFlipsPerCandidate [][]int, longFlipsPerCandidate [][]int)
- func GetWords(authorRnd uint64, firstIndex, dictionarySize, pairCount, pairIndex int) (word1, word2 int, err error)
- func NewQualification(config *config.Config, epochDb *database.EpochDb) *qualification
- type FlipQualification
- type FlipStatus
- type Queue
- type ValidationCeremony
- func (vc *ValidationCeremony) ApplyNewEpoch(height uint64, appState *appstate.AppState, ...) (identitiesCount int, results map[common.ShardId]*types.ValidationResults, ...)
- func (vc *ValidationCeremony) FlipKeyWordPairs() []int
- func (vc *ValidationCeremony) GeneratePairs(seed []byte, firstIndex, dictionarySize, pairCount int) (nums []int, proof []byte)
- func (vc *ValidationCeremony) GetDecryptedFlip(key []byte) (publicPart []byte, privatePart []byte, err error)
- func (vc *ValidationCeremony) GetFlipKeys(addr common.Address, cidBytes []byte) (publicKey []byte, encryptedPrivateKey []byte, err error)
- func (vc *ValidationCeremony) GetFlipWords(cid []byte) (word1, word2 int, err error)
- func (vc *ValidationCeremony) GetLongFlipsToSolve(address common.Address, shardId common.ShardId) [][]byte
- func (vc *ValidationCeremony) GetShortFlipsToSolve(address common.Address, shardId common.ShardId) [][]byte
- func (vc *ValidationCeremony) GetWordDictionaryRange() (firstIndex, size int)
- func (vc *ValidationCeremony) Initialize(currentBlock *types.Block)
- func (vc *ValidationCeremony) IsFlipInMemory(key []byte) bool
- func (vc *ValidationCeremony) IsFlipReadyToSolve(key []byte) bool
- func (vc *ValidationCeremony) IsValidationReady() bool
- func (vc *ValidationCeremony) PrivateEncryptionKeyCandidates(addr common.Address) ([][]byte, error)
- func (vc *ValidationCeremony) SendPrivateEncryptionKeysPackage(data *types.PrivateFlipKeysPackage) error
- func (vc *ValidationCeremony) SendPublicEncryptionKey(key *types.PublicFlipKey) error
- func (vc *ValidationCeremony) ShortSessionStarted() bool
- func (vc *ValidationCeremony) SubmitLongAnswers(answers *types.Answers) (common.Hash, error)
- func (vc *ValidationCeremony) SubmitShortAnswers(answers *types.Answers) (common.Hash, error)
Constants ¶
View Source
const ( LotterySeedLag = 100 MaxFlipKeysPackageBroadcastDelaySec = 120 MaxShortAnswersBroadcastDelaySec = 30 // Flip keys will stop syncing with peers in FlipKeysSyncTimeFrame seconds after short session start FlipKeysSyncTimeFrame = 60 * 4 // seconds )
View Source
const (
CandidatesPerAuthor = 13
)
Variables ¶
This section is empty.
Functions ¶
func GeneratePairsFromVrfHash ¶ added in v0.24.1
func GetAuthorsDistribution ¶
func GetFlipsDistribution ¶
Types ¶
type FlipQualification ¶
type FlipQualification struct {
// contains filtered or unexported fields
}
type FlipStatus ¶
type FlipStatus byte
const ( NotQualified FlipStatus = 0 Qualified FlipStatus = 1 WeaklyQualified FlipStatus = 2 QualifiedByNone FlipStatus = 3 )
type ValidationCeremony ¶
type ValidationCeremony struct {
// contains filtered or unexported fields
}
func NewValidationCeremony ¶
func (*ValidationCeremony) ApplyNewEpoch ¶
func (vc *ValidationCeremony) ApplyNewEpoch(height uint64, appState *appstate.AppState, statsCollector collector.StatsCollector) (identitiesCount int, results map[common.ShardId]*types.ValidationResults, failed bool)
func (*ValidationCeremony) FlipKeyWordPairs ¶
func (vc *ValidationCeremony) FlipKeyWordPairs() []int
func (*ValidationCeremony) GeneratePairs ¶
func (vc *ValidationCeremony) GeneratePairs(seed []byte, firstIndex, dictionarySize, pairCount int) (nums []int, proof []byte)
func (*ValidationCeremony) GetDecryptedFlip ¶ added in v0.23.1
func (vc *ValidationCeremony) GetDecryptedFlip(key []byte) (publicPart []byte, privatePart []byte, err error)
func (*ValidationCeremony) GetFlipKeys ¶ added in v0.23.1
func (*ValidationCeremony) GetFlipWords ¶
func (vc *ValidationCeremony) GetFlipWords(cid []byte) (word1, word2 int, err error)
func (*ValidationCeremony) GetLongFlipsToSolve ¶
func (*ValidationCeremony) GetShortFlipsToSolve ¶
func (*ValidationCeremony) GetWordDictionaryRange ¶ added in v0.27.0
func (vc *ValidationCeremony) GetWordDictionaryRange() (firstIndex, size int)
func (*ValidationCeremony) Initialize ¶
func (vc *ValidationCeremony) Initialize(currentBlock *types.Block)
func (*ValidationCeremony) IsFlipInMemory ¶ added in v0.23.1
func (vc *ValidationCeremony) IsFlipInMemory(key []byte) bool
func (*ValidationCeremony) IsFlipReadyToSolve ¶ added in v0.23.1
func (vc *ValidationCeremony) IsFlipReadyToSolve(key []byte) bool
func (*ValidationCeremony) IsValidationReady ¶ added in v0.23.1
func (vc *ValidationCeremony) IsValidationReady() bool
func (*ValidationCeremony) PrivateEncryptionKeyCandidates ¶ added in v0.23.1
func (vc *ValidationCeremony) PrivateEncryptionKeyCandidates(addr common.Address) ([][]byte, error)
func (*ValidationCeremony) SendPrivateEncryptionKeysPackage ¶ added in v0.23.1
func (vc *ValidationCeremony) SendPrivateEncryptionKeysPackage(data *types.PrivateFlipKeysPackage) error
func (*ValidationCeremony) SendPublicEncryptionKey ¶ added in v0.23.1
func (vc *ValidationCeremony) SendPublicEncryptionKey(key *types.PublicFlipKey) error
func (*ValidationCeremony) ShortSessionStarted ¶
func (vc *ValidationCeremony) ShortSessionStarted() bool
func (*ValidationCeremony) SubmitLongAnswers ¶
func (*ValidationCeremony) SubmitShortAnswers ¶
Click to show internal directories.
Click to hide internal directories.