constants

package
v0.0.0-...-e2cf2fa Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package constants contains all the constants used by relay by default all the settings in this is for mainnet

Index

Constants

View Source
const (
	KeyOfMaxOutboundAttempts      = "MaxOutboundAttempts"
	KeyOfSigningTransactionPeriod = "SigningTransactionPeriod"
	KeyOfHALTSIGNINGBSC           = "HALTSIGNINGBSC"
	KeyOfHALTSIGNINGETH           = "HALTSIGNINGETH"
	KeyOfHALTSIGNINGBTC           = "HALTSIGNINGBTC"
	KeyOfHALTSIGNING              = "HALTSIGNING"
	KeyOfSignerConcurrency        = "SignerConcurrency"
)
View Source
const (
	KeyOfConfirmCount           = "%s_CONFIRM_COUNT"            // cId
	KeyOfGASFeeGap              = "%s_GAS_FEE_GAP"              // cId
	KeyOfTransferFailedReceiver = "%s_TRANSFER_FAILED_RECEIVER" // cId
)
View Source
const (
	ElectionEpoch      = "electionEpoch"
	GetEpochInfo       = "getEpochInfo"
	GetMaintainerInfos = "getMaintainerInfos"
	Register           = "register"
	Heartbeat          = "heartbeat"
	VersionMethod      = "version"
)
View Source
const (
	RelaySigned     = "relaySigned"
	IsOrderExecuted = "isOrderExecuted"
	OrderInfos      = "orderInfos"
	Completed       = "completed" // custom method
)

----------------------------------------------------------------- Method of Relay -----------------------------------------------------------------

View Source
const (
	BridgeRelay       = "BridgeRelay"
	BridgeCompleted   = "BridgeCompleted"
	BridgeRelaySigned = "BridgeRelaySigned"
)

----------------------------------------------------------------- EventName of Relay -----------------------------------------------------------------

View Source
const (
	VoteUpdateTssPool = "voteUpdateTssPool"
	GetKeyShare       = "getKeyShare"
	VoteNetworkFee    = "voteNetworkFee"
	VoteTxIn          = "voteTxIn"
	VoteTxOut         = "voteTxOut"
	GetTSSStatus      = "getTSSStatus"
)

----------------------------------------------------------------- Method of TssManager -----------------------------------------------------------------

View Source
const (
	GetPublickeys             = "getPublicKeys" // vaults
	GetLastTxOutHeight        = "getLastTxOutHeight"
	GetLastTxInHeight         = "getLastTxInHeight"
	GetVault                  = "getVault"
	GetNetworkFeeInfo         = "getNetworkFeeInfo" // gas
	GetInfoByNickname         = "getInfoByNickname" // affiliate related
	GetInfoByShortName        = "getInfoByShortName"
	GetChainByName            = "getChainByName" // token
	GetChainName              = "getChainName"
	GetTokenAddressByNickname = "getTokenAddressByNickname"
	GetTokenDecimals          = "getTokenDecimals"
)

----------------------------------------------------------------- Method of View -----------------------------------------------------------------

View Source
const (
	GetIntValue      = "getIntValue"
	GetAddressValue  = "getAddressValue"
	GetBoolValue     = "getBoolValue"
	GetStringValue   = "getStringValue"
	GetBytesValue    = "getBytesValue"
	BatchGetIntValue = "batchGetIntValue"
)
View Source
const (
	MimirKeySecuredAssetHaltGlobal = "HaltSecuredGlobal"
	MimirKeyWasmPermissionless     = "WasmPermissionless"
	MimirKeyWasmHaltGlobal         = "HaltWasmGlobal"
	MimirKeyWasmMinGasPrice        = "WasmMinGasPrice"

	MimirTemplateConfMultiplierBasisPoints = "ConfMultiplierBasisPoints-%s" // Use with Chain
	MimirTemplateMaxConfirmations          = "MaxConfirmations-%s"          // Use with Chain
	MimirTemplateSwapSlipBasisPointsMin    = "SwapSlipBasisPointsMin-%s"    // Use with MimirRef
	MimirTemplateSecuredAssetHaltDeposit   = "HaltSecuredDeposit-%s"        // Use with Chain
	MimirTemplateSecuredAssetHaltWithdraw  = "HaltSecuredWithdraw-%s"       // Use with Chain
	MimirTemplateWasmHaltChecksum          = "HaltWasmCs-%s"                // Encode the checksum to base32 to fit within mimir's 64 char limit and case insenstivity. Truncate trailing `=` for brevity
	MimirTemplateWasmHaltContract          = "HaltWasmContract-%s"          // Use contract address checksum (last 6) for brevity and to fit inside mimir's 64 char length
	MimirTemplateSwitch                    = "EnableSwitch-%s-%s"           // Use with Chain, Symbol
	MimirTemplatePauseLPDeposit            = "PauseLPDeposit-%s"            // Use with Asset MimirString

	MimirRefL1           = "L1"           // Use with SwapSlipBasisPoints
	MimirRefSynth        = "Synth"        // Use with SwapSlipBasisPoints
	MimirRefTradeAccount = "TradeAccount" // Use with SwapSlipBasisPoints
)

