validatormanager

package
v1.16.19 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: BSD-3-Clause Imports: 37 Imported by: 0

Documentation

Overview

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Copyright (C) 2022-2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.

Index

Constants

View Source
const (
	ValidatorMessagesContractAddress        = "0x9C00629cE712B0255b17A4a657171Acd15720B8C"
	ValidatorContractAddress                = "0x0C0DEBA5E0000000000000000000000000000000"
	ValidatorProxyContractAddress           = "0x0FEEDC0DE0000000000000000000000000000000"
	ValidatorProxyAdminContractAddress      = "0xA0AFFE1234567890aBcDEF1234567890AbCdEf34"
	SpecializationProxyContractAddress      = "0x100C0DE1C0FFEE00000000000000000000000000"
	SpecializationProxyAdminContractAddress = "0x97A35a4A2A8a56256de7A32160819c7B3F4C9DA6"
	RewardCalculatorAddress                 = "0x0DEADC0DE0000000000000000000000000000000"

	DefaultPoSMinimumStakeAmount     = 1
	DefaultPoSMaximumStakeAmount     = 1000
	DefaultPoSMinimumStakeDuration   = 100
	DefaultPoSDMinimumDelegationFee  = 1
	DefaultPoSMaximumStakeMultiplier = 1
	DefaultPoSWeightToValueFactor    = 1
)

Variables

