keeper

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// This retrieves a specific validator set by it's nonce
	// used to compare what's on Ethereum with what's in Cosmos
	// to perform slashing / validation of system consistency
	QueryValsetRequest = "valsetRequest"
	// Gets all the confirmation signatures for a given validator
	// set, used by the relayer to package the validator set and
	// it's signatures into an Ethereum transaction
	QueryValsetConfirmsByNonce = "valsetConfirms"
	// Gets the last N (where N is currently 5) validator sets that
	// have been produced by the chain. Useful to see if any recently
	// signed requests can be submitted.
	QueryLastValsetRequests = "lastValsetRequests"
	// Gets a list of unsigned valsets for a given validators delegate
	// orchestrator address. Up to 100 are sent at a time
	QueryLastPendingValsetRequestByAddr = "lastPendingValsetRequest"

	QueryCurrentValset = "currentValset"
	QueryValsetConfirm = "valsetConfirm"

	// used by the contract deployer script. GravityID is set in the Genesis
	// file, then read by the contract deployer and deployed to Ethereum
	// a unique GravityID ensures that even if the same validator set with
	// the same keys is running on two chains these chains can have independent
	// bridges
	QueryGravityID = "gravityID"

	// This retrieves a specific batch by it's nonce and token contract
	// or in the case of a Cosmos originated address it's denom
	QueryBatch = "batch"
	// Get the last unsigned batch (of any denom) for the validators
	// orchestrator to sign
	QueryLastPendingBatchRequestByAddr = "lastPendingBatchRequest"
	// gets the last 100 outgoing batches, regardless of denom, useful
	// for a relayer to see what is available to relay
	QueryOutgoingTxBatches = "lastBatches"
	// Used by the relayer to package a batch with signatures required
	// to submit to Ethereum
	QueryBatchConfirms = "batchConfirms"
	// Used to query all pending SendToEth transactions and fees available for each
	// token type, a relayer can then estimate their potential profit when requesting
	// a batch
	QueryBatchFees = "batchFees"

	// Token mapping
	// This retrieves the denom which is represented by a given ERC20 contract
	QueryERC20ToDenom = "ERC20ToDenom"
	// This retrieves the ERC20 contract which represents a given denom
	QueryDenomToERC20 = "DenomToERC20"

	// Query pending transactions
	QueryPendingSendToEth = "PendingSendToEth"
)
View Source
const MaxResults = 100
View Source
const OutgoingTxBatchSize = 100

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the gov MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

NewQuerier is the module level router for state queries

Types

type AttestationHandler

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

AttestationHandler processes `observed` Attestations

func (AttestationHandler) Handle

func (a AttestationHandler) Handle(ctx sdk.Context, att types.Attestation, ethereumClaim types.EthereumClaim) error

Handle is the entry point for Attestation processing.

type Hooks

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

Hooks Wrapper struct

func (Hooks) AfterDelegationModified

func (h Hooks) AfterDelegationModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)

func (Hooks) AfterValidatorBeginUnbonding

func (h Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)

func (Hooks) AfterValidatorBonded

func (h Hooks) AfterValidatorBonded(_ sdk.Context, _ sdk.ConsAddress, _ sdk.ValAddress)

func (Hooks) AfterValidatorCreated

func (h Hooks) AfterValidatorCreated(_ sdk.Context, _ sdk.ValAddress)

func (Hooks) AfterValidatorRemoved

func (h Hooks) AfterValidatorRemoved(ctx sdk.Context, _ sdk.ConsAddress, valAddr sdk.ValAddress)

func (Hooks) BeforeDelegationCreated

func (h Hooks) BeforeDelegationCreated(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)

func (Hooks) BeforeDelegationRemoved

func (h Hooks) BeforeDelegationRemoved(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)

func (Hooks) BeforeDelegationSharesModified

func (h Hooks) BeforeDelegationSharesModified(_ sdk.Context, _ sdk.AccAddress, _ sdk.ValAddress)

func (Hooks) BeforeValidatorModified

func (h Hooks) BeforeValidatorModified(_ sdk.Context, _ sdk.ValAddress)

func (Hooks) BeforeValidatorSlashed

func (h Hooks) BeforeValidatorSlashed(_ sdk.Context, _ sdk.ValAddress, _ sdk.Dec)

type Keeper

type Keeper struct {
	StakingKeeper types.StakingKeeper

	SlashingKeeper types.SlashingKeeper
	// contains filtered or unexported fields
}

Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace,
	stakingKeeper types.StakingKeeper, bankKeeper types.BankKeeper, ak types.AccountKeeper, slashingKeeper types.SlashingKeeper,
	ibcTransferKeeper types.IBCTransferKeeper, channelKeeper types.IBCChannelKeeper, erc20Keeper types.Erc20Keeper) Keeper

NewKeeper returns a new instance of the gravity keeper

func (Keeper) AddToOutgoingPool

func (k Keeper) AddToOutgoingPool(ctx sdk.Context, sender sdk.AccAddress, counterpartReceiver string, amount sdk.Coin, fee sdk.Coin) (uint64, error)

AddToOutgoingPool - checks a counterpart denominator exists for the given voucher type - burns the voucher for transfer amount and fees - persists an OutgoingTx - adds the TX to the `available` TX pool via a second index

func (Keeper) Attest

func (k Keeper) Attest(ctx sdk.Context, claim types.EthereumClaim, anyClaim *codectypes.Any) (*types.Attestation, error)

func (Keeper) BatchConfirms

BatchConfirms returns the batch confirmations by nonce and token contract

func (Keeper) BatchFees

BatchFees queries the batch fees from unbatched pool

func (Keeper) BatchRequestByNonce

BatchRequestByNonce queries the BatchRequestByNonce of the gravity module

func (Keeper) BuildOutgoingTXBatch

func (k Keeper) BuildOutgoingTXBatch(ctx sdk.Context, contractAddress string, maxElements int, minimumFee sdk.Int, feeReceive string, baseFee sdk.Int) (*types.OutgoingTxBatch, error)

BuildOutgoingTXBatch starts the following process chain:

  • find bridged denominator for given voucher type
  • determine if a an unexecuted batch is already waiting for this token type, if so confirm the new batch would have a higher total fees. If not exit withtout creating a batch
  • select available transactions from the outgoing transaction pool sorted by fee desc
  • persist an outgoing batch object with an incrementing ID = nonce
  • emit an event

func (Keeper) CancelOutgoingTXBatch

func (k Keeper) CancelOutgoingTXBatch(ctx sdk.Context, tokenContract string, batchNonce uint64) error

CancelOutgoingTXBatch releases all TX in the batch and deletes the batch

func (Keeper) ConvertDenomToMany added in v2.2.1

func (k Keeper) ConvertDenomToMany(ctx sdk.Context, sender sdk.AccAddress, coin sdk.Coin) (sdk.Coin, error)

func (Keeper) CurrentValset

CurrentValset queries the CurrentValset of the gravity module

func (Keeper) DelEthAddressForValidator

func (k Keeper) DelEthAddressForValidator(ctk sdk.Context, validator sdk.ValAddress)

DelEthAddressForValidator delete the ethereum address for a give validator

func (Keeper) DeleteAttestation

func (k Keeper) DeleteAttestation(ctx sdk.Context, att types.Attestation)

DeleteAttestation deletes an attestation given an event nonce and claim

func (Keeper) DeleteBatch

func (k Keeper) DeleteBatch(ctx sdk.Context, batch types.OutgoingTxBatch)

DeleteBatch deletes an outgoing transaction batch

func (Keeper) DeleteValset

func (k Keeper) DeleteValset(ctx sdk.Context, nonce uint64)

DeleteValset deletes the valset at a given nonce from state

func (Keeper) DenomToERC20

DenomToERC20 queries the Cosmos Denom that maps to an Ethereum ERC20

func (Keeper) DenomToERC20Lookup

func (k Keeper) DenomToERC20Lookup(ctx sdk.Context, denom string) (bool, string, error)

DenomToERC20Lookup returns (bool isCosmosOriginated, string ERC20, err) Using this information, you can see if an asset is native to Cosmos or Ethereum, and get its corresponding ERC20 address This will return an error if it cant parse the denom as a gravity denom, and then also can't find the denom in an index of ERC20 contracts deployed on Ethereum to serve as synthetic Cosmos assets.

func (Keeper) ERC20ToDenom

ERC20ToDenom queries the ERC20 contract that maps to an Ethereum ERC20 if any

func (Keeper) ERC20ToDenomLookup

func (k Keeper) ERC20ToDenomLookup(ctx sdk.Context, tokenContract string) (bool, string)

ERC20ToDenomLookup returns (bool isCosmosOriginated, string denom, err) Using this information, you can see if an ERC20 address represents an asset is native to Cosmos or Ethereum, and get its corresponding denom

func (Keeper) GetAllBatchFees

func (k Keeper) GetAllBatchFees(ctx sdk.Context, minBatchFees []types.MinBatchFee) (batchFees []*types.BatchFees)

GetAllBatchFees creates a fee entry for every batch type currently in the store this can be used by relayers to determine what batch types are desirable to request

func (Keeper) GetAttestation

func (k Keeper) GetAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte) *types.Attestation

GetAttestation return an attestation given a nonce

func (Keeper) GetAttestationMapping

func (k Keeper) GetAttestationMapping(ctx sdk.Context) (out map[uint64][]types.Attestation)

GetAttestationMapping returns a mapping of eventnonce -> attestations at that nonce

func (Keeper) GetBatchConfirm

func (k Keeper) GetBatchConfirm(ctx sdk.Context, nonce uint64, tokenContract string, validator sdk.AccAddress) *types.MsgConfirmBatch

GetBatchConfirm returns a batch confirmation given its nonce, the token contract, and a validator address

func (Keeper) GetBatchConfirmByNonceAndTokenContract

func (k Keeper) GetBatchConfirmByNonceAndTokenContract(ctx sdk.Context, nonce uint64, tokenContract string) (out []types.MsgConfirmBatch)

GetBatchConfirmByNonceAndTokenContract returns the batch confirms

func (Keeper) GetBatchFeesByTokenType

func (k Keeper) GetBatchFeesByTokenType(ctx sdk.Context, tokenContractAddr string, baseFee sdk.Int) *types.BatchFees

GetBatchFeesByTokenType gets the fees the next batch of a given token type would have if created. This info is both presented to relayers for the purpose of determining when to request batches and also used by the batch creation process to decide not to create a new batch

func (Keeper) GetBatchTimeoutHeight

func (k Keeper) GetBatchTimeoutHeight(ctx sdk.Context) uint64

GetBatchTimeoutHeight This gets the batch timeout height in Ethereum blocks.

func (Keeper) GetBridgeChainID

func (k Keeper) GetBridgeChainID(ctx sdk.Context) uint64

GetBridgeChainID returns the chain id of the ETH chain we are running against

func (Keeper) GetBridgeContractAddress

func (k Keeper) GetBridgeContractAddress(ctx sdk.Context) string

GetBridgeContractAddress returns the bridge contract address on ETH

func (Keeper) GetCurrentValset

func (k Keeper) GetCurrentValset(ctx sdk.Context) *types.Valset

GetCurrentValset gets powers from the store and normalizes them into an integer percentage with a resolution of uint32 Max meaning a given validators 'gravity power' is computed as Cosmos power / total cosmos power = x / uint32 Max where x is the voting power on the gravity contract. This allows us to only use integer division which produces a known rounding error from truncation equal to the ratio of the validators Cosmos power / total cosmos power ratio, leaving us at uint32 Max - 1 total voting power. This is an acceptable rounding error since floating point may cause consensus problems if different floating point unit implementations are involved.

func (Keeper) GetDelegateKeys

func (k Keeper) GetDelegateKeys(ctx sdk.Context) []*types.MsgSetOrchestratorAddress

GetDelegateKeys iterates both the EthAddress and Orchestrator address indexes to produce a vector of MsgSetOrchestratorAddress entires containing all the delgate keys for state export / import. This may seem at first glance to be excessively complicated, why not combine the EthAddress and Orchestrator address indexes and simply iterate one thing? The answer is that even though we set the Eth and Orchestrator address in the same place we use them differently we always go from Orchestrator address to Validator address and from validator address to Ethereum address we want to keep looking up the validator address for various reasons, so a direct Orchestrator to Ethereum address mapping will mean having to keep two of the same data around just to provide lookups.

For the time being this will serve

func (Keeper) GetEthAddressByValidator

func (k Keeper) GetEthAddressByValidator(ctx sdk.Context, validator sdk.ValAddress) (ethAddress string, found bool)

GetEthAddressByValidator returns the eth address for a given gravity validator

func (Keeper) GetFxOriginatedDenom