All strings used in Mimir keys should be recorded here and referred to from elsewhere, except for strings referring to arbitrary Assets/Chains. Each string should clearly indicate its usage for the final Mimir key (key, template, reference) and no Mimir key should require the combination of more than two strings.

View Source
const (
	BTCToken = "BTC"
)
View Source
const (
	BridgeIn = "bridgeIn"
)
View Source
const (
	DefaultConfirmCount = 5
)
View Source
const (
	DefaultDir = ".compass-tss"
)
View Source
const DefaultTokenDecimals = 18
View Source
const MaxBasisPts = uint64(10_000)
View Source
const MaxMemoSize = 250

MaxMemoSize Maximum Memo Size

Variables

View Source
var (
	DefaultHome = os.ExpandEnv("$HOME/") + DefaultDir
)
View Source
var ErrorOfOrderExecuted = errors.New("order executed")
View Source
var MAPRelayChainBlockTime = 4500 * time.Millisecond
View Source
var ToMapIgnoreError = map[string]struct{}{
	"0x2dd1d0c8":                 {},
	"0x7ce72949":                 {},
	"0xe628c0d3":                 {},
	ErrorOfOrderExecuted.Error(): {},
}
View Source
var (
	ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")
)
View Source
var ZeroHash = "0x0000000000000000000000000000000000000000"

Functions

This section is empty.

Types

type ConstantName

type ConstantName int

ConstantName the name we used to get constant values.

const (
	EmissionCurve ConstantName = iota
	MaxRuneSupply
	BlocksPerYear
	OutboundTransactionFee
	NativeTransactionFee
	PoolCycle
	MinRunePoolDepth
	MaxAvailablePools
	StagedPoolCost
	PendingLiquidityAgeLimit
	MinimumNodesForBFT
	DesiredValidatorSet
	AsgardSize
	DerivedDepthBasisPts
	DerivedMinDepth
	MaxAnchorSlip
	MaxAnchorBlocks
	DynamicMaxAnchorSlipBlocks
	DynamicMaxAnchorTarget
	DynamicMaxAnchorCalcInterval
	ChurnInterval
	ChurnRetryInterval
	BadValidatorRedline
	LackOfObservationPenalty
	SigningTransactionPeriod
	DoubleSignMaxAge
	PauseBond
	PauseUnbond
	MinimumBondInRune
	FundMigrationInterval
	MaxOutboundAttempts
	SlashPenalty
	PauseOnSlashThreshold
	FailKeygenSlashPoints
	FailKeysignSlashPoints
	LiquidityLockUpBlocks
	ObserveSlashPoints
	DoubleBlockSignSlashPoints
	MissBlockSignSlashPoints
	ObservationDelayFlexibility
	JailTimeKeygen
	JailTimeKeysign
	NodePauseChainBlocks
	EnableDerivedAssets
	MinSwapsPerBlock
	MaxSwapsPerBlock
	EnableOrderBooks
	MaxSynthPerPoolDepth
	MaxSynthsForSaversYield
	VirtualMultSynths
	VirtualMultSynthsBasisPoints
	MinSlashPointsForBadValidator
	MaxBondProviders
	MinTxOutVolumeThreshold
	TxOutDelayRate
	TxOutDelayMax
	MaxTxOutOffset
	TNSRegisterFee
	TNSFeeOnSale
	TNSFeePerBlock
	StreamingSwapPause
	StreamingSwapMinBPFee // TODO: remove on hard fork
	StreamingSwapMaxLength
	StreamingSwapMaxLengthNative
	MinCR
	MaxCR
	LoanStreamingSwapsInterval
	PauseLoans
	LoanRepaymentMaturity
	LendingLever
	PermittedSolvencyGap
	NodeOperatorFee
	ValidatorMaxRewardRatio
	MaxNodeToChurnOutForLowVersion
	ChurnOutForLowVersionBlocks
	POLMaxNetworkDeposit
	POLMaxPoolMovement
	POLTargetSynthPerPoolDepth
	POLBuffer
	RagnarokProcessNumOfLPPerIteration
	SynthYieldBasisPoints
	SynthYieldCycle
	MinimumL1OutboundFeeUSD
	MinimumPoolLiquidityFee
	ChurnMigrateRounds
	AllowWideBlame
	MaxAffiliateFeeBasisPoints
	TargetOutboundFeeSurplusRune
	MaxOutboundFeeMultiplierBasisPoints
	MinOutboundFeeMultiplierBasisPoints
	NativeOutboundFeeUSD
	NativeTransactionFeeUSD
	TNSRegisterFeeUSD
	TNSFeePerBlockUSD
	EnableUSDFees
	PreferredAssetOutboundFeeMultiplier
	FeeUSDRoundSignificantDigits
	MigrationVaultSecurityBps
	CloutReset
	CloutLimit
	KeygenRetryInterval
	SaversStreamingSwapsInterval
	RescheduleCoalesceBlocks
	L1SlipMinBps
	SynthSlipMinBps
	TradeAccountsSlipMinBps
	DerivedSlipMinBps
	TradeAccountsEnabled
	TradeAccountsDepositEnabled
	SecuredAssetSlipMinBps
	EVMDisableContractWhitelist
	OperationalVotesMin
	RUNEPoolEnabled
	RUNEPoolDepositMaturityBlocks
	RUNEPoolMaxReserveBackstop
	SaversEjectInterval
	SystemIncomeBurnRateBps
	DevFundSystemIncomeBps
	DevFundAddress
	PendulumAssetsBasisPoints
	PendulumUseEffectiveSecurity
	PendulumUseVaultAssets
	TVLCapBasisPoints
	MultipleAffiliatesMaxCount
	BondSlashBan
	BankSendEnabled
	RUNEPoolHaltDeposit
	RUNEPoolHaltWithdraw
	MinRuneForTCYStakeDistribution
	MinTCYForTCYStakeDistribution
	TCYStakeSystemIncomeBps
	TCYClaimingSwapHalt
	TCYStakeDistributionHalt
	TCYStakingHalt
	TCYUnstakingHalt
	TCYClaimingHalt

	// These are the implicitly-0 Constants undisplayed in the API endpoint (no explicit value set).
	ArtificialRagnarokBlockHeight
	BondLockupPeriod
	BurnSynths
	DefaultPoolStatus
	ManualSwapsToSynthDisabled
	MaximumLiquidityRune
	MintSynths
	NumberOfNewNodesPerChurn
	SignerConcurrency
	StrictBondLiquidityRatio
	SwapOutDexAggregationDisabled
)

