validatormanager

package
v1.13.4 Latest Latest
Warning

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

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

Documentation

Overview

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

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

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

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

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

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 common.Address,
	generateRawTxOnly bool,
	ownerAddress common.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 common.Address,
	generateRawTxOnly bool,
	ownerAddress common.Address,
	privateKey string,
	subnetValidatorRegistrationSignedMessage *warp.Message,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

func CompleteValidatorWeightChange

func CompleteValidatorWeightChange(
	rpcURL string,
	managerAddress common.Address,
	generateRawTxOnly bool,
	ownerAddress common.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,
) (common.Address, error)

func DeployAndRegisterPoSValidatorManagerV2_0_0Contract

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

func DeployAndRegisterValidatorManagerV2_0_0Contract

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

func DeployPoSValidatorManagerV1_0_0Contract

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

func DeployPoSValidatorManagerV2_0_0Contract

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

func DeployValidatorManagerV2_0_0Contract

func DeployValidatorManagerV2_0_0Contract(
	rpcURL string,
	privateKey string,
) (common.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 logging.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 logging.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 logging.Logger,
	validatorManagerAddressStr string,
	l1ValidatorRegistrationSignedMessage *warp.Message,
	weight uint64,
	signatureAggregatorEndpoint string,
) (*types.Transaction, error)

func GetL1ValidatorWeightMessage

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

	unsignedMessage *warp.UnsignedMessage,
	subnetID ids.ID,
	blockchainID ids.ID,
	managerAddress common.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 logging.Logger,
	aggregatorQuorumPercentage uint64,
	subnetID ids.ID,
	validationID ids.ID,
	registered bool,
	signatureAggregatorEndpoint string,
) (*warp.Message, error)

func GetPChainL1ValidatorWeightMessage

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

	l1SignedMessage *warp.Message,

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

func GetRegisterL1ValidatorMessage

func GetRegisterL1ValidatorMessage(
	ctx context.Context,
	rpcURL string,
	network models.Network,
	aggregatorLogger logging.Logger,
	aggregatorQuorumPercentage uint64,
	subnetID ids.ID,
	blockchainID ids.ID,
	managerAddress common.Address,
	nodeID ids.NodeID,
	blsPublicKey [48]byte,
	expiry uint64,
	balanceOwners warpMessage.PChainOwner,
	disableOwners warpMessage.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,
) (common.Address, error)

func GetUptimeProofMessage

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

func GetValidatorNonce

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

func GetValidatorProxyImplementation

func GetValidatorProxyImplementation(
	rpcURL string,
) (common.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 warpMessage.PChainOwner,
	disableOwners warpMessage.PChainOwner,
	weight uint64,
	aggregatorLogger logging.Logger,
	isPos bool,
	delegationFee uint16,
	stakeDuration time.Duration,
	rewardRecipient common.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 logging.Logger,
	isPoS bool,
	uptimeSec uint64,
	force bool,
	validatorManagerAddressStr string,
	useACP99 bool,
	initiateTxHash string,
	signatureAggregatorEndpoint string,
) (*warp.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 logging.Logger,
	validatorManagerAddressStr string,
	weight uint64,
	initiateTxHash string,
	signatureAggregatorEndpoint string,
) (*warp.Message, ids.ID, *types.Transaction, error)

func InitializeValidatorRegistrationPoA

func InitializeValidatorRegistrationPoA(
	rpcURL string,
	managerAddress common.Address,
	generateRawTxOnly bool,
	managerOwnerAddress common.Address,
	managerOwnerPrivateKey string,
	nodeID ids.NodeID,
	blsPublicKey []byte,
	expiry uint64,
	balanceOwners warpMessage.PChainOwner,
	disableOwners warpMessage.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 common.Address,
	managerOwnerPrivateKey string,
	nodeID ids.NodeID,
	blsPublicKey []byte,
	expiry uint64,
	balanceOwners warpMessage.PChainOwner,
	disableOwners warpMessage.PChainOwner,
	delegationFeeBips uint16,
	minStakeDuration time.Duration,
	stakeAmount *big.Int,
	rewardRecipient common.Address,
	useACP99 bool,
) (*types.Transaction, *types.Receipt, error)

func InitializeValidatorRemoval

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

func InitializeValidatorWeightChange

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

func PoSWeightToValue

func PoSWeightToValue(
	rpcURL string,
	managerAddress common.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 logging.Logger,
	subnet blockchainSDK.Subnet,
	network models.Network,
	privateKey string,
	aggregatorLogger logging.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 logging.Logger,
	subnet blockchainSDK.Subnet,
	network models.Network,
	privateKey string,
	aggregatorLogger logging.Logger,
	posParams validatormanagerSDK.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 common.Address,
) (*types.Transaction, *types.Receipt, error)

func SetupValidatorProxyImplementation

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

func ValidatorProxyHasImplementationSet

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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