Documentation
¶
Index ¶
- func DefaultPunishNode(err error, node *models.QosNode, logger *zap.Logger) bool
- func GetBlockHeightTolerance(chainConfiguration chain_configurations_registry.ChainConfigurationsService, ...) int
- func GetDataIntegrityHeightLookback(chainConfiguration chain_configurations_registry.ChainConfigurationsService, ...) int
- func PerformDataIntegrityCheck(check *Check, calculatePayload GetBlockByNumberPayloadFmter, path string, ...)
- func PerformDefaultHeightCheck(check *Check, payload string, path string, parseHeight HeightJsonParser, ...)
- func SendRelaysAsync(relayer pokt_v0.PocketRelayer, nodes []*models.QosNode, payload string, ...) chan *nodeRelayResponse
- type BlockHashParser
- type Check
- type CheckJob
- type GetBlockByNumberPayloadFmter
- type HeightJsonParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPunishNode ¶
DefaultPunishNode generic punisher for whenever a node returns an error independent of a specific check
func GetBlockHeightTolerance ¶
func GetBlockHeightTolerance(chainConfiguration chain_configurations_registry.ChainConfigurationsService, chainId string, defaultValue int) int
GetBlockHeightTolerance - helper function to retrieve block height tolerance across checks
func GetDataIntegrityHeightLookback ¶
func GetDataIntegrityHeightLookback(chainConfiguration chain_configurations_registry.ChainConfigurationsService, chainId string, defaultValue int) int
GetDataIntegrityHeightLookback - helper function ro retrieve data integrity lookback across checks
func PerformDataIntegrityCheck ¶
func PerformDataIntegrityCheck(check *Check, calculatePayload GetBlockByNumberPayloadFmter, path string, retrieveBlockIdentifier BlockHashParser, logger *zap.Logger)
PerformDataIntegrityCheck: is the default implementation of a data integrity check by:
func PerformDefaultHeightCheck ¶
func PerformDefaultHeightCheck(check *Check, payload string, path string, parseHeight HeightJsonParser, logger *zap.Logger)
PerformDefaultHeightCheck is the default implementation of a height check by: 0. Filtering out nodes that have not been checked since defaultNodeHeightCheckInterval 1. Sending height request via payload to all the nodes 2. Punishing all nodes that return an error 3. Filtering out nodes that are returning a height out of the zScore threshold 4. Punishing the nodes with defaultCheckPenalty that exceed the height tolerance.
func SendRelaysAsync ¶
Types ¶
type BlockHashParser ¶
type Check ¶
type Check struct { NodeList []*qos_models.QosNode PocketRelayer pokt_v0.PocketRelayer ChainConfiguration chain_configurations_registry.ChainConfigurationsService ChainNetworkProvider config2.ChainNetworkProvider }
func NewCheck ¶
func NewCheck(pocketRelayer pokt_v0.PocketRelayer, chainConfiguration chain_configurations_registry.ChainConfigurationsService, chainNetworkProvider config2.ChainNetworkProvider) *Check
func (*Check) IsEvmChain ¶
func (c *Check) IsEvmChain(node *qos_models.QosNode) bool
func (*Check) IsPoktChain ¶
func (c *Check) IsPoktChain(node *qos_models.QosNode) bool
func (*Check) IsSolanaChain ¶
func (c *Check) IsSolanaChain(node *qos_models.QosNode) bool
type CheckJob ¶
type CheckJob interface { Perform() Name() string ShouldRun() bool SetNodes(nodes []*qos_models.QosNode) }