func (ConstantName) String

func (i ConstantName) String() string

type ConstantVals

type ConstantVals struct {
	// contains filtered or unexported fields
}

ConstantVals implement ConstantValues interface

func NewConstantValue

func NewConstantValue() *ConstantVals

NewConstantValue get new instance of ConstantValue

func (*ConstantVals) GetBoolValue

func (cv *ConstantVals) GetBoolValue(name ConstantName) bool

GetBoolValue retrieve a bool constant value from the map

func (ConstantVals) GetConstantValsByKeyname

func (cv ConstantVals) GetConstantValsByKeyname() ConstantValsByKeyname

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 ConstantValsByKeyname

type ConstantValsByKeyname struct {
	Int64Values  map[string]int64  `json:"int_64_values"`
	BoolValues   map[string]bool   `json:"bool_values"`
	StringValues map[string]string `json:"string_values"`
}

type ConstantValues

type ConstantValues interface {
	fmt.Stringer
	GetInt64Value(name ConstantName) int64
	GetBoolValue(name ConstantName) bool
	GetStringValue(name ConstantName) string
	GetConstantValsByKeyname() ConstantValsByKeyname
}

ConstantValues define methods used to get constant values

func GetConstantValues

func GetConstantValues(_ semver.Version) ConstantValues

GetConstantValues will return an implementation of ConstantValues which provide ways to get constant values TODO hard fork remove unused version parameter

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) GetConstantValsByKeyname

func (dc *DummyConstants) GetConstantValsByKeyname() ConstantValsByKeyname

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

type EventSig

type EventSig string
const (
	EventOfBridgeRelay       EventSig = "BridgeRelay(bytes32,uint256,uint8,bytes,bytes,bytes,uint256,uint256,bytes32,bytes,bytes)"
	EventOfBridgeCompleted   EventSig = "BridgeCompleted(bytes32,uint256,uint8,bytes,uint256,address,bytes)"
	EventOfBridgeRelaySigned EventSig = "BridgeRelaySigned(bytes32,uint256,bytes,bytes,bytes)"
)

relay event

const (
	EventOfBridgeOut EventSig = "BridgeOut(bytes32,uint256,uint8,bytes,address,uint256,address,address,bytes,bytes)"  // -> tss_manager voteTxIn
	EventOfBridgeIn  EventSig = "BridgeIn(bytes32,uint256,uint8,bytes,uint256,address,address,uint256,address,bytes)" // -> tss_manager voteTxOut
)

src or dst chain event

func (EventSig) GetTopic

func (es EventSig) GetTopic() common.Hash

func (EventSig) String

func (es EventSig) String() string

type NodeStatus

type NodeStatus uint8
const (
	NodeStatus_Unknown NodeStatus = iota
	NodeStatus_Whitelisted
	NodeStatus_Standby
	NodeStatus_Ready
	NodeStatus_Active
	NodeStatus_Disabled
)

type TssStatus

type TssStatus uint8
const (
	TssStatusUnknown TssStatus = iota
	TssStatusPending
	TssStatusConsensus
	TssStatusCompleted
	TssStatusFailed
)

type TxInType

type TxInType uint8
const (
	DEPOSIT TxInType = iota
	TRANSFER
	MIGRATE
	REFUND
	MESSAGE
)

func (TxInType) String

func (tx TxInType) String() string

type VaultStatus

type VaultStatus int32
const (
	VaultStatus_InactiveVault VaultStatus = 0
	VaultStatus_ActiveVault   VaultStatus = 1
	VaultStatus_RetiringVault VaultStatus = 2
	VaultStatus_InitVault     VaultStatus = 3
)

Jump to

Keyboard shortcuts

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