Documentation ¶
Overview ¶
Package constants contains all the constants used by thorchain by default all the settings in this is for mainnet
Index ¶
- Constants
- Variables
- type ConstantName
- type ConstantVals
- func NewConstantValue010() *ConstantVals
- func NewConstantValue102() *ConstantVals
- func NewConstantValue106() *ConstantVals
- func NewConstantValue107() *ConstantVals
- func NewConstantValue108() *ConstantVals
- func NewConstantValue110() *ConstantVals
- func NewConstantValue112() *ConstantVals
- func NewConstantValueVCUR() *ConstantVals
- type ConstantValues
- type DummyConstants
Constants ¶
const ( MimirKeyRegex = `^[a-zA-Z0-9-]+$` MimirKeyRegexV109 = `^[a-zA-Z0-9-_]+$` )
const CtxMetricLabels contextKey = "metricLabels"
const DefaultTHORChainGas = 2000000
DefaultTHORChainGas defines the default gas value when it's zero
const MaxBasisPts = uint64(10_000)
max basis points
const MaxETHGas = 50000000
MaxETHGas define the maximum gas for a single transaction on ETH
const MaxMemoSize = 250
MaxMemoSize Maximum Memo Size
const StreamingSwapMinBPFeeMulti = int64(100)
streaming swap math
const SymbolicNodeMimirValue = "ACCEPT_"
Symbolic node mimir value
Variables ¶
var ( GitCommit = "null" // sha1 revision used to build the program BuildTime = "null" // when the executable was built Version = "0.1.0" // software version )
var MayachainBlockTime = 5 * time.Second
MayachainBlockTime Block time of BASEChain
var SWVersion, _ = semver.Make(Version)
Functions ¶
This section is empty.
Types ¶
type ConstantName ¶
type ConstantName int
ConstantName the name we used to get constant values
const ( BlocksPerDay ConstantName = iota BlocksPerYear OutboundTransactionFee NativeTransactionFee KillSwitchStart KillSwitchDuration PoolCycle MinCacaoPoolDepth MaxAvailablePools StagedPoolCost MinimumNodesForYggdrasil MinimumNodesForBFT DesiredValidatorSet AsgardSize ChurnInterval ChurnRetryInterval ValidatorsChangeWindow LeaveProcessPerBlockHeight BadValidatorRedline BadValidatorRate OldValidatorRate LowBondValidatorRate LackOfObservationPenalty SigningTransactionPeriod DoubleSignMaxAge PauseBond PauseUnbond MinimumBondInCacao FundMigrationInterval ArtificialRagnarokBlockHeight MaximumLiquidityCacao StrictBondLiquidityRatio DefaultPoolStatus MaxOutboundAttempts SlashPenalty PauseOnSlashThreshold FailKeygenSlashPoints FailKeysignSlashPoints LiquidityLockUpBlocks ObserveSlashPoints DoubleBlockSignSlashPoints MissBlockSignSlashPoints ObservationDelayFlexibility ForgiveSlashPeriod YggFundLimit YggFundRetry JailTimeKeygen JailTimeKeysign NodePauseChainBlocks MinSwapsPerBlock MaxSwapsPerBlock MaxSlashRatio MaxSynthPerAssetDepth MaxSynthPerPoolDepth MaxSynthsForSaversYield VirtualMultSynths VirtualMultSynthsBasisPoints MinSlashPointsForBadValidator FullImpLossProtectionBlocks BondLockupPeriod MaxBondProviders NumberOfNewNodesPerChurn MinTxOutVolumeThreshold TxOutDelayRate TxOutDelayMax MaxTxOutOffset TNSRegisterFee TNSFeeOnSale TNSFeePerBlock PermittedSolvencyGap NodeOperatorFee ValidatorMaxRewardRatio PoolDepthForYggFundingMin MaxNodeToChurnOutForLowVersion MayaFundPerc MinCacaoForMayaFundDist WithdrawLimitTier1 WithdrawLimitTier2 WithdrawLimitTier3 WithdrawDaysTier1 WithdrawDaysTier2 WithdrawDaysTier3 WithdrawTier1 WithdrawTier2 WithdrawTier3 InflationPercentageThreshold InflationPoolPercentage InflationFormulaMulValue InflationFormulaSumValue IBCReceiveEnabled IBCSendEnabled RagnarokProcessNumOfLPPerIteration SwapOutDexAggregationDisabled POLMaxNetworkDeposit POLMaxPoolMovement POLSynthUtilization POLBuffer SynthYieldBasisPoints SynthYieldCycle MinimumL1OutboundFeeUSD MinimumPoolLiquidityFee SubsidizeReserveMultiplier LiquidityAuction IncentiveCurveControl FullImpLossProtectionBlocksTimes4 ZeroImpLossProtectionBlocks AllowWideBlame MaxAffiliateFeeBasisPoints TargetOutboundFeeSurplusRune MaxOutboundFeeMultiplierBasisPoints MinOutboundFeeMultiplierBasisPoints SlipFeeAddedBasisPoints PayBPNodeRewards PendingLiquidityAgeLimit StreamingSwapPause StreamingSwapMinBPFee StreamingSwapMaxLength StreamingSwapMaxLengthNative SaversStreamingSwapsInterval KeygenRetryInterval RescheduleCoalesceBlocks PreferredAssetOutboundFeeMultiplier MAYANameGracePeriodBlocks MultipleAffiliatesMaxCount SignerConcurrency )
type ConstantVals ¶
type ConstantVals struct {
// contains filtered or unexported fields
}
ConstantVals implement ConstantValues interface
func NewConstantValue010 ¶
func NewConstantValue010() *ConstantVals
NewConstantValue010 get new instance of ConstantValue010
func NewConstantValue102 ¶ added in v1.102.0
func NewConstantValue102() *ConstantVals
NewConstantValue102 get new instance of ConstantValue102
func NewConstantValue106 ¶ added in v1.106.0
func NewConstantValue106() *ConstantVals
NewConstantValue106 get new instance of ConstantValue102
func NewConstantValue107 ¶ added in v1.107.0
func NewConstantValue107() *ConstantVals
NewConstantValue107 get new instance of ConstantValue106
func NewConstantValue108 ¶ added in v1.108.0
func NewConstantValue108() *ConstantVals
NewConstantValue108 get new instance of ConstantValue106
func NewConstantValue110 ¶ added in v1.110.0
func NewConstantValue110() *ConstantVals
NewConstantValue110 get new instance of ConstantValue106
func NewConstantValue112 ¶ added in v1.114.0
func NewConstantValue112() *ConstantVals
NewConstantValueV112 get new instance of ConstantValueCUR
func NewConstantValueVCUR ¶ added in v1.112.0
func NewConstantValueVCUR() *ConstantVals
NewConstantValueVCUR get new instance of ConstantValueCUR
func (*ConstantVals) GetBoolValue ¶
func (cv *ConstantVals) GetBoolValue(name ConstantName) bool
GetBoolValue retrieve a bool constant value from the map
func (*ConstantVals) GetInt64Value ¶
func (cv *ConstantVals) GetInt64Value(name ConstantName) int64
GetInt64Value get value in int64 type, if it doesn't exist then it will return the default value of int64, which is 0
func (*ConstantVals) GetStringValue ¶
func (cv *ConstantVals) GetStringValue(name ConstantName) string
GetStringValue retrieve a string const value from the map
func (ConstantVals) MarshalJSON ¶
func (cv ConstantVals) MarshalJSON() ([]byte, error)
MarshalJSON marshal result to json format
func (*ConstantVals) String ¶
func (cv *ConstantVals) String() string
type ConstantValues ¶
type ConstantValues interface { fmt.Stringer GetInt64Value(name ConstantName) int64 GetBoolValue(name ConstantName) bool GetStringValue(name ConstantName) string }
ConstantValues define methods used to get constant values
func GetConstantValues ¶
func GetConstantValues(ver semver.Version) ConstantValues
GetConstantValues will return an implementation of ConstantValues which provide ways to get constant values
type DummyConstants ¶
type DummyConstants struct {
// contains filtered or unexported fields
}
func NewDummyConstants ¶
func NewDummyConstants(int64Values map[ConstantName]int64, boolValues map[ConstantName]bool, stringValues map[ConstantName]string) *DummyConstants
NewDummyConstants create a new instance of DummyConstants for test purpose
func (*DummyConstants) GetBoolValue ¶
func (dc *DummyConstants) GetBoolValue(name ConstantName) bool
func (*DummyConstants) GetInt64Value ¶
func (dc *DummyConstants) GetInt64Value(name ConstantName) int64
func (*DummyConstants) GetStringValue ¶
func (dc *DummyConstants) GetStringValue(name ConstantName) string
func (*DummyConstants) String ¶
func (dc *DummyConstants) String() string