consensus

package
v0.0.0-...-163fc3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SukhavatiPerSkt uint64 = 100000000
	// MinHighPriority 1 skt, 1 day old, a tx of 250 bytes
	MinHighPriority          = 1e8 * 1280.0 / 250
	MaxNewBlockChSize        = 1024
	DefaultBlockPrioritySize = 50000 // bytes  40MB

	// MaxStakingRewardNum staking tx
	MaxStakingRewardNum = 100

	DayPeriod uint64 = 1920
	// DaySeconds The number of seconds in a day
	DaySeconds uint64 = 86400

	// StakingPoolAwardActivation after 90 days  activation ,and dev only 1
	StakingPoolAwardActivation uint64 = 1
	MaxValidPeriod                    = defaultMinFrozenPeriod * 24 // 1474560
	// StakingPoolRewardProportionalDenominator 40s height + 1  1day 24 * 60 * 60 = 86400s  86400s % 40s = 2160
	// release staking pool  1/200
	StakingPoolRewardProportionalDenominator = 200
	// StakingPoolMergeEpoch staking pool merge  epoch
	StakingPoolMergeEpoch = 100
	StakingPoolAwardStart = 2
	// StakingPoolRewardStartHeight 90 day --> height
	StakingPoolRewardStartHeight = 194400
	StakingPoolRewardEpoch       = 2160
	// CoinbaseSubsidyAttenuation 5.838% --> 94.162%   --> 94162/100000
	CoinbaseSubsidyAttenuation            = 94162
	CoinbaseSubsidyAttenuationDenominator = 100000

	StakingPoolType = uint16(1)
	// BindingTxFrozenPeriod default binding frozen period
	BindingTxFrozenPeriod  = 90 * DayPeriod
	AwardingTxFrozenPeriod = 1 // DayPeriod
)

Variables

View Source
var (
	// CoinbaseMaturity is the number of blocks required before newly
	// mined coins can be spent
	CoinbaseMaturity = defaultCoinbaseMaturity

	// TransactionMaturity is the number of blocks required before newly
	// binding tx get reward
	TransactionMaturity = defaultTransactionMaturity

	// MaxSkt the maximum Sukhavati amount
	MaxSkt = defaultMaxSkt

	SubsidyHalvingInterval = defaultSubsidyHalvingInterval
	// BaseSubsidy is the original subsidy Sukhavati for mined blocks.  This
	// value is halved every SubsidyHalvingInterval blocks.
	BaseSubsidy = defaultBaseSubsidy
	// MinHalvedSubsidy is the minimum subsidy Sukhavati for mined blocks.
	MinHalvedSubsidy = defaultMinHalvedSubsidy

	// MinRelayTxFee minimum relay fee in Sukhavati
	MinRelayTxFee = defaultMinRelayTxFee

	// MinFrozenPeriod Min Frozen Period in a StakingScriptHash output
	MinFrozenPeriod = defaultMinFrozenPeriod
	// MinAwardFrozenPeriod min pooling tx award frozen period
	MinAwardFrozenPeriod uint64 = 1
	//MinStakingValue minimum StakingScriptHash output in Sukhavati
	MinStakingValue = defaultMinStakingValue
	// StakingTxRewardStart staking tx
	StakingTxRewardStart = defaultStakingTxRewardStart
	BindingRequiredSkt   = map[int]float64{
		24: 0.006144,
		26: 0.026624,
		28: 0.112,
		30: 0.48,
		32: 2.048,
		34: 8.704,
		36: 36.864,
		38: 152,
		40: 640,
	}
	// StakingFrozenPeriodWeight day --> weight * 10000
	StakingFrozenPeriodWeight = map[uint64]uint64{
		55:  10000,
		144: 16180,
		377: 26180,
	}
)

Functions

This section is empty.

Types

type ServiceFlag

type ServiceFlag uint64

ServiceFlag use uint64 to indicate what kind of server this node can provide. one uint64 can represent 64 type of service flag

const (
	// SFFullNode is a flag used to indicate a peer is a full node.
	SFFullNode ServiceFlag = 1 << iota
	// SFFastSync indicate peer support header first mode
	SFFastSync
	// SFSPV indicate peer support spv mode
	SFSPV
	// DefaultServices is the server that this node support
	DefaultServices = SFFullNode | SFFastSync
)

func (ServiceFlag) IsEnable

func (f ServiceFlag) IsEnable(checkFlag ServiceFlag) bool

IsEnable check does the flag support the input flag function

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL