poet_settings_view.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:sawtooth-core 作者: hyperledger 项目源码 文件源码
def ztest_maximum_win_deviation(self):
        """Return the zTest maximum win deviation if config setting exists and
        is valid, otherwise return the default.

        The zTest maximum win deviation specifies the maximum allowed
        deviation from the expected win frequency for a particular validator
        before the zTest will fail and the claimed block will be rejected.
        The deviation corresponds to a confidence interval (i.e., how
        confident we are that we have truly detected a validator winning at
        a frequency we consider too frequent):

        3.075 ==> 99.9%
        2.575 ==> 99.5%
        2.321 ==> 99%
        1.645 ==> 95%
        """
        if self._ztest_maximum_win_deviation is None:
            self._ztest_maximum_win_deviation = \
                self._get_config_setting(
                    name='sawtooth.poet.ztest_maximum_win_deviation',
                    value_type=float,
                    default_value=PoetSettingsView.
                    _ZTEST_MAXIMUM_WIN_DEVIATION_,
                    validate_function=lambda value:
                        math.isfinite(value) and value > 0)

        return self._ztest_maximum_win_deviation
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号