penumbra

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 101 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrTimeoutAfterWaitingForTxBroadcast _err = "timed out after waiting for tx to get included in the block"
)

Variables

View Source
var (
	// SupportedAlgorithms defines the list of signing algorithms used on Evmos:
	//  - secp256k1     (Cosmos)
	//  - eth_secp256k1 (Ethereum)
	SupportedAlgorithms = keyring.SigningAlgoList{hd.Secp256k1, ethermint.EthSecp256k1, injective.EthSecp256k1}
	// SupportedAlgorithmsLedger defines the list of signing algorithms used on Evmos for the Ledger device:
	//  - secp256k1     (Cosmos)
	//  - eth_secp256k1 (Ethereum)
	SupportedAlgorithmsLedger = keyring.SigningAlgoList{hd.Secp256k1, ethermint.EthSecp256k1, injective.EthSecp256k1}
)
View Source
var JmtSpec = &ics23.ProofSpec{
	LeafSpec: &ics23.LeafOp{
		Hash:         ics23.HashOp_SHA256,
		PrehashKey:   ics23.HashOp_SHA256,
		PrehashValue: ics23.HashOp_SHA256,
		Length:       ics23.LengthOp_NO_PREFIX,
		Prefix:       []byte("JMT::LeafNode"),
	},
	InnerSpec: &ics23.InnerSpec{
		Hash:            ics23.HashOp_SHA256,
		ChildOrder:      []int32{0, 1},
		MinPrefixLength: 16,
		MaxPrefixLength: 16,
		ChildSize:       32,
		EmptyChild:      []byte("SPARSE_MERKLE_PLACEHOLDER_HASH__"),
	},
	MinDepth:                   0,
	MaxDepth:                   64,
	PrehashKeyBeforeComparison: true,
}
View Source
var PenumbraProofSpecs = []*ics23.ProofSpec{JmtSpec, JmtSpec}

Functions

func CreateMnemonic

func CreateMnemonic() (string, error)

CreateMnemonic generates a new mnemonic.

func DefaultPageRequest

func DefaultPageRequest() *querytypes.PageRequest

func GetHeightFromMetadata

func GetHeightFromMetadata(md metadata.MD) (int64, error)

func GetProveFromMetadata

func GetProveFromMetadata(md metadata.MD) (bool, error)

func KeyringAlgoOptions

func KeyringAlgoOptions() keyring.Option

KeyringAlgoOptions defines a function keys options for the ethereum Secp256k1 curve. It supports secp256k1 and eth_secp256k1 keys for accounts.

func NewPenumbraMessage

func NewPenumbraMessage(msg sdk.Msg) provider.RelayerMessage

func PenumbraMsg

func PenumbraMsg(rm provider.RelayerMessage) sdk.Msg

func PenumbraMsgs

func PenumbraMsgs(rm ...provider.RelayerMessage) []sdk.Msg

Types

type Codec

type Codec struct {
	InterfaceRegistry types.InterfaceRegistry
	Marshaler         codec.Codec
	TxConfig          client.TxConfig
	Amino             *codec.LegacyAmino
}

type Event

type Event struct {
	Type       string           `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Attributes []EventAttribute `protobuf:"bytes,2,rep,name=attributes,proto3" json:"attributes,omitempty"`
}

Event allows application developers to attach additional information to ResponseFinalizeBlock, ResponseDeliverTx, ExecTxResult Later, transactions may be queried using these events.

type EventAttribute

type EventAttribute struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	Index bool   `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"`
}

EventAttribute is a single key-value pair, associated with an event.

type ExecTxResult