View Source
var (
	ErrDelegatorIneligibleForRewards       = fmt.Errorf("delegator ineligible for rewards")
	ErrInvalidBLSPublicKey                 = fmt.Errorf("invalid BLS public key")
	ErrAlreadyInitialized                  = fmt.Errorf("the contract is already initialized")
	ErrInvalidMaximumChurnPercentage       = fmt.Errorf("unvalid churn percentage")
	ErrInvalidValidationID                 = fmt.Errorf("invalid validation id")
	ErrInvalidValidatorStatus              = fmt.Errorf("invalid validator status")
	ErrMaxChurnRateExceeded                = fmt.Errorf("max churn rate exceeded")
	ErrInvalidInitializationStatus         = fmt.Errorf("validators set already initialized")
	ErrInvalidValidatorManagerBlockchainID = fmt.Errorf("invalid validator manager blockchain ID")
	ErrInvalidValidatorManagerAddress      = fmt.Errorf("invalid validator manager address")
	ErrNodeAlreadyRegistered               = fmt.Errorf("node already registered")
	ErrInvalidSubnetConversionID           = fmt.Errorf("invalid subnet conversion id")
	ErrInvalidRegistrationExpiry           = fmt.Errorf("invalid registration expiry")
	ErrInvalidBLSKeyLength                 = fmt.Errorf("invalid BLS key length")
	ErrInvalidNodeID                       = fmt.Errorf("invalid node id")
	ErrInvalidWarpMessage                  = fmt.Errorf("invalid warp message")
	ErrInvalidWarpSourceChainID            = fmt.Errorf("invalid wapr source chain ID")
	ErrInvalidWarpOriginSenderAddress      = fmt.Errorf("invalid warp origin sender address")
	ErrInvalidCodecID                      = fmt.Errorf("invalid codec ID")
	ErrInvalidConversionID                 = fmt.Errorf("invalid conversion ID")
	ErrInvalidDelegationFee                = fmt.Errorf("invalid delegation fee")
	ErrInvalidDelegationID                 = fmt.Errorf("invalid delegation ID")
	ErrInvalidDelegatorStatus              = fmt.Errorf("invalid delegator status")
	ErrInvalidMessageLength                = fmt.Errorf("invalid message length")
	ErrInvalidMessageType                  = fmt.Errorf("invalid message type")
	ErrInvalidMinStakeDuration             = fmt.Errorf("invalid min stake duration")
	ErrInvalidNonce                        = fmt.Errorf("invalid nonce")
	ErrInvalidPChainOwnerThreshold         = fmt.Errorf("invalid pchain owner threshold")
	ErrInvalidStakeAmount                  = fmt.Errorf("invalid stake amount")
	ErrInvalidStakeMultiplier              = fmt.Errorf("invalid stake multiplier")
	ErrInvalidTokenAddress                 = fmt.Errorf("invalid token address")
	ErrInvalidTotalWeight                  = fmt.Errorf("invalid total weight")
	ErrMaxWeightExceeded                   = fmt.Errorf("max weight exceeded")
	ErrMinStakeDurationNotPassed           = fmt.Errorf("min stake duration not passed")
	ErrPChainOwnerAddressesNotSorted       = fmt.Errorf("pchain owner addresses not sorted")
	ErrUnauthorizedOwner                   = fmt.Errorf("unauthorized owner")
	ErrUnexpectedRegistrationStatus        = fmt.Errorf("unexpected registration status")
	ErrValidatorIneligibleForRewards       = fmt.Errorf("validator ineligible for rewards")
	ErrValidatorNotPoS                     = fmt.Errorf("validator not PoS")
	ErrZeroWeightToValueFactor             = fmt.Errorf("zero weight to value factor")
	ErrInvalidOwner                        = fmt.Errorf("invalid proxy or validator owner")
	ErrorSignatureToError                  = map[string]error{
		"InvalidInitialization()":                      ErrAlreadyInitialized,
		"InvalidMaximumChurnPercentage(uint8)":         ErrInvalidMaximumChurnPercentage,
		"InvalidValidationID(bytes32)":                 ErrInvalidValidationID,
		"InvalidValidatorStatus(uint8)":                ErrInvalidValidatorStatus,
		"MaxChurnRateExceeded(uint64)":                 ErrMaxChurnRateExceeded,
		"InvalidInitializationStatus()":                ErrInvalidInitializationStatus,
		"InvalidValidatorManagerBlockchainID(bytes32)": ErrInvalidValidatorManagerBlockchainID,
		"InvalidValidatorManagerAddress(address)":      ErrInvalidValidatorManagerAddress,
		"NodeAlreadyRegistered(bytes)":                 ErrNodeAlreadyRegistered,
		"InvalidSubnetConversionID(bytes32,bytes32)":   ErrInvalidSubnetConversionID,
		"InvalidRegistrationExpiry(uint64)":            ErrInvalidRegistrationExpiry,
		"InvalidBLSKeyLength(uint256)":                 ErrInvalidBLSKeyLength,
		"InvalidNodeID(bytes)":                         ErrInvalidNodeID,
		"InvalidWarpMessage()":                         ErrInvalidWarpMessage,
		"InvalidWarpSourceChainID(bytes32)":            ErrInvalidWarpSourceChainID,
		"InvalidWarpOriginSenderAddress(address)":      ErrInvalidWarpOriginSenderAddress,
		"DelegatorIneligibleForRewards(bytes32)":       ErrDelegatorIneligibleForRewards,
		"InvalidBLSPublicKey()":                        ErrInvalidBLSPublicKey,
		"InvalidCodecID(uint32)":                       ErrInvalidCodecID,
		"InvalidConversionID(bytes32,bytes32)":         ErrInvalidConversionID,
		"InvalidDelegationFee(uint16)":                 ErrInvalidDelegationFee,
		"InvalidDelegationID(bytes32)":                 ErrInvalidDelegationID,
		"InvalidDelegatorStatus(DelegatorStatus)":      ErrInvalidDelegatorStatus,
		"InvalidMessageLength(uint32,uint32)":          ErrInvalidMessageLength,
		"InvalidMessageType()":                         ErrInvalidMessageType,
		"InvalidMinStakeDuration(uint64)":              ErrInvalidMinStakeDuration,
		"InvalidNonce(uint64)":                         ErrInvalidNonce,
		"InvalidPChainOwnerThreshold(uint256,uint256)": ErrInvalidPChainOwnerThreshold,
		"InvalidStakeAmount(uint256)":                  ErrInvalidStakeAmount,
		"InvalidStakeMultiplier(uint8)":                ErrInvalidStakeMultiplier,
		"InvalidTokenAddress(address)":                 ErrInvalidTokenAddress,
		"InvalidTotalWeight(uint256)":                  ErrInvalidTotalWeight,
		"MaxWeightExceeded(uint64)":                    ErrMaxWeightExceeded,
		"MinStakeDurationNotPassed(uint64)":            ErrMinStakeDurationNotPassed,
		"PChainOwnerAddressesNotSorted()":              ErrPChainOwnerAddressesNotSorted,
		"UnauthorizedOwner(address)":                   ErrUnauthorizedOwner,
		"UnexpectedRegistrationStatus(bool)":           ErrUnexpectedRegistrationStatus,
		"ValidatorIneligibleForRewards(bytes32)":       ErrValidatorIneligibleForRewards,
		"ValidatorNotPoS(bytes32)":                     ErrValidatorNotPoS,
		"ZeroWeightToValueFactor()":                    ErrZeroWeightToValueFactor,
		"OwnableInvalidOwner(address)":                 ErrInvalidOwner,
		"OwnableUnauthorizedAccount(address)":          ErrUnauthorizedOwner,
	}
)