func (k Keeper) GetFxOriginatedDenom(ctx sdk.Context, tokenContract string) (string, bool)

func (Keeper) GetFxOriginatedERC20

func (k Keeper) GetFxOriginatedERC20(ctx sdk.Context, denom string) (string, bool)

func (Keeper) GetGravityID

func (k Keeper) GetGravityID(ctx sdk.Context) string

GetGravityID returns the GravityID the GravityID is essentially a salt value for bridge signatures, provided each chain running Gravity has a unique ID it won't be possible to play back signatures from one bridge onto another even if they share a validator set.

The lifecycle of the GravityID is that it is set in the Genesis file read from the live chain for the contract deployment, once a Gravity contract is deployed the GravityID CAN NOT BE CHANGED. Meaning that it can't just be the same as the chain id since the chain id may be changed many times with each successive chain in charge of the same bridge

func (Keeper) GetIbcSequenceHeight

func (k Keeper) GetIbcSequenceHeight(ctx sdk.Context, sourcePort, sourceChannel string, sequence uint64) (uint64, bool)

GetIbcSequenceHeight get gravity -> ibc sequence block height.

func (Keeper) GetLastEventNonceByValidator

func (k Keeper) GetLastEventNonceByValidator(ctx sdk.Context, validator sdk.ValAddress) uint64

GetLastEventNonceByValidator returns the latest event nonce for a given validator

func (Keeper) GetLastObservedEthBlockHeight

func (k Keeper) GetLastObservedEthBlockHeight(ctx sdk.Context) types.LastObservedEthereumBlockHeight

GetLastObservedEthBlockHeight height gets the block height to of the last observed attestation from the store

func (Keeper) GetLastObservedEventNonce

func (k Keeper) GetLastObservedEventNonce(ctx sdk.Context) uint64

GetLastObservedEventNonce returns the latest observed event nonce

func (Keeper) GetLastObservedValset

func (k Keeper) GetLastObservedValset(ctx sdk.Context) *types.Valset

GetLastObservedValset retrieves the last observed validator set from the store WARNING: This value is not an up to date validator set on Ethereum, it is a validator set that AT ONE POINT was the one in the Gravity bridge on Ethereum. If you assume that it's up to date you may break the bridge

func (Keeper) GetLastOutgoingBatchByTokenType

func (k Keeper) GetLastOutgoingBatchByTokenType(ctx sdk.Context, token string) *types.OutgoingTxBatch

GetLastOutgoingBatchByTokenType gets the latest outgoing tx batch by token type

func (Keeper) GetLastSlashedBatchBlock

func (k Keeper) GetLastSlashedBatchBlock(ctx sdk.Context) uint64

GetLastSlashedBatchBlock returns the latest slashed Batch block

func (Keeper) GetLastSlashedValsetNonce

func (k Keeper) GetLastSlashedValsetNonce(ctx sdk.Context) uint64

GetLastSlashedValsetNonce returns the latest slashed valset nonce

func (Keeper) GetLastUnBondingBlockHeight

func (k Keeper) GetLastUnBondingBlockHeight(ctx sdk.Context) uint64

GetLastUnBondingBlockHeight returns the last unbonding block height

func (Keeper) GetLatestValset

func (k Keeper) GetLatestValset(ctx sdk.Context) (out *types.Valset)

GetLatestValset returns the latest validator set in state

func (Keeper) GetLatestValsetNonce

func (k Keeper) GetLatestValsetNonce(ctx sdk.Context) uint64

GetLatestValsetNonce returns the latest valset nonce

func (Keeper) GetOrchestratorValidator

func (k Keeper) GetOrchestratorValidator(ctx sdk.Context, orch sdk.AccAddress) (valAddr sdk.ValAddress, found bool)

GetOrchestratorValidator returns the validator key associated with an orchestrator key

func (Keeper) GetOutgoingTXBatch

func (k Keeper) GetOutgoingTXBatch(ctx sdk.Context, tokenContract string, nonce uint64) *types.OutgoingTxBatch

GetOutgoingTXBatch loads a batch object. Returns nil when not exists.

func (Keeper) GetOutgoingTxBatches

func (k Keeper) GetOutgoingTxBatches(ctx sdk.Context) (out []*types.OutgoingTxBatch)

GetOutgoingTxBatches returns the outgoing tx batches

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the parameters from the store

func (Keeper) GetPoolTransactions

