warp

package
v1.16.18 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidMessageType = errors.New("invalid message type")

	// Codec for serializing/deserializing L1 validator messages
	Codec codec.Manager
)

Functions

func ConvertStandaloneToNodeWarpMessage

func ConvertStandaloneToNodeWarpMessage(standaloneMsg *standaloneWarp.Message) (*nodeWarp.Message, error)

ConvertStandaloneToNodeWarpMessage converts a standalone warp message to a node warp message

func NewL1ValidatorRegistration

func NewL1ValidatorRegistration(validationID ids.ID, valid bool) (*warpPayload.L1ValidatorRegistration, error)

NewL1ValidatorRegistration creates a new L1 validator registration message

func NewSubnetToL1Conversion

func NewSubnetToL1Conversion(conversionID ids.ID) (*warpPayload.AddressedCall, error)

NewSubnetToL1Conversion creates a new subnet-to-L1 conversion message

func ParseAddressedCall

func ParseAddressedCall(payload []byte) (*warpPayload.AddressedCall, error)

ParseAddressedCall parses an addressed call from payload

func SubnetToL1ConversionID

func SubnetToL1ConversionID(data SubnetToL1ConversionData) (ids.ID, error)

SubnetToL1ConversionID calculates the ID for a subnet-to-L1 conversion

Types

type L1ValidatorRegistration

type L1ValidatorRegistration struct {
	ValidationID     ids.ID      `serialize:"true" json:"validationID"`
	NodeID           ids.NodeID  `serialize:"true" json:"nodeID"`
	BLSPublicKey     []byte      `serialize:"true" json:"blsPublicKey"`
	Weight           uint64      `serialize:"true" json:"weight"`
	Expiry           uint64      `serialize:"true" json:"expiry"`
	RemainingBalance uint64      `serialize:"true" json:"remainingBalance"`
	DisableOwner     PChainOwner `serialize:"true" json:"disableOwner"`
	Valid            bool        `serialize:"true" json:"valid"`
}

L1ValidatorRegistration represents an L1 validator registration

func NewRegisterL1Validator

func NewRegisterL1Validator(
	subnetID ids.ID,
	nodeID ids.NodeID,
	blsPublicKey []byte,
	expiry uint64,
	balanceOwners PChainOwner,
	disableOwners PChainOwner,
	weight uint64,
) (*L1ValidatorRegistration, error)

NewRegisterL1Validator creates a new L1 validator registration payload with proper signature

func ParseRegisterL1Validator

func ParseRegisterL1Validator(payload []byte) (*L1ValidatorRegistration, error)

ParseRegisterL1Validator parses L1 validator registration from payload

func (*L1ValidatorRegistration) Bytes

func (r *L1ValidatorRegistration) Bytes() []byte

Bytes returns the byte representation of this registration

func (*L1ValidatorRegistration) GetValidationID

func (r *L1ValidatorRegistration) GetValidationID() ids.ID

GetValidationID returns the validation ID for this registration

type L1ValidatorWeight

type L1ValidatorWeight struct {
	ValidationID ids.ID `serialize:"true" json:"validationID"`
	Nonce        uint64 `serialize:"true" json:"nonce"`
	Weight       uint64 `serialize:"true" json:"weight"`
}

L1ValidatorWeight represents an L1 validator weight update

func NewL1ValidatorWeight

func NewL1ValidatorWeight(validationID ids.ID, nonce uint64, weight uint64) (*L1ValidatorWeight, error)

NewL1ValidatorWeight creates a new L1ValidatorWeight message

func ParseL1ValidatorWeight

func ParseL1ValidatorWeight(payload []byte) (*L1ValidatorWeight, error)

ParseL1ValidatorWeight parses L1 validator weight from payload

func (*L1ValidatorWeight) Bytes

func (l *L1ValidatorWeight) Bytes() []byte

Bytes returns the byte representation of the message

type PChainOwner

type PChainOwner struct {
	Threshold uint32        `serialize:"true" json:"threshold"`
	Addresses []ids.ShortID `serialize:"true" json:"addresses"`
}

PChainOwner represents an owner on the P-Chain

type SubnetToL1ConversionData

type SubnetToL1ConversionData struct {
	SubnetID       ids.ID                              `serialize:"true" json:"subnetID"`
	ManagerChainID ids.ID                              `serialize:"true" json:"managerChainID"`
	ManagerAddress []byte                              `serialize:"true" json:"managerAddress"`
	Validators     []SubnetToL1ConversionValidatorData `serialize:"true" json:"validators"`
}

SubnetToL1ConversionData contains the full subnet-to-L1 conversion payload

type SubnetToL1ConversionValidatorData

type SubnetToL1ConversionValidatorData struct {
	NodeID       []byte                 `serialize:"true" json:"nodeID"`
	BLSPublicKey [bls.PublicKeyLen]byte `serialize:"true" json:"blsPublicKey"`
	Weight       uint64                 `serialize:"true" json:"weight"`
}

SubnetToL1ConversionValidatorData contains validator information for subnet-to-L1 conversion

Jump to

Keyboard shortcuts

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