types

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAttestationNotDataCommitmentRequest = errors.New("attestation is not a data commitment request")
	ErrUnknownAttestationType              = errors.New("unknown attestation type")
	ErrInvalidCommitmentInConfirm          = errors.New("confirm not carrying the right commitment for expected range")
	ErrInvalid                             = errors.New("invalid")
	ErrAttestationNotFound                 = errors.New("attestation not found")
	ErrUnmarshalValset                     = errors.New("couldn't unmarshal valset")
	ErrAttestationNotValsetRequest         = errors.New("attestation is not a valset request")
)

Functions

func DataCommitmentTupleRootSignBytes

func DataCommitmentTupleRootSignBytes(nonce *big.Int, commitment []byte) ethcmn.Hash

DataCommitmentTupleRootSignBytes EncodeDomainSeparatedDataCommitment takes the required input data and produces the required signature to confirm a validator set update on the Blobstream Ethereum contract. This value will then be signed before being submitted to Cosmos, verified, and then relayed to Ethereum.

func IsEmptyLatestValset

func IsEmptyLatestValset(latestValset LatestValset) bool

IsEmptyLatestValset takes a valset and checks if it is empty.

func IsEmptyMsgDataCommitmentConfirm

func IsEmptyMsgDataCommitmentConfirm(dcc DataCommitmentConfirm) bool

func IsEmptyValsetConfirm

func IsEmptyValsetConfirm(vs ValsetConfirm) bool

IsEmptyValsetConfirm takes a msg valset confirm and checks if it is an empty one.

func IsValsetEqualToLatestValset

func IsValsetEqualToLatestValset(vs types.Valset, lvs LatestValset) bool

func MarshalDataCommitmentConfirm

func MarshalDataCommitmentConfirm(dcc DataCommitmentConfirm) ([]byte, error)

MarshalDataCommitmentConfirm Encodes a data commitment confirm to Json bytes.

func MarshalLatestValset

func MarshalLatestValset(lv LatestValset) ([]byte, error)

MarshalLatestValset Encodes a valset to Json bytes.

func MarshalValsetConfirm

func MarshalValsetConfirm(vs ValsetConfirm) ([]byte, error)

MarshalValsetConfirm Encodes a valset confirm to Json bytes.

Types

type DataCommitmentConfirm

type DataCommitmentConfirm struct {
	// Signature over the commitment, the range of blocks, the validator address
	// and the Ethereum address.
	Signature string
	// Hex `0x` encoded Ethereum public key that will be used by this validator on
	// Ethereum.
	EthAddress string
}

DataCommitmentConfirm describes a data commitment for a set of blocks.

func NewDataCommitmentConfirm

func NewDataCommitmentConfirm(
	signature string,
	ethAddress ethcmn.Address,
) *DataCommitmentConfirm

NewDataCommitmentConfirm creates a new NewDataCommitmentConfirm.

func UnmarshalDataCommitmentConfirm

func UnmarshalDataCommitmentConfirm(encoded []byte) (DataCommitmentConfirm, error)

UnmarshalDataCommitmentConfirm Decodes a data commitment confirm from Json bytes.

type LatestValset

type LatestValset struct {
	// Universal nonce defined under:
	// https://github.com/celestiaorg/celestia-app/pull/464
	Nonce uint64 `json:"nonce,omitempty"`
	// List of BridgeValidator containing the current validator set.
	Members []types.BridgeValidator `json:"members"`
	// Current chain height
	Height uint64 `json:"height,omitempty"`
}

LatestValset a replica of the types.Valset to omit marshalling `time` as it bears different results on different machines.

func ToLatestValset

func ToLatestValset(vs types.Valset) *LatestValset

func UnmarshalLatestValset

func UnmarshalLatestValset(encoded []byte) (LatestValset, error)

UnmarshalLatestValset Decodes a valset from Json bytes.

func (LatestValset) ToValset

func (v LatestValset) ToValset() *types.Valset

type ValsetConfirm

type ValsetConfirm struct {
	// Ethereum address, associated to the orchestrator, used to sign the `ValSet`
	// message.
	EthAddress string
	// The `ValSet` message signature.
	Signature string
}

ValsetConfirm this is the message sent by the validators when they wish to submit their signatures over the validator set at a given block height. A validators sign the validator set, powers, and Ethereum addresses of the entire validator set at the height of a ValsetRequest and submit that signature with this message.

If a sufficient number of validators (66% of voting power) submit ValsetConfirm messages with their signatures, it is then possible for anyone to query them from the Blobstream P2P network and submit them to Ethereum to update the validator set.

func NewValsetConfirm

func NewValsetConfirm(
	ethAddress common.Address,
	signature string,
) *ValsetConfirm

NewValsetConfirm returns a new msgValSetConfirm.

func UnmarshalValsetConfirm

func UnmarshalValsetConfirm(encoded []byte) (ValsetConfirm, error)

UnmarshalValsetConfirm Decodes a valset confirm from Json bytes.

Jump to

Keyboard shortcuts

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