func (k Keeper) GetPoolTransactions(ctx sdk.Context) []*types.OutgoingTransferTx

GetPoolTransactions grabs all transactions from the tx pool, useful for queries or genesis save/load

func (Keeper) GetUnSlashedBatches

func (k Keeper) GetUnSlashedBatches(ctx sdk.Context, maxHeight uint64) (out []*types.OutgoingTxBatch)

GetUnSlashedBatches returns all the unslashed batches in state

func (Keeper) GetUnSlashedValsets

func (k Keeper) GetUnSlashedValsets(ctx sdk.Context, maxHeight uint64) (out []*types.Valset)

GetUnSlashedValsets returns all the unslashed validator sets in state

func (Keeper) GetUnbondingValidators

func (k Keeper) GetUnbondingValidators(unbondingVals []byte) stakingtypes.ValAddresses

GetUnbondingValidators returns UnbondingValidators. Adding here in gravity keeper as cdc is available inside endblocker.

func (Keeper) GetValidatorByEthAddress

func (k Keeper) GetValidatorByEthAddress(ctx sdk.Context, ethAddr string) string

GetValidatorByEthAddress returns the eth address for a given gravity validator

func (Keeper) GetValset

func (k Keeper) GetValset(ctx sdk.Context, nonce uint64) *types.Valset

GetValset returns a valset by nonce

func (Keeper) GetValsetConfirm

func (k Keeper) GetValsetConfirm(ctx sdk.Context, nonce uint64, validator sdk.AccAddress) *types.MsgValsetConfirm

GetValsetConfirm returns a valset confirmation by a nonce and validator address

func (Keeper) GetValsetConfirms

func (k Keeper) GetValsetConfirms(ctx sdk.Context, nonce uint64) (confirms []*types.MsgValsetConfirm)

GetValsetConfirms returns all validator set confirmations by nonce

func (Keeper) GetValsets

func (k Keeper) GetValsets(ctx sdk.Context) (out []*types.Valset)

GetValsets returns all the validator sets in state

func (Keeper) HandlerIbcTransactionAfter

func (k Keeper) HandlerIbcTransactionAfter(ctx sdk.Context, sender, receive string, coin, fee sdk.Coin) error

func (Keeper) HasValsetRequest

func (k Keeper) HasValsetRequest(ctx sdk.Context, nonce uint64) bool

HasValsetRequest returns true if a valset defined by a nonce exists

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Hooks Create new gravity hooks

func (Keeper) IterateAttestations

func (k Keeper) IterateAttestations(ctx sdk.Context, cb func([]byte, types.Attestation) bool)

IterateAttestations iterates through all attestations

func (Keeper) IterateBatchBySlashedBatchBlock

func (k Keeper) IterateBatchBySlashedBatchBlock(ctx sdk.Context, lastSlashedBatchBlock uint64, maxHeight uint64, cb func([]byte, *types.OutgoingTxBatch) bool)

IterateBatchBySlashedBatchBlock iterates through all Batch by last slashed Batch block in ASC order

func (Keeper) IterateBatchConfirmByNonceAndTokenContract

func (k Keeper) IterateBatchConfirmByNonceAndTokenContract(ctx sdk.Context, nonce uint64, tokenContract string, cb func([]byte, types.MsgConfirmBatch) bool)

IterateBatchConfirmByNonceAndTokenContract iterates through all batch confirmations MARK finish-batches: this is where the key is iterated in the old (presumed working) code

func (Keeper) IterateERC20ToDenom

func (k Keeper) IterateERC20ToDenom(ctx sdk.Context, cb func([]byte, *types.ERC20ToDenom) bool)

IterateERC20ToDenom iterates over erc20 to denom relations

func (Keeper) IterateOutgoingPoolByFee

func (k Keeper) IterateOutgoingPoolByFee(ctx sdk.Context, contract string, cb func(uint64, *types.OutgoingTransferTx) bool)

IterateOutgoingPoolByFee iterates over the outgoing pool which is sorted by fee

func (Keeper) IterateOutgoingTXBatches

func (k Keeper) IterateOutgoingTXBatches(ctx sdk.Context, cb func(key []byte, batch *types.OutgoingTxBatch) bool)

IterateOutgoingTXBatches iterates through all outgoing batches in DESC order.

func (Keeper) IterateValsetBySlashedValsetNonce