Functions

func AddPoAValidatorManagerV1_0_0ContractToAllocations

func AddPoAValidatorManagerV1_0_0ContractToAllocations(
	allocs core.GenesisAlloc,
)

func AddRewardCalculatorV2_0_0ToAllocations

func AddRewardCalculatorV2_0_0ToAllocations(
	allocs core.GenesisAlloc,
	rewardBasisPoints uint64,
)

func AddSpecializationTransparentProxyContractToAllocations

func AddSpecializationTransparentProxyContractToAllocations(
	allocs core.GenesisAlloc,
	proxyManager string,
)

func AddValidatorManagerV2_0_0ContractToAllocations

func AddValidatorManagerV2_0_0ContractToAllocations(
	allocs core.GenesisAlloc,
)

func AddValidatorMessagesV2_0_0ContractToAllocations

func AddValidatorMessagesV2_0_0ContractToAllocations(
	allocs core.GenesisAlloc,
)

func AddValidatorTransparentProxyContractToAllocations

func AddValidatorTransparentProxyContractToAllocations(
	allocs core.GenesisAlloc,
	proxyManager string,
)

func CompleteValidatorRegistration

func CompleteValidatorRegistration(
	rpcURL string,
	managerAddress crypto.Address,
	generateRawTxOnly bool,
	ownerAddress crypto.Address,
	privateKey string,
	l1ValidatorRegistrationSignedMessage *warp.Message,
) (*types.Transaction, *types.Receipt, error)

last step of flow for adding a new validator

func CompleteValidatorRemoval