type ExecTxResult struct {
	Code      uint32  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Data      []byte  `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Log       string  `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"`
	Info      string  `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"`
	GasWanted int64   `protobuf:"varint,5,opt,name=gas_wanted,json=gasWanted,proto3" json:"gas_wanted,omitempty"`
	GasUsed   int64   `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
	Events    []Event `protobuf:"bytes,7,rep,name=events,proto3" json:"events,omitempty"`
	Codespace string  `protobuf:"bytes,8,opt,name=codespace,proto3" json:"codespace,omitempty"`
}

ExecTxResult contains results of executing one individual transaction.

* Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted

type PenumbraChainProcessor

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

func NewPenumbraChainProcessor

func NewPenumbraChainProcessor(log *zap.Logger, provider *PenumbraProvider) *PenumbraChainProcessor

func (*PenumbraChainProcessor) Provider

Provider returns the ChainProvider, which provides the methods for querying, assembling IBC messages, and sending transactions.

func (*PenumbraChainProcessor) Run

func (pcp *PenumbraChainProcessor) Run(ctx context.Context, initialBlockHistory uint64, _ *processor.StuckPacket) error

Run starts the query loop for the chain which will gather applicable ibc messages and push events out to the relevant PathProcessors. The initialBlockHistory parameter determines how many historical blocks should be fetched and processed before continuing with current blocks. ChainProcessors should obey the context and return upon context cancellation.

func (*PenumbraChainProcessor) SetPathProcessors

func (pcp *PenumbraChainProcessor) SetPathProcessors(pathProcessors processor.PathProcessors)

Set the PathProcessors that this ChainProcessor should publish relevant IBC events to. ChainProcessors need reference to their PathProcessors and vice-versa, handled by EventProcessorBuilder.Build().

type PenumbraIBCHeader

type PenumbraIBCHeader struct {
	SignedHeader *tmtypes.SignedHeader
	ValidatorSet *tmtypes.ValidatorSet
}

func (PenumbraIBCHeader) ConsensusState

func (h PenumbraIBCHeader) ConsensusState() ibcexported.ConsensusState

func (PenumbraIBCHeader) Height

func (h PenumbraIBCHeader) Height() uint64

func (PenumbraIBCHeader) NextValidatorsHash

func (h PenumbraIBCHeader) NextValidatorsHash() []byte

type PenumbraMessage

type PenumbraMessage struct {
	Msg sdk.Msg
}

func (PenumbraMessage) MarshalLogObject

func (cm PenumbraMessage) MarshalLogObject(enc zapcore.ObjectEncoder) error

MarshalLogObject is used to encode cm to a zap logger with the zap.Object field type.

func (PenumbraMessage) MsgBytes

func (cm PenumbraMessage) MsgBytes() ([]byte, error)

func (PenumbraMessage) Type

func (cm PenumbraMessage) Type() string

type PenumbraProvider

type PenumbraProvider struct {
	PCfg           PenumbraProviderConfig
	Keybase        keyring.Keyring
	KeyringOptions []keyring.Option
	RPCClient      cwrapper.RPCClient
	LightProvider  provtypes.Provider
	Input          io.Reader
	Output         io.Writer
	Codec          Codec
	RPCCaller      jsonrpcclient.Caller
	// contains filtered or unexported fields
}

func (*PenumbraProvider) AcknowledgementFromSequence

func (cc *PenumbraProvider) AcknowledgementFromSequence(ctx context.Context, dst provider.ChainProvider, dsth, seq uint64, dstChanId, dstPortId, srcChanId, srcPortId string) (provider.RelayerMessage, error)

AcknowledgementFromSequence relays an acknowledgement with a given seq on src, source is the sending chain, destination is the receiving chain

func (*PenumbraProvider) AddKey

func (cc *PenumbraProvider) AddKey(name string, coinType uint32, signingAlgorithm string) (output *provider.KeyOutput, err error)

AddKey generates a new mnemonic which is then converted to a private key and BIP-39 HD Path and persists it to the keystore. It fails if there is an existing key with the same address.

func (*PenumbraProvider) Address

func (cc *PenumbraProvider) Address() (string, error)

Address returns the chains configured address as a string

func (*PenumbraProvider) BlockTime

func (cc *PenumbraProvider) BlockTime(ctx context.Context, height int64) (time.Time, error)

func (*PenumbraProvider) ChainId

func (cc *PenumbraProvider) ChainId() string

func (*PenumbraProvider) ChainName

func (cc *PenumbraProvider) ChainName() string

func (*PenumbraProvider) ChannelCloseConfirm

func (cc *PenumbraProvider) ChannelCloseConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dsth int64, dstChanId, dstPortId, srcPortId, srcChanId string) (provider.RelayerMessage, error)

func (*PenumbraProvider) ChannelCloseInit

func (cc *PenumbraProvider) ChannelCloseInit(srcPortId, srcChanId string) (provider.RelayerMessage, error)

func (*PenumbraProvider) ChannelOpenAck

func (cc *PenumbraProvider) ChannelOpenAck(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcClientId, srcPortId, srcChanId, dstChanId, dstPortId string) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ChannelOpenConfirm

func (cc *PenumbraProvider) ChannelOpenConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcClientId, srcPortId, srcChanId, dstPortId, dstChanId string) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ChannelOpenInit

func (cc *PenumbraProvider) ChannelOpenInit(srcClientId, srcConnId, srcPortId, srcVersion, dstPortId string, order chantypes.Order, dstHeader ibcexported.ClientMessage) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ChannelOpenTry

func (cc *PenumbraProvider) ChannelOpenTry(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcPortId, dstPortId, srcChanId, dstChanId, srcVersion, srcConnectionId, srcClientId string) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ChannelProof

func (cc *PenumbraProvider) ChannelProof(ctx context.Context, msg provider.ChannelInfo, height uint64) (provider.ChannelProof, error)

func (*PenumbraProvider) CommitmentPrefix

func (cc *PenumbraProvider) CommitmentPrefix() commitmenttypes.MerklePrefix

func (*PenumbraProvider) ConnectionHandshakeProof

func (cc *PenumbraProvider) ConnectionHandshakeProof(ctx context.Context, msgOpenInit provider.ConnectionInfo, height uint64) (provider.ConnectionProof, error)

func (*PenumbraProvider) ConnectionOpenAck

func (cc *PenumbraProvider) ConnectionOpenAck(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, srcClientId, srcConnId, dstClientId, dstConnId string) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ConnectionOpenConfirm

func (cc *PenumbraProvider) ConnectionOpenConfirm(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, dstConnId, srcClientId, srcConnId string) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ConnectionOpenInit

func (cc *PenumbraProvider) ConnectionOpenInit(srcClientId, dstClientId string, dstPrefix commitmenttypes.MerklePrefix, dstHeader ibcexported.ClientMessage) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ConnectionOpenTry

func (cc *PenumbraProvider) ConnectionOpenTry(ctx context.Context, dstQueryProvider provider.QueryProvider, dstHeader ibcexported.ClientMessage, dstPrefix commitmenttypes.MerklePrefix, srcClientId, dstClientId, srcConnId, dstConnId string) ([]provider.RelayerMessage, error)

func (*PenumbraProvider) ConnectionProof

func (cc *PenumbraProvider) ConnectionProof(ctx context.Context, msgOpenAck provider.ConnectionInfo, height uint64) (provider.ConnectionProof, error)

func (*PenumbraProvider) CreateKeystore

func (cc *PenumbraProvider) CreateKeystore(path string) error

CreateKeystore initializes a new instance of a keyring at the specified path in the local filesystem.

func (*PenumbraProvider) DeleteKey

func (cc *PenumbraProvider) DeleteKey(name string) error

DeleteKey removes a key from the keystore for the specified name.

func (*PenumbraProvider) EncodeBech32AccAddr

func (cc *PenumbraProvider) EncodeBech32AccAddr(addr sdk.AccAddress) (string, error)

EncodeBech32AccAddr returns the string bech32 representation for the specified account address. It returns an empty sting if the byte slice is 0-length. It returns an error if the bech32 conversion fails or the prefix is empty.

func (*PenumbraProvider) ExportPrivKeyArmor

func (cc *PenumbraProvider) ExportPrivKeyArmor(keyName string) (armor string, err error)

ExportPrivKeyArmor returns a private key in ASCII armored format. It returns an error if the key does not exist or a wrong encryption passphrase is supplied.

func (*PenumbraProvider) GenerateConnHandshakeProof

func (cc *PenumbraProvider) GenerateConnHandshakeProof(ctx context.Context, height int64, clientId, connId string) (clientState ibcexported.ClientState, clientStateProof []byte, consensusProof []byte, connectionProof []byte, connectionProofHeight ibcexported.Height, err error)

GenerateConnHandshakeProof generates all the proofs needed to prove the existence of the connection state on this chain. A counterparty should use these generated proofs.

func (*PenumbraProvider) GetIBCUpdateHeader

func (cc *PenumbraProvider) GetIBCUpdateHeader(ctx context.Context, srch int64, dst provider.ChainProvider, dstClientId string) (ibcexported.ClientMessage, error)

GetIBCUpdateHeader updates the off chain tendermint light client and returns an IBC Update Header which can be used to update an on chain light client on the destination chain. The source is used to construct the header data.

func (*PenumbraProvider) GetKeyAddress

func (cc *PenumbraProvider) GetKeyAddress() (sdk.AccAddress, error)

GetKeyAddress returns the account address representation for the currently configured key.

func (*PenumbraProvider) GetLightSignedHeaderAtHeight

func (cc *PenumbraProvider) GetLightSignedHeaderAtHeight(ctx context.Context, h int64) (ibcexported.ClientMessage, error)

func (*PenumbraProvider) IBCHeaderAtHeight

func (cc *PenumbraProvider) IBCHeaderAtHeight(ctx context.Context, h int64) (provider.IBCHeader, error)

func (*PenumbraProvider) Init

func (cc *PenumbraProvider) Init(ctx context.Context) error

Init initializes the keystore, RPC client, amd light client provider. Once initialization is complete an attempt to query the underlying node's tendermint version is performed. NOTE: Init must be called after creating a new instance of CosmosProvider.

func (*PenumbraProvider) InjectTrustedFields

func (cc *PenumbraProvider) InjectTrustedFields(ctx context.Context, header ibcexported.ClientMessage, dst provider.ChainProvider, dstClientId string) (ibcexported.ClientMessage, error)

InjectTrustedFields injects the necessary trusted fields for a header to update a light client stored on the destination chain, using the information provided by the source chain. TrustedHeight is the latest height of the IBC client on dst TrustedValidators is the validator set of srcChain at the TrustedHeight InjectTrustedFields returns a copy of the header with TrustedFields modified

func (*PenumbraProvider) Invoke

func (cc *PenumbraProvider) Invoke(ctx context.Context, method string, req, reply interface{}, opts ...grpc.CallOption) (err error)

Invoke implements the grpc ClientConn.Invoke method

func (*PenumbraProvider) Key

func (cc *PenumbraProvider) Key() string

func (*PenumbraProvider) KeyAddOrRestore

func (cc *PenumbraProvider) KeyAddOrRestore(keyName string, coinType uint32, mnemonic ...string) (*provider.KeyOutput, error)

KeyAddOrRestore either generates a new mnemonic or uses the specified mnemonic and converts it to a private key and BIP-39 HD Path which is then persisted to the keystore. It fails if there is an existing key with the same address.

func (*PenumbraProvider) KeyExists

func (cc *PenumbraProvider) KeyExists(name string) bool

KeyExists returns true if a key with the specified name exists in the keystore, it returns false otherwise.

func (*PenumbraProvider) KeystoreCreated

func (cc *PenumbraProvider) KeystoreCreated(path string) bool

KeystoreCreated returns true if there is an existing keystore instance at the specified path, it returns false otherwise.

func (*PenumbraProvider) ListAddresses

func (cc *PenumbraProvider) ListAddresses() (map[string]string, error)

ListAddresses returns a map of bech32 encoded strings representing all keys currently in the keystore.

func (*PenumbraProvider) LogFailedTx

func (cc *PenumbraProvider) LogFailedTx(res *provider.RelayerTxResponse, err error, msgs []provider.RelayerMessage)

LogFailedTx takes the transaction and the messages to create it and logs the appropriate data

func (*PenumbraProvider) LogSuccessTx

func (cc *PenumbraProvider) LogSuccessTx(res *sdk.TxResponse, msgs []provider.RelayerMessage)

LogSuccessTx take the transaction and the messages to create it and logs the appropriate data

func (*PenumbraProvider) MsgAcknowledgement

func (cc *PenumbraProvider) MsgAcknowledgement(msgRecvPacket provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgChannelCloseConfirm

func (cc *PenumbraProvider) MsgChannelCloseConfirm(msgCloseInit provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgChannelCloseInit

func (cc *PenumbraProvider) MsgChannelCloseInit(info provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgChannelOpenAck

func (cc *PenumbraProvider) MsgChannelOpenAck(msgOpenTry provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgChannelOpenConfirm

func (cc *PenumbraProvider) MsgChannelOpenConfirm(msgOpenAck provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgChannelOpenInit

func (cc *PenumbraProvider) MsgChannelOpenInit(info provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgChannelOpenTry

func (cc *PenumbraProvider) MsgChannelOpenTry(msgOpenInit provider.ChannelInfo, proof provider.ChannelProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgConnectionOpenAck

func (cc *PenumbraProvider) MsgConnectionOpenAck(msgOpenTry provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgConnectionOpenConfirm

func (cc *PenumbraProvider) MsgConnectionOpenConfirm(msgOpenAck provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgConnectionOpenInit

func (*PenumbraProvider) MsgConnectionOpenTry

func (cc *PenumbraProvider) MsgConnectionOpenTry(msgOpenInit provider.ConnectionInfo, proof provider.ConnectionProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgCreateClient

func (cc *PenumbraProvider) MsgCreateClient(clientState ibcexported.ClientState, consensusState ibcexported.ConsensusState) (provider.RelayerMessage, error)

CreateClient creates an sdk.Msg to update the client on src with consensus state from dst

func (*PenumbraProvider) MsgRecvPacket

func (cc *PenumbraProvider) MsgRecvPacket(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgRegisterCounterpartyPayee

func (cc *PenumbraProvider) MsgRegisterCounterpartyPayee(portID, channelID, relayerAddr, counterpartyPayee string) (provider.RelayerMessage, error)

MsgRegisterCounterpartyPayee creates an sdk.Msg to broadcast the counterparty address

func (*PenumbraProvider) MsgRelayAcknowledgement

func (cc *PenumbraProvider) MsgRelayAcknowledgement(ctx context.Context, dst provider.ChainProvider, dstChanId, dstPortId, srcChanId, srcPortId string, dsth int64, packet provider.RelayPacket) (provider.RelayerMessage, error)

MsgRelayAcknowledgement constructs the MsgAcknowledgement which is to be sent to the sending chain. The counterparty represents the receiving chain where the acknowledgement would be stored.

func (*PenumbraProvider) MsgRelayRecvPacket

func (cc *PenumbraProvider) MsgRelayRecvPacket(ctx context.Context, dst provider.ChainProvider, dsth int64, packet provider.RelayPacket, dstChanId, dstPortId, srcChanId, srcPortId string) (provider.RelayerMessage, error)

MsgRelayRecvPacket constructs the MsgRecvPacket which is to be sent to the receiving chain. The counterparty represents the sending chain where the packet commitment would be stored.

func (*PenumbraProvider) MsgRelayTimeout

func (cc *PenumbraProvider) MsgRelayTimeout(
	ctx context.Context,
	dst provider.ChainProvider,
	dsth int64,
	packet provider.RelayPacket,
	dstChanId, dstPortId, srcChanId, srcPortId string,
	order chantypes.Order,
) (provider.RelayerMessage, error)

MsgRelayTimeout constructs the MsgTimeout which is to be sent to the sending chain. The counterparty represents the receiving chain where the receipts would have been stored.

func (*PenumbraProvider) MsgSubmitMisbehaviour

func (cc *PenumbraProvider) MsgSubmitMisbehaviour(clientID string, misbehaviour ibcexported.ClientMessage) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgSubmitQueryResponse

func (cc *PenumbraProvider) MsgSubmitQueryResponse(chainID string, queryID provider.ClientICQQueryID, proof provider.ICQProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgTimeout

func (cc *PenumbraProvider) MsgTimeout(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgTimeoutOnClose

func (cc *PenumbraProvider) MsgTimeoutOnClose(msgTransfer provider.PacketInfo, proof provider.PacketProof) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgTransfer

func (cc *PenumbraProvider) MsgTransfer(
	dstAddr string,
	amount sdk.Coin,
	info provider.PacketInfo,
) (provider.RelayerMessage, error)

MsgTransfer creates a new transfer message

func (*PenumbraProvider) MsgUpdateClient

func (cc *PenumbraProvider) MsgUpdateClient(srcClientId string, dstHeader ibcexported.ClientMessage) (provider.RelayerMessage, error)

func (*PenumbraProvider) MsgUpdateClientHeader

func (cc *PenumbraProvider) MsgUpdateClientHeader(
	latestHeader provider.IBCHeader,
	trustedHeight clienttypes.Height,
	trustedHeader provider.IBCHeader,
) (ibcexported.ClientMessage, error)

func (*PenumbraProvider) MsgUpgradeClient

func (*PenumbraProvider) NewClientState

func (cc *PenumbraProvider) NewClientState(
	dstChainID string,
	dstUpdateHeader provider.IBCHeader,
	dstTrustingPeriod,
	dstUbdPeriod,
	maxClockDrift time.Duration,
	allowUpdateAfterExpiry,
	allowUpdateAfterMisbehaviour bool,
) (ibcexported.ClientState, error)

NewClientState creates a new tendermint client state tracking the dst chain.

func (*PenumbraProvider) NewStream

NewStream implements the grpc ClientConn.NewStream method

func (*PenumbraProvider) NextSeqRecv

func (cc *PenumbraProvider) NextSeqRecv(
	ctx context.Context,
	msgTransfer provider.PacketInfo,
	height uint64,
) (provider.PacketProof, error)

NextSeqRecv queries for the appropriate Tendermint proof required to prove the next expected packet sequence number for a given counterparty channel. This is used in ORDERED channels to ensure packets are being delivered in the exact same order as they were sent over the wire.

func (*PenumbraProvider) PacketAcknowledgement

func (cc *PenumbraProvider) PacketAcknowledgement(ctx context.Context, msgRecvPacket provider.PacketInfo, height uint64) (provider.PacketProof, error)

func (*PenumbraProvider) PacketCommitment

func (cc *PenumbraProvider) PacketCommitment(ctx context.Context, msgTransfer provider.PacketInfo, height uint64) (provider.PacketProof, error)

func (*PenumbraProvider) PacketReceipt

func (cc *PenumbraProvider) PacketReceipt(ctx context.Context, msgTransfer provider.PacketInfo, height uint64) (provider.PacketProof, error)

func (*PenumbraProvider) ProviderConfig

func (cc *PenumbraProvider) ProviderConfig() provider.ProviderConfig

func (*PenumbraProvider) QueryABCI

QueryABCI performs an ABCI query and returns the appropriate response and error sdk error code.

func (*PenumbraProvider) QueryBalance

func (cc *PenumbraProvider) QueryBalance(ctx context.Context, keyName string) (sdk.Coins, error)

QueryBalance returns the amount of coins in the relayer account

func (*PenumbraProvider) QueryBalanceWithAddress

func (cc *PenumbraProvider) QueryBalanceWithAddress(ctx context.Context, address string) (sdk.Coins, error)

QueryBalanceWithAddress returns the amount of coins in the relayer account with address as input TODO add pagination support

func (*PenumbraProvider) QueryChannel

func (cc *PenumbraProvider) QueryChannel(ctx context.Context, height int64, channelid, portid string) (chanRes *chantypes.QueryChannelResponse, err error)

QueryChannel returns the channel associated with a channelID

func (*PenumbraProvider) QueryChannelClient

func (cc *PenumbraProvider) QueryChannelClient(ctx context.Context, height int64, channelid, portid string) (*clienttypes.IdentifiedClientState, error)

QueryChannelClient returns the client state of the client supporting a given channel

func (*PenumbraProvider) QueryChannels

func (cc *PenumbraProvider) QueryChannels(ctx context.Context) ([]*chantypes.IdentifiedChannel, error)

QueryChannels returns all the channels that are registered on a chain TODO add pagination support

func (*PenumbraProvider) QueryClientConsensusState

func (cc *PenumbraProvider) QueryClientConsensusState(ctx context.Context, chainHeight int64, clientid string, clientHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error)

QueryClientConsensusState retrieves the latest consensus state for a client in state at a given height

func (*PenumbraProvider) QueryClientState

func (cc *PenumbraProvider) QueryClientState(ctx context.Context, height int64, clientid string) (ibcexported.ClientState, error)

QueryClientState retrieves the latest consensus state for a client in state at a given height and unpacks it to exported client state interface

func (*PenumbraProvider) QueryClientStateResponse

func (cc *PenumbraProvider) QueryClientStateResponse(ctx context.Context, height int64, srcClientId string) (*clienttypes.QueryClientStateResponse, error)

QueryClientStateResponse retrieves the latest consensus state for a client in state at a given height

func (*PenumbraProvider) QueryClients

QueryClients queries all the clients! TODO add pagination support

func (*PenumbraProvider) QueryConnection

func (cc *PenumbraProvider) QueryConnection(ctx context.Context, height int64, connectionid string) (*conntypes.QueryConnectionResponse, error)

QueryConnection returns the remote end of a given connection

func (*PenumbraProvider) QueryConnectionChannels

func (cc *PenumbraProvider) QueryConnectionChannels(ctx context.Context, height int64, connectionid string) ([]*chantypes.IdentifiedChannel, error)

QueryConnectionChannels queries the channels associated with a connection

func (*PenumbraProvider) QueryConnections

func (cc *PenumbraProvider) QueryConnections(ctx context.Context) (conns []*conntypes.IdentifiedConnection, err error)

QueryConnections gets any connections on a chain TODO add pagination support

func (*PenumbraProvider) QueryConnectionsUsingClient

func (cc *PenumbraProvider) QueryConnectionsUsingClient(ctx context.Context, height int64, clientid string) (*conntypes.QueryConnectionsResponse, error)

QueryConnectionsUsingClient gets any connections that exist between chain and counterparty TODO add pagination support

func (*PenumbraProvider) QueryConsensusState

func (cc *PenumbraProvider) QueryConsensusState(ctx context.Context, height int64) (ibcexported.ConsensusState, int64, error)

QueryConsensusState returns a consensus state for a given chain to be used as a client in another chain, fetches latest height when passed 0 as arg

func (*PenumbraProvider) QueryConsensusStateABCI

func (cc *PenumbraProvider) QueryConsensusStateABCI(ctx context.Context, clientID string, height ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error)

func (*PenumbraProvider) QueryDenomTrace

func (cc *PenumbraProvider) QueryDenomTrace(ctx context.Context, denom string) (*transfertypes.DenomTrace, error)

QueryDenomTrace takes a denom from IBC and queries the information about it

func (*PenumbraProvider) QueryDenomTraces

func (cc *PenumbraProvider) QueryDenomTraces(ctx context.Context, offset, limit uint64, height int64) ([]transfertypes.DenomTrace, error)

QueryDenomTraces returns all the denom traces from a given chain TODO add pagination support

func (*PenumbraProvider) QueryHeaderAtHeight

func (cc *PenumbraProvider) QueryHeaderAtHeight(ctx context.Context, height int64) (ibcexported.ClientMessage, error)

QueryHeaderAtHeight returns the header at a given height

func (*PenumbraProvider) QueryIBCHeader

func (cc *PenumbraProvider) QueryIBCHeader(ctx context.Context, h int64) (provider.IBCHeader, error)

QueryIBCHeader returns the IBC compatible block header (CosmosIBCHeader) at a specific height.

func (*PenumbraProvider) QueryICQWithProof

func (cc *PenumbraProvider) QueryICQWithProof(ctx context.Context, msgType string, request []byte, height uint64) (provider.ICQProof, error)

func (*PenumbraProvider) QueryLatestHeight

func (cc *PenumbraProvider) QueryLatestHeight(ctx context.Context) (int64, error)

func (*PenumbraProvider) QueryNextSeqAck

func (cc *PenumbraProvider) QueryNextSeqAck(ctx context.Context, height int64, channelid, portid string) (recvRes *chantypes.QueryNextSequenceReceiveResponse, err error)

QueryNextSeqAck returns the next seqAck for a configured channel

func (*PenumbraProvider) QueryNextSeqRecv

func (cc *PenumbraProvider) QueryNextSeqRecv(ctx context.Context, height int64, channelid, portid string) (recvRes *chantypes.QueryNextSequenceReceiveResponse, err error)

QueryNextSeqRecv returns the next seqRecv for a configured channel

func (*PenumbraProvider) QueryPacketAcknowledgement

func (cc *PenumbraProvider) QueryPacketAcknowledgement(ctx context.Context, height int64, channelid, portid string, seq uint64) (ackRes *chantypes.QueryPacketAcknowledgementResponse, err error)

QueryPacketAcknowledgement returns the packet ack proof at a given height

func (*PenumbraProvider) QueryPacketAcknowledgements

func (cc *PenumbraProvider) QueryPacketAcknowledgements(ctx context.Context, height uint64, channelid, portid string) (acknowledgements []*chantypes.PacketState, err error)

QueryPacketAcknowledgements returns an array of packet acks TODO add pagination support

func (*PenumbraProvider) QueryPacketCommitment

func (cc *PenumbraProvider) QueryPacketCommitment(ctx context.Context, height int64, channelid, portid string, seq uint64) (comRes *chantypes.QueryPacketCommitmentResponse, err error)

QueryPacketCommitment returns the packet commitment proof at a given height

func (*PenumbraProvider) QueryPacketCommitments

func (cc *PenumbraProvider) QueryPacketCommitments(ctx context.Context, height uint64, channelid, portid string) (commitments *chantypes.QueryPacketCommitmentsResponse, err error)

QueryPacketCommitments returns an array of packet commitments TODO add pagination support

func (*PenumbraProvider) QueryPacketReceipt

func (cc *PenumbraProvider) QueryPacketReceipt(ctx context.Context, height int64, channelid, portid string, seq uint64) (recRes *chantypes.QueryPacketReceiptResponse, err error)

QueryPacketReceipt returns the packet receipt proof at a given height

func (*PenumbraProvider) QueryRecvPacket

func (cc *PenumbraProvider) QueryRecvPacket(
	ctx context.Context,
	dstChanID,
	dstPortID string,
	sequence uint64,
) (provider.PacketInfo, error)

func (*PenumbraProvider) QuerySendPacket

func (cc *PenumbraProvider) QuerySendPacket(
	ctx context.Context,
	srcChanID,
	srcPortID string,
	sequence uint64,
) (provider.PacketInfo, error)

func (*PenumbraProvider) QueryStakingParams

func (cc *PenumbraProvider) QueryStakingParams(ctx context.Context) (*stakingtypes.Params, error)

func (*PenumbraProvider) QueryStatus

func (cc *PenumbraProvider) QueryStatus(ctx context.Context) (*coretypes.ResultStatus, error)

QueryStatus queries the current node status.

func (*PenumbraProvider) QueryTendermintProof

func (cc *PenumbraProvider) QueryTendermintProof(ctx context.Context, height int64, key []byte) ([]byte, []byte, clienttypes.Height, error)

QueryTendermintProof performs an ABCI query with the given key and returns the value of the query, the proto encoded merkle proof, and the height of the Tendermint block containing the state root. The desired tendermint height to perform the query should be set in the client context. The query will be performed at one below this height (at the IAVL version) in order to obtain the correct merkle proof. Proof queries at height less than or equal to 2 are not supported. Queries with a client context height of 0 will perform a query at the latest state available. Issue: https://github.com/cosmos/cosmos-sdk/issues/6567

func (*PenumbraProvider) QueryTx

func (cc *PenumbraProvider) QueryTx(ctx context.Context, hashHex string) (*provider.RelayerTxResponse, error)

QueryTx takes a transaction hash and returns the transaction

func (*PenumbraProvider) QueryTxs

func (cc *PenumbraProvider) QueryTxs(ctx context.Context, page, limit int, events []string) ([]*provider.RelayerTxResponse, error)

QueryTxs returns an array of transactions given a tag

func (*PenumbraProvider) QueryUnbondingPeriod

func (cc *PenumbraProvider) QueryUnbondingPeriod(ctx context.Context) (time.Duration, error)

QueryUnbondingPeriod returns the unbonding period of the chain

func (*PenumbraProvider) QueryUnreceivedAcknowledgements

func (cc *PenumbraProvider) QueryUnreceivedAcknowledgements(ctx context.Context, height uint64, channelid, portid string, seqs []uint64) ([]uint64, error)

QueryUnreceivedAcknowledgements returns a list of unrelayed packet acks

func (*PenumbraProvider) QueryUnreceivedPackets

func (cc *PenumbraProvider) QueryUnreceivedPackets(ctx context.Context, height uint64, channelid, portid string, seqs []uint64) ([]uint64, error)

QueryUnreceivedPackets returns a list of unrelayed packet commitments

func (*PenumbraProvider) QueryUpgradeProof

func (cc *PenumbraProvider) QueryUpgradeProof(ctx context.Context, key []byte, height uint64) ([]byte, clienttypes.Height, error)

QueryUpgradeProof performs an abci query with the given key and returns the proto encoded merkle proof for the query and the height at which the proof will succeed on a tendermint verifier.

func (*PenumbraProvider) QueryUpgradedClient

func (cc *PenumbraProvider) QueryUpgradedClient(ctx context.Context, height int64) (*clienttypes.QueryClientStateResponse, error)

QueryUpgradedClient returns upgraded client info

func (*PenumbraProvider) QueryUpgradedConsState

func (cc *PenumbraProvider) QueryUpgradedConsState(ctx context.Context, height int64) (*clienttypes.QueryConsensusStateResponse, error)

QueryUpgradedConsState returns upgraded consensus state and height of client

func (*PenumbraProvider) RelayPacketFromSequence

func (cc *PenumbraProvider) RelayPacketFromSequence(
	ctx context.Context,
	src provider.ChainProvider,
	srch, dsth, seq uint64,
	srcChanID, srcPortID string,
	order chantypes.Order,
) (provider.RelayerMessage, provider.RelayerMessage, error)

RelayPacketFromSequence relays a packet with a given seq on src and returns recvPacket msgs, timeoutPacketmsgs and error

func (*PenumbraProvider) RestoreKey

func (cc *PenumbraProvider) RestoreKey(name, mnemonic string, coinType uint32, signingAlgorithm string) (address string, err error)

RestoreKey converts a mnemonic to a private key and BIP-39 HD Path and persists it to the keystore. It fails if there is an existing key with the same address.

func (*PenumbraProvider) RunGRPCQuery

func (cc *PenumbraProvider) RunGRPCQuery(ctx context.Context, method string, req interface{}, md metadata.MD) (abci.ResponseQuery, metadata.MD, error)

RunGRPCQuery runs a gRPC query from the clientCtx, given all necessary arguments for the gRPC method, and returns the ABCI response. It is used to factorize code between client (Invoke) and server (RegisterGRPCServer) gRPC handlers.

func (*PenumbraProvider) SendMessage

SendMessage attempts to sign, encode & send a RelayerMessage This is used extensively in the relayer as an extension of the Provider interface

func (*PenumbraProvider) SendMessages

SendMessages attempts to sign, encode, & send a slice of RelayerMessages This is used extensively in the relayer as an extension of the Provider interface

NOTE: An error is returned if there was an issue sending the transaction. A successfully sent, but failed transaction will not return an error. If a transaction is successfully sent, the result of the execution of that transaction will be logged. A boolean indicating if a transaction was successfully sent and executed successfully is returned.

func (*PenumbraProvider) SendMessagesToMempool

func (cc *PenumbraProvider) SendMessagesToMempool(ctx context.Context, msgs []provider.RelayerMessage, memo string, asyncCtx context.Context, asyncCallback []func(*provider.RelayerTxResponse, error)) error

func (*PenumbraProvider) SetRpcAddr added in v2.5.0

func (cc *PenumbraProvider) SetRpcAddr(rpcAddr string) error

SetPCAddr sets the rpc-addr for the chain. It will fail if the rpcAddr is invalid(not a url).

func (*PenumbraProvider) ShowAddress

func (cc *PenumbraProvider) ShowAddress(name string) (address string, err error)

ShowAddress retrieves a key by name from the keystore and returns the bech32 encoded string representation of that key.

func (*PenumbraProvider) Sprint

func (cc *PenumbraProvider) Sprint(toPrint proto.Message) (string, error)

Sprint returns the json representation of the specified proto message.

func (*PenumbraProvider) SubmitMisbehavior

func (cc *PenumbraProvider) SubmitMisbehavior() (provider.RelayerMessage, error)

func (*PenumbraProvider) Timeout

func (cc *PenumbraProvider) Timeout() string

func (*PenumbraProvider) TrustingPeriod

func (cc *PenumbraProvider) TrustingPeriod(ctx context.Context, overrideUnbondingPeriod time.Duration, percentage int64) (time.Duration, error)

func (*PenumbraProvider) TxServiceBroadcast

func (cc *PenumbraProvider) TxServiceBroadcast(ctx context.Context, req *tx.BroadcastTxRequest) (*tx.BroadcastTxResponse, error)

TxServiceBroadcast is a helper function to broadcast a Tx with the correct gRPC types from the tx service. Calls `clientCtx.BroadcastTx` under the hood.

func (*PenumbraProvider) Type

func (cc *PenumbraProvider) Type() string

func (*PenumbraProvider) UseKey added in v2.4.2

func (cc *PenumbraProvider) UseKey(key string) error

Updates config.yaml chain with the specified key. It fails config is already using the same key or if the key does not exist

func (*PenumbraProvider) ValidatePacket

func (cc *PenumbraProvider) ValidatePacket(msgTransfer provider.PacketInfo, latest provider.LatestBlock) error

func (*PenumbraProvider) WaitForNBlocks

func (cc *PenumbraProvider) WaitForNBlocks(ctx context.Context, n int64) error

WaitForNBlocks blocks until the next block on a given chain

type PenumbraProviderConfig

type PenumbraProviderConfig struct {
	KeyDirectory     string                     `json:"key-directory" yaml:"key-directory"`
	Key              string                     `json:"key" yaml:"key"`
	ChainName        string                     `json:"-" yaml:"-"`
	ChainID          string                     `json:"chain-id" yaml:"chain-id"`
	RPCAddr          string                     `json:"rpc-addr" yaml:"rpc-addr"`
	AccountPrefix    string                     `json:"account-prefix" yaml:"account-prefix"`
	KeyringBackend   string                     `json:"keyring-backend" yaml:"keyring-backend"`
	GasAdjustment    float64                    `json:"gas-adjustment" yaml:"gas-adjustment"`
	GasPrices        string                     `json:"gas-prices" yaml:"gas-prices"`
	MinGasAmount     uint64                     `json:"min-gas-amount" yaml:"min-gas-amount"`
	MaxGasAmount     uint64                     `json:"max-gas-amount" yaml:"max-gas-amount"`
	Debug            bool                       `json:"debug" yaml:"debug"`
	Timeout          string                     `json:"timeout" yaml:"timeout"`
	BlockTimeout     string                     `json:"block-timeout" yaml:"block-timeout"`
	OutputFormat     string                     `json:"output-format" yaml:"output-format"`
	SignModeStr      string                     `json:"sign-mode" yaml:"sign-mode"`
	ExtraCodecs      []string                   `json:"extra-codecs" yaml:"extra-codecs"`
	Modules          []module.AppModuleBasic    `json:"-" yaml:"-"`
	Slip44           int                        `json:"coin-type" yaml:"coin-type"`
	Broadcast        provider.BroadcastMode     `json:"broadcast-mode" yaml:"broadcast-mode"`
	MinLoopDuration  time.Duration              `json:"min-loop-duration" yaml:"min-loop-duration"`
	ExtensionOptions []provider.ExtensionOption `json:"extension-options" yaml:"extension-options"`
}

func (PenumbraProviderConfig) BroadcastMode

func (pc PenumbraProviderConfig) BroadcastMode() provider.BroadcastMode

func (PenumbraProviderConfig) NewProvider

func (pc PenumbraProviderConfig) NewProvider(log *zap.Logger, homepath string, debug bool, chainName string) (provider.ChainProvider, error)

NewProvider validates the PenumbraProviderConfig, instantiates a ChainClient and then instantiates a CosmosProvider

func (PenumbraProviderConfig) Validate

func (pc PenumbraProviderConfig) Validate() error

type ResultBlockResults

type ResultBlockResults struct {
	Height                int64                    `json:"height,string"`
	TxsResults            []*ExecTxResult          `json:"txs_results"`
	TotalGasUsed          int64                    `json:"total_gas_used,string"`
	FinalizeBlockEvents   []Event                  `json:"finalize_block_events"`
	ValidatorUpdates      []ValidatorUpdate        `json:"validator_updates"`
	ConsensusParamUpdates *tmproto.ConsensusParams `json:"consensus_param_updates"`
}

ABCI results from a block

type ResultTx

type ResultTx struct {
	Hash     bytes.HexBytes  `json:"hash"`
	Height   int64           `json:"height,string"`
	Index    uint32          `json:"index"`
	TxResult ExecTxResult    `json:"tx_result"`
	Tx       tmtypes.Tx      `json:"tx"`
	Proof    tmtypes.TxProof `json:"proof,omitempty"`
}

Result of querying for a tx. This is from the new tendermint API.

type ValidatorUpdate

type ValidatorUpdate struct {
	PubKey tmcrypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"`
	Power  int64              `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"`
}

ValidatorUpdate

Jump to

Keyboard shortcuts

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