Documentation ¶
Index ¶
- Constants
- func CheckAndUpdateCctxGasPrice(ctx sdk.Context, k Keeper, cctx types.CrossChainTx, ...) (math.Uint, math.Uint, error)
- func EmitEventInboundFinalized(ctx sdk.Context, cctx *types.CrossChainTx)
- func EmitOutboundFailure(ctx sdk.Context, valueReceived string, oldStatus string, newStatus string, ...)
- func EmitOutboundSuccess(ctx sdk.Context, valueReceived string, oldStatus string, newStatus string, ...)
- func EmitZRCWithdrawCreated(ctx sdk.Context, cctx types.CrossChainTx)
- func EmitZetaWithdrawCreated(ctx sdk.Context, cctx types.CrossChainTx)
- func GetAbortedAmount(cctx types.CrossChainTx) sdkmath.Uint
- func GetRefundAddress(refundAddress string) (ethcommon.Address, error)
- func IsPending(cctx *types.CrossChainTx) bool
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func ParseZRC20WithdrawalEvent(log ethtypes.Log) (*zrc20.ZRC20Withdrawal, error)
- func ParseZetaSentEvent(log ethtypes.Log, connectorZEVM ethcommon.Address) (*connectorzevm.ZetaConnectorZEVMZetaSent, error)
- func SortCctxsByHeightAndChainID(cctxs []*types.CrossChainTx) []*types.CrossChainTx
- type CCTXGateway
- type CCTXGatewayObservers
- type CCTXGatewayZEVM
- type ChainGasParams
- type CheckAndUpdateCctxGasPriceFunc
- type Hooks
- type InitiateOutboundConfig
- type Keeper
- func (k Keeper) AddFinalizedInbound(ctx sdk.Context, inboundHash string, chainID int64, eventIndex uint64)
- func (k Keeper) AddZetaAbortedAmount(ctx sdk.Context, amount sdkmath.Uint)
- func (k Keeper) Cctx(c context.Context, req *types.QueryGetCctxRequest) (*types.QueryGetCctxResponse, error)
- func (k Keeper) CctxAll(c context.Context, req *types.QueryAllCctxRequest) (*types.QueryAllCctxResponse, error)
- func (k Keeper) CctxByNonce(c context.Context, req *types.QueryGetCctxByNonceRequest) (*types.QueryGetCctxResponse, error)
- func (k Keeper) ChainGasParams(ctx sdk.Context, chainID int64) (ChainGasParams, error)
- func (k Keeper) CheckIfTSSMigrationTransfer(ctx sdk.Context, msg *types.MsgVoteInbound) error
- func (k Keeper) ConvertGasToZeta(context context.Context, request *types.QueryConvertGasToZetaRequest) (*types.QueryConvertGasToZetaResponse, error)
- func (k Keeper) FundGasStabilityPoolFromRemainingFees(ctx sdk.Context, OutboundParams types.OutboundParams, chainID int64) error
- func (k Keeper) FundStabilityPool(ctx sdk.Context, cctx *types.CrossChainTx)
- func (k Keeper) GasPrice(c context.Context, req *types.QueryGetGasPriceRequest) (*types.QueryGetGasPriceResponse, error)
- func (k Keeper) GasPriceAll(c context.Context, req *types.QueryAllGasPriceRequest) (*types.QueryAllGasPriceResponse, error)
- func (k Keeper) GetAllCrossChainTx(ctx sdk.Context) (list []types.CrossChainTx)
- func (k Keeper) GetAllFinalizedInbound(ctx sdk.Context) (list []string)
- func (k Keeper) GetAllForeignCoins(ctx sdk.Context) []fungibleModuleTypes.ForeignCoins
- func (k Keeper) GetAllGasPrice(ctx sdk.Context) (list []types.GasPrice)
- func (k Keeper) GetAllInboundHashToCctx(ctx sdk.Context) (list []types.InboundHashToCctx)
- func (k Keeper) GetAllInboundTracker(ctx sdk.Context) (inTxTrackers []types.InboundTracker)
- func (k Keeper) GetAllInboundTrackerForChain(ctx sdk.Context, chainID int64) (list []types.InboundTracker)
- func (k Keeper) GetAllInboundTrackerForChainPaginated(ctx sdk.Context, chainID int64, pagination *query.PageRequest) (inTxTrackers []types.InboundTracker, pageRes *query.PageResponse, err error)
- func (k Keeper) GetAllInboundTrackerPaginated(ctx sdk.Context, pagination *query.PageRequest) (inTxTrackers []types.InboundTracker, pageRes *query.PageResponse, err error)
- func (k Keeper) GetAllLastBlockHeight(ctx sdk.Context) (list []types.LastBlockHeight)
- func (k Keeper) GetAllOutboundTracker(ctx sdk.Context) (list []types.OutboundTracker)
- func (k Keeper) GetAuthKeeper() types.AccountKeeper
- func (k Keeper) GetAuthorityKeeper() types.AuthorityKeeper
- func (k Keeper) GetBankKeeper() types.BankKeeper
- func (k *Keeper) GetChainsSupportingTSSMigration(ctx sdk.Context) []chains.Chain
- func (k Keeper) GetCodec() codec.Codec
- func (k Keeper) GetCrossChainTx(ctx sdk.Context, index string) (val types.CrossChainTx, found bool)
- func (k Keeper) GetFungibleKeeper() types.FungibleKeeper
- func (k Keeper) GetGasPrice(ctx sdk.Context, chainID int64) (types.GasPrice, bool)
- func (k Keeper) GetIBCCrosschainKeeper() types.IBCCrosschainKeeper
- func (k Keeper) GetInboundHashToCctx(ctx sdk.Context, inboundHash string) (val types.InboundHashToCctx, found bool)
- func (k Keeper) GetInboundTracker(ctx sdk.Context, chainID int64, txHash string) (val types.InboundTracker, found bool)
- func (k Keeper) GetLastBlockHeight(ctx sdk.Context, index string) (val types.LastBlockHeight, found bool)
- func (k Keeper) GetLightclientKeeper() types.LightclientKeeper
- func (k Keeper) GetMedianGasValues(ctx sdk.Context, chainID int64) (math.Uint, math.Uint, bool)
- func (k Keeper) GetMemKey() storetypes.StoreKey
- func (k Keeper) GetObserverKeeper() types.ObserverKeeper
- func (k Keeper) GetOutboundTracker(ctx sdk.Context, chainID int64, nonce uint64) (val types.OutboundTracker, found bool)
- func (k Keeper) GetRateLimiterAssetRateList(ctx sdk.Context) (flags types.RateLimiterFlags, assetRates []types.AssetRate, found bool)
- func (k Keeper) GetRateLimiterFlags(ctx sdk.Context) (val types.RateLimiterFlags, found bool)
- func (k Keeper) GetRevertGasLimit(ctx sdk.Context, cctx types.CrossChainTx) (uint64, error)
- func (k Keeper) GetStakingKeeper() types.StakingKeeper
- func (k Keeper) GetStoreKey() storetypes.StoreKey
- func (k Keeper) GetZetaAccounting(ctx sdk.Context) (val types.ZetaAccounting, found bool)
- func (k Keeper) HandleEVMDeposit(ctx sdk.Context, cctx *types.CrossChainTx) (bool, error)
- func (k Keeper) Hooks() Hooks
- func (k Keeper) InTxHashToCctx(c context.Context, req *types.QueryGetInboundHashToCctxRequest) (*types.QueryGetInboundHashToCctxResponse, error)
- func (k Keeper) InTxHashToCctxAll(c context.Context, req *types.QueryAllInboundHashToCctxRequest) (*types.QueryAllInboundHashToCctxResponse, error)
- func (k Keeper) InTxHashToCctxData(c context.Context, req *types.QueryInboundHashToCctxDataRequest) (*types.QueryInboundHashToCctxDataResponse, error)
- func (k Keeper) InTxTrackerAll(c context.Context, req *types.QueryAllInboundTrackersRequest) (*types.QueryAllInboundTrackersResponse, error)
- func (k Keeper) InTxTrackerAllByChain(c context.Context, req *types.QueryAllInboundTrackerByChainRequest) (*types.QueryAllInboundTrackerByChainResponse, error)
- func (k Keeper) InboundHashToCctx(c context.Context, req *types.QueryGetInboundHashToCctxRequest) (*types.QueryGetInboundHashToCctxResponse, error)
- func (k Keeper) InboundHashToCctxAll(c context.Context, req *types.QueryAllInboundHashToCctxRequest) (*types.QueryAllInboundHashToCctxResponse, error)
- func (k Keeper) InboundHashToCctxData(c context.Context, req *types.QueryInboundHashToCctxDataRequest) (*types.QueryInboundHashToCctxDataResponse, error)
- func (k Keeper) InboundTracker(goCtx context.Context, req *types.QueryInboundTrackerRequest) (*types.QueryInboundTrackerResponse, error)
- func (k Keeper) InboundTrackerAll(goCtx context.Context, req *types.QueryAllInboundTrackersRequest) (*types.QueryAllInboundTrackersResponse, error)
- func (k Keeper) InboundTrackerAllByChain(goCtx context.Context, request *types.QueryAllInboundTrackerByChainRequest) (*types.QueryAllInboundTrackerByChainResponse, error)
- func (k Keeper) InitiateOutbound(ctx sdk.Context, config InitiateOutboundConfig) (types.CctxStatus, error)
- func (k Keeper) IsFinalizedInbound(ctx sdk.Context, inboundHash string, chainID int64, eventIndex uint64) bool
- func (k Keeper) IterateAndUpdateCctxGasPrice(ctx sdk.Context, chains []zetachains.Chain, ...) (int, observertypes.GasPriceIncreaseFlags)
- func (k Keeper) LastBlockHeight(c context.Context, req *types.QueryGetLastBlockHeightRequest) (*types.QueryGetLastBlockHeightResponse, error)
- func (k Keeper) LastBlockHeightAll(c context.Context, req *types.QueryAllLastBlockHeightRequest) (*types.QueryAllLastBlockHeightResponse, error)
- func (k Keeper) LastZetaHeight(goCtx context.Context, req *types.QueryLastZetaHeightRequest) (*types.QueryLastZetaHeightResponse, error)
- func (k Keeper) ListPendingCctx(c context.Context, req *types.QueryListPendingCctxRequest) (*types.QueryListPendingCctxResponse, error)
- func (k Keeper) ListPendingCctxWithinRateLimit(c context.Context, req *types.QueryListPendingCctxWithinRateLimitRequest) (res *types.QueryListPendingCctxWithinRateLimitResponse, err error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) OutTxTracker(c context.Context, req *types.QueryGetOutboundTrackerRequest) (*types.QueryGetOutboundTrackerResponse, error)
- func (k Keeper) OutTxTrackerAll(c context.Context, req *types.QueryAllOutboundTrackerRequest) (*types.QueryAllOutboundTrackerResponse, error)
- func (k Keeper) OutTxTrackerAllByChain(c context.Context, req *types.QueryAllOutboundTrackerByChainRequest) (*types.QueryAllOutboundTrackerByChainResponse, error)
- func (k Keeper) OutboundTracker(c context.Context, req *types.QueryGetOutboundTrackerRequest) (*types.QueryGetOutboundTrackerResponse, error)
- func (k Keeper) OutboundTrackerAll(c context.Context, req *types.QueryAllOutboundTrackerRequest) (*types.QueryAllOutboundTrackerResponse, error)
- func (k Keeper) OutboundTrackerAllByChain(c context.Context, req *types.QueryAllOutboundTrackerByChainRequest) (*types.QueryAllOutboundTrackerByChainResponse, error)
- func (k Keeper) PayGasAndUpdateCctx(ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, ...) error
- func (k Keeper) PayGasInERC20AndUpdateCctx(ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, ...) error
- func (k Keeper) PayGasInZetaAndUpdateCctx(ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, zetaBurnt math.Uint, ...) error
- func (k Keeper) PayGasNativeAndUpdateCctx(ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, ...) error
- func (k Keeper) PostTxProcessing(ctx sdk.Context, msg *core.Message, receipt *ethtypes.Receipt) error
- func (k Keeper) ProcessLogs(ctx sdk.Context, logs []*ethtypes.Log, emittingAddress ethcommon.Address, ...) error
- func (k Keeper) ProcessZEVMInboundV1(ctx sdk.Context, log *ethtypes.Log, ...) error
- func (k Keeper) ProcessZEVMInboundV2(ctx sdk.Context, log *ethtypes.Log, gatewayAddr ethcommon.Address, ...) error
- func (k Keeper) ProcessZRC20WithdrawalEvent(ctx sdk.Context, event *zrc20.ZRC20Withdrawal, ...) error
- func (k Keeper) ProcessZetaSentEvent(ctx sdk.Context, event *connectorzevm.ZetaConnectorZEVMZetaSent, ...) error
- func (k Keeper) ProtocolFee(_ context.Context, _ *types.QueryMessagePassingProtocolFeeRequest) (*types.QueryMessagePassingProtocolFeeResponse, error)
- func (k Keeper) RateLimiterFlags(c context.Context, req *types.QueryRateLimiterFlagsRequest) (*types.QueryRateLimiterFlagsResponse, error)
- func (k Keeper) RateLimiterInput(c context.Context, req *types.QueryRateLimiterInputRequest) (res *types.QueryRateLimiterInputResponse, err error)
- func (k Keeper) RefundAbortedAmountOnZetaChain(ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address) error
- func (k Keeper) RefundAmountOnZetaChainERC20(ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address) error
- func (k Keeper) RefundAmountOnZetaChainGas(ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address) error
- func (k Keeper) RefundAmountOnZetaChainZeta(ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address) error
- func (k Keeper) RemoveCrossChainTx(ctx sdk.Context, index string)
- func (k Keeper) RemoveGasPrice(ctx sdk.Context, index string)
- func (k Keeper) RemoveInboundHashToCctx(ctx sdk.Context, inboundHash string)
- func (k Keeper) RemoveInboundTrackerIfExists(ctx sdk.Context, chainID int64, txHash string)
- func (k Keeper) RemoveLastBlockHeight(ctx sdk.Context, index string)
- func (k Keeper) RemoveOutboundTrackerFromStore(ctx sdk.Context, chainID int64, nonce uint64)
- func (k Keeper) RemoveZetaAbortedAmount(ctx sdk.Context, amount sdkmath.Uint) error
- func (k Keeper) ResetGasMeterAndConsumeGas(ctx sdk.Context, gasUsed uint64)
- func (k Keeper) SaveFailedOutbound(ctx sdk.Context, cctx *types.CrossChainTx, errMessage string, tssPubkey string)
- func (k Keeper) SaveObservedInboundInformation(ctx sdk.Context, cctx *types.CrossChainTx, eventIndex uint64)
- func (k Keeper) SaveOutbound(ctx sdk.Context, cctx *types.CrossChainTx, tssPubkey string)
- func (k Keeper) SaveSuccessfulOutbound(ctx sdk.Context, cctx *types.CrossChainTx, tssPubkey string)
- func (k Keeper) SetCctxAndNonceToCctxAndInboundHashToCctx(ctx sdk.Context, cctx types.CrossChainTx, tssPubkey string)
- func (k Keeper) SetCrossChainTx(ctx sdk.Context, cctx types.CrossChainTx)
- func (k Keeper) SetFinalizedInbound(ctx sdk.Context, finalizedInboundIndex string)
- func (k Keeper) SetGasPrice(ctx sdk.Context, gasPrice types.GasPrice)
- func (k *Keeper) SetIBCCrosschainKeeper(ibcCrosschainKeeper types.IBCCrosschainKeeper)
- func (k Keeper) SetInboundHashToCctx(ctx sdk.Context, inboundHashToCctx types.InboundHashToCctx)
- func (k Keeper) SetInboundTracker(ctx sdk.Context, InboundTracker types.InboundTracker)
- func (k Keeper) SetLastBlockHeight(ctx sdk.Context, lastBlockHeight types.LastBlockHeight)
- func (k Keeper) SetObserverOutboundInfo(ctx sdk.Context, receiveChainID int64, cctx *types.CrossChainTx) error
- func (k Keeper) SetOutboundTracker(ctx sdk.Context, outboundTracker types.OutboundTracker)
- func (k Keeper) SetRateLimiterFlags(ctx sdk.Context, rateLimiterFlags types.RateLimiterFlags)
- func (k Keeper) SetZetaAccounting(ctx sdk.Context, abortedZetaAmount types.ZetaAccounting)
- func (k Keeper) ValidateInbound(ctx sdk.Context, msg *types.MsgVoteInbound, shouldPayGas bool) (*types.CrossChainTx, error)
- func (k Keeper) ValidateOutboundMessage(ctx sdk.Context, msg types.MsgVoteOutbound) (types.CrossChainTx, error)
- func (k Keeper) ValidateOutboundObservers(ctx sdk.Context, cctx *types.CrossChainTx, ...) error
- func (k Keeper) ValidateOutboundZEVM(ctx sdk.Context, cctx *types.CrossChainTx, depositErr error, ...) (newCCTXStatus types.CctxStatus)
- func (k Keeper) ValidateZrc20WithdrawEvent(ctx sdk.Context, event *zrc20.ZRC20Withdrawal, chainID int64) error
- func (k Keeper) ZetaAccounting(c context.Context, _ *types.QueryZetaAccountingRequest) (*types.QueryZetaAccountingResponse, error)
- type Migrator
Constants ¶
const ( // MaxPendingCctxs is the maximum number of pending cctxs that can be queried MaxPendingCctxs = 500 // MaxLookbackNonce is the maximum number of nonces to look back to find missed pending cctxs MaxLookbackNonce = 1000 DefaultPageSize = 100 )
const (
// AbortMessage is the message to abort a stuck CCTX
AbortMessage = "CCTX aborted with admin cmd"
)
const InCCTXIndexKey = "inCctxIndex"
const MaxOutboundTrackerHashes = 5
MaxOutboundTrackerHashes is the maximum number of hashes that can be stored in the outbound transaction tracker
const (
// RemainingFeesToStabilityPoolPercent is the percentage of remaining fees used to fund the gas stability pool
RemainingFeesToStabilityPoolPercent = 95
)
Variables ¶
This section is empty.
Functions ¶
func CheckAndUpdateCctxGasPrice ¶
func CheckAndUpdateCctxGasPrice( ctx sdk.Context, k Keeper, cctx types.CrossChainTx, flags observertypes.GasPriceIncreaseFlags, ) (math.Uint, math.Uint, error)
CheckAndUpdateCctxGasPrice checks if the retry interval is reached and updates the gas price if so The function returns the gas price increase and the additional fees paid from the gas stability pool
func EmitEventInboundFinalized ¶
func EmitEventInboundFinalized(ctx sdk.Context, cctx *types.CrossChainTx)
func EmitOutboundFailure ¶
func EmitOutboundSuccess ¶
func EmitZRCWithdrawCreated ¶
func EmitZRCWithdrawCreated(ctx sdk.Context, cctx types.CrossChainTx)
func EmitZetaWithdrawCreated ¶
func EmitZetaWithdrawCreated(ctx sdk.Context, cctx types.CrossChainTx)
func GetAbortedAmount ¶
func GetAbortedAmount(cctx types.CrossChainTx) sdkmath.Uint
GetAbortedAmount returns the amount to refund for a given CCTX . If the CCTX has an outbound transaction, it returns the amount of the outbound transaction. If OutboundParams is nil or the amount is zero, it returns the amount of the inbound transaction. This is because there might be a case where the transaction is set to be aborted before paying gas or creating an outbound transaction.In such a situation we can refund the entire amount that has been locked in connector or TSS
func GetRefundAddress ¶
GetRefundAddress gets the proper refund address. For BTC sender chain the refund address is the one provided in the message in the RefundAddress field. For EVM chain with coin type ERC20 the refund address is the sender , but can be overridden by the RefundAddress field in the message. For EVM chain with coin type Zeta the refund address is the tx origin, but can be overridden by the RefundAddress field in the message. For EVM chain with coin type Gas the refund address is the tx origin, but can be overridden by the RefundAddress field in the message.
func IsPending ¶
func IsPending(cctx *types.CrossChainTx) bool
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
func ParseZRC20WithdrawalEvent ¶
ParseZRC20WithdrawalEvent tries extracting ZRC20Withdrawal event from the input logs using the zrc20 contract; It only returns a not-nil event if the event has been correctly validated as a valid withdrawal event
func ParseZetaSentEvent ¶
func ParseZetaSentEvent( log ethtypes.Log, connectorZEVM ethcommon.Address, ) (*connectorzevm.ZetaConnectorZEVMZetaSent, error)
ParseZetaSentEvent tries extracting ZetaSent event from connectorZEVM contract; returns error if the log entry is not a ZetaSent event, or is not emitted from connectorZEVM It only returns a not-nil event if all the error checks pass
func SortCctxsByHeightAndChainID ¶
func SortCctxsByHeightAndChainID(cctxs []*types.CrossChainTx) []*types.CrossChainTx
SortCctxsByHeightAndChainID sorts the cctxs by height (first come first serve), the chain ID doesn't really matter
Types ¶
type CCTXGateway ¶
type CCTXGateway interface { // Initiate a new outbound, this tells the CCTXGateway to carry out the action to execute the outbound. // It is the only entry point to initiate an outbound and it returns new CCTX status after it is completed. InitiateOutbound(ctx sdk.Context, config InitiateOutboundConfig) (newCCTXStatus types.CctxStatus, err error) }
CCTXGateway is interface implemented by every gateway. It is one of interfaces used for communication between CCTX gateways and crosschain module, and it is called by crosschain module.
func ResolveCCTXGateway ¶
func ResolveCCTXGateway(c chains.CCTXGateway, keeper Keeper) (CCTXGateway, bool)
ResolveCCTXGateway respolves cctx gateway implementation based on provided cctx gateway
type CCTXGatewayObservers ¶
type CCTXGatewayObservers struct {
// contains filtered or unexported fields
}
CCTXGatewayObservers is implementation of CCTXGateway interface for observers
func NewCCTXGatewayObservers ¶
func NewCCTXGatewayObservers(crosschainKeeper Keeper) CCTXGatewayObservers
NewCCTXGatewayObservers returns new instance of CCTXGatewayObservers
func (CCTXGatewayObservers) InitiateOutbound ¶
func (c CCTXGatewayObservers) InitiateOutbound( ctx sdk.Context, config InitiateOutboundConfig, ) (newCCTXStatus types.CctxStatus, err error)
InitiateOutbound updates the store so observers can use the PendingCCTX query:
If preprocessing of outbound is successful, the CCTX status is changed to PendingOutbound.
if preprocessing of outbound, such as paying the gas fee for the destination fails, the state is reverted to aborted
We do not return an error from this function, as all changes need to be persisted to the state.
Instead, we use a temporary context to make changes and then commit the context on for the happy path, i.e cctx is set to PendingOutbound. New CCTX status after preprocessing is returned.
type CCTXGatewayZEVM ¶
type CCTXGatewayZEVM struct {
// contains filtered or unexported fields
}
CCTXGatewayZEVM is implementation of CCTXGateway interface for ZEVM
func NewCCTXGatewayZEVM ¶
func NewCCTXGatewayZEVM(crosschainKeeper Keeper) CCTXGatewayZEVM
NewCCTXGatewayZEVM returns new instance of CCTXGatewayZEVM
func (CCTXGatewayZEVM) InitiateOutbound ¶
func (c CCTXGatewayZEVM) InitiateOutbound( ctx sdk.Context, config InitiateOutboundConfig, ) (newCCTXStatus types.CctxStatus, err error)
InitiateOutbound handles evm deposit and immediately validates pending outbound
type ChainGasParams ¶
type ChainGasParams struct { GasZRC20 ethcommon.Address GasLimit math.Uint GasPrice math.Uint // PriorityFee (optional for EIP-1559) PriorityFee math.Uint ProtocolFlatFee math.Uint }
ChainGasParams represents the parameters to calculate the fees for gas for a chain.
type CheckAndUpdateCctxGasPriceFunc ¶
type CheckAndUpdateCctxGasPriceFunc func( ctx sdk.Context, k Keeper, cctx types.CrossChainTx, flags observertypes.GasPriceIncreaseFlags, ) (math.Uint, math.Uint, error)
CheckAndUpdateCctxGasPriceFunc is a function type for checking and updating the gas price of a cctx
type InitiateOutboundConfig ¶
type InitiateOutboundConfig struct { CCTX *types.CrossChainTx ShouldPayGas bool }
TODO (https://github.com/zeta-chain/node/issues/2345): this is just a tmp solution because some flows require gas payment and others don't. TBD during implementation of issue above if info can be passed to CCTX constructor somehow. and not initialize CCTX using MsgVoteInbound and instead use something like (InboundParams, OutboundParams). Also check if msg.Digest can be replaced to calculate index
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey, memKey storetypes.StoreKey, stakingKeeper types.StakingKeeper, authKeeper types.AccountKeeper, bankKeeper types.BankKeeper, zetaObserverKeeper types.ObserverKeeper, fungibleKeeper types.FungibleKeeper, authorityKeeper types.AuthorityKeeper, lightclientKeeper types.LightclientKeeper, ) *Keeper
func (Keeper) AddFinalizedInbound ¶
func (Keeper) AddZetaAbortedAmount ¶
func (Keeper) Cctx ¶
func (k Keeper) Cctx(c context.Context, req *types.QueryGetCctxRequest) (*types.QueryGetCctxResponse, error)
func (Keeper) CctxAll ¶
func (k Keeper) CctxAll(c context.Context, req *types.QueryAllCctxRequest) (*types.QueryAllCctxResponse, error)
func (Keeper) CctxByNonce ¶
func (k Keeper) CctxByNonce( c context.Context, req *types.QueryGetCctxByNonceRequest, ) (*types.QueryGetCctxResponse, error)
func (Keeper) ChainGasParams ¶
ChainGasParams returns the params to calculates the fees for gas for a chain tha gas address, the gas limit, gas price and protocol flat fee are returned
func (Keeper) CheckIfTSSMigrationTransfer ¶
CheckIfTSSMigrationTransfer checks if the sender is a TSS address and returns an error if it is. If the sender is an older TSS address, this means that it is a migration transfer, and we do not need to treat this as a deposit and process the CCTX
func (Keeper) ConvertGasToZeta ¶
func (k Keeper) ConvertGasToZeta( context context.Context, request *types.QueryConvertGasToZetaRequest, ) (*types.QueryConvertGasToZetaResponse, error)
func (Keeper) FundGasStabilityPoolFromRemainingFees ¶
func (k Keeper) FundGasStabilityPoolFromRemainingFees( ctx sdk.Context, OutboundParams types.OutboundParams, chainID int64, ) error
FundGasStabilityPoolFromRemainingFees funds the gas stability pool with the remaining fees of an outbound tx
func (Keeper) FundStabilityPool ¶
func (k Keeper) FundStabilityPool(ctx sdk.Context, cctx *types.CrossChainTx)
FundStabilityPool funds the stability pool with the remaining fees of an outbound tx The funds are sent to the gas stability pool associated with the receiver chain This wraps the FundGasStabilityPoolFromRemainingFees function and logs an error if it fails.We do not return an error here. Event if the funding fails, the outbound tx is still processed.
func (Keeper) GasPrice ¶
func (k Keeper) GasPrice( c context.Context, req *types.QueryGetGasPriceRequest, ) (*types.QueryGetGasPriceResponse, error)
func (Keeper) GasPriceAll ¶
func (k Keeper) GasPriceAll( c context.Context, req *types.QueryAllGasPriceRequest, ) (*types.QueryAllGasPriceResponse, error)
func (Keeper) GetAllCrossChainTx ¶
func (k Keeper) GetAllCrossChainTx(ctx sdk.Context) (list []types.CrossChainTx)
GetAllCrossChainTx returns all cctxs
func (Keeper) GetAllFinalizedInbound ¶
func (Keeper) GetAllForeignCoins ¶
func (k Keeper) GetAllForeignCoins(ctx sdk.Context) []fungibleModuleTypes.ForeignCoins
func (Keeper) GetAllGasPrice ¶
GetAllGasPrice returns all gasPrice
func (Keeper) GetAllInboundHashToCctx ¶
func (k Keeper) GetAllInboundHashToCctx(ctx sdk.Context) (list []types.InboundHashToCctx)
GetAllInboundHashToCctx returns all inboundHashToCctx
func (Keeper) GetAllInboundTracker ¶
func (k Keeper) GetAllInboundTracker(ctx sdk.Context) (inTxTrackers []types.InboundTracker)
func (Keeper) GetAllInboundTrackerForChain ¶
func (Keeper) GetAllInboundTrackerForChainPaginated ¶
func (k Keeper) GetAllInboundTrackerForChainPaginated( ctx sdk.Context, chainID int64, pagination *query.PageRequest, ) (inTxTrackers []types.InboundTracker, pageRes *query.PageResponse, err error)
func (Keeper) GetAllInboundTrackerPaginated ¶
func (k Keeper) GetAllInboundTrackerPaginated( ctx sdk.Context, pagination *query.PageRequest, ) (inTxTrackers []types.InboundTracker, pageRes *query.PageResponse, err error)
func (Keeper) GetAllLastBlockHeight ¶
func (k Keeper) GetAllLastBlockHeight(ctx sdk.Context) (list []types.LastBlockHeight)
GetAllLastBlockHeight returns all lastBlockHeight
func (Keeper) GetAllOutboundTracker ¶
func (k Keeper) GetAllOutboundTracker(ctx sdk.Context) (list []types.OutboundTracker)
GetAllOutboundTracker returns all outbound trackers
func (Keeper) GetAuthKeeper ¶
func (k Keeper) GetAuthKeeper() types.AccountKeeper
func (Keeper) GetAuthorityKeeper ¶
func (k Keeper) GetAuthorityKeeper() types.AuthorityKeeper
func (Keeper) GetBankKeeper ¶
func (k Keeper) GetBankKeeper() types.BankKeeper
func (*Keeper) GetChainsSupportingTSSMigration ¶
GetChainsSupportingTSSMigration returns the chains that support tss migration. Chains that support tss migration are chains that have the following properties: 1. External chains 2. Gateway observer 3. Consensus is bitcoin or ethereum (Other consensus types are not supported)
func (Keeper) GetCrossChainTx ¶
GetCrossChainTx returns a cctx from its index
func (Keeper) GetFungibleKeeper ¶
func (k Keeper) GetFungibleKeeper() types.FungibleKeeper
func (Keeper) GetGasPrice ¶
GetGasPrice returns a gasPrice from its index or false if it doesn't exist.
func (Keeper) GetIBCCrosschainKeeper ¶
func (k Keeper) GetIBCCrosschainKeeper() types.IBCCrosschainKeeper
func (Keeper) GetInboundHashToCctx ¶
func (k Keeper) GetInboundHashToCctx( ctx sdk.Context, inboundHash string, ) (val types.InboundHashToCctx, found bool)
GetInboundHashToCctx returns a inboundHashToCctx from its index
func (Keeper) GetInboundTracker ¶
func (k Keeper) GetInboundTracker( ctx sdk.Context, chainID int64, txHash string, ) (val types.InboundTracker, found bool)
GetInboundTracker returns a InboundTracker from its index
func (Keeper) GetLastBlockHeight ¶
func (k Keeper) GetLastBlockHeight(ctx sdk.Context, index string) (val types.LastBlockHeight, found bool)
GetLastBlockHeight returns a lastBlockHeight from its index
func (Keeper) GetLightclientKeeper ¶
func (k Keeper) GetLightclientKeeper() types.LightclientKeeper
func (Keeper) GetMedianGasValues ¶
GetMedianGasValues returns *median* gas price and priority fee (for EIP-1559) from the store or false if it doesn't exist.
func (Keeper) GetMemKey ¶
func (k Keeper) GetMemKey() storetypes.StoreKey
func (Keeper) GetObserverKeeper ¶
func (k Keeper) GetObserverKeeper() types.ObserverKeeper
func (Keeper) GetOutboundTracker ¶
func (k Keeper) GetOutboundTracker( ctx sdk.Context, chainID int64, nonce uint64, ) (val types.OutboundTracker, found bool)
GetOutboundTracker returns an outbound tracker from its index
func (Keeper) GetRateLimiterAssetRateList ¶
func (k Keeper) GetRateLimiterAssetRateList( ctx sdk.Context, ) (flags types.RateLimiterFlags, assetRates []types.AssetRate, found bool)
GetRateLimiterAssetRateList returns a list of all foreign asset rate
func (Keeper) GetRateLimiterFlags ¶
GetRateLimiterFlags returns the rate limiter flags
func (Keeper) GetRevertGasLimit ¶
GetRevertGasLimit returns the gas limit for the revert transaction in a CCTX It returns 0 if there is no error but the gas limit can't be determined from the CCTX data
func (Keeper) GetStakingKeeper ¶
func (k Keeper) GetStakingKeeper() types.StakingKeeper
func (Keeper) GetStoreKey ¶
func (k Keeper) GetStoreKey() storetypes.StoreKey
func (Keeper) GetZetaAccounting ¶
func (Keeper) HandleEVMDeposit ¶
HandleEVMDeposit handles a deposit from an inbound tx returns (isContractReverted, err) (true, non-nil) means CallEVM() reverted
func (Keeper) InTxHashToCctx ¶
func (k Keeper) InTxHashToCctx( c context.Context, req *types.QueryGetInboundHashToCctxRequest, ) (*types.QueryGetInboundHashToCctxResponse, error)
InTxHashToCctx Deprecated(v17): use InboundHashToCctx
func (Keeper) InTxHashToCctxAll ¶
func (k Keeper) InTxHashToCctxAll( c context.Context, req *types.QueryAllInboundHashToCctxRequest, ) (*types.QueryAllInboundHashToCctxResponse, error)
InTxHashToCctxAll Deprecated(v17): use InboundHashToCctxAll
func (Keeper) InTxHashToCctxData ¶
func (k Keeper) InTxHashToCctxData( c context.Context, req *types.QueryInboundHashToCctxDataRequest, ) (*types.QueryInboundHashToCctxDataResponse, error)
InTxHashToCctxData Deprecated(v17): use InboundHashToCctxData
func (Keeper) InTxTrackerAll ¶
func (k Keeper) InTxTrackerAll( c context.Context, req *types.QueryAllInboundTrackersRequest, ) (*types.QueryAllInboundTrackersResponse, error)
InTxTrackerAll Deprecated(v17): use InboundTrackerAll
func (Keeper) InTxTrackerAllByChain ¶
func (k Keeper) InTxTrackerAllByChain( c context.Context, req *types.QueryAllInboundTrackerByChainRequest, ) (*types.QueryAllInboundTrackerByChainResponse, error)
InTxTrackerAllByChain Deprecated(v17): use InboundTrackerAllByChain
func (Keeper) InboundHashToCctx ¶
func (k Keeper) InboundHashToCctx( c context.Context, req *types.QueryGetInboundHashToCctxRequest, ) (*types.QueryGetInboundHashToCctxResponse, error)
func (Keeper) InboundHashToCctxAll ¶
func (k Keeper) InboundHashToCctxAll( c context.Context, req *types.QueryAllInboundHashToCctxRequest, ) (*types.QueryAllInboundHashToCctxResponse, error)
func (Keeper) InboundHashToCctxData ¶
func (k Keeper) InboundHashToCctxData( c context.Context, req *types.QueryInboundHashToCctxDataRequest, ) (*types.QueryInboundHashToCctxDataResponse, error)
InboundHashToCctxData queries the data of all cctxs indexed by a in tx hash
func (Keeper) InboundTracker ¶
func (k Keeper) InboundTracker( goCtx context.Context, req *types.QueryInboundTrackerRequest, ) (*types.QueryInboundTrackerResponse, error)
func (Keeper) InboundTrackerAll ¶
func (k Keeper) InboundTrackerAll( goCtx context.Context, req *types.QueryAllInboundTrackersRequest, ) (*types.QueryAllInboundTrackersResponse, error)
func (Keeper) InboundTrackerAllByChain ¶
func (k Keeper) InboundTrackerAllByChain( goCtx context.Context, request *types.QueryAllInboundTrackerByChainRequest, ) (*types.QueryAllInboundTrackerByChainResponse, error)
func (Keeper) InitiateOutbound ¶
func (k Keeper) InitiateOutbound(ctx sdk.Context, config InitiateOutboundConfig) (types.CctxStatus, error)
InitiateOutbound initiates the outbound for the CCTX depending on the CCTX gateway. It does a conditional dispatch to correct CCTX gateway based on the receiver chain which handles the state changes and error handling.
func (Keeper) IsFinalizedInbound ¶
func (Keeper) IterateAndUpdateCctxGasPrice ¶
func (k Keeper) IterateAndUpdateCctxGasPrice( ctx sdk.Context, chains []zetachains.Chain, updateFunc CheckAndUpdateCctxGasPriceFunc, ) (int, observertypes.GasPriceIncreaseFlags)
IterateAndUpdateCctxGasPrice iterates through all cctx and updates the gas price if pending for too long The function returns the number of cctxs updated and the gas price increase flags used
func (Keeper) LastBlockHeight ¶
func (k Keeper) LastBlockHeight( c context.Context, req *types.QueryGetLastBlockHeightRequest, ) (*types.QueryGetLastBlockHeightResponse, error)
func (Keeper) LastBlockHeightAll ¶
func (k Keeper) LastBlockHeightAll( c context.Context, req *types.QueryAllLastBlockHeightRequest, ) (*types.QueryAllLastBlockHeightResponse, error)
func (Keeper) LastZetaHeight ¶
func (k Keeper) LastZetaHeight( goCtx context.Context, req *types.QueryLastZetaHeightRequest, ) (*types.QueryLastZetaHeightResponse, error)
func (Keeper) ListPendingCctx ¶
func (k Keeper) ListPendingCctx( c context.Context, req *types.QueryListPendingCctxRequest, ) (*types.QueryListPendingCctxResponse, error)
ListPendingCctx returns a list of pending cctxs and the total number of pending cctxs a limit for the number of cctxs to return can be specified or the default is MaxPendingCctxs
func (Keeper) ListPendingCctxWithinRateLimit ¶
func (k Keeper) ListPendingCctxWithinRateLimit( c context.Context, req *types.QueryListPendingCctxWithinRateLimitRequest, ) (res *types.QueryListPendingCctxWithinRateLimitResponse, err error)
ListPendingCctxWithinRateLimit returns a list of pending cctxs that do not exceed the outbound rate limit a limit for the number of cctxs to return can be specified or the default is MaxPendingCctxs
func (Keeper) OutTxTracker ¶
func (k Keeper) OutTxTracker( c context.Context, req *types.QueryGetOutboundTrackerRequest, ) (*types.QueryGetOutboundTrackerResponse, error)
OutTxTracker Deprecated(v17): use OutboundTracker
func (Keeper) OutTxTrackerAll ¶
func (k Keeper) OutTxTrackerAll( c context.Context, req *types.QueryAllOutboundTrackerRequest, ) (*types.QueryAllOutboundTrackerResponse, error)
OutTxTrackerAll Deprecated(v17): use OutboundTrackerAll
func (Keeper) OutTxTrackerAllByChain ¶
func (k Keeper) OutTxTrackerAllByChain( c context.Context, req *types.QueryAllOutboundTrackerByChainRequest, ) (*types.QueryAllOutboundTrackerByChainResponse, error)
OutTxTrackerAllByChain Deprecated(v17): use OutboundTrackerAllByChain
func (Keeper) OutboundTracker ¶
func (k Keeper) OutboundTracker( c context.Context, req *types.QueryGetOutboundTrackerRequest, ) (*types.QueryGetOutboundTrackerResponse, error)
func (Keeper) OutboundTrackerAll ¶
func (k Keeper) OutboundTrackerAll( c context.Context, req *types.QueryAllOutboundTrackerRequest, ) (*types.QueryAllOutboundTrackerResponse, error)
func (Keeper) OutboundTrackerAllByChain ¶
func (k Keeper) OutboundTrackerAllByChain( c context.Context, req *types.QueryAllOutboundTrackerByChainRequest, ) (*types.QueryAllOutboundTrackerByChainResponse, error)
func (Keeper) PayGasAndUpdateCctx ¶
func (k Keeper) PayGasAndUpdateCctx( ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, inputAmount math.Uint, noEthereumTxEvent bool, ) error
PayGasAndUpdateCctx updates the outbound tx with the new amount after paying the gas fee **Caller should feed temporary ctx into this function** chainID is the outbound chain chain id , this can be receiver chain for regular transactions and sender-chain to reverted transactions
func (Keeper) PayGasInERC20AndUpdateCctx ¶
func (k Keeper) PayGasInERC20AndUpdateCctx( ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, inputAmount math.Uint, noEthereumTxEvent bool, ) error
PayGasInERC20AndUpdateCctx updates parameter cctx amount subtracting the gas fee the gas fee in ERC20 is calculated by swapping ERC20 -> Zeta -> Gas if the route is not available, the gas payment will fail **Caller should feed temporary ctx into this function**
func (Keeper) PayGasInZetaAndUpdateCctx ¶
func (k Keeper) PayGasInZetaAndUpdateCctx( ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, zetaBurnt math.Uint, noEthereumTxEvent bool, ) error
PayGasInZetaAndUpdateCctx updates parameter cctx with the gas price and gas fee for the outbound tx; it also makes a trade to fulfill the outbound tx gas fee in ZETA by swapping ZETA for some gas ZRC20 balances The gas ZRC20 balance is subsequently burned to account for the expense of TSS address gas fee payment in the outbound tx. zetaBurnt represents the amount of Zeta that has been burnt for the tx, the final amount for the tx is zetaBurnt - gasFee **Caller should feed temporary ctx into this function**
func (Keeper) PayGasNativeAndUpdateCctx ¶
func (k Keeper) PayGasNativeAndUpdateCctx( ctx sdk.Context, chainID int64, cctx *types.CrossChainTx, inputAmount math.Uint, ) error
PayGasNativeAndUpdateCctx updates the outbound tx with the new amount subtracting the gas fee **Caller should feed temporary ctx into this function**
func (Keeper) PostTxProcessing ¶
func (k Keeper) PostTxProcessing( ctx sdk.Context, msg *core.Message, receipt *ethtypes.Receipt, ) error
PostTxProcessing implements EvmHooks.PostTxProcessing.
func (Keeper) ProcessLogs ¶
func (k Keeper) ProcessLogs( ctx sdk.Context, logs []*ethtypes.Log, emittingAddress ethcommon.Address, txOrigin string, ) error
ProcessLogs post-processes logs emitted by a zEVM contract; if the log contains Withdrawal event from registered ZRC20 contract, new CCTX will be created to trigger and track outbound transaction. Returning error from process logs does the following: - revert the whole tx. - clear the logs TODO: implement unit tests https://github.com/zeta-chain/node/issues/1759 TODO: refactor and simplify https://github.com/zeta-chain/node/issues/2627
func (Keeper) ProcessZEVMInboundV1 ¶
func (k Keeper) ProcessZEVMInboundV1( ctx sdk.Context, log *ethtypes.Log, connectorZEVMAddr, emittingAddress ethcommon.Address, txOrigin string, ) error
ProcessZEVMInboundV1 processes the logs emitted by the zEVM contract for V1 protocol contracts it parses logs from Connector and ZRC20 contracts and processes them accordingly
func (Keeper) ProcessZEVMInboundV2 ¶
func (k Keeper) ProcessZEVMInboundV2( ctx sdk.Context, log *ethtypes.Log, gatewayAddr ethcommon.Address, txOrigin string, ) error
ProcessZEVMInboundV2 processes the logs emitted by the zEVM contract for V2 protocol contracts it parses logs from GatewayZEVM contract and updates the crosschain module state
func (Keeper) ProcessZRC20WithdrawalEvent ¶
func (k Keeper) ProcessZRC20WithdrawalEvent( ctx sdk.Context, event *zrc20.ZRC20Withdrawal, emittingContract ethcommon.Address, txOrigin string, ) error
ProcessZRC20WithdrawalEvent creates a new CCTX to process the withdrawal event error indicates system error and non-recoverable; should abort
func (Keeper) ProcessZetaSentEvent ¶
func (k Keeper) ProcessZetaSentEvent( ctx sdk.Context, event *connectorzevm.ZetaConnectorZEVMZetaSent, emittingContract ethcommon.Address, txOrigin string, ) error
func (Keeper) ProtocolFee ¶
func (k Keeper) ProtocolFee( _ context.Context, _ *types.QueryMessagePassingProtocolFeeRequest, ) (*types.QueryMessagePassingProtocolFeeResponse, error)
func (Keeper) RateLimiterFlags ¶
func (k Keeper) RateLimiterFlags( c context.Context, req *types.QueryRateLimiterFlagsRequest, ) (*types.QueryRateLimiterFlagsResponse, error)
RateLimiterFlags queries the rate limiter flags
func (Keeper) RateLimiterInput ¶
func (k Keeper) RateLimiterInput( c context.Context, req *types.QueryRateLimiterInputRequest, ) (res *types.QueryRateLimiterInputResponse, err error)
RateLimiterInput collects the input data for the rate limiter
func (Keeper) RefundAbortedAmountOnZetaChain ¶
func (Keeper) RefundAmountOnZetaChainERC20 ¶
func (k Keeper) RefundAmountOnZetaChainERC20( ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address, ) error
RefundAmountOnZetaChainERC20 refunds the amount of the cctx on ZetaChain in case of aborted cctx NOTE: GetCurrentOutboundParam should contain the last up to date cctx amount Refund address should already be validated before calling this function
func (Keeper) RefundAmountOnZetaChainGas ¶
func (k Keeper) RefundAmountOnZetaChainGas( ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address, ) error
RefundAmountOnZetaChainGas refunds the amount of the cctx on ZetaChain in case of aborted cctx with cointype gas
func (Keeper) RefundAmountOnZetaChainZeta ¶
func (k Keeper) RefundAmountOnZetaChainZeta( ctx sdk.Context, cctx types.CrossChainTx, refundAddress ethcommon.Address, ) error
RefundAmountOnZetaChainZeta refunds the amount of the cctx on ZetaChain in case of aborted cctx with cointype zeta
func (Keeper) RemoveCrossChainTx ¶
RemoveCrossChainTx removes a cctx from the store
func (Keeper) RemoveGasPrice ¶
RemoveGasPrice removes a gasPrice from the store
func (Keeper) RemoveInboundHashToCctx ¶
RemoveInboundHashToCctx removes a inboundHashToCctx from the store
func (Keeper) RemoveInboundTrackerIfExists ¶
func (Keeper) RemoveLastBlockHeight ¶
RemoveLastBlockHeight removes a lastBlockHeight from the store
func (Keeper) RemoveOutboundTrackerFromStore ¶
RemoveOutboundTrackerFromStore removes a outbound tracker from the store
func (Keeper) RemoveZetaAbortedAmount ¶
func (Keeper) ResetGasMeterAndConsumeGas ¶
ResetGasMeterAndConsumeGas reset first the gas meter consumed value to zero and set it back to the new value 'gasUsed'
func (Keeper) SaveFailedOutbound ¶
func (Keeper) SaveObservedInboundInformation ¶
func (Keeper) SaveOutbound ¶
SaveOutbound saves the outbound transaction.It does the following things in one function:
Set the ballot index for the outbound vote to the cctx
Remove the nonce from the pending nonces
Remove the outbound tx tracker
Set the cctx and nonce to cctx and inboundHash to cctx
func (Keeper) SaveSuccessfulOutbound ¶
SaveSuccessfulOutbound saves a successful outbound transaction. This function does not set the CCTX status, therefore all successful outbound transactions need to have their status set during processing
func (Keeper) SetCctxAndNonceToCctxAndInboundHashToCctx ¶
func (k Keeper) SetCctxAndNonceToCctxAndInboundHashToCctx( ctx sdk.Context, cctx types.CrossChainTx, tssPubkey string, )
SetCctxAndNonceToCctxAndInboundHashToCctx does the following things in one function: 1. set the cctx in the store 2. set the mapping inboundHash -> cctxIndex , one inboundHash can be connected to multiple cctxindex 3. set the mapping nonce => cctx 4. update the zeta accounting
func (Keeper) SetCrossChainTx ¶
func (k Keeper) SetCrossChainTx(ctx sdk.Context, cctx types.CrossChainTx)
SetCrossChainTx set a specific cctx in the store from its index
func (Keeper) SetFinalizedInbound ¶
func (Keeper) SetGasPrice ¶
SetGasPrice set a specific gasPrice in the store from its index
func (*Keeper) SetIBCCrosschainKeeper ¶
func (k *Keeper) SetIBCCrosschainKeeper(ibcCrosschainKeeper types.IBCCrosschainKeeper)
func (Keeper) SetInboundHashToCctx ¶
func (k Keeper) SetInboundHashToCctx(ctx sdk.Context, inboundHashToCctx types.InboundHashToCctx)
SetInboundHashToCctx set a specific inboundHashToCctx in the store from its index
func (Keeper) SetInboundTracker ¶
func (k Keeper) SetInboundTracker(ctx sdk.Context, InboundTracker types.InboundTracker)
SetInboundTracker set a specific InboundTracker in the store from its index
func (Keeper) SetLastBlockHeight ¶
func (k Keeper) SetLastBlockHeight(ctx sdk.Context, lastBlockHeight types.LastBlockHeight)
SetLastBlockHeight set a specific lastBlockHeight in the store from its index
func (Keeper) SetObserverOutboundInfo ¶
func (k Keeper) SetObserverOutboundInfo(ctx sdk.Context, receiveChainID int64, cctx *types.CrossChainTx) error
SetObserverOutboundInfo sets the CCTX outbound nonce to the next available nonce for the TSS address, and updates the nonce of blockchain state. It also updates the PendingNonces that is used to track the unfulfilled outbound txs.
func (Keeper) SetOutboundTracker ¶
func (k Keeper) SetOutboundTracker(ctx sdk.Context, outboundTracker types.OutboundTracker)
SetOutboundTracker set a specific outbound tracker in the store from its index
func (Keeper) SetRateLimiterFlags ¶
func (k Keeper) SetRateLimiterFlags(ctx sdk.Context, rateLimiterFlags types.RateLimiterFlags)
SetRateLimiterFlags set the rate limiter flags in the store
func (Keeper) SetZetaAccounting ¶
func (k Keeper) SetZetaAccounting(ctx sdk.Context, abortedZetaAmount types.ZetaAccounting)
func (Keeper) ValidateInbound ¶
func (k Keeper) ValidateInbound( ctx sdk.Context, msg *types.MsgVoteInbound, shouldPayGas bool, ) (*types.CrossChainTx, error)
ValidateInbound is the only entry-point to create new CCTX (eg. when observers voting is done or new inbound event is detected). It creates new CCTX object and calls InitiateOutbound method.
func (Keeper) ValidateOutboundMessage ¶
func (k Keeper) ValidateOutboundMessage(ctx sdk.Context, msg types.MsgVoteOutbound) (types.CrossChainTx, error)
func (Keeper) ValidateOutboundObservers ¶
func (k Keeper) ValidateOutboundObservers( ctx sdk.Context, cctx *types.CrossChainTx, ballotStatus observertypes.BallotStatus, valueReceived string, ) error
ValidateOutboundObservers processes the finalization of an outbound transaction based on the ballot status. The state is committed only if the individual steps are successful.
func (Keeper) ValidateOutboundZEVM ¶
func (k Keeper) ValidateOutboundZEVM( ctx sdk.Context, cctx *types.CrossChainTx, depositErr error, isContractReverted bool, ) (newCCTXStatus types.CctxStatus)
ValidateOutboundZEVM processes the finalization of an outbound transaction if receiver is ZEVM. It takes deposit error and information if contract revert happened during deposit, to make a decision:
- If the deposit was successful, the CCTX status is changed to OutboundMined.
- If the deposit returned an internal error, but isContractReverted is false, the CCTX status is changed to Aborted.
- If the deposit is reverted, the function tries to create a revert cctx with status PendingRevert.
- If the creation of revert tx also fails it changes the status to Aborted.
Note : Aborted CCTXs are not refunded in this function. The refund is done using a separate refunding mechanism. We do not return an error from this function, as all changes need to be persisted to the state. Instead we use a temporary context to make changes and then commit the context on for the happy path, i.e cctx is set to OutboundMined. New CCTX status after preprocessing is returned.
func (Keeper) ValidateZrc20WithdrawEvent ¶
func (k Keeper) ValidateZrc20WithdrawEvent(ctx sdk.Context, event *zrc20.ZRC20Withdrawal, chainID int64) error
ValidateZrc20WithdrawEvent checks if the ZRC20Withdrawal event is valid It verifies event information for BTC chains and returns an error if the event is invalid
func (Keeper) ZetaAccounting ¶
func (k Keeper) ZetaAccounting( c context.Context, _ *types.QueryZetaAccountingRequest, ) (*types.QueryZetaAccountingResponse, error)
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func (Migrator) Migrate1to2 ¶
Migrate1to2 migrates the store from consensus version 1 to 2
func (Migrator) Migrate2to3 ¶
Migrate2to3 migrates the store from consensus version 2 to 3
func (Migrator) Migrate3to4 ¶
Migrate3to4 migrates the store from consensus version 3 to 4
Source Files ¶
- abci.go
- cctx.go
- cctx_gateway_observers.go
- cctx_gateway_zevm.go
- cctx_gateways.go
- cctx_orchestrator_validate_inbound.go
- cctx_orchestrator_validate_outbound.go
- cctx_utils.go
- events.go
- evm_deposit.go
- evm_hooks.go
- finalized_inbounds.go
- foreign_coins.go
- gas_payment.go
- gas_price.go
- grpc_query.go
- grpc_query_cctx.go
- grpc_query_cctx_rate_limit.go
- grpc_query_gas_price.go
- grpc_query_inbound_hash_to_cctx.go
- grpc_query_inbound_tracker.go
- grpc_query_last_block_height.go
- grpc_query_last_zeta_height.go
- grpc_query_legacy.go
- grpc_query_outbound_tracker.go
- grpc_query_rate_limiter_flags.go
- grpc_query_zeta_conversion_rate.go
- inbound_hash_to_cctx.go
- inbound_tracker.go
- initiate_outbound.go
- keeper.go
- last_block_height.go
- migrator.go
- msg_server.go
- msg_server_abort_stuck_cctx.go
- msg_server_add_inbound_tracker.go
- msg_server_add_outbound_tracker.go
- msg_server_migrate_erc20_custody_funds.go
- msg_server_migrate_tss_funds.go
- msg_server_refund_aborted_tx.go
- msg_server_remove_outbound_tracker.go
- msg_server_update_erc20_custody_pause_status.go
- msg_server_update_rate_limiter_flags.go
- msg_server_update_tss.go
- msg_server_vote_gas_price.go
- msg_server_vote_inbound_tx.go
- msg_server_vote_outbound_tx.go
- msg_server_whitelist_erc20.go
- outbound_tracker.go
- rate_limiter_flags.go
- refund.go
- v2_zevm_inbound.go
- zeta_accounting.go