func CompleteValidatorRemoval(
	rpcURL string,
	managerAddress crypto.Address,
	generateRawTxOnly bool,
	ownerAddress crypto.Address,
	privateKey string,
	subnetValidatorRegistrationSignedMessage *standaloneWarp.Message,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

func CompleteValidatorWeightChange

func CompleteValidatorWeightChange(
	rpcURL string,
	managerAddress crypto.Address,
	generateRawTxOnly bool,
	ownerAddress crypto.Address,
	privateKey string,
	pchainL1ValidatorRegistrationSignedMessage *warp.Message,
) (*types.Transaction, *types.Receipt, error)

func DeployAndRegisterPoSValidatorManagerV1_0_0Contract

func DeployAndRegisterPoSValidatorManagerV1_0_0Contract(
	rpcURL string,
	privateKey string,
	proxyOwnerPrivateKey string,
) (crypto.Address, error)

func DeployAndRegisterPoSValidatorManagerV2_0_0Contract

func DeployAndRegisterPoSValidatorManagerV2_0_0Contract(
	rpcURL string,
	privateKey string,
	proxyOwnerPrivateKey string,
) (crypto.Address, error)

func DeployAndRegisterValidatorManagerV2_0_0Contract

func DeployAndRegisterValidatorManagerV2_0_0Contract(
	rpcURL string,
	privateKey string,
	proxyOwnerPrivateKey string,
) (crypto.Address, error)

func DeployPoSValidatorManagerV1_0_0Contract

func DeployPoSValidatorManagerV1_0_0Contract(
	rpcURL string,
	privateKey string,
) (crypto.Address, error)

func DeployPoSValidatorManagerV2_0_0Contract

func DeployPoSValidatorManagerV2_0_0Contract(
	rpcURL string,
	privateKey string,
) (crypto.Address, error)

func DeployValidatorManagerV2_0_0Contract

func DeployValidatorManagerV2_0_0Contract(
	rpcURL string,
	privateKey string,
) (crypto.Address, error)

func FinishValidatorRegistration

func FinishValidatorRegistration(
	ctx context.Context,
	app *application.Lux,
	network models.Network,
	rpcURL string,
	chainSpec contract.ChainSpec,
	generateRawTxOnly bool,
	ownerAddressStr string,
	privateKey string,
	validationID ids.ID,
	aggregatorLogger luxlog.Logger,
	validatorManagerAddressStr string,
	signatureAggregatorEndpoint string,
) (*types.Transaction, error)

func FinishValidatorRemoval

func FinishValidatorRemoval(
	ctx context.Context,
	app *application.Lux,
	network models.Network,
	rpcURL string,
	chainSpec contract.ChainSpec,
	generateRawTxOnly bool,
	ownerAddressStr string,
	privateKey string,
	validationID ids.ID,
	aggregatorLogger luxlog.Logger,
	validatorManagerAddressStr string,
	useACP99 bool,
	signatureAggregatorEndpoint string,
) (*types.Transaction, error)

func FinishValidatorWeightChange

func FinishValidatorWeightChange(
	ctx context.Context,
	app *application.Lux,
	network models.Network,
	rpcURL string,
	chainSpec contract.ChainSpec,
	generateRawTxOnly bool,
	ownerAddressStr string,
	privateKey string,
	validationID ids.ID,
	aggregatorLogger luxlog.Logger,
	validatorManagerAddressStr string,
	l1ValidatorRegistrationSignedMessage *warp.Message,
	weight uint64,
	signatureAggregatorEndpoint string,
) (*types.Transaction, error)

func GetL1ValidatorWeightMessage

func GetL1ValidatorWeightMessage(
	network models.Network,
	aggregatorLogger luxlog.Logger,

	unsignedMessage *warp.UnsignedMessage,
	subnetID ids.ID,
	blockchainID ids.ID,
	managerAddress crypto.Address,
	validationID ids.ID,
	nonce uint64,
	weight uint64,
	signatureAggregatorEndpoint string,
) (*warp.Message, error)

func GetL1ValidatorWeightMessageFromTx

func GetL1ValidatorWeightMessageFromTx(
	rpcURL string,
	validationID ids.ID,
	weight uint64,
	txHash string,
) (*warp.UnsignedMessage, error)

func GetPChainL1ValidatorRegistrationMessage

func GetPChainL1ValidatorRegistrationMessage(
	ctx context.Context,
	network models.Network,
	rpcURL string,
	aggregatorLogger luxlog.Logger,
	aggregatorQuorumPercentage uint64,
	subnetID ids.ID,
	validationID ids.ID,
	registered bool,
	signatureAggregatorEndpoint string,
) (*warp.Message, error)

func GetPChainL1ValidatorWeightMessage

func GetPChainL1ValidatorWeightMessage(
	network models.Network,
	aggregatorLogger luxlog.Logger,
	aggregatorQuorumPercentage uint64,
	subnetID ids.ID,

	l1SignedMessage *warp.Message,

	validationID ids.ID,
	nonce uint64,
	weight uint64,
	signatureAggregatorEndpoint string,
) (*warp.Message, error)

func GetPChainSubnetToL1ConversionUnsignedMessage

func GetPChainSubnetToL1ConversionUnsignedMessage(
	network network.Network,
	subnetID ids.ID,
	managerBlockchainID ids.ID,
	managerAddress crypto.Address,
	convertSubnetValidators []*platformvmtxs.ConvertNetToL1Validator,
) (*warp.UnsignedMessage, error)

func GetRegisterL1ValidatorMessage

func GetRegisterL1ValidatorMessage(
	ctx context.Context,
	rpcURL string,
	network models.Network,
	aggregatorLogger luxlog.Logger,
	aggregatorQuorumPercentage uint64,
	subnetID ids.ID,
	blockchainID ids.ID,
	managerAddress crypto.Address,
	nodeID ids.NodeID,
	blsPublicKey [48]byte,
	expiry uint64,
	balanceOwners localWarpMessage.PChainOwner,
	disableOwners localWarpMessage.PChainOwner,
	weight uint64,
	alreadyInitialized bool,
	initiateTxHash string,
	registerSubnetValidatorUnsignedMessage *warp.UnsignedMessage,
	signatureAggregatorEndpoint string,
) (*warp.Message, ids.ID, error)

func GetRegisterL1ValidatorMessageFromTx

func GetRegisterL1ValidatorMessageFromTx(
	rpcURL string,
	validationID ids.ID,
	txHash string,
) (*warp.UnsignedMessage, error)

func GetRegistrationJustification

func GetRegistrationJustification(
	ctx context.Context,
	rpcURL string,
	validationID ids.ID,
	subnetID ids.ID,
) ([]byte, error)

func GetSpecializedValidatorProxyImplementation

func GetSpecializedValidatorProxyImplementation(
	rpcURL string,
) (crypto.Address, error)

func GetUptimeProofMessage

func GetUptimeProofMessage(
	network models.Network,
	aggregatorLogger luxlog.Logger,
	aggregatorQuorumPercentage uint64,
	subnetID ids.ID,
	blockchainID ids.ID,
	validationID ids.ID,
	uptime uint64,
	signatureAggregatorEndpoint string,
) (*standaloneWarp.Message, error)

func GetValidatorManagerType

func GetValidatorManagerType(
	rpcURL string,
	managerAddress crypto.Address,
) validatormanagertypes.ValidatorManagementType

GetValidatorManagerType returns validatormanagertypes.ProofOfAuthority if validator manager is verified to be Proof of Authority If validator manager is verified to be Proof of Stake, returns validatormanagertypes.ProofOfStake In other cases, returns validatormanagertypes.UndefinedValidatorManagement

func GetValidatorNonce

func GetValidatorNonce(
	ctx context.Context,
	rpcURL string,
	validationID ids.ID,
) (uint64, error)

func GetValidatorProxyImplementation

func GetValidatorProxyImplementation(
	rpcURL string,
) (crypto.Address, error)

func InitValidatorRegistration

func InitValidatorRegistration(
	ctx context.Context,
	app *application.Lux,
	network models.Network,
	rpcURL string,
	chainSpec contract.ChainSpec,
	generateRawTxOnly bool,
	ownerAddressStr string,
	ownerPrivateKey string,
	nodeID ids.NodeID,
	blsPublicKey []byte,
	expiry uint64,
	balanceOwners localWarpMessage.PChainOwner,
	disableOwners localWarpMessage.PChainOwner,
	weight uint64,
	aggregatorLogger luxlog.Logger,
	isPos bool,
	delegationFee uint16,
	stakeDuration time.Duration,
	rewardRecipient crypto.Address,
	validatorManagerAddressStr string,
	useACP99 bool,
	initiateTxHash string,
	signatureAggregatorEndpoint string,
) (*warp.Message, ids.ID, *types.Transaction, error)

func InitValidatorRemoval

func InitValidatorRemoval(
	ctx context.Context,
	app *application.Lux,
	network models.Network,
	rpcURL string,
	chainSpec contract.ChainSpec,
	generateRawTxOnly bool,
	ownerAddressStr string,
	ownerPrivateKey string,
	nodeID ids.NodeID,
	aggregatorLogger luxlog.Logger,
	isPoS bool,
	uptimeSec uint64,
	force bool,
	validatorManagerAddressStr string,
	useACP99 bool,
	initiateTxHash string,
	signatureAggregatorEndpoint string,
) (*standaloneWarp.Message, ids.ID, *types.Transaction, error)

func InitValidatorWeightChange

func InitValidatorWeightChange(
	ctx context.Context,
	printFunc func(msg string, args ...interface{}),
	app *application.Lux,
	network models.Network,
	rpcURL string,
	chainSpec contract.ChainSpec,
	generateRawTxOnly bool,
	ownerAddressStr string,
	ownerPrivateKey string,
	nodeID ids.NodeID,
	aggregatorLogger luxlog.Logger,
	validatorManagerAddressStr string,
	weight uint64,
	initiateTxHash string,
	signatureAggregatorEndpoint string,
) (*warp.Message, ids.ID, *types.Transaction, error)

func InitializeValidatorRegistrationPoA

func InitializeValidatorRegistrationPoA(
	rpcURL string,
	managerAddress crypto.Address,
	generateRawTxOnly bool,
	managerOwnerAddress crypto.Address,
	managerOwnerPrivateKey string,
	nodeID ids.NodeID,
	blsPublicKey []byte,
	expiry uint64,
	balanceOwners localWarpMessage.PChainOwner,
	disableOwners localWarpMessage.PChainOwner,
	weight uint64,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

step 1 of flow for adding a new validator

func InitializeValidatorRegistrationPoSNative

func InitializeValidatorRegistrationPoSNative(
	rpcURL string,
	managerAddress crypto.Address,
	managerOwnerPrivateKey string,
	nodeID ids.NodeID,
	blsPublicKey []byte,
	expiry uint64,
	balanceOwners localWarpMessage.PChainOwner,
	disableOwners localWarpMessage.PChainOwner,
	delegationFeeBips uint16,
	minStakeDuration time.Duration,
	stakeAmount *big.Int,
	rewardRecipient crypto.Address,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

func InitializeValidatorRemoval

func InitializeValidatorRemoval(
	rpcURL string,
	managerAddress crypto.Address,
	generateRawTxOnly bool,
	managerOwnerAddress crypto.Address,
	privateKey string,
	validationID ids.ID,
	isPoS bool,
	uptimeProofSignedMessage *standaloneWarp.Message,
	force bool,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

func InitializeValidatorWeightChange

func InitializeValidatorWeightChange(
	rpcURL string,
	managerAddress crypto.Address,
	generateRawTxOnly bool,
	managerOwnerAddress crypto.Address,
	privateKey string,
	validationID ids.ID,
	weight uint64,
) (*types.Transaction, *types.Receipt, error)

func InitializeValidatorsSet

func InitializeValidatorsSet(
	rpcURL string,
	managerAddress crypto.Address,
	privateKey string,
	subnetID ids.ID,
	managerBlockchainID ids.ID,
	convertSubnetValidators []*platformvmtxs.ConvertNetToL1Validator,
	subnetConversionSignedMessage *warp.Message,
) (*types.Transaction, *types.Receipt, error)

InitializeValidatorsSet calls poa manager validators set init method, passing to it the p-chain signed [subnetConversionSignedMessage] to verify p-chain already processed the associated ConvertSubnetToL1Tx

func PoAValidatorManagerInitialize

func PoAValidatorManagerInitialize(
	rpcURL string,
	managerAddress crypto.Address,
	privateKey string,
	subnetID ids.ID,
	ownerAddress crypto.Address,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

PoAValidatorManagerInitialize initializes contract [managerAddress] at [rpcURL], to manage validators on [subnetID], with owner given by [ownerAddress]

func PoSValidatorManagerInitialize

func PoSValidatorManagerInitialize(
	rpcURL string,
	managerAddress crypto.Address,
	specializedManagerAddress crypto.Address,
	managerOwnerPrivateKey string,
	privateKey string,
	subnetID [32]byte,
	posParams PoSParams,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

initializes contract [managerAddress] at [rpcURL], to manage validators on [subnetID] using PoS specific settings

func PoSWeightToValue

func PoSWeightToValue(
	rpcURL string,
	managerAddress crypto.Address,
	weight uint64,
) (*big.Int, error)

func SearchForL1ValidatorWeightMessage

func SearchForL1ValidatorWeightMessage(
	ctx context.Context,
	rpcURL string,
	validationID ids.ID,
	weight uint64,
) (*warp.UnsignedMessage, error)

func SearchForRegisterL1ValidatorMessage

func SearchForRegisterL1ValidatorMessage(
	ctx context.Context,
	rpcURL string,
	validationID ids.ID,
) (*warp.UnsignedMessage, error)

func SetupPoA

func SetupPoA(
	log luxlog.Logger,
	subnet blockchainSDK.Subnet,
	network models.Network,
	privateKey string,
	aggregatorLogger luxlog.Logger,
	validatorManagerAddressStr string,
	v2_0_0 bool,
	signatureAggregatorEndpoint string,
) error

setups PoA manager after a successful execution of ConvertSubnetToL1Tx on P-Chain needs the list of validators for that tx, [convertSubnetValidators], together with an evm [ownerAddress] to set as the owner of the PoA manager

func SetupPoS

func SetupPoS(
	log luxlog.Logger,
	subnet blockchainSDK.Subnet,
	network models.Network,
	privateKey string,
	aggregatorLogger luxlog.Logger,
	posParams PoSParams,
	managerAddress string,
	specializedManagerAddress string,
	managerOwnerPrivateKey string,
	v2_0_0 bool,
	signatureAggregatorEndpoint string,
) error

setups PoA manager after a successful execution of ConvertSubnetToL1Tx on P-Chain needs the list of validators for that tx, [convertSubnetValidators], together with an evm [ownerAddress] to set as the owner of the PoA manager

func SetupSpecializationProxyImplementation

func SetupSpecializationProxyImplementation(
	rpcURL string,
	proxyManagerPrivateKey string,
	validatorManager crypto.Address,
) (*types.Transaction, *types.Receipt, error)

func SetupValidatorProxyImplementation

func SetupValidatorProxyImplementation(
	rpcURL string,
	proxyManagerPrivateKey string,
	validatorManager crypto.Address,
) (*types.Transaction, *types.Receipt, error)

func ValidatorProxyHasImplementationSet

func ValidatorProxyHasImplementationSet(
	rpcURL string,
) (bool, error)

Types

type ACP99ValidatorManagerSettings

type ACP99ValidatorManagerSettings struct {
	Admin                  crypto.Address
	SubnetID               [32]byte
	ChurnPeriodSeconds     uint64
	MaximumChurnPercentage uint8
}

type NativeTokenValidatorManagerSettingsV1_0_0

type NativeTokenValidatorManagerSettingsV1_0_0 struct {
	BaseSettings             ValidatorManagerSettings
	MinimumStakeAmount       *big.Int
	MaximumStakeAmount       *big.Int
	MinimumStakeDuration     uint64
	MinimumDelegationFeeBips uint16
	MaximumStakeMultiplier   uint8
	WeightToValueFactor      *big.Int
	RewardCalculator         crypto.Address
	UptimeBlockchainID       [32]byte
}

type NativeTokenValidatorManagerSettingsV2_0_0

type NativeTokenValidatorManagerSettingsV2_0_0 struct {
	Manager                  crypto.Address
	MinimumStakeAmount       *big.Int
	MaximumStakeAmount       *big.Int
	MinimumStakeDuration     uint64
	MinimumDelegationFeeBips uint16
	MaximumStakeMultiplier   uint8
	WeightToValueFactor      *big.Int
	RewardCalculator         crypto.Address
	UptimeBlockchainID       [32]byte
}

type PoSParams

type PoSParams struct {
	MinimumStakeAmount      *big.Int
	MaximumStakeAmount      *big.Int
	MinimumStakeDuration    uint64
	MinimumDelegationFee    uint16
	MaximumStakeMultiplier  uint8
	WeightToValueFactor     *big.Int
	RewardCalculatorAddress string
	UptimeBlockchainID      ids.ID
}

func (PoSParams) Verify

func (p PoSParams) Verify() error

type ValidatorManagerSettings

type ValidatorManagerSettings struct {
	SubnetID               [32]byte
	ChurnPeriodSeconds     uint64
	MaximumChurnPercentage uint8
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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