func (k Keeper) IterateValsetBySlashedValsetNonce(ctx sdk.Context, lastSlashedValsetNonce uint64, maxHeight uint64, cb func([]byte, *types.Valset) bool)

IterateValsetBySlashedValsetNonce iterates through all valset by last slashed valset nonce in ASC order

func (Keeper) IterateValsetConfirmByNonce

func (k Keeper) IterateValsetConfirmByNonce(ctx sdk.Context, nonce uint64, cb func([]byte, types.MsgValsetConfirm) bool)

IterateValsetConfirmByNonce iterates through all valset confirms by nonce in ASC order MARK finish-batches: this is where the key is iterated in the old (presumed working) code

func (Keeper) IterateValsets

func (k Keeper) IterateValsets(ctx sdk.Context, cb func(key []byte, val *types.Valset) bool)

IterateValsets retruns all valsetRequests

func (Keeper) LastEventNonceByAddr

LastEventNonceByAddr returns the last event nonce for the given validator address, this allows eth oracles to figure out where they left off

func (Keeper) LastPendingBatchRequestByAddr

LastPendingBatchRequestByAddr queries the LastPendingBatchRequestByAddr of the gravity module

func (Keeper) LastPendingValsetRequestByAddr

LastPendingValsetRequestByAddr queries the LastPendingValsetRequestByAddr of the gravity module

func (Keeper) LastValsetRequests

LastValsetRequests queries the LastValsetRequests of the gravity module

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) OutgoingTxBatchExecuted

func (k Keeper) OutgoingTxBatchExecuted(ctx sdk.Context, tokenContract string, nonce uint64) error

OutgoingTxBatchExecuted is run when the Cosmos chain detects that a batch has been executed on Ethereum It frees all the transactions in the batch, then cancels all earlier batches

func (Keeper) OutgoingTxBatches

OutgoingTxBatches queries the OutgoingTxBatches of the gravity module

func (Keeper) Params

Params queries the params of the gravity module

func (Keeper) RemoveFromOutgoingPoolAndRefund

func (k Keeper) RemoveFromOutgoingPoolAndRefund(ctx sdk.Context, txId uint64, sender sdk.AccAddress) error

RemoveFromOutgoingPoolAndRefund - checks that the provided tx actually exists - deletes the unbatched tx from the pool - issues the tokens back to the sender

func (Keeper) SetAttestation

func (k Keeper) SetAttestation(ctx sdk.Context, eventNonce uint64, claimHash []byte, att *types.Attestation)

SetAttestation sets the attestation in the store

func (Keeper) SetBatchConfirm

func (k Keeper) SetBatchConfirm(ctx sdk.Context, batch *types.MsgConfirmBatch) []byte

SetBatchConfirm sets a batch confirmation by a validator

func (Keeper) SetEthAddressForValidator

func (k Keeper) SetEthAddressForValidator(ctx sdk.Context, validator sdk.ValAddress, ethAddr string)

SetEthAddressForValidator sets the ethereum address for a given validator

func (Keeper) SetFxOriginatedDenomToERC20

func (k Keeper) SetFxOriginatedDenomToERC20(ctx sdk.Context, denom string, tokenContract string)

func (Keeper) SetGravityID

func (k Keeper) SetGravityID(ctx sdk.Context, v string)

SetGravityID Set GravityID sets the GravityID the GravityID is essentially a salt value for bridge signatures, provided each chain running Gravity has a unique ID it won't be possible to play back signatures from one bridge onto another even if they share a validator set.

The lifecycle of the GravityID is that it is set in the Genesis file read from the live chain for the contract deployment, once a Gravity contract is deployed the GravityID CAN NOT BE CHANGED. Meaning that it can't just be the same as the chain id since the chain id may be changed many times with each successive chain in charge of the same bridge

func (Keeper) SetIbcSequenceHeight

func (k Keeper) SetIbcSequenceHeight(ctx sdk.Context, sourcePort, sourceChannel string, sequence, height uint64)

SetIbcSequenceHeight set gravity -> ibc sequence block height.

func (Keeper) SetLastEventNonceByValidator

func (k Keeper) SetLastEventNonceByValidator(ctx sdk.Context, validator sdk.ValAddress, nonce uint64)

SetLastEventNonceByValidator sets the latest event nonce for a give validator

func (Keeper) SetLastObservedEthBlockHeight

func (k Keeper) SetLastObservedEthBlockHeight(ctx sdk.Context, ethereumHeight uint64)

SetLastObservedEthBlockHeight sets the block height in the store.

func (Keeper) SetLastObservedEventNonce

func (k Keeper) SetLastObservedEventNonce(ctx sdk.Context, nonce uint64)

SetLastObservedEventNonce sets the latest observed event nonce

func (Keeper) SetLastObservedValset

func (k Keeper) SetLastObservedValset(ctx sdk.Context, valset types.Valset)

SetLastObservedValset updates the last observed validator set in the store

func (Keeper) SetLastSlashedBatchBlock

func (k Keeper) SetLastSlashedBatchBlock(ctx sdk.Context, blockHeight uint64)

SetLastSlashedBatchBlock sets the latest slashed Batch block height

func (Keeper) SetLastSlashedValsetNonce

func (k Keeper) SetLastSlashedValsetNonce(ctx sdk.Context, nonce uint64)

SetLastSlashedValsetNonce sets the latest slashed valset nonce

func (Keeper) SetLastUnBondingBlockHeight

func (k Keeper) SetLastUnBondingBlockHeight(ctx sdk.Context, unbondingBlockHeight uint64)

SetLastUnBondingBlockHeight sets the last unbonding block height

func (Keeper) SetLatestValsetNonce

func (k Keeper) SetLatestValsetNonce(ctx sdk.Context, nonce uint64)

SetLatestValsetNonce sets the latest valset nonce

func (Keeper) SetOrchestratorValidator

func (k Keeper) SetOrchestratorValidator(ctx sdk.Context, val sdk.ValAddress, orch sdk.AccAddress)

SetOrchestratorValidator sets the Orchestrator key for a given validator

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, ps types.Params)

SetParams sets the parameters in the store

func (Keeper) SetPoolEntry

func (k Keeper) SetPoolEntry(ctx sdk.Context, val *types.OutgoingTransferTx)

func (Keeper) SetValsetConfirm

func (k Keeper) SetValsetConfirm(ctx sdk.Context, valsetConf types.MsgValsetConfirm) []byte

SetValsetConfirm sets a valset confirmation

func (Keeper) SetValsetRequest

func (k Keeper) SetValsetRequest(ctx sdk.Context, valset *types.Valset) *types.Valset

SetValsetRequest returns a new instance of the Gravity BridgeValidatorSet i.e. {"nonce": 1, "memebers": [{"eth_addr": "foo", "power": 11223}]}

func (Keeper) StoreBatch

func (k Keeper) StoreBatch(ctx sdk.Context, batch *types.OutgoingTxBatch) error

StoreBatch stores a transaction batch

func (Keeper) StoreBatchUnsafe

func (k Keeper) StoreBatchUnsafe(ctx sdk.Context, batch *types.OutgoingTxBatch)

StoreBatchUnsafe stores a transaction batch w/o setting the height

func (Keeper) StoreValset

func (k Keeper) StoreValset(ctx sdk.Context, valset *types.Valset)

StoreValset is for storing a valiator set at a given height

func (Keeper) TransferAfter

func (k Keeper) TransferAfter(ctx sdk.Context, sender, receive string, amount, fee sdk.Coin) error

TransferAfter Hook operation after transfer transaction triggered by IBC module

func (Keeper) TryAttestation

func (k Keeper) TryAttestation(ctx sdk.Context, att *types.Attestation)

TryAttestation checks if an attestation has enough votes to be applied to the consensus state and has not already been marked Observed, then calls processAttestation to actually apply it to the state, and then marks it Observed and emits an event.

func (Keeper) UnpackAttestationClaim

func (k Keeper) UnpackAttestationClaim(att *types.Attestation) (types.EthereumClaim, error)

func (Keeper) ValsetConfirm

ValsetConfirm queries the ValsetConfirm of the gravity module

func (Keeper) ValsetConfirmsByNonce

ValsetConfirmsByNonce queries the ValsetConfirmsByNonce of the gravity module

func (Keeper) ValsetRequest

ValsetRequest queries the ValsetRequest of the gravity module

type MultiSigUpdateResponse

type MultiSigUpdateResponse struct {
	Valset     types.Valset `json:"valset"`
	Signatures [][]byte     `json:"signatures,omitempty"`
}

Jump to

Keyboard shortcuts

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