diff --git a/app/setup_handlers.go b/app/setup_handlers.go index 60087fbb95..18a8ae1f62 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/upgrade/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) const releaseVersion = "v10.1.0" @@ -16,7 +17,7 @@ func SetupHandlers(app *App) { for m, mb := range app.mm.Modules { vm[m] = mb.ConsensusVersion() } - + vm[observertypes.ModuleName] = vm[observertypes.ModuleName] - 1 return app.mm.RunMigrations(ctx, app.configurator, vm) }) diff --git a/cmd/zetaclientd/debug.go b/cmd/zetaclientd/debug.go new file mode 100644 index 0000000000..48cae761b2 --- /dev/null +++ b/cmd/zetaclientd/debug.go @@ -0,0 +1,189 @@ +package main + +import ( + "context" + "fmt" + "io" + "strconv" + "strings" + "sync" + + "github.com/btcsuite/btcd/rpcclient" + sdk "github.com/cosmos/cosmos-sdk/types" + ethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/rs/zerolog" + "github.com/spf13/cobra" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/testutil/sample" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" + "github.com/zeta-chain/zetacore/zetaclient" + "github.com/zeta-chain/zetacore/zetaclient/config" +) + +var debugArgs = debugArguments{} + +type debugArguments struct { + zetaCoreHome string + zetaNode string + zetaChainID string +} + +func init() { + RootCmd.AddCommand(DebugCmd()) + DebugCmd().Flags().StringVar(&debugArgs.zetaCoreHome, "core-home", "/Users/tanmay/.zetacored", "peer address, e.g. /dns/tss1/tcp/6668/ipfs/16Uiu2HAmACG5DtqmQsHtXg4G2sLS65ttv84e7MrL4kapkjfmhxAp") + DebugCmd().Flags().StringVar(&debugArgs.zetaNode, "node", "46.4.15.110", "public ip address") + DebugCmd().Flags().StringVar(&debugArgs.zetaChainID, "chain-id", "athens_7001-1", "pre-params file path") +} + +func DebugCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "get-ballot-from-intx [txHash] [chainID]", + Short: "provide txHash and chainID to get the ballot status for the txHash", + RunE: func(cmd *cobra.Command, args []string) error { + cobra.ExactArgs(2) + cfg, err := config.Load(debugArgs.zetaCoreHome) + if err != nil { + return err + } + chainID, err := strconv.ParseInt(args[1], 10, 64) + if err != nil { + return err + } + txHash := args[0] + var ballotIdentifier string + chainLogger := zerolog.New(io.Discard).Level(zerolog.Disabled) + bridge, err := zetaclient.NewZetaCoreBridge(&zetaclient.Keys{OperatorAddress: sdk.MustAccAddressFromBech32(sample.AccAddress())}, debugArgs.zetaNode, "", debugArgs.zetaChainID) + if err != nil { + return err + } + coreParams, err := bridge.GetCoreParams() + if err != nil { + return err + } + tssEthAddress, err := bridge.GetEthTssAddress() + if err != nil { + return err + } + + chain := common.GetChainFromChainID(chainID) + if chain == nil { + return fmt.Errorf("invalid chain id") + } + + if common.IsEVMChain(chain.ChainId) { + + ob := zetaclient.EVMChainClient{ + Mu: &sync.Mutex{}, + } + ob.WithZetaClient(bridge) + ob.WithLogger(chainLogger) + client := ðclient.Client{} + coinType := common.CoinType_Cmd + for chain, evmConfig := range cfg.GetAllEVMConfigs() { + if chainID == chain { + client, err = ethclient.Dial(evmConfig.Endpoint) + if err != nil { + return err + } + ob.WithEvmClient(client) + ob.WithChain(*common.GetChainFromChainID(chainID)) + } + } + hash := ethcommon.HexToHash(txHash) + tx, isPending, err := client.TransactionByHash(context.Background(), hash) + if err != nil { + return fmt.Errorf("tx not found on chain %s , %d", err.Error(), chain.ChainId) + } + if isPending { + return fmt.Errorf("tx is still pending") + } + + for _, chainCoreParams := range coreParams { + if chainCoreParams.ChainId == chainID { + ob.WithParams(observertypes.CoreParams{ + ChainId: chainID, + ConnectorContractAddress: chainCoreParams.ConnectorContractAddress, + ZetaTokenContractAddress: chainCoreParams.ZetaTokenContractAddress, + Erc20CustodyContractAddress: chainCoreParams.Erc20CustodyContractAddress, + }) + cfg.EVMChainConfigs[chainID].ZetaTokenContractAddress = chainCoreParams.ZetaTokenContractAddress + ob.SetConfig(cfg) + if strings.EqualFold(tx.To().Hex(), chainCoreParams.ConnectorContractAddress) { + coinType = common.CoinType_Zeta + } else if strings.EqualFold(tx.To().Hex(), chainCoreParams.Erc20CustodyContractAddress) { + coinType = common.CoinType_ERC20 + } else if strings.EqualFold(tx.To().Hex(), tssEthAddress) { + coinType = common.CoinType_Gas + } + + } + } + + switch coinType { + case common.CoinType_Zeta: + ballotIdentifier, err = ob.CheckReceiptForCoinTypeZeta(txHash, false) + if err != nil { + return err + } + + case common.CoinType_ERC20: + ballotIdentifier, err = ob.CheckReceiptForCoinTypeERC20(txHash, false) + if err != nil { + return err + } + + case common.CoinType_Gas: + ballotIdentifier, err = ob.CheckReceiptForCoinTypeGas(txHash, false) + if err != nil { + return err + } + default: + fmt.Println("CoinType not detected") + } + fmt.Println("CoinType : ", coinType) + } else if common.IsBitcoinChain(chain.ChainId) { + obBtc := zetaclient.BitcoinChainClient{ + Mu: &sync.Mutex{}, + } + obBtc.WithZetaClient(bridge) + obBtc.WithLogger(chainLogger) + obBtc.WithChain(*common.GetChainFromChainID(chainID)) + connCfg := &rpcclient.ConnConfig{ + Host: cfg.BitcoinConfig.RPCHost, + User: cfg.BitcoinConfig.RPCUsername, + Pass: cfg.BitcoinConfig.RPCPassword, + HTTPPostMode: true, + DisableTLS: true, + Params: cfg.BitcoinConfig.RPCParams, + } + + btcClient, err := rpcclient.New(connCfg, nil) + if err != nil { + return err + } + obBtc.WithBtcClient(btcClient) + ballotIdentifier, err = obBtc.CheckReceiptForBtcTxHash(txHash, false) + if err != nil { + return err + } + + } + fmt.Println("BallotIdentifier : ", ballotIdentifier) + + ballot, err := bridge.GetBallot(ballotIdentifier) + if err != nil { + return err + } + + for _, vote := range ballot.Voters { + fmt.Printf("%s : %s \n", vote.VoterAddress, vote.VoteType) + } + fmt.Println("BallotStatus : ", ballot.BallotStatus) + + return nil + }, + } + + return cmd +} diff --git a/common/chain.go b/common/chain.go index c0286a1f8d..63cb26b213 100644 --- a/common/chain.go +++ b/common/chain.go @@ -106,6 +106,11 @@ func (chain Chain) IsKlaytnChain() bool { return chain.ChainId == 1001 } +// SupportMerkleProof returns true if the chain supports block header-based verification +func (chain Chain) SupportMerkleProof() bool { + return IsEVMChain(chain.ChainId) || IsBitcoinChain(chain.ChainId) +} + func IsBitcoinChain(chainID int64) bool { return chainID == 18444 || // regtest chainID == 18332 || //testnet diff --git a/common/coin.go b/common/coin.go index b47cbeed9b..4c875d97bb 100644 --- a/common/coin.go +++ b/common/coin.go @@ -1,5 +1,18 @@ package common -const ( - ZETADenom = "azeta" +import ( + "fmt" + "strconv" ) + +func GetCoinType(coin string) (CoinType, error) { + coinInt, err := strconv.ParseInt(coin, 10, 32) + if err != nil { + return CoinType_Cmd, err + } + if coinInt < 0 || coinInt > 3 { + return CoinType_Cmd, fmt.Errorf("invalid coin type %d", coinInt) + } + // #nosec G701 always in range + return CoinType(coinInt), nil +} diff --git a/common/default_chains_mainnet.go b/common/default_chains_mainnet.go index e870103232..3b80f2a89e 100644 --- a/common/default_chains_mainnet.go +++ b/common/default_chains_mainnet.go @@ -35,6 +35,10 @@ func BtcChainID() int64 { return BtcMainnetChain().ChainId } +func BtcDustOffset() int64 { + return 0 +} + func PolygonChain() Chain { return Chain{ ChainName: ChainName_polygon_mainnet, diff --git a/common/default_chains_mock_mainnet.go b/common/default_chains_mock_mainnet.go index 0b131f432a..7400f48779 100644 --- a/common/default_chains_mock_mainnet.go +++ b/common/default_chains_mock_mainnet.go @@ -35,6 +35,10 @@ func BtcChainID() int64 { return BtcMainnetChain().ChainId } +func BtcDustOffset() int64 { + return 2000 +} + func PolygonChain() Chain { return Chain{ ChainName: ChainName_polygon_mainnet, diff --git a/common/default_chains_privnet.go b/common/default_chains_privnet.go index e6a0bb80a1..c3cefa0ed4 100644 --- a/common/default_chains_privnet.go +++ b/common/default_chains_privnet.go @@ -28,6 +28,10 @@ func BtcChainID() int64 { return BtcRegtestChain().ChainId } +func BtcDustOffset() int64 { + return 2000 +} + func DefaultChainsList() []*Chain { chains := []Chain{ BtcRegtestChain(), diff --git a/common/default_chains_testnet.go b/common/default_chains_testnet.go index 8220d53ac5..86ed783c0d 100644 --- a/common/default_chains_testnet.go +++ b/common/default_chains_testnet.go @@ -35,6 +35,10 @@ func BtcChainID() int64 { return BtcTestNetChain().ChainId } +func BtcDustOffset() int64 { + return 2000 +} + func MumbaiChain() Chain { return Chain{ ChainName: ChainName_mumbai_testnet, diff --git a/common/headers_test.go b/common/headers_test.go index 96d058cf71..ecef7f6f8a 100644 --- a/common/headers_test.go +++ b/common/headers_test.go @@ -4,7 +4,6 @@ import ( "bytes" "encoding/base64" "fmt" - "log" "testing" "time" @@ -26,7 +25,7 @@ func TestTrueBitcoinHeader(t *testing.T) { // Deserialize the header bytes from base64 headerBytes, err := base64.StdEncoding.DecodeString(b.HeaderBase64) require.NoError(t, err) - header := unmarshalHeader(headerBytes) + header := unmarshalHeader(t, headerBytes) // Validate validateTrueBitcoinHeader(t, header, headerBytes) @@ -40,7 +39,7 @@ func TestFakeBitcoinHeader(t *testing.T) { // Deserialize the header bytes from base64 headerBytes, err := base64.StdEncoding.DecodeString(b.HeaderBase64) require.NoError(t, err) - header := unmarshalHeader(headerBytes) + header := unmarshalHeader(t, headerBytes) // Validate validateFakeBitcoinHeader(t, header, headerBytes) @@ -60,7 +59,7 @@ func BitcoinHeaderValidationLiveTest(t *testing.T) { // Get the block header header, err := client.GetBlockHeader(blockHash) require.NoError(t, err) - headerBytes := marshalHeader(header) + headerBytes := marshalHeader(t, header) // Validate true header validateTrueBitcoinHeader(t, header, headerBytes) @@ -101,21 +100,17 @@ func copyHeader(header *wire.BlockHeader) *wire.BlockHeader { return copyHeader } -func marshalHeader(header *wire.BlockHeader) []byte { +func marshalHeader(t *testing.T, header *wire.BlockHeader) []byte { var headerBuf bytes.Buffer err := header.Serialize(&headerBuf) - if err != nil { - log.Fatal(err) - } + require.NoError(t, err) return headerBuf.Bytes() } -func unmarshalHeader(headerBytes []byte) *wire.BlockHeader { +func unmarshalHeader(t *testing.T, headerBytes []byte) *wire.BlockHeader { var header wire.BlockHeader err := header.Deserialize(bytes.NewReader(headerBytes)) - if err != nil { - log.Fatal(err) - } + require.NoError(t, err) return &header } @@ -136,52 +131,40 @@ func validateFakeBitcoinHeader(t *testing.T, header *wire.BlockHeader, headerByt // Incorrect header length should fail validation err := common.ValidateBitcoinHeader(headerBytes[:79], blockHash[:], 18332) - if err == nil { - t.Error("Incorrect header length should fail validation") - } + require.Error(t, err) // Incorrect version should fail validation fakeHeader := copyHeader(header) fakeHeader.Version = 0 - fakeBytes := marshalHeader(fakeHeader) + fakeBytes := marshalHeader(t, fakeHeader) fakeHash := fakeHeader.BlockHash() err = common.ValidateBitcoinHeader(fakeBytes, fakeHash[:], 18332) - if err == nil { - t.Error("Incorrect version should fail validation") - } + require.Error(t, err) // Incorrect timestamp should fail validation // Case1: timestamp is before genesis block fakeHeader = copyHeader(header) fakeHeader.Timestamp = chaincfg.TestNet3Params.GenesisBlock.Header.Timestamp.Add(-time.Second) - fakeBytes = marshalHeader(fakeHeader) + fakeBytes = marshalHeader(t, fakeHeader) fakeHash = fakeHeader.BlockHash() err = common.ValidateBitcoinHeader(fakeBytes, fakeHash[:], 18332) - if err == nil { - t.Error("Timestamp before genesis should fail validation") - } + require.Error(t, err) // Case2: timestamp is after 2 hours in the future fakeHeader = copyHeader(header) fakeHeader.Timestamp = header.Timestamp.Add(time.Second * (blockchain.MaxTimeOffsetSeconds + 1)) - fakeBytes = marshalHeader(fakeHeader) + fakeBytes = marshalHeader(t, fakeHeader) err = common.NewBitcoinHeader(fakeBytes).ValidateTimestamp(header.Timestamp) - if err == nil { - t.Error("Timestamp in future should fail validation") - } + require.Error(t, err) // Incorrect block hash should fail validation fakeHeader = copyHeader(header) header.Nonce = 0 - fakeBytes = marshalHeader(header) + fakeBytes = marshalHeader(t, header) err = common.ValidateBitcoinHeader(fakeBytes, blockHash[:], 18332) - if err == nil { - t.Error("Incorrect block hash should fail validation") - } + require.Error(t, err) // PoW not satisfied should fail validation fakeHash = fakeHeader.BlockHash() err = common.ValidateBitcoinHeader(fakeBytes, fakeHash[:], 18332) - if err == nil { - t.Error("PoW not satisfied should fail validation") - } + require.Error(t, err) } diff --git a/common/proof_test.go b/common/proof_test.go index 6e6fd0a588..9f3f958504 100644 --- a/common/proof_test.go +++ b/common/proof_test.go @@ -5,12 +5,10 @@ import ( "os" "testing" - "bytes" "encoding/base64" "encoding/hex" "encoding/json" "fmt" - "log" "github.com/stretchr/testify/require" "github.com/zeta-chain/zetacore/common" @@ -65,7 +63,7 @@ func TestBitcoinMerkleProof(t *testing.T) { // Deserialize the header bytes from base64 headerBytes, err := base64.StdEncoding.DecodeString(b.HeaderBase64) require.NoError(t, err) - header := unmarshalHeader(headerBytes) + header := unmarshalHeader(t, headerBytes) // Deserialize the block bytes from base64 blockBytes, err := base64.StdEncoding.DecodeString(b.BlockBase64) @@ -93,7 +91,7 @@ func BitcoinMerkleProofLiveTest(t *testing.T) { // Get the block header header, err := client.GetBlockHeader(blockHash) require.NoError(t, err) - headerBytes := marshalHeader(header) + headerBytes := marshalHeader(t, header) target := blockchain.CompactToBig(header.Bits) // Get the block with verbose transactions @@ -113,13 +111,9 @@ func validateBitcoinBlock(t *testing.T, header *wire.BlockHeader, headerBytes [] txBodies := [][]byte{} for _, res := range blockVerbose.Tx { txBytes, err := hex.DecodeString(res.Hex) - if err != nil { - log.Fatalf("error decoding transaction hex: %v", err) - } + require.NoError(t, err) tx, err := btcutil.NewTxFromBytes(txBytes) - if err != nil { - log.Fatalf("error deserializing transaction: %v", err) - } + require.NoError(t, err) // Validate Tss SegWit transaction if it's an outTx if res.Txid == outTxid { @@ -128,7 +122,7 @@ func validateBitcoinBlock(t *testing.T, header *wire.BlockHeader, headerBytes [] Nonce: nonce, TxHash: outTxid, } - err = keeper.ValidateBTCOutTxBody(msg, txBytes, tssAddress) + err = keeper.VerifyBTCOutTxBody(msg, txBytes, tssAddress) require.NoError(t, err) } txns = append(txns, tx) @@ -139,26 +133,19 @@ func validateBitcoinBlock(t *testing.T, header *wire.BlockHeader, headerBytes [] mk := bitcoin.NewMerkle(txns) for i := range txns { path, index, err := mk.BuildMerkleProof(i) - if err != nil { - log.Fatalf("Error building merkle proof: %v", err) - } + require.NoError(t, err) // True proof should verify proof := common.NewBitcoinProof(txBodies[i], path, index) txBytes, err := proof.Verify(common.NewBitcoinHeader(headerBytes), 0) - if err != nil { - log.Fatal("Merkle proof verification failed") - } - if !bytes.Equal(txBytes, txBodies[i]) { - log.Fatalf("Transaction body mismatch") - } + require.NoError(t, err) + require.Equal(t, txBytes, txBodies[i]) // Fake proof should not verify fakeIndex := index ^ 0xffffffff // flip all bits fakeProof := common.NewBitcoinProof(txBodies[i], path, fakeIndex) txBytes, err = fakeProof.Verify(common.NewBitcoinHeader(headerBytes), 0) - if err == nil || txBytes != nil { - log.Fatalf("Merkle proof should not verify") - } + require.Error(t, err) + require.Nil(t, txBytes) } } diff --git a/common/utils.go b/common/utils.go index 80f6701736..773c709210 100644 --- a/common/utils.go +++ b/common/utils.go @@ -8,14 +8,10 @@ import ( ethcommon "github.com/ethereum/go-ethereum/common" ) -const ( - DustUTXOOffset = 2000 -) - // A very special value to mark current nonce in UTXO func NonceMarkAmount(nonce uint64) int64 { // #nosec G701 always in range - return int64(nonce) + DustUTXOOffset // +2000 to avoid being a dust rejection + return int64(nonce) + BtcDustOffset() // +2000 to avoid being a dust rejection } // HashToString convert hash bytes to string diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index ae13471986..c53284398a 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -26947,6 +26947,83 @@ paths: type: string tags: - Query + /zeta-chain/crosschain/inTxTrackerByChain/{chain_id}: + get: + operationId: Query_InTxTrackerAllByChain + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/crosschainQueryAllInTxTrackerByChainResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: chain_id + in: path + required: true + type: string + format: int64 + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: |- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: |- + limit is the total number of results to be returned in the result page. + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: |- + count_total is set to true to indicate that the result set should include + a count of the total number of items available for pagination in UIs. + count_total is only respected when offset is used. It is ignored when key + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: |- + reverse is set to true if results are to be returned in the descending order. + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /zeta-chain/crosschain/inTxTrackers: + get: + operationId: Query_InTxTrackerAll + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/crosschainQueryAllInTxTrackersResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query /zeta-chain/crosschain/lastBlockHeight: get: summary: Queries a list of lastBlockHeight items. @@ -50474,6 +50551,16 @@ definitions: type: array items: type: string + crosschainInTxTracker: + type: object + properties: + chain_id: + type: string + format: int64 + tx_hash: + type: string + coin_type: + $ref: '#/definitions/commonCoinType' crosschainInboundTxParams: type: object properties: @@ -50518,6 +50605,8 @@ definitions: lastReceiveHeight: type: string format: uint64 + crosschainMsgAddToInTxTrackerResponse: + type: object crosschainMsgAddToOutTxTrackerResponse: type: object crosschainMsgCreateTSSVoterResponse: @@ -50665,6 +50754,24 @@ definitions: $ref: '#/definitions/crosschainInTxHashToCctx' pagination: $ref: '#/definitions/v1beta1PageResponse' + crosschainQueryAllInTxTrackerByChainResponse: + type: object + properties: + inTxTracker: + type: array + items: + type: object + $ref: '#/definitions/crosschainInTxTracker' + pagination: + $ref: '#/definitions/v1beta1PageResponse' + crosschainQueryAllInTxTrackersResponse: + type: object + properties: + inTxTracker: + type: array + items: + type: object + $ref: '#/definitions/crosschainInTxTracker' crosschainQueryAllLastBlockHeightResponse: type: object properties: @@ -50992,6 +51099,13 @@ definitions: items: type: object $ref: '#/definitions/observerNode' + observerBlockHeaderVerificationFlags: + type: object + properties: + isEthTypeChainEnabled: + type: boolean + isBtcTypeChainEnabled: + type: boolean observerCoreParams: type: object properties: @@ -51042,6 +51156,8 @@ definitions: type: boolean gasPriceIncreaseFlags: $ref: '#/definitions/observerGasPriceIncreaseFlags' + blockHeaderVerificationFlags: + $ref: '#/definitions/observerBlockHeaderVerificationFlags' observerGasPriceIncreaseFlags: type: object properties: diff --git a/docs/spec/crosschain/messages.md b/docs/spec/crosschain/messages.md index a42024e82e..7ad44e674e 100644 --- a/docs/spec/crosschain/messages.md +++ b/docs/spec/crosschain/messages.md @@ -3,7 +3,7 @@ ## MsgAddToOutTxTracker AddToOutTxTracker adds a new record to the outbound transaction tracker. -only the admin policy account and the observer validators are authorized to broadcast this message. +only the admin policy account and the observer validators are authorized to broadcast this message without proof. ```proto message MsgAddToOutTxTracker { @@ -17,6 +17,22 @@ message MsgAddToOutTxTracker { } ``` +## MsgAddToInTxTracker + +TODO https://github.com/zeta-chain/node/issues/1269 + +```proto +message MsgAddToInTxTracker { + string creator = 1; + int64 chain_id = 2; + string tx_hash = 3; + common.CoinType coin_type = 4; + common.Proof proof = 5; + string block_hash = 6; + int64 tx_index = 7; +} +``` + ## MsgRemoveFromOutTxTracker RemoveFromOutTxTracker removes a record from the outbound transaction tracker by chain ID and nonce. diff --git a/docs/spec/observer/messages.md b/docs/spec/observer/messages.md index 5373e16993..3f7f4cc5d9 100644 --- a/docs/spec/observer/messages.md +++ b/docs/spec/observer/messages.md @@ -52,6 +52,7 @@ message MsgUpdateCrosschainFlags { bool isInboundEnabled = 3; bool isOutboundEnabled = 4; GasPriceIncreaseFlags gasPriceIncreaseFlags = 5; + BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6; } ``` diff --git a/proto/crosschain/genesis.proto b/proto/crosschain/genesis.proto index e86cf6d073..c62d228d0b 100644 --- a/proto/crosschain/genesis.proto +++ b/proto/crosschain/genesis.proto @@ -5,6 +5,7 @@ import "crosschain/chain_nonces.proto"; import "crosschain/cross_chain_tx.proto"; import "crosschain/gas_price.proto"; import "crosschain/in_tx_hash_to_cctx.proto"; +import "crosschain/in_tx_tracker.proto"; import "crosschain/last_block_height.proto"; import "crosschain/out_tx_tracker.proto"; import "crosschain/params.proto"; @@ -25,4 +26,5 @@ message GenesisState { repeated LastBlockHeight lastBlockHeightList = 8; repeated InTxHashToCctx inTxHashToCctxList = 9 [(gogoproto.nullable) = false]; repeated TSS tss_history = 10 [(gogoproto.nullable) = false]; + repeated InTxTracker in_tx_tracker_list = 11 [(gogoproto.nullable) = false]; } diff --git a/proto/crosschain/in_tx_tracker.proto b/proto/crosschain/in_tx_tracker.proto new file mode 100644 index 0000000000..e0775f7e0c --- /dev/null +++ b/proto/crosschain/in_tx_tracker.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package zetachain.zetacore.crosschain; + +import "common/common.proto"; + +option go_package = "github.com/zeta-chain/zetacore/x/crosschain/types"; + +message InTxTracker { + int64 chain_id = 1; + string tx_hash = 2; + common.CoinType coin_type = 3; +} diff --git a/proto/crosschain/query.proto b/proto/crosschain/query.proto index 9f2c035a4c..e05265258d 100644 --- a/proto/crosschain/query.proto +++ b/proto/crosschain/query.proto @@ -6,6 +6,7 @@ import "crosschain/chain_nonces.proto"; import "crosschain/cross_chain_tx.proto"; import "crosschain/gas_price.proto"; import "crosschain/in_tx_hash_to_cctx.proto"; +import "crosschain/in_tx_tracker.proto"; import "crosschain/last_block_height.proto"; import "crosschain/nonce_to_cctx.proto"; import "crosschain/out_tx_tracker.proto"; @@ -37,6 +38,13 @@ service Query { option (google.api.http).get = "/zeta-chain/crosschain/outTxTrackerByChain/{chain}"; } + rpc InTxTrackerAllByChain(QueryAllInTxTrackerByChainRequest) returns (QueryAllInTxTrackerByChainResponse) { + option (google.api.http).get = "/zeta-chain/crosschain/inTxTrackerByChain/{chain_id}"; + } + rpc InTxTrackerAll(QueryAllInTxTrackersRequest) returns (QueryAllInTxTrackersResponse) { + option (google.api.http).get = "/zeta-chain/crosschain/inTxTrackers"; + } + // Queries a InTxHashToCctx by index. rpc InTxHashToCctx(QueryGetInTxHashToCctxRequest) returns (QueryGetInTxHashToCctxResponse) { option (google.api.http).get = "/zeta-chain/crosschain/inTxHashToCctx/{inTxHash}"; @@ -180,6 +188,22 @@ message QueryAllOutTxTrackerByChainResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryAllInTxTrackerByChainRequest { + int64 chain_id = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +message QueryAllInTxTrackerByChainResponse { + repeated InTxTracker inTxTracker = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryAllInTxTrackersRequest {} + +message QueryAllInTxTrackersResponse { + repeated InTxTracker inTxTracker = 1 [(gogoproto.nullable) = false]; +} + message QueryGetInTxHashToCctxRequest { string inTxHash = 1; } diff --git a/proto/crosschain/tx.proto b/proto/crosschain/tx.proto index 2e3b3a63a6..b34fa2f47d 100644 --- a/proto/crosschain/tx.proto +++ b/proto/crosschain/tx.proto @@ -9,6 +9,7 @@ option go_package = "github.com/zeta-chain/zetacore/x/crosschain/types"; // Msg defines the Msg service. service Msg { rpc AddToOutTxTracker(MsgAddToOutTxTracker) returns (MsgAddToOutTxTrackerResponse); + rpc AddToInTxTracker(MsgAddToInTxTracker) returns (MsgAddToInTxTrackerResponse); rpc RemoveFromOutTxTracker(MsgRemoveFromOutTxTracker) returns (MsgRemoveFromOutTxTrackerResponse); rpc CreateTSSVoter(MsgCreateTSSVoter) returns (MsgCreateTSSVoterResponse); rpc GasPriceVoter(MsgGasPriceVoter) returns (MsgGasPriceVoterResponse); @@ -31,6 +32,17 @@ message MsgMigrateTssFunds { } message MsgMigrateTssFundsResponse {} +message MsgAddToInTxTracker { + string creator = 1; + int64 chain_id = 2; + string tx_hash = 3; + common.CoinType coin_type = 4; + common.Proof proof = 5; + string block_hash = 6; + int64 tx_index = 7; +} +message MsgAddToInTxTrackerResponse {} + message MsgUpdateTssAddress { string creator = 1; string tss_pubkey = 2; diff --git a/proto/observer/crosschain_flags.proto b/proto/observer/crosschain_flags.proto index af52a75f46..32e7ae8669 100644 --- a/proto/observer/crosschain_flags.proto +++ b/proto/observer/crosschain_flags.proto @@ -14,9 +14,20 @@ message GasPriceIncreaseFlags { ]; uint32 gasPriceIncreasePercent = 3; } +message BlockHeaderVerificationFlags { + bool isEthTypeChainEnabled = 1; + bool isBtcTypeChainEnabled = 2; +} message CrosschainFlags { bool isInboundEnabled = 1; bool isOutboundEnabled = 2; GasPriceIncreaseFlags gasPriceIncreaseFlags = 3; + BlockHeaderVerificationFlags blockHeaderVerificationFlags = 4; +} + +message LegacyCrosschainFlags { + bool isInboundEnabled = 1; + bool isOutboundEnabled = 2; + GasPriceIncreaseFlags gasPriceIncreaseFlags = 3; } diff --git a/proto/observer/events.proto b/proto/observer/events.proto index 66fff998f4..88bd20fe39 100644 --- a/proto/observer/events.proto +++ b/proto/observer/events.proto @@ -35,4 +35,5 @@ message EventCrosschainFlagsUpdated { bool isOutboundEnabled = 3; GasPriceIncreaseFlags gasPriceIncreaseFlags = 4; string signer = 5; + BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6; } diff --git a/proto/observer/tx.proto b/proto/observer/tx.proto index 441fa01b8b..7d1fd5e1e2 100644 --- a/proto/observer/tx.proto +++ b/proto/observer/tx.proto @@ -59,6 +59,7 @@ message MsgUpdateCrosschainFlags { bool isInboundEnabled = 3; bool isOutboundEnabled = 4; GasPriceIncreaseFlags gasPriceIncreaseFlags = 5; + BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6; } message MsgUpdateCrosschainFlagsResponse {} diff --git a/testutil/network/genesis_state.go b/testutil/network/genesis_state.go index 047114afe9..334c258746 100644 --- a/testutil/network/genesis_state.go +++ b/testutil/network/genesis_state.go @@ -165,6 +165,16 @@ func AddCrosschainData(t *testing.T, n int, genesisState map[string]json.RawMess state.OutTxTrackerList = append(state.OutTxTrackerList, outTxTracker) } + for i := 0; i < n; i++ { + inTxTracker := types.InTxTracker{ + ChainId: 5, + TxHash: fmt.Sprintf("txHash-%d", i), + CoinType: common.CoinType_Gas, + } + nullify.Fill(&inTxTracker) + state.InTxTrackerList = append(state.InTxTrackerList, inTxTracker) + } + for i := 0; i < n; i++ { inTxHashToCctx := types.InTxHashToCctx{ InTxHash: strconv.Itoa(i), diff --git a/x/crosschain/client/cli/cli_in_tx_tracker.go b/x/crosschain/client/cli/cli_in_tx_tracker.go new file mode 100644 index 0000000000..764127a900 --- /dev/null +++ b/x/crosschain/client/cli/cli_in_tx_tracker.go @@ -0,0 +1,104 @@ +package cli + +import ( + "context" + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func CmdAddToInTxTracker() *cobra.Command { + cmd := &cobra.Command{ + Use: "add-to-in-tx-tracker [chain-id] [tx-hash] [coin-type]", + Short: `Add a in-tx-tracker + Use 0:Zeta,1:Gas,2:ERC20`, + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argChain, err := strconv.ParseInt(args[0], 10, 64) + if err != nil { + return err + } + argTxHash := args[1] + argsCoinType, err := common.GetCoinType(args[2]) + if err != nil { + return err + } + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgAddToInTxTracker( + clientCtx.GetFromAddress().String(), + argChain, + argsCoinType, + argTxHash, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func CmdListInTxTrackerByChain() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-in-tx-tracker [chainId]", + Short: "shows a list of in tx tracker by chainId", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + argChain, err := strconv.ParseInt(args[0], 10, 64) + if err != nil { + return err + } + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + params := &types.QueryAllInTxTrackerByChainRequest{ + ChainId: argChain, + Pagination: pageReq, + } + res, err := queryClient.InTxTrackerAllByChain(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + return cmd +} + +func CmdListInTxTrackers() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-all-in-tx-trackers", + Short: "shows all inTxTrackers", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + params := &types.QueryAllInTxTrackersRequest{} + res, err := queryClient.InTxTrackerAll(context.Background(), params) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/crosschain/client/cli/query.go b/x/crosschain/client/cli/query.go index fe4ac3dc4c..21b112a621 100644 --- a/x/crosschain/client/cli/query.go +++ b/x/crosschain/client/cli/query.go @@ -44,6 +44,8 @@ func GetQueryCmd(_ string) *cobra.Command { CmdListTssHistory(), CmdListPendingNonces(), CmdPendingCctx(), + CmdListInTxTrackerByChain(), + CmdListInTxTrackers(), ) return cmd diff --git a/x/crosschain/client/cli/tx.go b/x/crosschain/client/cli/tx.go index 27a0c03af8..868ff07549 100644 --- a/x/crosschain/client/cli/tx.go +++ b/x/crosschain/client/cli/tx.go @@ -30,6 +30,7 @@ func GetTxCmd() *cobra.Command { CmdRemoveFromWatchList(), CmdUpdateTss(), CmdMigrateTssFunds(), + CmdAddToInTxTracker(), ) return cmd diff --git a/x/crosschain/client/querytests/in_tx_tracker.go b/x/crosschain/client/querytests/in_tx_tracker.go new file mode 100644 index 0000000000..15c34b3bda --- /dev/null +++ b/x/crosschain/client/querytests/in_tx_tracker.go @@ -0,0 +1,103 @@ +package querytests + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + tmcli "github.com/tendermint/tendermint/libs/cli" + "github.com/zeta-chain/zetacore/testutil/nullify" + "github.com/zeta-chain/zetacore/x/crosschain/client/cli" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func (s *CliTestSuite) TestListInTxTrackers() { + ctx := s.network.Validators[0].ClientCtx + objs := s.crosschainState.InTxTrackerList + s.Run("List all trackers", func() { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListInTxTrackers(), args) + s.Require().NoError(err) + var resp types.QueryAllInTxTrackersResponse + s.Require().NoError(s.network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + s.Require().Equal(len(objs), len(resp.InTxTracker)) + s.Require().ElementsMatch(nullify.Fill(objs), nullify.Fill(resp.InTxTracker)) + }) +} + +func (s *CliTestSuite) TestListInTxTrackersByChain() { + ctx := s.network.Validators[0].ClientCtx + objs := s.crosschainState.InTxTrackerList + request := func(next []byte, offset, limit uint64, total bool, chainID int) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + args = append(args, fmt.Sprintf("%d", chainID)) + return args + } + s.Run("ByOffset", func() { + step := 2 + for i := 0; i < len(objs); i += step { + // #nosec G701 always positive + args := request(nil, uint64(i), uint64(step), false, 5) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListInTxTrackerByChain(), args) + s.Require().NoError(err) + var resp types.QueryAllInTxTrackerByChainResponse + s.Require().NoError(s.network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + s.Require().LessOrEqual(len(resp.InTxTracker), step) + s.Require().Subset(nullify.Fill(objs), + nullify.Fill(resp.InTxTracker), + ) + } + }) + s.Run("ByKey", func() { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + // #nosec G701 always positive + args := request(next, 0, uint64(step), false, 5) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListInTxTrackerByChain(), args) + s.Require().NoError(err) + var resp types.QueryAllInTxTrackerByChainResponse + s.Require().NoError(s.network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + s.Require().LessOrEqual(len(resp.InTxTracker), step) + s.Require().Subset( + nullify.Fill(objs), + nullify.Fill(resp.InTxTracker), + ) + next = resp.Pagination.NextKey + } + }) + s.Run("Total", func() { + args := request(nil, 0, uint64(len(objs)), true, 5) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListInTxTrackerByChain(), args) + s.Require().NoError(err) + var resp types.QueryAllInTxTrackerByChainResponse + s.Require().NoError(s.network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + s.Require().NoError(err) + s.Require().Equal(uint64(len(objs)), resp.Pagination.Total) + s.Require().ElementsMatch(nullify.Fill(objs), + nullify.Fill(resp.InTxTracker), + ) + }) + s.Run("Incorrect Chain ID ", func() { + args := request(nil, 0, uint64(len(objs)), true, 15) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListInTxTrackerByChain(), args) + s.Require().NoError(err) + var resp types.QueryAllInTxTrackerByChainResponse + s.Require().NoError(s.network.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + s.Require().NoError(err) + s.Require().Equal(uint64(0), resp.Pagination.Total) + }) +} diff --git a/x/crosschain/genesis.go b/x/crosschain/genesis.go index f6b6a910dd..e1d77b1c02 100644 --- a/x/crosschain/genesis.go +++ b/x/crosschain/genesis.go @@ -18,6 +18,11 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.SetOutTxTracker(ctx, elem) } + // Set all the inTxTracker + for _, elem := range genState.InTxTrackerList { + k.SetInTxTracker(ctx, elem) + } + // Set all the inTxHashToCctx for _, elem := range genState.InTxHashToCctxList { k.SetInTxHashToCctx(ctx, elem) @@ -76,6 +81,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.Params = k.GetParams(ctx) genesis.OutTxTrackerList = k.GetAllOutTxTracker(ctx) genesis.InTxHashToCctxList = k.GetAllInTxHashToCctx(ctx) + genesis.InTxTrackerList = k.GetAllInTxTracker(ctx) // Get tss tss, found := k.GetTSS(ctx) diff --git a/x/crosschain/keeper/grpc_query_in_tx_tracker.go b/x/crosschain/keeper/grpc_query_in_tx_tracker.go new file mode 100644 index 0000000000..ccdaa92e3d --- /dev/null +++ b/x/crosschain/keeper/grpc_query_in_tx_tracker.go @@ -0,0 +1,28 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/zeta-chain/zetacore/x/crosschain/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) InTxTrackerAllByChain(goCtx context.Context, request *types.QueryAllInTxTrackerByChainRequest) (*types.QueryAllInTxTrackerByChainResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + var inTxTrackers []types.InTxTracker + inTxTrackers, pageRes, err := k.GetAllInTxTrackerForChainPaginated(ctx, request.ChainId, request.Pagination) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + return &types.QueryAllInTxTrackerByChainResponse{InTxTracker: inTxTrackers, Pagination: pageRes}, nil +} + +func (k Keeper) InTxTrackerAll(goCtx context.Context, _ *types.QueryAllInTxTrackersRequest) (*types.QueryAllInTxTrackersResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + var inTxTrackers []types.InTxTracker + inTxTrackers = k.GetAllInTxTracker(ctx) + return &types.QueryAllInTxTrackersResponse{InTxTracker: inTxTrackers}, nil +} diff --git a/x/crosschain/keeper/in_tx_tracker.go b/x/crosschain/keeper/in_tx_tracker.go new file mode 100644 index 0000000000..0957cb2162 --- /dev/null +++ b/x/crosschain/keeper/in_tx_tracker.go @@ -0,0 +1,79 @@ +package keeper + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func getInTrackerKey(chainID int64, txHash string) string { + return fmt.Sprintf("%d-%s", chainID, txHash) +} + +// SetInTxTracker set a specific InTxTracker in the store from its index +func (k Keeper) SetInTxTracker(ctx sdk.Context, InTxTracker types.InTxTracker) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InTxTrackerKeyPrefix)) + b := k.cdc.MustMarshal(&InTxTracker) + key := types.KeyPrefix(getInTrackerKey(InTxTracker.ChainId, InTxTracker.TxHash)) + store.Set(key, b) +} + +// GetInTxTracker returns a InTxTracker from its index +func (k Keeper) GetInTxTracker(ctx sdk.Context, chainID int64, txHash string) (val types.InTxTracker, found bool) { + key := getInTrackerKey(chainID, txHash) + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InTxTrackerKeyPrefix)) + b := store.Get(types.KeyPrefix(key)) + if b == nil { + return val, false + } + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +func (k Keeper) RemoveInTxTrackerIfExists(ctx sdk.Context, chainID int64, txHash string) { + key := getInTrackerKey(chainID, txHash) + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InTxTrackerKeyPrefix)) + if store.Has(types.KeyPrefix(key)) { + store.Delete(types.KeyPrefix(key)) + } +} +func (k Keeper) GetAllInTxTracker(ctx sdk.Context) (list []types.InTxTracker) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InTxTrackerKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var val types.InTxTracker + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + return list +} + +func (k Keeper) GetAllInTxTrackerForChain(ctx sdk.Context, chainID int64) (list []types.InTxTracker) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.InTxTrackerKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte(fmt.Sprintf("%d-", chainID))) + defer iterator.Close() + for ; iterator.Valid(); iterator.Next() { + var val types.InTxTracker + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + return list +} + +func (k Keeper) GetAllInTxTrackerForChainPaginated(ctx sdk.Context, chainID int64, pagination *query.PageRequest) (inTxTrackers []types.InTxTracker, pageRes *query.PageResponse, err error) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(fmt.Sprintf("%s", types.InTxTrackerKeyPrefix))) + chainStore := prefix.NewStore(store, types.KeyPrefix(fmt.Sprintf("%d-", chainID))) + pageRes, err = query.Paginate(chainStore, pagination, func(key []byte, value []byte) error { + var inTxTracker types.InTxTracker + if err := k.cdc.Unmarshal(value, &inTxTracker); err != nil { + return err + } + inTxTrackers = append(inTxTrackers, inTxTracker) + return nil + }) + return +} diff --git a/x/crosschain/keeper/in_tx_tracker_test.go b/x/crosschain/keeper/in_tx_tracker_test.go new file mode 100644 index 0000000000..c16deeb819 --- /dev/null +++ b/x/crosschain/keeper/in_tx_tracker_test.go @@ -0,0 +1,78 @@ +package keeper + +import ( + "fmt" + "sort" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/testutil/nullify" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func createNInTxTracker(keeper *Keeper, ctx sdk.Context, n int, chainID int64) []types.InTxTracker { + items := make([]types.InTxTracker, n) + for i := range items { + items[i].TxHash = fmt.Sprintf("TxHash-%d", i) + items[i].ChainId = chainID + items[i].CoinType = common.CoinType_Gas + keeper.SetInTxTracker(ctx, items[i]) + } + return items +} +func TestKeeper_GetAllInTxTrackerForChain(t *testing.T) { + keeper, ctx := setupKeeper(t) + intxTrackers := createNInTxTracker(keeper, ctx, 10, 5) + t.Run("Get InTx trackers one by one", func(t *testing.T) { + for _, item := range intxTrackers { + rst, found := keeper.GetInTxTracker(ctx, item.ChainId, item.TxHash) + require.True(t, found) + require.Equal(t, item, rst) + } + }) + t.Run("Get all InTx trackers", func(t *testing.T) { + rst := keeper.GetAllInTxTracker(ctx) + require.Equal(t, intxTrackers, rst) + }) + t.Run("Get all InTx trackers for chain", func(t *testing.T) { + intxTrackersNew := createNInTxTracker(keeper, ctx, 100, 6) + rst := keeper.GetAllInTxTrackerForChain(ctx, 6) + sort.SliceStable(rst, func(i, j int) bool { + return rst[i].TxHash < rst[j].TxHash + }) + sort.SliceStable(intxTrackersNew, func(i, j int) bool { + return intxTrackersNew[i].TxHash < intxTrackersNew[j].TxHash + }) + require.Equal(t, intxTrackersNew, rst) + }) + t.Run("Get all InTx trackers for chain paginated by limit", func(t *testing.T) { + intxTrackers = createNInTxTracker(keeper, ctx, 100, 6) + rst, pageRes, err := keeper.GetAllInTxTrackerForChainPaginated(ctx, 6, &query.PageRequest{Limit: 10, CountTotal: true}) + require.NoError(t, err) + require.Subset(t, nullify.Fill(intxTrackers), nullify.Fill(rst)) + require.Equal(t, len(intxTrackers), int(pageRes.Total)) + }) + t.Run("Get all InTx trackers for chain paginated by offset", func(t *testing.T) { + intxTrackers = createNInTxTracker(keeper, ctx, 100, 6) + rst, pageRes, err := keeper.GetAllInTxTrackerForChainPaginated(ctx, 6, &query.PageRequest{Offset: 10, CountTotal: true}) + require.NoError(t, err) + require.Subset(t, nullify.Fill(intxTrackers), nullify.Fill(rst)) + require.Equal(t, len(intxTrackers), int(pageRes.Total)) + }) + t.Run("Delete InTxTracker", func(t *testing.T) { + trackers := keeper.GetAllInTxTracker(ctx) + for _, item := range trackers { + keeper.RemoveInTxTrackerIfExists(ctx, item.ChainId, item.TxHash) + } + + intxTrackers = createNInTxTracker(keeper, ctx, 10, 6) + for _, item := range intxTrackers { + keeper.RemoveInTxTrackerIfExists(ctx, item.ChainId, item.TxHash) + } + rst := keeper.GetAllInTxTrackerForChain(ctx, 6) + require.Equal(t, 0, len(rst)) + }) +} diff --git a/x/crosschain/keeper/keeper_cross_chain_tx_vote_inbound_tx.go b/x/crosschain/keeper/keeper_cross_chain_tx_vote_inbound_tx.go index a384c320ba..ac82cd022f 100644 --- a/x/crosschain/keeper/keeper_cross_chain_tx_vote_inbound_tx.go +++ b/x/crosschain/keeper/keeper_cross_chain_tx_vote_inbound_tx.go @@ -124,6 +124,7 @@ func (k msgServer) VoteOnObservedInboundTx(goCtx context.Context, msg *types.Msg EmitEventInboundFinalized(ctx, &cctx) // #nosec G701 always positive cctx.InboundTxParams.InboundTxFinalizedZetaHeight = uint64(ctx.BlockHeight()) + k.RemoveInTxTrackerIfExists(ctx, cctx.InboundTxParams.SenderChainId, cctx.InboundTxParams.InboundTxObservedHash) k.SetCctxAndNonceToCctxAndInTxHashToCctx(ctx, cctx) }() // FinalizeInbound updates CCTX Prices and Nonce diff --git a/x/crosschain/keeper/keeper_out_tx_tracker.go b/x/crosschain/keeper/keeper_out_tx_tracker.go index 308f4c13b0..1be2b0e8a4 100644 --- a/x/crosschain/keeper/keeper_out_tx_tracker.go +++ b/x/crosschain/keeper/keeper_out_tx_tracker.go @@ -3,22 +3,12 @@ package keeper import ( "context" "fmt" - "math/big" - "strings" - cosmoserrors "cosmossdk.io/errors" - - "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcutil" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - eth "github.com/ethereum/go-ethereum/common" - ethtypes "github.com/ethereum/go-ethereum/core/types" - "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" - "github.com/zeta-chain/zetacore/zetaclient/config" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -162,177 +152,6 @@ func (k Keeper) OutTxTracker(c context.Context, req *types.QueryGetOutTxTrackerR // Messages -// AddToOutTxTracker adds a new record to the outbound transaction tracker. -// only the admin policy account and the observer validators are authorized to broadcast this message. -func (k msgServer) AddToOutTxTracker(goCtx context.Context, msg *types.MsgAddToOutTxTracker) (*types.MsgAddToOutTxTrackerResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - chain := k.zetaObserverKeeper.GetParams(ctx).GetChainFromChainID(msg.ChainId) - if chain == nil { - return nil, observertypes.ErrSupportedChains - } - - if msg.Proof == nil { // without proof, only certain accounts can send this message - adminPolicyAccount := k.zetaObserverKeeper.GetParams(ctx).GetAdminPolicyAccount(observertypes.Policy_Type_group1) - isAdmin := msg.Creator == adminPolicyAccount - - isObserver := k.zetaObserverKeeper.IsAuthorized(ctx, msg.Creator, chain) - - // Sender needs to be either the admin policy account or an observer - if !(isAdmin || isObserver) { - return nil, cosmoserrors.Wrap(observertypes.ErrNotAuthorized, fmt.Sprintf("Creator %s", msg.Creator)) - } - } - - proven := false - if msg.Proof != nil { - blockHash, err := common.StringToHash(msg.ChainId, msg.BlockHash) - if err != nil { - return nil, cosmoserrors.Wrap(err, "block hash conversion failed") - } - res, found := k.zetaObserverKeeper.GetBlockHeader(ctx, blockHash) - if !found { - return nil, cosmoserrors.Wrap(observertypes.ErrBlockHeaderNotFound, fmt.Sprintf("block header not found %s", msg.BlockHash)) - } - - // verify outTx merkle proof - txBytes, err := msg.Proof.Verify(res.Header, int(msg.TxIndex)) - if err != nil && !common.IsErrorInvalidProof(err) { - return nil, err - } - if err == nil { - tss, err := k.GetTssAddress(ctx, &types.QueryGetTssAddressRequest{}) - if err != nil { - return nil, err - } - // verify outTx transaction body - if common.IsEVMChain(msg.ChainId) { - err = ValidateEVMOutTxBody(msg, txBytes, tss.Eth) - } else if common.IsBitcoinChain(msg.ChainId) { - err = ValidateBTCOutTxBody(msg, txBytes, tss.Btc) - } else { - return nil, fmt.Errorf("unsupported chain id %d", msg.ChainId) - } - if err != nil { - return nil, err - } - } - - if !proven { - return nil, fmt.Errorf("proof failed") - } - } - - tracker, found := k.GetOutTxTracker(ctx, msg.ChainId, msg.Nonce) - hash := types.TxHashList{ - TxHash: msg.TxHash, - TxSigner: msg.Creator, - } - if !found { - k.SetOutTxTracker(ctx, types.OutTxTracker{ - Index: "", - ChainId: chain.ChainId, - Nonce: msg.Nonce, - HashList: []*types.TxHashList{&hash}, - }) - return &types.MsgAddToOutTxTrackerResponse{}, nil - } - - var isDup = false - for _, hash := range tracker.HashList { - if strings.EqualFold(hash.TxHash, msg.TxHash) { - isDup = true - if proven { - hash.Proved = true - k.SetOutTxTracker(ctx, tracker) - k.Logger(ctx).Info("Proof'd outbound transaction") - return &types.MsgAddToOutTxTrackerResponse{}, nil - } - break - } - } - if !isDup { - if proven { - hash.Proved = true - tracker.HashList = append([]*types.TxHashList{&hash}, tracker.HashList...) - k.Logger(ctx).Info("Proof'd outbound transaction") - } else { - tracker.HashList = append(tracker.HashList, &hash) - } - k.SetOutTxTracker(ctx, tracker) - } - return &types.MsgAddToOutTxTrackerResponse{}, nil -} - -// ValidateEVMOutTxBody validates the sender address, nonce and chain ID. -// Note: 'msg' may contain fabricated information -func ValidateEVMOutTxBody(msg *types.MsgAddToOutTxTracker, txBytes []byte, tssEth string) error { - var txx ethtypes.Transaction - err := txx.UnmarshalBinary(txBytes) - if err != nil { - return err - } - signer := ethtypes.NewLondonSigner(txx.ChainId()) - sender, err := ethtypes.Sender(signer, &txx) - if err != nil { - return err - } - tssAddr := eth.HexToAddress(tssEth) - if tssAddr == (eth.Address{}) { - return fmt.Errorf("tss address not found") - } - if sender != tssAddr { - return fmt.Errorf("sender %s is not tss address", sender) - } - if txx.ChainId().Cmp(big.NewInt(msg.ChainId)) != 0 { - return fmt.Errorf("want evm chain id %d, got %d", txx.ChainId(), msg.ChainId) - } - if txx.Nonce() != msg.Nonce { - return fmt.Errorf("want nonce %d, got %d", txx.Nonce(), msg.Nonce) - } - if txx.Hash().Hex() != msg.TxHash { - return fmt.Errorf("want tx hash %s, got %s", txx.Hash().Hex(), msg.TxHash) - } - return nil -} - -// ValidateBTCOutTxBody validates the SegWit sender address, nonce and chain ID. -// Note: 'msg' may contain fabricated information -func ValidateBTCOutTxBody(msg *types.MsgAddToOutTxTracker, txBytes []byte, tssBtc string) error { - tx, err := btcutil.NewTxFromBytes(txBytes) - if err != nil { - return err - } - for _, vin := range tx.MsgTx().TxIn { - if len(vin.Witness) != 2 { // outTx is SegWit transaction for now - return fmt.Errorf("not a SegWit transaction") - } - pubKey, err := btcec.ParsePubKey(vin.Witness[1], btcec.S256()) - if err != nil { - return fmt.Errorf("failed to parse public key") - } - addrP2WPKH, err := btcutil.NewAddressWitnessPubKeyHash(btcutil.Hash160(pubKey.SerializeCompressed()), config.BitconNetParams) - if err != nil { - return fmt.Errorf("failed to create P2WPKH address") - } - if addrP2WPKH.EncodeAddress() != tssBtc { - return fmt.Errorf("sender %s is not tss address", addrP2WPKH.EncodeAddress()) - } - } - if common.BtcChainID() != msg.ChainId { - return fmt.Errorf("want btc chain id %d, got %d", common.BtcChainID(), msg.ChainId) - } - if len(tx.MsgTx().TxOut) < 1 { - return fmt.Errorf("outTx should have at least one output") - } - if tx.MsgTx().TxOut[0].Value != common.NonceMarkAmount(msg.Nonce) { - return fmt.Errorf("want nonce mark %d, got %d", tx.MsgTx().TxOut[0].Value, common.NonceMarkAmount(msg.Nonce)) - } - if tx.MsgTx().TxHash().String() != msg.TxHash { - return fmt.Errorf("want tx hash %s, got %s", tx.MsgTx().TxHash(), msg.TxHash) - } - return nil -} - // RemoveFromOutTxTracker removes a record from the outbound transaction tracker by chain ID and nonce. // only the admin policy account is authorized to broadcast this message. func (k msgServer) RemoveFromOutTxTracker(goCtx context.Context, msg *types.MsgRemoveFromOutTxTracker) (*types.MsgRemoveFromOutTxTrackerResponse, error) { diff --git a/x/crosschain/keeper/msg_server_add_to_intx_tracker.go b/x/crosschain/keeper/msg_server_add_to_intx_tracker.go new file mode 100644 index 0000000000..cb9510e9fd --- /dev/null +++ b/x/crosschain/keeper/msg_server_add_to_intx_tracker.go @@ -0,0 +1,105 @@ +package keeper + +import ( + "context" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + eth "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/x/crosschain/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" +) + +// TODO https://github.com/zeta-chain/node/issues/1269 +func (k msgServer) AddToInTxTracker(goCtx context.Context, msg *types.MsgAddToInTxTracker) (*types.MsgAddToInTxTrackerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + chain := k.zetaObserverKeeper.GetParams(ctx).GetChainFromChainID(msg.ChainId) + if chain == nil { + return nil, observertypes.ErrSupportedChains + } + + adminPolicyAccount := k.zetaObserverKeeper.GetParams(ctx).GetAdminPolicyAccount(observertypes.Policy_Type_group1) + isAdmin := msg.Creator == adminPolicyAccount + isObserver := k.zetaObserverKeeper.IsAuthorized(ctx, msg.Creator, chain) + + isProven := false + if !(isAdmin || isObserver) && msg.Proof != nil { + txBytes, err := k.VerifyProof(ctx, msg.Proof, msg.ChainId, msg.BlockHash, msg.TxIndex) + if err != nil { + return nil, types.ErrCannotVerifyProof.Wrapf(err.Error()) + } + err = k.VerifyInTxBody(ctx, msg, txBytes) + if err != nil { + return nil, types.ErrCannotVerifyProof.Wrapf(err.Error()) + } + isProven = true + } + + // Sender needs to be either the admin policy account or an observer + if !(isAdmin || isObserver || isProven) { + return nil, errorsmod.Wrap(observertypes.ErrNotAuthorized, fmt.Sprintf("Creator %s", msg.Creator)) + } + + k.Keeper.SetInTxTracker(ctx, types.InTxTracker{ + ChainId: msg.ChainId, + TxHash: msg.TxHash, + CoinType: msg.CoinType, + }) + return &types.MsgAddToInTxTrackerResponse{}, nil +} + +// https://github.com/zeta-chain/node/issues/1254 +func (k Keeper) VerifyInTxBody(ctx sdk.Context, msg *types.MsgAddToInTxTracker, txBytes []byte) error { + // get core params and tss address + coreParams, found := k.zetaObserverKeeper.GetCoreParamsByChainID(ctx, msg.ChainId) + if !found { + return types.ErrUnsupportedChain.Wrapf("core params not found for chain %d", msg.ChainId) + } + tss, err := k.GetTssAddress(ctx, &types.QueryGetTssAddressRequest{}) + if err != nil { + return err + } + + // verify message against transaction body + if common.IsEVMChain(msg.ChainId) { + err = VerifyEVMInTxBody(coreParams, msg, txBytes, tss.Eth) + } else { + return fmt.Errorf("cannot verify inTx body for chain %d", msg.ChainId) + } + return err +} + +func VerifyEVMInTxBody(coreParams *observertypes.CoreParams, msg *types.MsgAddToInTxTracker, txBytes []byte, tssEth string) error { + var txx ethtypes.Transaction + err := txx.UnmarshalBinary(txBytes) + if err != nil { + return err + } + tssAddr := eth.HexToAddress(tssEth) + if tssAddr == (eth.Address{}) { + return fmt.Errorf("tss address not found") + } + + switch msg.CoinType { + case common.CoinType_Zeta: + if txx.To().Hex() != coreParams.ConnectorContractAddress { + return fmt.Errorf("receiver is not connector contract for coin type %s", msg.CoinType) + } + return nil + case common.CoinType_ERC20: + if txx.To().Hex() != coreParams.Erc20CustodyContractAddress { + return fmt.Errorf("receiver is not erc20Custory contract for coin type %s", msg.CoinType) + } + return nil + case common.CoinType_Gas: + if txx.To().Hex() != tssAddr.Hex() { + return fmt.Errorf("receiver is not tssAddress contract for coin type %s", msg.CoinType) + } + return nil + default: + return fmt.Errorf("coin type %s not supported", msg.CoinType) + } +} diff --git a/x/crosschain/keeper/msg_server_add_to_outtx_tracker.go b/x/crosschain/keeper/msg_server_add_to_outtx_tracker.go new file mode 100644 index 0000000000..c562f2344b --- /dev/null +++ b/x/crosschain/keeper/msg_server_add_to_outtx_tracker.go @@ -0,0 +1,181 @@ +package keeper + +import ( + "context" + "fmt" + "math/big" + "strings" + + cosmoserrors "cosmossdk.io/errors" + "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcutil" + sdk "github.com/cosmos/cosmos-sdk/types" + eth "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/x/crosschain/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" + "github.com/zeta-chain/zetacore/zetaclient/config" +) + +// AddToOutTxTracker adds a new record to the outbound transaction tracker. +// only the admin policy account and the observer validators are authorized to broadcast this message without proof. +func (k msgServer) AddToOutTxTracker(goCtx context.Context, msg *types.MsgAddToOutTxTracker) (*types.MsgAddToOutTxTrackerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + chain := k.zetaObserverKeeper.GetParams(ctx).GetChainFromChainID(msg.ChainId) + if chain == nil { + return nil, observertypes.ErrSupportedChains + } + + if msg.Proof == nil { // without proof, only certain accounts can send this message + adminPolicyAccount := k.zetaObserverKeeper.GetParams(ctx).GetAdminPolicyAccount(observertypes.Policy_Type_group1) + isAdmin := msg.Creator == adminPolicyAccount + isObserver := k.zetaObserverKeeper.IsAuthorized(ctx, msg.Creator, chain) + + // Sender needs to be either the admin policy account or an observer + if !(isAdmin || isObserver) { + return nil, cosmoserrors.Wrap(observertypes.ErrNotAuthorized, fmt.Sprintf("Creator %s", msg.Creator)) + } + } + + isProven := false + if msg.Proof != nil { // verify proof when it is provided + txBytes, err := k.VerifyProof(ctx, msg.Proof, msg.ChainId, msg.BlockHash, msg.TxIndex) + if err != nil { + return nil, types.ErrProofVerificationFail.Wrapf(err.Error()) + } + err = k.VerifyOutTxBody(ctx, msg, txBytes) + if err != nil { + return nil, types.ErrTxBodyVerificationFail.Wrapf(err.Error()) + } + isProven = true + } + + tracker, found := k.GetOutTxTracker(ctx, msg.ChainId, msg.Nonce) + hash := types.TxHashList{ + TxHash: msg.TxHash, + TxSigner: msg.Creator, + } + if !found { + k.SetOutTxTracker(ctx, types.OutTxTracker{ + Index: "", + ChainId: chain.ChainId, + Nonce: msg.Nonce, + HashList: []*types.TxHashList{&hash}, + }) + return &types.MsgAddToOutTxTrackerResponse{}, nil + } + + var isDup = false + for _, hash := range tracker.HashList { + if strings.EqualFold(hash.TxHash, msg.TxHash) { + isDup = true + if isProven { + hash.Proved = true + k.SetOutTxTracker(ctx, tracker) + k.Logger(ctx).Info("Proof'd outbound transaction") + return &types.MsgAddToOutTxTrackerResponse{}, nil + } + break + } + } + if !isDup { + if isProven { + hash.Proved = true + tracker.HashList = append([]*types.TxHashList{&hash}, tracker.HashList...) + k.Logger(ctx).Info("Proof'd outbound transaction") + } else { + tracker.HashList = append(tracker.HashList, &hash) + } + k.SetOutTxTracker(ctx, tracker) + } + return &types.MsgAddToOutTxTrackerResponse{}, nil +} + +func (k Keeper) VerifyOutTxBody(ctx sdk.Context, msg *types.MsgAddToOutTxTracker, txBytes []byte) error { + // get tss address + tss, err := k.GetTssAddress(ctx, &types.QueryGetTssAddressRequest{}) + if err != nil { + return err + } + + // verify message against transaction body + if common.IsEVMChain(msg.ChainId) { + err = VerifyEVMOutTxBody(msg, txBytes, tss.Eth) + } else if common.IsBitcoinChain(msg.ChainId) { + err = VerifyBTCOutTxBody(msg, txBytes, tss.Btc) + } else { + return fmt.Errorf("cannot verify outTx body for chain %d", msg.ChainId) + } + return err +} + +// VerifyEVMOutTxBody validates the sender address, nonce, chain id and tx hash. +// Note: 'msg' may contain fabricated information +func VerifyEVMOutTxBody(msg *types.MsgAddToOutTxTracker, txBytes []byte, tssEth string) error { + var txx ethtypes.Transaction + err := txx.UnmarshalBinary(txBytes) + if err != nil { + return err + } + signer := ethtypes.NewLondonSigner(txx.ChainId()) + sender, err := ethtypes.Sender(signer, &txx) + if err != nil { + return err + } + tssAddr := eth.HexToAddress(tssEth) + if tssAddr == (eth.Address{}) { + return fmt.Errorf("tss address not found") + } + if sender != tssAddr { + return fmt.Errorf("sender %s is not tss address", sender) + } + if txx.ChainId().Cmp(big.NewInt(msg.ChainId)) != 0 { + return fmt.Errorf("want evm chain id %d, got %d", txx.ChainId(), msg.ChainId) + } + if txx.Nonce() != msg.Nonce { + return fmt.Errorf("want nonce %d, got %d", txx.Nonce(), msg.Nonce) + } + if txx.Hash().Hex() != msg.TxHash { + return fmt.Errorf("want tx hash %s, got %s", txx.Hash().Hex(), msg.TxHash) + } + return nil +} + +// VerifyBTCOutTxBody validates the SegWit sender address, nonce and chain id and tx hash +// Note: 'msg' may contain fabricated information +func VerifyBTCOutTxBody(msg *types.MsgAddToOutTxTracker, txBytes []byte, tssBtc string) error { + tx, err := btcutil.NewTxFromBytes(txBytes) + if err != nil { + return err + } + for _, vin := range tx.MsgTx().TxIn { + if len(vin.Witness) != 2 { // outTx is SegWit transaction for now + return fmt.Errorf("not a SegWit transaction") + } + pubKey, err := btcec.ParsePubKey(vin.Witness[1], btcec.S256()) + if err != nil { + return fmt.Errorf("failed to parse public key") + } + addrP2WPKH, err := btcutil.NewAddressWitnessPubKeyHash(btcutil.Hash160(pubKey.SerializeCompressed()), config.BitconNetParams) + if err != nil { + return fmt.Errorf("failed to create P2WPKH address") + } + if addrP2WPKH.EncodeAddress() != tssBtc { + return fmt.Errorf("sender %s is not tss address", addrP2WPKH.EncodeAddress()) + } + } + if common.BtcChainID() != msg.ChainId { + return fmt.Errorf("want btc chain id %d, got %d", common.BtcChainID(), msg.ChainId) + } + if len(tx.MsgTx().TxOut) < 1 { + return fmt.Errorf("outTx should have at least one output") + } + if tx.MsgTx().TxOut[0].Value != common.NonceMarkAmount(msg.Nonce) { + return fmt.Errorf("want nonce mark %d, got %d", tx.MsgTx().TxOut[0].Value, common.NonceMarkAmount(msg.Nonce)) + } + if tx.MsgTx().TxHash().String() != msg.TxHash { + return fmt.Errorf("want tx hash %s, got %s", tx.MsgTx().TxHash(), msg.TxHash) + } + return nil +} diff --git a/x/crosschain/keeper/verify_block_header.go b/x/crosschain/keeper/verify_block_header.go new file mode 100644 index 0000000000..92f389987e --- /dev/null +++ b/x/crosschain/keeper/verify_block_header.go @@ -0,0 +1,53 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func (k Keeper) VerifyProof(ctx sdk.Context, proof *common.Proof, chainID int64, blockHash string, txIndex int64) ([]byte, error) { + // header-based merkle proof verification must be enabled + crosschainFlags, found := k.zetaObserverKeeper.GetCrosschainFlags(ctx) + if !found { + return nil, fmt.Errorf("crosschain flags not found") + } + if crosschainFlags.BlockHeaderVerificationFlags == nil { + return nil, fmt.Errorf("block header verification flags not found") + } + if common.IsBitcoinChain(chainID) && !crosschainFlags.BlockHeaderVerificationFlags.IsBtcTypeChainEnabled { + return nil, fmt.Errorf("proof verification not enabled for bitcoin chain") + } + if common.IsEVMChain(chainID) && !crosschainFlags.BlockHeaderVerificationFlags.IsEthTypeChainEnabled { + return nil, fmt.Errorf("proof verification not enabled for evm chain") + } + + // chain must support header-based merkle proof verification + senderChain := common.GetChainFromChainID(chainID) + if senderChain == nil { + return nil, types.ErrUnsupportedChain + } + if !senderChain.SupportMerkleProof() { + return nil, fmt.Errorf("chain %d does not support block header-based verification", chainID) + } + + // get block header from the store + hashBytes, err := common.StringToHash(chainID, blockHash) + if err != nil { + return nil, fmt.Errorf("block hash %s conversion failed %s", blockHash, err) + } + res, found := k.zetaObserverKeeper.GetBlockHeader(ctx, hashBytes) + if !found { + return nil, fmt.Errorf("block header not found %s", blockHash) + } + + // verify merkle proof + txBytes, err := proof.Verify(res.Header, int(txIndex)) + if err != nil { + return nil, err + } + + return txBytes, err +} diff --git a/x/crosschain/types/errors.go b/x/crosschain/types/errors.go index 32d07bc636..c9186f9795 100644 --- a/x/crosschain/types/errors.go +++ b/x/crosschain/types/errors.go @@ -30,8 +30,8 @@ var ( ErrNotEnoughGas = errorsmod.Register(ModuleName, 1131, "not enough gas") ErrNotEnoughFunds = errorsmod.Register(ModuleName, 1132, "not enough funds") - ErrProofVerificationFail = errorsmod.Register(ModuleName, 1133, "Proof verification fail") - ErrCannotFindCctx = errorsmod.Register(ModuleName, 1134, "Cannot find cctx") + ErrProofVerificationFail = errorsmod.Register(ModuleName, 1133, "proof verification fail") + ErrCannotFindCctx = errorsmod.Register(ModuleName, 1134, "cannot find cctx") ErrStatusNotPending = errorsmod.Register(ModuleName, 1135, "Status not pending") ErrCannotFindGasParams = errorsmod.Register(ModuleName, 1136, "cannot find gas params") @@ -39,4 +39,7 @@ var ( ErrNoLiquidityPool = errorsmod.Register(ModuleName, 1138, "no liquidity pool") ErrInvalidCoinType = errorsmod.Register(ModuleName, 1139, "invalid coin type") ErrCannotMigrateTss = errorsmod.Register(ModuleName, 1140, "Cannot migrate TSS funds") + + ErrCannotVerifyProof = errorsmod.Register(ModuleName, 1141, "cannot verify proof") + ErrTxBodyVerificationFail = errorsmod.Register(ModuleName, 1142, "transaction body verification fail") ) diff --git a/x/crosschain/types/genesis.pb.go b/x/crosschain/types/genesis.pb.go index b5e24bfca0..c1b357ebad 100644 --- a/x/crosschain/types/genesis.pb.go +++ b/x/crosschain/types/genesis.pb.go @@ -35,6 +35,7 @@ type GenesisState struct { LastBlockHeightList []*LastBlockHeight `protobuf:"bytes,8,rep,name=lastBlockHeightList,proto3" json:"lastBlockHeightList,omitempty"` InTxHashToCctxList []InTxHashToCctx `protobuf:"bytes,9,rep,name=inTxHashToCctxList,proto3" json:"inTxHashToCctxList"` TssHistory []TSS `protobuf:"bytes,10,rep,name=tss_history,json=tssHistory,proto3" json:"tss_history"` + InTxTrackerList []InTxTracker `protobuf:"bytes,11,rep,name=in_tx_tracker_list,json=inTxTrackerList,proto3" json:"in_tx_tracker_list"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -133,6 +134,13 @@ func (m *GenesisState) GetTssHistory() []TSS { return nil } +func (m *GenesisState) GetInTxTrackerList() []InTxTracker { + if m != nil { + return m.InTxTrackerList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "zetachain.zetacore.crosschain.GenesisState") } @@ -140,38 +148,39 @@ func init() { func init() { proto.RegisterFile("crosschain/genesis.proto", fileDescriptor_dd51403692d571f4) } var fileDescriptor_dd51403692d571f4 = []byte{ - // 488 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xd1, 0x6a, 0x13, 0x41, - 0x14, 0x86, 0xb3, 0xb6, 0x8d, 0x3a, 0xa9, 0x28, 0xa3, 0xe0, 0x12, 0xe8, 0xb6, 0x44, 0xc4, 0xa2, - 0x74, 0x17, 0xab, 0x4f, 0x90, 0x5c, 0x34, 0xa5, 0x45, 0xeb, 0x66, 0xaf, 0x04, 0x59, 0x27, 0xc3, - 0xb0, 0xbb, 0xb4, 0xcd, 0x84, 0x3d, 0x27, 0xb0, 0xf5, 0x29, 0x7c, 0xac, 0x5e, 0xf6, 0xd2, 0x2b, - 0x91, 0xe4, 0x05, 0x7c, 0x04, 0x99, 0xb3, 0xd3, 0x76, 0xa2, 0xc1, 0xed, 0xcd, 0x72, 0xd8, 0xf3, - 0xff, 0xdf, 0xf9, 0x99, 0x39, 0xc3, 0x7c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x06, 0xdc, 0x47, 0xc7, 0x66, - 0xa1, 0xff, 0xa0, 0xf8, 0x7b, 0xb6, 0x86, 0x00, 0xfe, 0x3a, 0x05, 0xec, 0x35, 0x10, 0x93, 0xd1, - 0x28, 0x36, 0x72, 0x7e, 0xc4, 0x36, 0x33, 0x01, 0x27, 0xe6, 0xae, 0x28, 0xd0, 0x06, 0x05, 0x7a, - 0xd5, 0x60, 0x3f, 0xb0, 0x96, 0x78, 0xc9, 0xcc, 0x13, 0xf6, 0x98, 0xfa, 0x1f, 0x68, 0x71, 0x88, - 0xd7, 0x26, 0xde, 0xeb, 0x06, 0xde, 0xe0, 0xd6, 0x15, 0xff, 0x8d, 0xe0, 0x9f, 0xd8, 0xa3, 0x81, - 0x91, 0x92, 0x28, 0xa9, 0xc0, 0xbf, 0x7f, 0xa7, 0x43, 0x73, 0x3d, 0xf1, 0x32, 0x81, 0x7f, 0x65, - 0x4f, 0xcd, 0x86, 0xf5, 0xcd, 0x82, 0x0d, 0x69, 0xbf, 0x28, 0xec, 0x03, 0x02, 0x87, 0x0d, 0xe0, - 0xe3, 0x65, 0x67, 0xbc, 0x0a, 0xc5, 0x25, 0xe3, 0x66, 0xd4, 0x50, 0x40, 0x9e, 0xe8, 0x81, 0xc4, - 0x8a, 0x06, 0x3c, 0xa4, 0x01, 0x7b, 0x0d, 0x03, 0x0e, 0x97, 0x8c, 0xf6, 0xc2, 0x57, 0xe0, 0xf8, - 0x21, 0xeb, 0x20, 0x40, 0x9a, 0x17, 0x80, 0xba, 0xbc, 0xf0, 0x19, 0xd1, 0xef, 0x70, 0xf5, 0x16, - 0xc9, 0x10, 0x60, 0x58, 0x7b, 0xfb, 0x47, 0x97, 0xf3, 0xc0, 0xbb, 0x9a, 0x07, 0xde, 0xaf, 0x79, - 0xe0, 0x7d, 0x5f, 0x04, 0xad, 0xab, 0x45, 0xd0, 0xfa, 0xb1, 0x08, 0x5a, 0x9f, 0xdf, 0x66, 0x05, - 0xe6, 0xb3, 0x71, 0x28, 0xf5, 0x79, 0x64, 0x78, 0x7b, 0xf5, 0x1b, 0xba, 0x46, 0x47, 0x55, 0xe4, - 0xbe, 0xac, 0x8b, 0xa9, 0x82, 0x71, 0x9b, 0x9e, 0xd1, 0xbb, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xe0, 0xed, 0xc4, 0xaf, 0x8c, 0x04, 0x00, 0x00, + // 512 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xd1, 0x6e, 0xd3, 0x30, + 0x14, 0x86, 0x1b, 0x36, 0x0a, 0xb8, 0x43, 0x43, 0x06, 0x89, 0xa8, 0xd2, 0xb2, 0xa9, 0x08, 0x31, + 0x81, 0x96, 0x88, 0xc1, 0x13, 0xb4, 0x17, 0xeb, 0xb4, 0x09, 0x46, 0x9a, 0x2b, 0xa4, 0xc9, 0xb8, + 0x96, 0x95, 0x44, 0xeb, 0xe2, 0x2a, 0xc7, 0x95, 0x32, 0x9e, 0x82, 0xc7, 0xda, 0x1d, 0xbb, 0xe4, + 0x0a, 0xa1, 0xf6, 0x45, 0x90, 0x4f, 0xb2, 0xcd, 0xa1, 0x15, 0xe9, 0x4d, 0x65, 0xe5, 0xfc, 0xff, + 0x77, 0xfe, 0xda, 0xe7, 0x10, 0x57, 0xe4, 0x0a, 0x40, 0x24, 0x3c, 0xcd, 0x82, 0x58, 0x66, 0x12, + 0x52, 0xf0, 0xa7, 0xb9, 0xd2, 0x8a, 0xee, 0x7c, 0x97, 0x9a, 0x63, 0xc1, 0xc7, 0x93, 0xca, 0xa5, + 0x7f, 0x2f, 0xee, 0xee, 0x58, 0x46, 0xfc, 0x65, 0x99, 0xca, 0x84, 0xac, 0xdc, 0xdd, 0x5d, 0xbb, + 0x6c, 0x8e, 0xac, 0x14, 0xe9, 0xa2, 0x12, 0x74, 0xed, 0xc6, 0x1c, 0xd8, 0x34, 0x4f, 0x85, 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05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -194,6 +203,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.InTxTrackerList) > 0 { + for iNdEx := len(m.InTxTrackerList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InTxTrackerList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } + } if len(m.TssHistory) > 0 { for iNdEx := len(m.TssHistory) - 1; iNdEx >= 0; iNdEx-- { { @@ -382,6 +405,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.InTxTrackerList) > 0 { + for _, e := range m.InTxTrackerList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -727,6 +756,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxTrackerList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InTxTrackerList = append(m.InTxTrackerList, InTxTracker{}) + if err := m.InTxTrackerList[len(m.InTxTrackerList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/crosschain/types/in_tx_tracker.pb.go b/x/crosschain/types/in_tx_tracker.pb.go new file mode 100644 index 0000000000..75074880b6 --- /dev/null +++ b/x/crosschain/types/in_tx_tracker.pb.go @@ -0,0 +1,391 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: crosschain/in_tx_tracker.proto + +package types + +import ( + fmt "fmt" + io "io" + math "math" + math_bits "math/bits" + + proto "github.com/gogo/protobuf/proto" + common "github.com/zeta-chain/zetacore/common" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type InTxTracker struct { + ChainId int64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` + CoinType common.CoinType `protobuf:"varint,3,opt,name=coin_type,json=coinType,proto3,enum=common.CoinType" json:"coin_type,omitempty"` +} + +func (m *InTxTracker) Reset() { *m = InTxTracker{} } +func (m *InTxTracker) String() string { return proto.CompactTextString(m) } +func (*InTxTracker) ProtoMessage() {} +func (*InTxTracker) Descriptor() ([]byte, []int) { + return fileDescriptor_799b411f065af0ce, []int{0} +} +func (m *InTxTracker) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InTxTracker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InTxTracker.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *InTxTracker) XXX_Merge(src proto.Message) { + xxx_messageInfo_InTxTracker.Merge(m, src) +} +func (m *InTxTracker) XXX_Size() int { + return m.Size() +} +func (m *InTxTracker) XXX_DiscardUnknown() { + xxx_messageInfo_InTxTracker.DiscardUnknown(m) +} + +var xxx_messageInfo_InTxTracker proto.InternalMessageInfo + +func (m *InTxTracker) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *InTxTracker) GetTxHash() string { + if m != nil { + return m.TxHash + } + return "" +} + +func (m *InTxTracker) GetCoinType() common.CoinType { + if m != nil { + return m.CoinType + } + return common.CoinType_Zeta +} + +func init() { + proto.RegisterType((*InTxTracker)(nil), "zetachain.zetacore.crosschain.InTxTracker") +} + +func init() { proto.RegisterFile("crosschain/in_tx_tracker.proto", fileDescriptor_799b411f065af0ce) } + +var fileDescriptor_799b411f065af0ce = []byte{ + // 237 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0x2e, 0xca, 0x2f, + 0x2e, 0x4e, 0xce, 0x48, 0xcc, 0xcc, 0xd3, 0xcf, 0xcc, 0x8b, 0x2f, 0xa9, 0x88, 0x2f, 0x29, 0x4a, + 0x4c, 0xce, 0x4e, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0xad, 0x4a, 0x2d, 0x49, + 0x04, 0x4b, 0xeb, 0x81, 0x59, 0xf9, 0x45, 0xa9, 0x7a, 0x08, 0x2d, 0x52, 0xc2, 0xc9, 0xf9, 0xb9, + 0xb9, 0xf9, 0x79, 0xfa, 0x10, 0x0a, 0xa2, 0x47, 0xa9, 0x80, 0x8b, 0xdb, 0x33, 0x2f, 0xa4, 0x22, + 0x04, 0x62, 0x90, 0x90, 0x24, 0x17, 0x07, 0x58, 0x71, 0x7c, 0x66, 0x8a, 0x04, 0xa3, 0x02, 0xa3, + 0x06, 0x73, 0x10, 0x3b, 0x98, 0xef, 0x99, 0x22, 0x24, 0xce, 0xc5, 0x5e, 0x52, 0x11, 0x9f, 0x91, + 0x58, 0x9c, 0x21, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x19, 0xc4, 0x56, 0x52, 0xe1, 0x91, 0x58, 0x9c, + 0x21, 0xa4, 0xcb, 0xc5, 0x99, 0x9c, 0x0f, 0x72, 0x4f, 0x65, 0x41, 0xaa, 0x04, 0xb3, 0x02, 0xa3, + 0x06, 0x9f, 0x91, 0x80, 0x1e, 0xd4, 0x12, 0xe7, 0xfc, 0xcc, 0xbc, 0x90, 0xca, 0x82, 0xd4, 0x20, + 0x8e, 0x64, 0x28, 0xcb, 0xc9, 0xfb, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, + 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2, + 0x0c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0x40, 0x7a, 0xf5, 0x41, 0x1e, 0xd0, 0x85, 0x78, 0x15, + 0xe6, 0x17, 0xfd, 0x0a, 0x7d, 0xa4, 0x00, 0x00, 0xd9, 0x56, 0x9c, 0xc4, 0x06, 0xf6, 0x85, 0x31, + 0x20, 0x00, 0x00, 0xff, 0xff, 0x60, 0xe9, 0x97, 0x6f, 0x1b, 0x01, 0x00, 0x00, +} + +func (m *InTxTracker) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InTxTracker) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InTxTracker) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CoinType != 0 { + i = encodeVarintInTxTracker(dAtA, i, uint64(m.CoinType)) + i-- + dAtA[i] = 0x18 + } + if len(m.TxHash) > 0 { + i -= len(m.TxHash) + copy(dAtA[i:], m.TxHash) + i = encodeVarintInTxTracker(dAtA, i, uint64(len(m.TxHash))) + i-- + dAtA[i] = 0x12 + } + if m.ChainId != 0 { + i = encodeVarintInTxTracker(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintInTxTracker(dAtA []byte, offset int, v uint64) int { + offset -= sovInTxTracker(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *InTxTracker) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovInTxTracker(uint64(m.ChainId)) + } + l = len(m.TxHash) + if l > 0 { + n += 1 + l + sovInTxTracker(uint64(l)) + } + if m.CoinType != 0 { + n += 1 + sovInTxTracker(uint64(m.CoinType)) + } + return n +} + +func sovInTxTracker(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozInTxTracker(x uint64) (n int) { + return sovInTxTracker(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *InTxTracker) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInTxTracker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InTxTracker: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InTxTracker: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInTxTracker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInTxTracker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthInTxTracker + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthInTxTracker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CoinType", wireType) + } + m.CoinType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowInTxTracker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CoinType |= common.CoinType(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipInTxTracker(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthInTxTracker + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipInTxTracker(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInTxTracker + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInTxTracker + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowInTxTracker + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthInTxTracker + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupInTxTracker + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthInTxTracker + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthInTxTracker = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowInTxTracker = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupInTxTracker = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/crosschain/types/keys.go b/x/crosschain/types/keys.go index 247ab676ac..5af95e2e3c 100644 --- a/x/crosschain/types/keys.go +++ b/x/crosschain/types/keys.go @@ -54,6 +54,7 @@ const ( TSSHistoryKey = "TSS-History-value-" OutTxTrackerKeyPrefix = "OutTxTracker-value-" + InTxTrackerKeyPrefix = "InTxTracker-value-" NonceToCctxKeyPrefix = "NonceToCctx-value-" PendingNoncesKeyPrefix = "PendingNonces-value-" diff --git a/x/crosschain/types/message_add_to_in_tx_tracker.go b/x/crosschain/types/message_add_to_in_tx_tracker.go new file mode 100644 index 0000000000..c44c15ba8c --- /dev/null +++ b/x/crosschain/types/message_add_to_in_tx_tracker.go @@ -0,0 +1,61 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/zeta-chain/zetacore/common" +) + +const TypeMsgAddToInTxTracker = "AddToInTxTracker" + +var _ sdk.Msg = &MsgAddToInTxTracker{} + +func NewMsgAddToInTxTracker(creator string, chain int64, coinType common.CoinType, txHash string) *MsgAddToInTxTracker { + return &MsgAddToInTxTracker{ + Creator: creator, + ChainId: chain, + TxHash: txHash, + CoinType: coinType, + } +} + +func (msg *MsgAddToInTxTracker) Route() string { + return RouterKey +} + +func (msg *MsgAddToInTxTracker) Type() string { + return TypeMsgAddToInTxTracker +} + +func (msg *MsgAddToInTxTracker) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgAddToInTxTracker) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgAddToInTxTracker) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + chain := common.GetChainFromChainID(msg.ChainId) + if chain == nil { + return errorsmod.Wrapf(ErrInvalidChainID, "chain id (%d)", msg.ChainId) + } + if msg.Proof != nil && !chain.SupportMerkleProof() { + return errorsmod.Wrapf(ErrCannotVerifyProof, "chain id %d does not support proof-based trackers", msg.ChainId) + } + _, ok := common.CoinType_value[msg.CoinType.String()] + if !ok { + return errorsmod.Wrapf(ErrCannotVerifyProof, "coin-type not supported") + } + return nil +} diff --git a/x/crosschain/types/message_add_to_in_tx_tracker_test.go b/x/crosschain/types/message_add_to_in_tx_tracker_test.go new file mode 100644 index 0000000000..0bd45fbb7a --- /dev/null +++ b/x/crosschain/types/message_add_to_in_tx_tracker_test.go @@ -0,0 +1,64 @@ +//go:build TESTNET +// +build TESTNET + +package types_test + +import ( + "testing" + + errorsmod "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func TestMsgAddToInTxTracker_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg types.MsgAddToInTxTracker + err error + }{ + { + name: "invalid address", + msg: types.MsgAddToInTxTracker{ + Creator: "invalid_address", + ChainId: common.GoerliChain().ChainId, + TxHash: "hash", + CoinType: common.CoinType_Gas, + }, + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid chain id", + msg: types.MsgAddToInTxTracker{ + Creator: sample.AccAddress(), + ChainId: 42, + TxHash: "hash", + CoinType: common.CoinType_Gas, + }, + err: errorsmod.Wrapf(types.ErrInvalidChainID, "chain id (%d)", 42), + }, + { + name: "valid", + msg: types.MsgAddToInTxTracker{ + Creator: sample.AccAddress(), + ChainId: common.GoerliChain().ChainId, + TxHash: "hash", + CoinType: common.CoinType_Gas, + }, + err: nil, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/crosschain/types/query.pb.go b/x/crosschain/types/query.pb.go index dfeacc4365..868abf1169 100644 --- a/x/crosschain/types/query.pb.go +++ b/x/crosschain/types/query.pb.go @@ -490,6 +490,190 @@ func (m *QueryAllOutTxTrackerByChainResponse) GetPagination() *query.PageRespons return nil } +type QueryAllInTxTrackerByChainRequest struct { + ChainId int64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllInTxTrackerByChainRequest) Reset() { *m = QueryAllInTxTrackerByChainRequest{} } +func (m *QueryAllInTxTrackerByChainRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllInTxTrackerByChainRequest) ProtoMessage() {} +func (*QueryAllInTxTrackerByChainRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_65a992045e92a606, []int{10} +} +func (m *QueryAllInTxTrackerByChainRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllInTxTrackerByChainRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllInTxTrackerByChainRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllInTxTrackerByChainRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllInTxTrackerByChainRequest.Merge(m, src) +} +func (m *QueryAllInTxTrackerByChainRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllInTxTrackerByChainRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllInTxTrackerByChainRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllInTxTrackerByChainRequest proto.InternalMessageInfo + +func (m *QueryAllInTxTrackerByChainRequest) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *QueryAllInTxTrackerByChainRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllInTxTrackerByChainResponse struct { + InTxTracker []InTxTracker `protobuf:"bytes,1,rep,name=inTxTracker,proto3" json:"inTxTracker"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllInTxTrackerByChainResponse) Reset() { *m = QueryAllInTxTrackerByChainResponse{} } +func (m *QueryAllInTxTrackerByChainResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllInTxTrackerByChainResponse) ProtoMessage() {} +func (*QueryAllInTxTrackerByChainResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_65a992045e92a606, []int{11} +} +func (m *QueryAllInTxTrackerByChainResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllInTxTrackerByChainResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllInTxTrackerByChainResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllInTxTrackerByChainResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllInTxTrackerByChainResponse.Merge(m, src) +} +func (m *QueryAllInTxTrackerByChainResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllInTxTrackerByChainResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllInTxTrackerByChainResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllInTxTrackerByChainResponse proto.InternalMessageInfo + +func (m *QueryAllInTxTrackerByChainResponse) GetInTxTracker() []InTxTracker { + if m != nil { + return m.InTxTracker + } + return nil +} + +func (m *QueryAllInTxTrackerByChainResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllInTxTrackersRequest struct { +} + +func (m *QueryAllInTxTrackersRequest) Reset() { *m = QueryAllInTxTrackersRequest{} } +func (m *QueryAllInTxTrackersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllInTxTrackersRequest) ProtoMessage() {} +func (*QueryAllInTxTrackersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_65a992045e92a606, []int{12} +} +func (m *QueryAllInTxTrackersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllInTxTrackersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllInTxTrackersRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllInTxTrackersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllInTxTrackersRequest.Merge(m, src) +} +func (m *QueryAllInTxTrackersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllInTxTrackersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllInTxTrackersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllInTxTrackersRequest proto.InternalMessageInfo + +type QueryAllInTxTrackersResponse struct { + InTxTracker []InTxTracker `protobuf:"bytes,1,rep,name=inTxTracker,proto3" json:"inTxTracker"` +} + +func (m *QueryAllInTxTrackersResponse) Reset() { *m = QueryAllInTxTrackersResponse{} } +func (m *QueryAllInTxTrackersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllInTxTrackersResponse) ProtoMessage() {} +func (*QueryAllInTxTrackersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_65a992045e92a606, []int{13} +} +func (m *QueryAllInTxTrackersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllInTxTrackersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllInTxTrackersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllInTxTrackersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllInTxTrackersResponse.Merge(m, src) +} +func (m *QueryAllInTxTrackersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllInTxTrackersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllInTxTrackersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllInTxTrackersResponse proto.InternalMessageInfo + +func (m *QueryAllInTxTrackersResponse) GetInTxTracker() []InTxTracker { + if m != nil { + return m.InTxTracker + } + return nil +} + type QueryGetInTxHashToCctxRequest struct { InTxHash string `protobuf:"bytes,1,opt,name=inTxHash,proto3" json:"inTxHash,omitempty"` } @@ -498,7 +682,7 @@ func (m *QueryGetInTxHashToCctxRequest) Reset() { *m = QueryGetInTxHashT func (m *QueryGetInTxHashToCctxRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetInTxHashToCctxRequest) ProtoMessage() {} func (*QueryGetInTxHashToCctxRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{10} + return fileDescriptor_65a992045e92a606, []int{14} } func (m *QueryGetInTxHashToCctxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -542,7 +726,7 @@ func (m *QueryGetInTxHashToCctxResponse) Reset() { *m = QueryGetInTxHash func (m *QueryGetInTxHashToCctxResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetInTxHashToCctxResponse) ProtoMessage() {} func (*QueryGetInTxHashToCctxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{11} + return fileDescriptor_65a992045e92a606, []int{15} } func (m *QueryGetInTxHashToCctxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -586,7 +770,7 @@ func (m *QueryInTxHashToCctxDataRequest) Reset() { *m = QueryInTxHashToC func (m *QueryInTxHashToCctxDataRequest) String() string { return proto.CompactTextString(m) } func (*QueryInTxHashToCctxDataRequest) ProtoMessage() {} func (*QueryInTxHashToCctxDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{12} + return fileDescriptor_65a992045e92a606, []int{16} } func (m *QueryInTxHashToCctxDataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -630,7 +814,7 @@ func (m *QueryInTxHashToCctxDataResponse) Reset() { *m = QueryInTxHashTo func (m *QueryInTxHashToCctxDataResponse) String() string { return proto.CompactTextString(m) } func (*QueryInTxHashToCctxDataResponse) ProtoMessage() {} func (*QueryInTxHashToCctxDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{13} + return fileDescriptor_65a992045e92a606, []int{17} } func (m *QueryInTxHashToCctxDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -674,7 +858,7 @@ func (m *QueryAllInTxHashToCctxRequest) Reset() { *m = QueryAllInTxHashT func (m *QueryAllInTxHashToCctxRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllInTxHashToCctxRequest) ProtoMessage() {} func (*QueryAllInTxHashToCctxRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{14} + return fileDescriptor_65a992045e92a606, []int{18} } func (m *QueryAllInTxHashToCctxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -719,7 +903,7 @@ func (m *QueryAllInTxHashToCctxResponse) Reset() { *m = QueryAllInTxHash func (m *QueryAllInTxHashToCctxResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllInTxHashToCctxResponse) ProtoMessage() {} func (*QueryAllInTxHashToCctxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{15} + return fileDescriptor_65a992045e92a606, []int{19} } func (m *QueryAllInTxHashToCctxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -770,7 +954,7 @@ func (m *QueryGetTssAddressRequest) Reset() { *m = QueryGetTssAddressReq func (m *QueryGetTssAddressRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTssAddressRequest) ProtoMessage() {} func (*QueryGetTssAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{16} + return fileDescriptor_65a992045e92a606, []int{20} } func (m *QueryGetTssAddressRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -815,7 +999,7 @@ func (m *QueryGetTssAddressResponse) Reset() { *m = QueryGetTssAddressRe func (m *QueryGetTssAddressResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTssAddressResponse) ProtoMessage() {} func (*QueryGetTssAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{17} + return fileDescriptor_65a992045e92a606, []int{21} } func (m *QueryGetTssAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -865,7 +1049,7 @@ func (m *QueryGetTSSRequest) Reset() { *m = QueryGetTSSRequest{} } func (m *QueryGetTSSRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetTSSRequest) ProtoMessage() {} func (*QueryGetTSSRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{18} + return fileDescriptor_65a992045e92a606, []int{22} } func (m *QueryGetTSSRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -902,7 +1086,7 @@ func (m *QueryGetTSSResponse) Reset() { *m = QueryGetTSSResponse{} } func (m *QueryGetTSSResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetTSSResponse) ProtoMessage() {} func (*QueryGetTSSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{19} + return fileDescriptor_65a992045e92a606, []int{23} } func (m *QueryGetTSSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -946,7 +1130,7 @@ func (m *QueryGetGasPriceRequest) Reset() { *m = QueryGetGasPriceRequest func (m *QueryGetGasPriceRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetGasPriceRequest) ProtoMessage() {} func (*QueryGetGasPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{20} + return fileDescriptor_65a992045e92a606, []int{24} } func (m *QueryGetGasPriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -990,7 +1174,7 @@ func (m *QueryGetGasPriceResponse) Reset() { *m = QueryGetGasPriceRespon func (m *QueryGetGasPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetGasPriceResponse) ProtoMessage() {} func (*QueryGetGasPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{21} + return fileDescriptor_65a992045e92a606, []int{25} } func (m *QueryGetGasPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1034,7 +1218,7 @@ func (m *QueryAllGasPriceRequest) Reset() { *m = QueryAllGasPriceRequest func (m *QueryAllGasPriceRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllGasPriceRequest) ProtoMessage() {} func (*QueryAllGasPriceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{22} + return fileDescriptor_65a992045e92a606, []int{26} } func (m *QueryAllGasPriceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1079,7 +1263,7 @@ func (m *QueryAllGasPriceResponse) Reset() { *m = QueryAllGasPriceRespon func (m *QueryAllGasPriceResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllGasPriceResponse) ProtoMessage() {} func (*QueryAllGasPriceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{23} + return fileDescriptor_65a992045e92a606, []int{27} } func (m *QueryAllGasPriceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1130,7 +1314,7 @@ func (m *QueryGetChainNoncesRequest) Reset() { *m = QueryGetChainNoncesR func (m *QueryGetChainNoncesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetChainNoncesRequest) ProtoMessage() {} func (*QueryGetChainNoncesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{24} + return fileDescriptor_65a992045e92a606, []int{28} } func (m *QueryGetChainNoncesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1174,7 +1358,7 @@ func (m *QueryGetChainNoncesResponse) Reset() { *m = QueryGetChainNonces func (m *QueryGetChainNoncesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetChainNoncesResponse) ProtoMessage() {} func (*QueryGetChainNoncesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{25} + return fileDescriptor_65a992045e92a606, []int{29} } func (m *QueryGetChainNoncesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1218,7 +1402,7 @@ func (m *QueryAllChainNoncesRequest) Reset() { *m = QueryAllChainNoncesR func (m *QueryAllChainNoncesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllChainNoncesRequest) ProtoMessage() {} func (*QueryAllChainNoncesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{26} + return fileDescriptor_65a992045e92a606, []int{30} } func (m *QueryAllChainNoncesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1263,7 +1447,7 @@ func (m *QueryAllChainNoncesResponse) Reset() { *m = QueryAllChainNonces func (m *QueryAllChainNoncesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllChainNoncesResponse) ProtoMessage() {} func (*QueryAllChainNoncesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{27} + return fileDescriptor_65a992045e92a606, []int{31} } func (m *QueryAllChainNoncesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1313,7 +1497,7 @@ func (m *QueryAllPendingNoncesRequest) Reset() { *m = QueryAllPendingNon func (m *QueryAllPendingNoncesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllPendingNoncesRequest) ProtoMessage() {} func (*QueryAllPendingNoncesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{28} + return fileDescriptor_65a992045e92a606, []int{32} } func (m *QueryAllPendingNoncesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1350,7 +1534,7 @@ func (m *QueryAllPendingNoncesResponse) Reset() { *m = QueryAllPendingNo func (m *QueryAllPendingNoncesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllPendingNoncesResponse) ProtoMessage() {} func (*QueryAllPendingNoncesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{29} + return fileDescriptor_65a992045e92a606, []int{33} } func (m *QueryAllPendingNoncesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1394,7 +1578,7 @@ func (m *QueryPendingNoncesByChainRequest) Reset() { *m = QueryPendingNo func (m *QueryPendingNoncesByChainRequest) String() string { return proto.CompactTextString(m) } func (*QueryPendingNoncesByChainRequest) ProtoMessage() {} func (*QueryPendingNoncesByChainRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{30} + return fileDescriptor_65a992045e92a606, []int{34} } func (m *QueryPendingNoncesByChainRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1438,7 +1622,7 @@ func (m *QueryPendingNoncesByChainResponse) Reset() { *m = QueryPendingN func (m *QueryPendingNoncesByChainResponse) String() string { return proto.CompactTextString(m) } func (*QueryPendingNoncesByChainResponse) ProtoMessage() {} func (*QueryPendingNoncesByChainResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{31} + return fileDescriptor_65a992045e92a606, []int{35} } func (m *QueryPendingNoncesByChainResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1482,7 +1666,7 @@ func (m *QueryGetLastBlockHeightRequest) Reset() { *m = QueryGetLastBloc func (m *QueryGetLastBlockHeightRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetLastBlockHeightRequest) ProtoMessage() {} func (*QueryGetLastBlockHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{32} + return fileDescriptor_65a992045e92a606, []int{36} } func (m *QueryGetLastBlockHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1526,7 +1710,7 @@ func (m *QueryGetLastBlockHeightResponse) Reset() { *m = QueryGetLastBlo func (m *QueryGetLastBlockHeightResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetLastBlockHeightResponse) ProtoMessage() {} func (*QueryGetLastBlockHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{33} + return fileDescriptor_65a992045e92a606, []int{37} } func (m *QueryGetLastBlockHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1570,7 +1754,7 @@ func (m *QueryAllLastBlockHeightRequest) Reset() { *m = QueryAllLastBloc func (m *QueryAllLastBlockHeightRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllLastBlockHeightRequest) ProtoMessage() {} func (*QueryAllLastBlockHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{34} + return fileDescriptor_65a992045e92a606, []int{38} } func (m *QueryAllLastBlockHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1615,7 +1799,7 @@ func (m *QueryAllLastBlockHeightResponse) Reset() { *m = QueryAllLastBlo func (m *QueryAllLastBlockHeightResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllLastBlockHeightResponse) ProtoMessage() {} func (*QueryAllLastBlockHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{35} + return fileDescriptor_65a992045e92a606, []int{39} } func (m *QueryAllLastBlockHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1666,7 +1850,7 @@ func (m *QueryGetCctxRequest) Reset() { *m = QueryGetCctxRequest{} } func (m *QueryGetCctxRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetCctxRequest) ProtoMessage() {} func (*QueryGetCctxRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{36} + return fileDescriptor_65a992045e92a606, []int{40} } func (m *QueryGetCctxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1711,7 +1895,7 @@ func (m *QueryGetCctxByNonceRequest) Reset() { *m = QueryGetCctxByNonceR func (m *QueryGetCctxByNonceRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetCctxByNonceRequest) ProtoMessage() {} func (*QueryGetCctxByNonceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{37} + return fileDescriptor_65a992045e92a606, []int{41} } func (m *QueryGetCctxByNonceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1762,7 +1946,7 @@ func (m *QueryGetCctxResponse) Reset() { *m = QueryGetCctxResponse{} } func (m *QueryGetCctxResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetCctxResponse) ProtoMessage() {} func (*QueryGetCctxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{38} + return fileDescriptor_65a992045e92a606, []int{42} } func (m *QueryGetCctxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1806,7 +1990,7 @@ func (m *QueryAllCctxRequest) Reset() { *m = QueryAllCctxRequest{} } func (m *QueryAllCctxRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllCctxRequest) ProtoMessage() {} func (*QueryAllCctxRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{39} + return fileDescriptor_65a992045e92a606, []int{43} } func (m *QueryAllCctxRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1851,7 +2035,7 @@ func (m *QueryAllCctxResponse) Reset() { *m = QueryAllCctxResponse{} } func (m *QueryAllCctxResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllCctxResponse) ProtoMessage() {} func (*QueryAllCctxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{40} + return fileDescriptor_65a992045e92a606, []int{44} } func (m *QueryAllCctxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1903,7 +2087,7 @@ func (m *QueryAllCctxPendingRequest) Reset() { *m = QueryAllCctxPendingR func (m *QueryAllCctxPendingRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllCctxPendingRequest) ProtoMessage() {} func (*QueryAllCctxPendingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{41} + return fileDescriptor_65a992045e92a606, []int{45} } func (m *QueryAllCctxPendingRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1955,7 +2139,7 @@ func (m *QueryAllCctxPendingResponse) Reset() { *m = QueryAllCctxPending func (m *QueryAllCctxPendingResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllCctxPendingResponse) ProtoMessage() {} func (*QueryAllCctxPendingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{42} + return fileDescriptor_65a992045e92a606, []int{46} } func (m *QueryAllCctxPendingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2005,7 +2189,7 @@ func (m *QueryLastZetaHeightRequest) Reset() { *m = QueryLastZetaHeightR func (m *QueryLastZetaHeightRequest) String() string { return proto.CompactTextString(m) } func (*QueryLastZetaHeightRequest) ProtoMessage() {} func (*QueryLastZetaHeightRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{43} + return fileDescriptor_65a992045e92a606, []int{47} } func (m *QueryLastZetaHeightRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2042,7 +2226,7 @@ func (m *QueryLastZetaHeightResponse) Reset() { *m = QueryLastZetaHeight func (m *QueryLastZetaHeightResponse) String() string { return proto.CompactTextString(m) } func (*QueryLastZetaHeightResponse) ProtoMessage() {} func (*QueryLastZetaHeightResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{44} + return fileDescriptor_65a992045e92a606, []int{48} } func (m *QueryLastZetaHeightResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2087,7 +2271,7 @@ func (m *QueryConvertGasToZetaRequest) Reset() { *m = QueryConvertGasToZ func (m *QueryConvertGasToZetaRequest) String() string { return proto.CompactTextString(m) } func (*QueryConvertGasToZetaRequest) ProtoMessage() {} func (*QueryConvertGasToZetaRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{45} + return fileDescriptor_65a992045e92a606, []int{49} } func (m *QueryConvertGasToZetaRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2140,7 +2324,7 @@ func (m *QueryConvertGasToZetaResponse) Reset() { *m = QueryConvertGasTo func (m *QueryConvertGasToZetaResponse) String() string { return proto.CompactTextString(m) } func (*QueryConvertGasToZetaResponse) ProtoMessage() {} func (*QueryConvertGasToZetaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{46} + return fileDescriptor_65a992045e92a606, []int{50} } func (m *QueryConvertGasToZetaResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2197,7 +2381,7 @@ func (m *QueryMessagePassingProtocolFeeRequest) Reset() { *m = QueryMess func (m *QueryMessagePassingProtocolFeeRequest) String() string { return proto.CompactTextString(m) } func (*QueryMessagePassingProtocolFeeRequest) ProtoMessage() {} func (*QueryMessagePassingProtocolFeeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{47} + return fileDescriptor_65a992045e92a606, []int{51} } func (m *QueryMessagePassingProtocolFeeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2236,7 +2420,7 @@ func (m *QueryMessagePassingProtocolFeeResponse) Reset() { func (m *QueryMessagePassingProtocolFeeResponse) String() string { return proto.CompactTextString(m) } func (*QueryMessagePassingProtocolFeeResponse) ProtoMessage() {} func (*QueryMessagePassingProtocolFeeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{48} + return fileDescriptor_65a992045e92a606, []int{52} } func (m *QueryMessagePassingProtocolFeeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2280,7 +2464,7 @@ func (m *QueryZEVMGetTransactionReceiptRequest) Reset() { *m = QueryZEVM func (m *QueryZEVMGetTransactionReceiptRequest) String() string { return proto.CompactTextString(m) } func (*QueryZEVMGetTransactionReceiptRequest) ProtoMessage() {} func (*QueryZEVMGetTransactionReceiptRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{49} + return fileDescriptor_65a992045e92a606, []int{53} } func (m *QueryZEVMGetTransactionReceiptRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2337,7 +2521,7 @@ func (m *QueryZEVMGetTransactionReceiptResponse) Reset() { func (m *QueryZEVMGetTransactionReceiptResponse) String() string { return proto.CompactTextString(m) } func (*QueryZEVMGetTransactionReceiptResponse) ProtoMessage() {} func (*QueryZEVMGetTransactionReceiptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{50} + return fileDescriptor_65a992045e92a606, []int{54} } func (m *QueryZEVMGetTransactionReceiptResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2467,7 +2651,7 @@ func (m *Log) Reset() { *m = Log{} } func (m *Log) String() string { return proto.CompactTextString(m) } func (*Log) ProtoMessage() {} func (*Log) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{51} + return fileDescriptor_65a992045e92a606, []int{55} } func (m *Log) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2567,7 +2751,7 @@ func (m *QueryZEVMGetTransactionRequest) Reset() { *m = QueryZEVMGetTran func (m *QueryZEVMGetTransactionRequest) String() string { return proto.CompactTextString(m) } func (*QueryZEVMGetTransactionRequest) ProtoMessage() {} func (*QueryZEVMGetTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{52} + return fileDescriptor_65a992045e92a606, []int{56} } func (m *QueryZEVMGetTransactionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2627,7 +2811,7 @@ func (m *QueryZEVMGetTransactionResponse) Reset() { *m = QueryZEVMGetTra func (m *QueryZEVMGetTransactionResponse) String() string { return proto.CompactTextString(m) } func (*QueryZEVMGetTransactionResponse) ProtoMessage() {} func (*QueryZEVMGetTransactionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{53} + return fileDescriptor_65a992045e92a606, []int{57} } func (m *QueryZEVMGetTransactionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2783,7 +2967,7 @@ func (m *QueryZEVMGetBlockByNumberRequest) Reset() { *m = QueryZEVMGetBl func (m *QueryZEVMGetBlockByNumberRequest) String() string { return proto.CompactTextString(m) } func (*QueryZEVMGetBlockByNumberRequest) ProtoMessage() {} func (*QueryZEVMGetBlockByNumberRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{54} + return fileDescriptor_65a992045e92a606, []int{58} } func (m *QueryZEVMGetBlockByNumberRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2847,7 +3031,7 @@ func (m *QueryZEVMGetBlockByNumberResponse) Reset() { *m = QueryZEVMGetB func (m *QueryZEVMGetBlockByNumberResponse) String() string { return proto.CompactTextString(m) } func (*QueryZEVMGetBlockByNumberResponse) ProtoMessage() {} func (*QueryZEVMGetBlockByNumberResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_65a992045e92a606, []int{55} + return fileDescriptor_65a992045e92a606, []int{59} } func (m *QueryZEVMGetBlockByNumberResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3034,6 +3218,10 @@ func init() { proto.RegisterType((*QueryAllOutTxTrackerResponse)(nil), "zetachain.zetacore.crosschain.QueryAllOutTxTrackerResponse") proto.RegisterType((*QueryAllOutTxTrackerByChainRequest)(nil), "zetachain.zetacore.crosschain.QueryAllOutTxTrackerByChainRequest") proto.RegisterType((*QueryAllOutTxTrackerByChainResponse)(nil), "zetachain.zetacore.crosschain.QueryAllOutTxTrackerByChainResponse") + proto.RegisterType((*QueryAllInTxTrackerByChainRequest)(nil), "zetachain.zetacore.crosschain.QueryAllInTxTrackerByChainRequest") + proto.RegisterType((*QueryAllInTxTrackerByChainResponse)(nil), "zetachain.zetacore.crosschain.QueryAllInTxTrackerByChainResponse") + proto.RegisterType((*QueryAllInTxTrackersRequest)(nil), "zetachain.zetacore.crosschain.QueryAllInTxTrackersRequest") + proto.RegisterType((*QueryAllInTxTrackersResponse)(nil), "zetachain.zetacore.crosschain.QueryAllInTxTrackersResponse") proto.RegisterType((*QueryGetInTxHashToCctxRequest)(nil), "zetachain.zetacore.crosschain.QueryGetInTxHashToCctxRequest") proto.RegisterType((*QueryGetInTxHashToCctxResponse)(nil), "zetachain.zetacore.crosschain.QueryGetInTxHashToCctxResponse") proto.RegisterType((*QueryInTxHashToCctxDataRequest)(nil), "zetachain.zetacore.crosschain.QueryInTxHashToCctxDataRequest") @@ -3085,197 +3273,204 @@ func init() { func init() { proto.RegisterFile("crosschain/query.proto", fileDescriptor_65a992045e92a606) } var fileDescriptor_65a992045e92a606 = []byte{ - // 3038 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5a, 0xdd, 0x6f, 0x1b, 0xc7, - 0x11, 0xf7, 0x89, 0xfa, 0x5c, 0x7d, 0x7a, 0xad, 0x38, 0x0c, 0x63, 0x8b, 0xce, 0x39, 0xfe, 0x88, - 0x3f, 0xc8, 0x58, 0xb1, 0x9d, 0xc4, 0x76, 0xd2, 0x48, 0x76, 0xac, 0x18, 0x51, 0x12, 0xf5, 0xa4, - 0xf4, 0xc3, 0x45, 0x4b, 0x9c, 0x8e, 0x6b, 0xea, 0xe0, 0x23, 0x8f, 0xb9, 0x5d, 0x0a, 0x52, 0x0c, - 0xb5, 0x40, 0xfe, 0x82, 0x00, 0x05, 0xda, 0x97, 0xbe, 0xf6, 0xe3, 0xa1, 0x0f, 0x01, 0x1a, 0x34, - 0x05, 0x0a, 0xa4, 0x0f, 0x6d, 0xd3, 0x3c, 0x06, 0x2d, 0x50, 0xb4, 0x28, 0x40, 0x14, 0x71, 0x9f, - 0xf8, 0x1f, 0x14, 0xe8, 0x43, 0xb1, 0x73, 0x73, 0xbc, 0x3d, 0xf2, 0x4e, 0x3c, 0x51, 0x6c, 0xd1, - 0xbe, 0x88, 0xbb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, - 0x04, 0x5b, 0xba, 0xb1, 0xc3, 0x53, 0xee, 0x9e, 0xca, 0x83, 0xd0, 0xa3, 0x72, 0xf4, 0x0a, 0x5a, - 0x7d, 0xc9, 0x71, 0xe2, 0xad, 0x3e, 0xa8, 0x60, 0xff, 0x4c, 0x43, 0x1b, 0xc5, 0xac, 0xb4, 0xcf, - 0x16, 0x65, 0x06, 0xb4, 0x45, 0x83, 0xf4, 0xd3, 0xa7, 0x02, 0x57, 0xdb, 0xe0, 0x7c, 0xa9, 0x5c, - 0xf6, 0x18, 0x0f, 0xee, 0x16, 0xba, 0x40, 0x26, 0xe5, 0xb5, 0x55, 0x6f, 0x6c, 0x96, 0x1e, 0xb2, - 0x5d, 0xdc, 0xe9, 0x09, 0xc1, 0xf9, 0x5a, 0x63, 0xf3, 0x4d, 0xb6, 0xab, 0xbf, 0x46, 0x72, 0x71, - 0xcc, 0x68, 0x80, 0x39, 0x92, 0x61, 0x22, 0xf0, 0x0f, 0xd9, 0x94, 0x94, 0x4d, 0x61, 0x01, 0xdc, - 0x09, 0x43, 0x36, 0xdb, 0x77, 0x9a, 0x94, 0xb0, 0xbe, 0x1e, 0xdc, 0x69, 0x6f, 0xe2, 0x9d, 0x16, - 0x50, 0x51, 0xe0, 0x55, 0x92, 0xd9, 0x58, 0x5f, 0xc7, 0x5d, 0x4b, 0x71, 0x81, 0x1a, 0x72, 0xba, - 0x5e, 0xc4, 0x6b, 0x79, 0x85, 0x89, 0x15, 0x93, 0xaf, 0xc9, 0xbc, 0x45, 0x39, 0xca, 0xec, 0x5a, - 0x99, 0xed, 0x20, 0x46, 0xbf, 0xa3, 0x97, 0x48, 0xb6, 0x9b, 0x21, 0xbc, 0xc8, 0x03, 0x1a, 0xe2, - 0x38, 0xd7, 0x03, 0x47, 0x5b, 0x44, 0x9b, 0x51, 0x37, 0x11, 0xd1, 0x92, 0xe3, 0x74, 0x22, 0x1a, - 0x94, 0x7f, 0xfe, 0x4c, 0x43, 0x25, 0x22, 0x6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, 0x00, 0xff, 0xff, 0xe5, 0x26, 0xeb, 0xed, 0x7e, 0x32, 0x00, 0x00, + // 3151 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x5b, 0xdd, 0x6f, 0x1b, 0xc7, + 0x11, 0xf7, 0x89, 0xfa, 0x5c, 0x4a, 0x96, 0xbc, 0x56, 0x1c, 0x86, 0xb1, 0x45, 0xe7, 0x1c, 0x5b, + 0x8e, 0x3f, 0xc8, 0x58, 0xb1, 0x95, 0xc4, 0x76, 0xd2, 0x48, 0x76, 0xac, 0x18, 0x51, 0x12, 0xf5, + 0xa4, 0xf4, 0xc3, 0x45, 0x4b, 0x9c, 0xc8, 0x35, 0x75, 0x30, 0xc9, 0x63, 0x6e, 0x97, 0x82, 0x14, + 0x43, 0x2d, 0x90, 0x87, 0x3e, 0x07, 0x28, 0xd0, 0xbe, 0xf4, 0xb5, 0x1f, 0x0f, 0x7d, 0x28, 0xd0, + 0xa0, 0x29, 0x50, 0x20, 0x45, 0xd1, 0xd6, 0xcd, 0x63, 0xd0, 0x02, 0x45, 0x3f, 0x00, 0xa2, 0x48, + 0xfa, 0xc4, 0xff, 0xa0, 0x40, 0x1f, 0x8a, 0x9d, 0x9b, 0xe3, 0xed, 0xf1, 0xee, 0xc4, 0x13, 0xc5, + 0x04, 0xed, 0x8b, 0xb8, 0x3b, 0x7b, 0x33, 0xfb, 0x9b, 0xd9, 0x99, 0xdd, 0xd9, 0x9b, 0x13, 0x39, + 0x51, 0x72, 0x6c, 0xce, 0x4b, 0x5b, 0xa6, 0x55, 0x2f, 0xbc, 0xd3, 0x64, 0xce, 0x6e, 0xbe, 0xe1, + 0xd8, 0xc2, 0xa6, 0xa7, 0xde, 0x65, 0xc2, 0x04, 0x72, 0x1e, 0x5a, 0xb6, 0xc3, 0xf2, 0xfe, 0xa3, + 0xd9, 0x0b, 0x25, 0x9b, 0xd7, 0x6c, 0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 0xaf, 0xb7, 0x2d, 0x55, 0x21, 0x05, 0x9e, 0x0e, + 0x6c, 0x4b, 0x90, 0x06, 0xfb, 0x09, 0x71, 0x20, 0x11, 0x99, 0xd9, 0x27, 0x11, 0xb9, 0x48, 0x26, + 0x84, 0x55, 0x63, 0x5c, 0x98, 0xb5, 0x06, 0x46, 0x12, 0xa0, 0xeb, 0x10, 0x0d, 0xbf, 0x49, 0xaf, + 0x92, 0x49, 0x75, 0x55, 0x33, 0x14, 0x42, 0x1e, 0x96, 0x24, 0xb0, 0xda, 0x81, 0x9e, 0x8c, 0x16, + 0x74, 0xca, 0xe3, 0xf0, 0x3c, 0x44, 0x8b, 0x4b, 0x31, 0xf0, 0x97, 0x5e, 0x27, 0x33, 0xf2, 0x66, + 0x52, 0xbc, 0xcf, 0x58, 0xb1, 0xc1, 0x1c, 0x99, 0x9e, 0x65, 0x66, 0x01, 0xcd, 0xb1, 0x76, 0x2b, + 0x37, 0x25, 0xc7, 0xee, 0x30, 0xb6, 0xc6, 0x9c, 0x15, 0x93, 0x1b, 0xc1, 0xae, 0x54, 0xb5, 0x66, + 0xb9, 0xdf, 0x40, 0x64, 0x1e, 0xf3, 0x55, 0xad, 0x59, 0xf0, 0x02, 0xdf, 0xf0, 0x1a, 0x0b, 0x8f, + 0xe6, 0xc9, 0x08, 0xc4, 0x36, 0xfd, 0xbe, 0x46, 0x46, 0xdd, 0x02, 0x3b, 0xbd, 0xd2, 0x23, 0x1b, + 0x09, 0x57, 0xf8, 0xb3, 0x0b, 0x07, 0x61, 0x71, 0x77, 0x0c, 0xfd, 0xec, 0x7b, 0x7f, 0xfe, 0xd7, + 0xf7, 0x86, 0x72, 0xf4, 0x54, 0x41, 0x72, 0x5c, 0x56, 0x3e, 0xfc, 0x50, 0x3f, 0x8e, 0xa0, 0x8f, + 0x34, 0x32, 0xa9, 0xd6, 0x44, 0xe9, 0xf5, 0x24, 0x73, 0x45, 0x7f, 0x0e, 0x90, 0xbd, 0xd1, 0x17, + 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, 0x2b, 0x3a, 0x2c, 0xcb, 0xaf, 0x7f, 0xfc, 0xe9, 0x9c, 0xf6, + 0xc9, 0xa7, 0x73, 0xda, 0x3f, 0x3f, 0x9d, 0xd3, 0xde, 0xff, 0x6c, 0xee, 0xc8, 0x27, 0x9f, 0xcd, + 0x1d, 0xf9, 0xeb, 0x67, 0x73, 0x47, 0xee, 0x5d, 0xa9, 0x58, 0x62, 0xab, 0xb9, 0x99, 0x2f, 0xd9, + 0x35, 0x55, 0x8c, 0x87, 0xa3, 0xb0, 0x13, 0x90, 0xb8, 0xdb, 0x60, 0x7c, 0x73, 0x14, 0xd2, 0x9e, + 0xe7, 0xfe, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x16, 0xbf, 0x39, 0xb6, 0x14, 0x36, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3297,6 +3492,8 @@ type QueryClient interface { // Queries a list of OutTxTracker items. OutTxTrackerAll(ctx context.Context, in *QueryAllOutTxTrackerRequest, opts ...grpc.CallOption) (*QueryAllOutTxTrackerResponse, error) OutTxTrackerAllByChain(ctx context.Context, in *QueryAllOutTxTrackerByChainRequest, opts ...grpc.CallOption) (*QueryAllOutTxTrackerByChainResponse, error) + InTxTrackerAllByChain(ctx context.Context, in *QueryAllInTxTrackerByChainRequest, opts ...grpc.CallOption) (*QueryAllInTxTrackerByChainResponse, error) + InTxTrackerAll(ctx context.Context, in *QueryAllInTxTrackersRequest, opts ...grpc.CallOption) (*QueryAllInTxTrackersResponse, error) // Queries a InTxHashToCctx by index. InTxHashToCctx(ctx context.Context, in *QueryGetInTxHashToCctxRequest, opts ...grpc.CallOption) (*QueryGetInTxHashToCctxResponse, error) // Queries a InTxHashToCctx data by index. @@ -3380,6 +3577,24 @@ func (c *queryClient) OutTxTrackerAllByChain(ctx context.Context, in *QueryAllOu return out, nil } +func (c *queryClient) InTxTrackerAllByChain(ctx context.Context, in *QueryAllInTxTrackerByChainRequest, opts ...grpc.CallOption) (*QueryAllInTxTrackerByChainResponse, error) { + out := new(QueryAllInTxTrackerByChainResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Query/InTxTrackerAllByChain", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) InTxTrackerAll(ctx context.Context, in *QueryAllInTxTrackersRequest, opts ...grpc.CallOption) (*QueryAllInTxTrackersResponse, error) { + out := new(QueryAllInTxTrackersResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Query/InTxTrackerAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) InTxHashToCctx(ctx context.Context, in *QueryGetInTxHashToCctxRequest, opts ...grpc.CallOption) (*QueryGetInTxHashToCctxResponse, error) { out := new(QueryGetInTxHashToCctxResponse) err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Query/InTxHashToCctx", in, out, opts...) @@ -3578,6 +3793,8 @@ type QueryServer interface { // Queries a list of OutTxTracker items. OutTxTrackerAll(context.Context, *QueryAllOutTxTrackerRequest) (*QueryAllOutTxTrackerResponse, error) OutTxTrackerAllByChain(context.Context, *QueryAllOutTxTrackerByChainRequest) (*QueryAllOutTxTrackerByChainResponse, error) + InTxTrackerAllByChain(context.Context, *QueryAllInTxTrackerByChainRequest) (*QueryAllInTxTrackerByChainResponse, error) + InTxTrackerAll(context.Context, *QueryAllInTxTrackersRequest) (*QueryAllInTxTrackersResponse, error) // Queries a InTxHashToCctx by index. InTxHashToCctx(context.Context, *QueryGetInTxHashToCctxRequest) (*QueryGetInTxHashToCctxResponse, error) // Queries a InTxHashToCctx data by index. @@ -3633,6 +3850,12 @@ func (*UnimplementedQueryServer) OutTxTrackerAll(ctx context.Context, req *Query func (*UnimplementedQueryServer) OutTxTrackerAllByChain(ctx context.Context, req *QueryAllOutTxTrackerByChainRequest) (*QueryAllOutTxTrackerByChainResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OutTxTrackerAllByChain not implemented") } +func (*UnimplementedQueryServer) InTxTrackerAllByChain(ctx context.Context, req *QueryAllInTxTrackerByChainRequest) (*QueryAllInTxTrackerByChainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InTxTrackerAllByChain not implemented") +} +func (*UnimplementedQueryServer) InTxTrackerAll(ctx context.Context, req *QueryAllInTxTrackersRequest) (*QueryAllInTxTrackersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InTxTrackerAll not implemented") +} func (*UnimplementedQueryServer) InTxHashToCctx(ctx context.Context, req *QueryGetInTxHashToCctxRequest) (*QueryGetInTxHashToCctxResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InTxHashToCctx not implemented") } @@ -3773,6 +3996,42 @@ func _Query_OutTxTrackerAllByChain_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_InTxTrackerAllByChain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllInTxTrackerByChainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).InTxTrackerAllByChain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.crosschain.Query/InTxTrackerAllByChain", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).InTxTrackerAllByChain(ctx, req.(*QueryAllInTxTrackerByChainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_InTxTrackerAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllInTxTrackersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).InTxTrackerAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.crosschain.Query/InTxTrackerAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).InTxTrackerAll(ctx, req.(*QueryAllInTxTrackersRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_InTxHashToCctx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetInTxHashToCctxRequest) if err := dec(in); err != nil { @@ -4171,6 +4430,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "OutTxTrackerAllByChain", Handler: _Query_OutTxTrackerAllByChain_Handler, }, + { + MethodName: "InTxTrackerAllByChain", + Handler: _Query_InTxTrackerAllByChain_Handler, + }, + { + MethodName: "InTxTrackerAll", + Handler: _Query_InTxTrackerAll_Handler, + }, { MethodName: "InTxHashToCctx", Handler: _Query_InTxHashToCctx_Handler, @@ -4615,7 +4882,7 @@ func (m *QueryAllOutTxTrackerByChainResponse) MarshalToSizedBuffer(dAtA []byte) return len(dAtA) - i, nil } -func (m *QueryGetInTxHashToCctxRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAllInTxTrackerByChainRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4625,18 +4892,167 @@ func (m *QueryGetInTxHashToCctxRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryGetInTxHashToCctxRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAllInTxTrackerByChainRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryGetInTxHashToCctxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAllInTxTrackerByChainRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.InTxHash) > 0 { - i -= len(m.InTxHash) + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ChainId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryAllInTxTrackerByChainResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllInTxTrackerByChainResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllInTxTrackerByChainResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.InTxTracker) > 0 { + for iNdEx := len(m.InTxTracker) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InTxTracker[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryAllInTxTrackersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllInTxTrackersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllInTxTrackersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryAllInTxTrackersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllInTxTrackersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllInTxTrackersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InTxTracker) > 0 { + for iNdEx := len(m.InTxTracker) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InTxTracker[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryGetInTxHashToCctxRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetInTxHashToCctxRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetInTxHashToCctxRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InTxHash) > 0 { + i -= len(m.InTxHash) copy(dAtA[i:], m.InTxHash) i = encodeVarintQuery(dAtA, i, uint64(len(m.InTxHash))) i-- @@ -6743,6 +7159,65 @@ func (m *QueryAllOutTxTrackerByChainResponse) Size() (n int) { return n } +func (m *QueryAllInTxTrackerByChainRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ChainId != 0 { + n += 1 + sovQuery(uint64(m.ChainId)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllInTxTrackerByChainResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.InTxTracker) > 0 { + for _, e := range m.InTxTracker { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllInTxTrackersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryAllInTxTrackersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.InTxTracker) > 0 { + for _, e := range m.InTxTracker { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryGetInTxHashToCctxRequest) Size() (n int) { if m == nil { return 0 @@ -8478,6 +8953,365 @@ func (m *QueryAllOutTxTrackerByChainResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryAllInTxTrackerByChainRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllInTxTrackerByChainRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllInTxTrackerByChainRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllInTxTrackerByChainResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllInTxTrackerByChainResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllInTxTrackerByChainResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxTracker", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InTxTracker = append(m.InTxTracker, InTxTracker{}) + if err := m.InTxTracker[len(m.InTxTracker)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllInTxTrackersRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllInTxTrackersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllInTxTrackersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllInTxTrackersResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllInTxTrackersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllInTxTrackersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InTxTracker", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InTxTracker = append(m.InTxTracker, InTxTracker{}) + if err := m.InTxTracker[len(m.InTxTracker)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryGetInTxHashToCctxRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/crosschain/types/query.pb.gw.go b/x/crosschain/types/query.pb.gw.go index 7832f5170c..ee6cee4368 100644 --- a/x/crosschain/types/query.pb.gw.go +++ b/x/crosschain/types/query.pb.gw.go @@ -235,6 +235,96 @@ func local_request_Query_OutTxTrackerAllByChain_0(ctx context.Context, marshaler } +var ( + filter_Query_InTxTrackerAllByChain_0 = &utilities.DoubleArray{Encoding: map[string]int{"chain_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_InTxTrackerAllByChain_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllInTxTrackerByChainRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_InTxTrackerAllByChain_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.InTxTrackerAllByChain(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_InTxTrackerAllByChain_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllInTxTrackerByChainRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["chain_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "chain_id") + } + + protoReq.ChainId, err = runtime.Int64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "chain_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_InTxTrackerAllByChain_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.InTxTrackerAllByChain(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_InTxTrackerAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllInTxTrackersRequest + var metadata runtime.ServerMetadata + + msg, err := client.InTxTrackerAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_InTxTrackerAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllInTxTrackersRequest + var metadata runtime.ServerMetadata + + msg, err := server.InTxTrackerAll(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_InTxHashToCctx_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetInTxHashToCctxRequest var metadata runtime.ServerMetadata @@ -1165,6 +1255,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_InTxTrackerAllByChain_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_InTxTrackerAllByChain_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_InTxTrackerAllByChain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_InTxTrackerAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_InTxTrackerAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_InTxTrackerAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_InTxHashToCctx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1769,6 +1905,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_InTxTrackerAllByChain_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_InTxTrackerAllByChain_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_InTxTrackerAllByChain_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_InTxTrackerAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_InTxTrackerAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_InTxTrackerAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_InTxHashToCctx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -2201,6 +2377,10 @@ var ( pattern_Query_OutTxTrackerAllByChain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "crosschain", "outTxTrackerByChain", "chain"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_InTxTrackerAllByChain_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "crosschain", "inTxTrackerByChain", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_InTxTrackerAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "crosschain", "inTxTrackers"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_InTxHashToCctx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "crosschain", "inTxHashToCctx", "inTxHash"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_InTxHashToCctxData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "crosschain", "in_tx_hash_to_cctx_data", "inTxHash"}, "", runtime.AssumeColonVerbOpt(false))) @@ -2253,6 +2433,10 @@ var ( forward_Query_OutTxTrackerAllByChain_0 = runtime.ForwardResponseMessage + forward_Query_InTxTrackerAllByChain_0 = runtime.ForwardResponseMessage + + forward_Query_InTxTrackerAll_0 = runtime.ForwardResponseMessage + forward_Query_InTxHashToCctx_0 = runtime.ForwardResponseMessage forward_Query_InTxHashToCctxData_0 = runtime.ForwardResponseMessage diff --git a/x/crosschain/types/tx.pb.go b/x/crosschain/types/tx.pb.go index 6b173e9478..279eeffffd 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -120,6 +120,134 @@ func (m *MsgMigrateTssFundsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgMigrateTssFundsResponse proto.InternalMessageInfo +type MsgAddToInTxTracker struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + ChainId int64 `protobuf:"varint,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + TxHash string `protobuf:"bytes,3,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` + CoinType common.CoinType `protobuf:"varint,4,opt,name=coin_type,json=coinType,proto3,enum=common.CoinType" json:"coin_type,omitempty"` + Proof *common.Proof `protobuf:"bytes,5,opt,name=proof,proto3" json:"proof,omitempty"` + BlockHash string `protobuf:"bytes,6,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + TxIndex int64 `protobuf:"varint,7,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` +} + +func (m *MsgAddToInTxTracker) Reset() { *m = MsgAddToInTxTracker{} } +func (m *MsgAddToInTxTracker) String() string { return proto.CompactTextString(m) } +func (*MsgAddToInTxTracker) ProtoMessage() {} +func (*MsgAddToInTxTracker) Descriptor() ([]byte, []int) { + return fileDescriptor_81d6d611190b7635, []int{2} +} +func (m *MsgAddToInTxTracker) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddToInTxTracker) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddToInTxTracker.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddToInTxTracker) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddToInTxTracker.Merge(m, src) +} +func (m *MsgAddToInTxTracker) XXX_Size() int { + return m.Size() +} +func (m *MsgAddToInTxTracker) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddToInTxTracker.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddToInTxTracker proto.InternalMessageInfo + +func (m *MsgAddToInTxTracker) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgAddToInTxTracker) GetChainId() int64 { + if m != nil { + return m.ChainId + } + return 0 +} + +func (m *MsgAddToInTxTracker) GetTxHash() string { + if m != nil { + return m.TxHash + } + return "" +} + +func (m *MsgAddToInTxTracker) GetCoinType() common.CoinType { + if m != nil { + return m.CoinType + } + return common.CoinType_Zeta +} + +func (m *MsgAddToInTxTracker) GetProof() *common.Proof { + if m != nil { + return m.Proof + } + return nil +} + +func (m *MsgAddToInTxTracker) GetBlockHash() string { + if m != nil { + return m.BlockHash + } + return "" +} + +func (m *MsgAddToInTxTracker) GetTxIndex() int64 { + if m != nil { + return m.TxIndex + } + return 0 +} + +type MsgAddToInTxTrackerResponse struct { +} + +func (m *MsgAddToInTxTrackerResponse) Reset() { *m = MsgAddToInTxTrackerResponse{} } +func (m *MsgAddToInTxTrackerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAddToInTxTrackerResponse) ProtoMessage() {} +func (*MsgAddToInTxTrackerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_81d6d611190b7635, []int{3} +} +func (m *MsgAddToInTxTrackerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAddToInTxTrackerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAddToInTxTrackerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAddToInTxTrackerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAddToInTxTrackerResponse.Merge(m, src) +} +func (m *MsgAddToInTxTrackerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAddToInTxTrackerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAddToInTxTrackerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAddToInTxTrackerResponse proto.InternalMessageInfo + type MsgUpdateTssAddress struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` TssPubkey string `protobuf:"bytes,2,opt,name=tss_pubkey,json=tssPubkey,proto3" json:"tss_pubkey,omitempty"` @@ -129,7 +257,7 @@ func (m *MsgUpdateTssAddress) Reset() { *m = MsgUpdateTssAddress{} } func (m *MsgUpdateTssAddress) String() string { return proto.CompactTextString(m) } func (*MsgUpdateTssAddress) ProtoMessage() {} func (*MsgUpdateTssAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{2} + return fileDescriptor_81d6d611190b7635, []int{4} } func (m *MsgUpdateTssAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -179,7 +307,7 @@ func (m *MsgUpdateTssAddressResponse) Reset() { *m = MsgUpdateTssAddress func (m *MsgUpdateTssAddressResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateTssAddressResponse) ProtoMessage() {} func (*MsgUpdateTssAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{3} + return fileDescriptor_81d6d611190b7635, []int{5} } func (m *MsgUpdateTssAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -222,7 +350,7 @@ func (m *MsgWhitelistERC20) Reset() { *m = MsgWhitelistERC20{} } func (m *MsgWhitelistERC20) String() string { return proto.CompactTextString(m) } func (*MsgWhitelistERC20) ProtoMessage() {} func (*MsgWhitelistERC20) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{4} + return fileDescriptor_81d6d611190b7635, []int{6} } func (m *MsgWhitelistERC20) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -309,7 +437,7 @@ func (m *MsgWhitelistERC20Response) Reset() { *m = MsgWhitelistERC20Resp func (m *MsgWhitelistERC20Response) String() string { return proto.CompactTextString(m) } func (*MsgWhitelistERC20Response) ProtoMessage() {} func (*MsgWhitelistERC20Response) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{5} + return fileDescriptor_81d6d611190b7635, []int{7} } func (m *MsgWhitelistERC20Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -366,7 +494,7 @@ func (m *MsgAddToOutTxTracker) Reset() { *m = MsgAddToOutTxTracker{} } func (m *MsgAddToOutTxTracker) String() string { return proto.CompactTextString(m) } func (*MsgAddToOutTxTracker) ProtoMessage() {} func (*MsgAddToOutTxTracker) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{6} + return fileDescriptor_81d6d611190b7635, []int{8} } func (m *MsgAddToOutTxTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -451,7 +579,7 @@ func (m *MsgAddToOutTxTrackerResponse) Reset() { *m = MsgAddToOutTxTrack func (m *MsgAddToOutTxTrackerResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddToOutTxTrackerResponse) ProtoMessage() {} func (*MsgAddToOutTxTrackerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{7} + return fileDescriptor_81d6d611190b7635, []int{9} } func (m *MsgAddToOutTxTrackerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -490,7 +618,7 @@ func (m *MsgRemoveFromOutTxTracker) Reset() { *m = MsgRemoveFromOutTxTra func (m *MsgRemoveFromOutTxTracker) String() string { return proto.CompactTextString(m) } func (*MsgRemoveFromOutTxTracker) ProtoMessage() {} func (*MsgRemoveFromOutTxTracker) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{8} + return fileDescriptor_81d6d611190b7635, []int{10} } func (m *MsgRemoveFromOutTxTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -547,7 +675,7 @@ func (m *MsgRemoveFromOutTxTrackerResponse) Reset() { *m = MsgRemoveFrom func (m *MsgRemoveFromOutTxTrackerResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemoveFromOutTxTrackerResponse) ProtoMessage() {} func (*MsgRemoveFromOutTxTrackerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{9} + return fileDescriptor_81d6d611190b7635, []int{11} } func (m *MsgRemoveFromOutTxTrackerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -587,7 +715,7 @@ func (m *MsgCreateTSSVoter) Reset() { *m = MsgCreateTSSVoter{} } func (m *MsgCreateTSSVoter) String() string { return proto.CompactTextString(m) } func (*MsgCreateTSSVoter) ProtoMessage() {} func (*MsgCreateTSSVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{10} + return fileDescriptor_81d6d611190b7635, []int{12} } func (m *MsgCreateTSSVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -651,7 +779,7 @@ func (m *MsgCreateTSSVoterResponse) Reset() { *m = MsgCreateTSSVoterResp func (m *MsgCreateTSSVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateTSSVoterResponse) ProtoMessage() {} func (*MsgCreateTSSVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{11} + return fileDescriptor_81d6d611190b7635, []int{13} } func (m *MsgCreateTSSVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -692,7 +820,7 @@ func (m *MsgGasPriceVoter) Reset() { *m = MsgGasPriceVoter{} } func (m *MsgGasPriceVoter) String() string { return proto.CompactTextString(m) } func (*MsgGasPriceVoter) ProtoMessage() {} func (*MsgGasPriceVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{12} + return fileDescriptor_81d6d611190b7635, []int{14} } func (m *MsgGasPriceVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -763,7 +891,7 @@ func (m *MsgGasPriceVoterResponse) Reset() { *m = MsgGasPriceVoterRespon func (m *MsgGasPriceVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgGasPriceVoterResponse) ProtoMessage() {} func (*MsgGasPriceVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{13} + return fileDescriptor_81d6d611190b7635, []int{15} } func (m *MsgGasPriceVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -802,7 +930,7 @@ func (m *MsgNonceVoter) Reset() { *m = MsgNonceVoter{} } func (m *MsgNonceVoter) String() string { return proto.CompactTextString(m) } func (*MsgNonceVoter) ProtoMessage() {} func (*MsgNonceVoter) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{14} + return fileDescriptor_81d6d611190b7635, []int{16} } func (m *MsgNonceVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -859,7 +987,7 @@ func (m *MsgNonceVoterResponse) Reset() { *m = MsgNonceVoterResponse{} } func (m *MsgNonceVoterResponse) String() string { return proto.CompactTextString(m) } func (*MsgNonceVoterResponse) ProtoMessage() {} func (*MsgNonceVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{15} + return fileDescriptor_81d6d611190b7635, []int{17} } func (m *MsgNonceVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -907,7 +1035,7 @@ func (m *MsgVoteOnObservedOutboundTx) Reset() { *m = MsgVoteOnObservedOu func (m *MsgVoteOnObservedOutboundTx) String() string { return proto.CompactTextString(m) } func (*MsgVoteOnObservedOutboundTx) ProtoMessage() {} func (*MsgVoteOnObservedOutboundTx) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{16} + return fileDescriptor_81d6d611190b7635, []int{18} } func (m *MsgVoteOnObservedOutboundTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1013,7 +1141,7 @@ func (m *MsgVoteOnObservedOutboundTxResponse) Reset() { *m = MsgVoteOnOb func (m *MsgVoteOnObservedOutboundTxResponse) String() string { return proto.CompactTextString(m) } func (*MsgVoteOnObservedOutboundTxResponse) ProtoMessage() {} func (*MsgVoteOnObservedOutboundTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{17} + return fileDescriptor_81d6d611190b7635, []int{19} } func (m *MsgVoteOnObservedOutboundTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1064,7 +1192,7 @@ func (m *MsgVoteOnObservedInboundTx) Reset() { *m = MsgVoteOnObservedInb func (m *MsgVoteOnObservedInboundTx) String() string { return proto.CompactTextString(m) } func (*MsgVoteOnObservedInboundTx) ProtoMessage() {} func (*MsgVoteOnObservedInboundTx) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{18} + return fileDescriptor_81d6d611190b7635, []int{20} } func (m *MsgVoteOnObservedInboundTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1184,7 +1312,7 @@ func (m *MsgVoteOnObservedInboundTxResponse) Reset() { *m = MsgVoteOnObs func (m *MsgVoteOnObservedInboundTxResponse) String() string { return proto.CompactTextString(m) } func (*MsgVoteOnObservedInboundTxResponse) ProtoMessage() {} func (*MsgVoteOnObservedInboundTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{19} + return fileDescriptor_81d6d611190b7635, []int{21} } func (m *MsgVoteOnObservedInboundTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1223,7 +1351,7 @@ func (m *MsgSetNodeKeys) Reset() { *m = MsgSetNodeKeys{} } func (m *MsgSetNodeKeys) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeys) ProtoMessage() {} func (*MsgSetNodeKeys) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{20} + return fileDescriptor_81d6d611190b7635, []int{22} } func (m *MsgSetNodeKeys) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1280,7 +1408,7 @@ func (m *MsgSetNodeKeysResponse) Reset() { *m = MsgSetNodeKeysResponse{} func (m *MsgSetNodeKeysResponse) String() string { return proto.CompactTextString(m) } func (*MsgSetNodeKeysResponse) ProtoMessage() {} func (*MsgSetNodeKeysResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{21} + return fileDescriptor_81d6d611190b7635, []int{23} } func (m *MsgSetNodeKeysResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1312,6 +1440,8 @@ var xxx_messageInfo_MsgSetNodeKeysResponse proto.InternalMessageInfo func init() { proto.RegisterType((*MsgMigrateTssFunds)(nil), "zetachain.zetacore.crosschain.MsgMigrateTssFunds") proto.RegisterType((*MsgMigrateTssFundsResponse)(nil), "zetachain.zetacore.crosschain.MsgMigrateTssFundsResponse") + proto.RegisterType((*MsgAddToInTxTracker)(nil), "zetachain.zetacore.crosschain.MsgAddToInTxTracker") + proto.RegisterType((*MsgAddToInTxTrackerResponse)(nil), "zetachain.zetacore.crosschain.MsgAddToInTxTrackerResponse") proto.RegisterType((*MsgUpdateTssAddress)(nil), "zetachain.zetacore.crosschain.MsgUpdateTssAddress") proto.RegisterType((*MsgUpdateTssAddressResponse)(nil), "zetachain.zetacore.crosschain.MsgUpdateTssAddressResponse") proto.RegisterType((*MsgWhitelistERC20)(nil), "zetachain.zetacore.crosschain.MsgWhitelistERC20") @@ -1337,97 +1467,100 @@ func init() { func init() { proto.RegisterFile("crosschain/tx.proto", fileDescriptor_81d6d611190b7635) } var fileDescriptor_81d6d611190b7635 = []byte{ - // 1440 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x6f,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 0x75, 0xb0, 0xed, 0xf9, - 0x56, 0x83, 0xaa, 0x99, 0xab, 0xca, 0xcd, 0xbc, 0x91, 0xd0, 0x68, 0x19, 0x72, 0xae, 0x45, 0xcd, - 0x86, 0xe7, 0x7b, 0x4c, 0x9d, 0x12, 0x36, 0xb2, 0xae, 0x45, 0x3f, 0xe5, 0xb4, 0x6e, 0xc2, 0xe5, - 0x13, 0x31, 0xc5, 0x11, 0xf3, 0x08, 0x8e, 0x52, 0x11, 0xc8, 0x08, 0x67, 0x8e, 0xba, 0x23, 0x58, - 0x01, 0xb0, 0x6d, 0xd6, 0x36, 0xbd, 0xc0, 0xc1, 0xed, 0x38, 0xa9, 0x9c, 0xb3, 0xcd, 0x19, 0xfa, - 0x6b, 0x05, 0x16, 0x2b, 0xd4, 0x7d, 0xe8, 0x38, 0x55, 0xb2, 0xdb, 0x62, 0xd5, 0x76, 0x35, 0xb4, - 0xec, 0x03, 0x1c, 0x9e, 0xaf, 0xb2, 0x16, 0x61, 0x32, 0x20, 0x81, 0x8d, 0x45, 0xae, 0x26, 0x0c, - 0x49, 0xa0, 0x25, 0x98, 0x62, 0x6d, 0xb3, 0x6e, 0xd1, 0x7a, 0x94, 0xac, 0x0c, 0x6b, 0x3f, 0xb1, - 0x68, 0x1d, 0xad, 0xc1, 0x64, 0x33, 0x24, 0x64, 0x5f, 0x64, 0x6b, 0xba, 0x9c, 0x2f, 0x46, 0x8d, - 0xf0, 0x8c, 0x33, 0x0d, 0xb9, 0xc7, 0x03, 0xa8, 0x35, 0x88, 0x7d, 0x20, 0x15, 0x64, 0x64, 0x00, - 0x82, 0x23, 0x74, 0x5c, 0x86, 0x6c, 0x12, 0x9d, 0xcc, 0xde, 0x54, 0x1c, 0x5b, 0x01, 0xae, 0x9c, - 0x16, 0x5a, 0x52, 0x31, 0xfb, 0x22, 0xb9, 0x06, 0xf6, 0xc9, 0x21, 0x7e, 0x1c, 0x12, 0xff, 0x1f, - 0x8a, 0x5f, 0x5f, 0x83, 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ef, 0x04, 0xf1, 0x60, - 0xb8, 0xca, 0x7e, 0x58, 0x6d, 0xe3, 0xfc, 0xd8, 0xc4, 0xb9, 0x1f, 0x14, 0x58, 0xea, 0x77, 0xb7, - 0xdf, 0x1f, 0x55, 0x7f, 0x02, 0xd5, 0x1e, 0x9e, 0x1b, 0xda, 0x5d, 0xa1, 0x3d, 0xff, 0x14, 0xcf, - 0x50, 0xa1, 0x69, 0xc4, 0x59, 0x2a, 0xb4, 0xcf, 0x3f, 0xb7, 0xaf, 0x14, 0x98, 0x3b, 0xf1, 0xc7, - 0xb8, 0x3c, 0x5c, 0x5d, 0x2f, 0x46, 0x7b, 0x30, 0x3a, 0x26, 0x71, 0xe2, 0x4b, 0xb8, 0xd0, 0xfb, - 0x39, 0xe1, 0xce, 0x70, 0x75, 0x3d, 0x10, 0xed, 0xfe, 0xc8, 0x90, 0xd8, 0x81, 0x8d, 0xa7, 0x2f, - 0xdf, 0x16, 0x94, 0x57, 0x6f, 0x0b, 0xca, 0x1f, 0x6f, 0x0b, 0xca, 0xb7, 0xef, 0x0a, 0x63, 0xaf, - 0xde, 0x15, 0xc6, 0x7e, 0x7b, 0x57, 0x18, 0x7b, 0x71, 0xa7, 0xeb, 0x09, 0xe5, 0x4a, 0xd7, 0xe5, - 0x77, 0x95, 0x58, 0x7f, 0xa9, 0x5d, 0xea, 0xfe, 0xda, 0xc2, 0x5f, 0xd4, 0x5a, 0x46, 0x7c, 0x27, - 0xb9, 0xfb, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x59, 0x22, 0xcb, 0x23, 0x88, 0x11, 0x00, 0x00, + // 1487 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xdd, 0x4e, 0x1b, 0xc7, + 0x17, 0x67, 0xff, 0x80, 0xb1, 0x8f, 0x31, 0x81, 0x85, 0x84, 0xcd, 0x12, 0x0c, 0x59, 0xfe, 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e, 0x39, 0x04, 0x15, 0x07, + 0x8b, 0x4a, 0x00, 0xd4, 0x8f, 0x46, 0x04, 0xc4, 0xaa, 0x1b, 0x00, 0x1d, 0x93, 0xcc, 0x8d, 0xc1, + 0x62, 0x4e, 0x76, 0xab, 0x1f, 0x8c, 0xb2, 0x3b, 0xd6, 0xf8, 0x8b, 0x04, 0x4a, 0xcf, 0x31, 0x66, + 0x88, 0xd2, 0xea, 0x85, 0x55, 0x37, 0xcf, 0x8f, 0x8d, 0x8d, 0xfb, 0x49, 0x82, 0xc5, 0x5e, 0x17, + 0xcc, 0xdd, 0x51, 0xe5, 0xc7, 0x50, 0xf5, 0xfe, 0xb9, 0xa1, 0x9d, 0x15, 0xda, 0xf5, 0x5c, 0x1d, + 0xa2, 0x42, 0x93, 0x88, 0x61, 0x2a, 0xb4, 0xc7, 0xf3, 0x31, 0x3c, 0x3b, 0x4e, 0xbd, 0xce, 0x87, + 0x38, 0x3b, 0xba, 0x31, 0xc3, 0x9c, 0x1d, 0xbd, 0x5e, 0xed, 0xf2, 0xd7, 0x70, 0xa1, 0xfb, 0x6f, + 0x9e, 0x5b, 0x83, 0xc5, 0x75, 0x41, 0xd4, 0xbb, 0x23, 0x43, 0x22, 0x03, 0x36, 0x1f, 0x3f, 0x7f, + 0x9d, 0x97, 0x5e, 0xbc, 0xce, 0x4b, 0x7f, 0xbd, 0xce, 0x4b, 0xdf, 0xbf, 0xc9, 0x8f, 0xbd, 0x78, + 0x93, 0x1f, 0xfb, 0xe3, 0x4d, 0x7e, 0xec, 0xd9, 0xad, 0x8e, 0x7b, 0x3c, 0x14, 0xba, 0xc1, 0xff, + 0xef, 0x8a, 0xe4, 0x17, 0x5b, 0xc5, 0xce, 0x7f, 0xc1, 0xc2, 0x6b, 0xbd, 0x9a, 0x62, 0xff, 0x5f, + 0xdd, 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x49, 0x4b, 0x22, 0xc9, 0x20, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1443,6 +1576,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type MsgClient interface { AddToOutTxTracker(ctx context.Context, in *MsgAddToOutTxTracker, opts ...grpc.CallOption) (*MsgAddToOutTxTrackerResponse, error) + AddToInTxTracker(ctx context.Context, in *MsgAddToInTxTracker, opts ...grpc.CallOption) (*MsgAddToInTxTrackerResponse, error) RemoveFromOutTxTracker(ctx context.Context, in *MsgRemoveFromOutTxTracker, opts ...grpc.CallOption) (*MsgRemoveFromOutTxTrackerResponse, error) CreateTSSVoter(ctx context.Context, in *MsgCreateTSSVoter, opts ...grpc.CallOption) (*MsgCreateTSSVoterResponse, error) GasPriceVoter(ctx context.Context, in *MsgGasPriceVoter, opts ...grpc.CallOption) (*MsgGasPriceVoterResponse, error) @@ -1471,6 +1605,15 @@ func (c *msgClient) AddToOutTxTracker(ctx context.Context, in *MsgAddToOutTxTrac return out, nil } +func (c *msgClient) AddToInTxTracker(ctx context.Context, in *MsgAddToInTxTracker, opts ...grpc.CallOption) (*MsgAddToInTxTrackerResponse, error) { + out := new(MsgAddToInTxTrackerResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Msg/AddToInTxTracker", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) RemoveFromOutTxTracker(ctx context.Context, in *MsgRemoveFromOutTxTracker, opts ...grpc.CallOption) (*MsgRemoveFromOutTxTrackerResponse, error) { out := new(MsgRemoveFromOutTxTrackerResponse) err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Msg/RemoveFromOutTxTracker", in, out, opts...) @@ -1555,6 +1698,7 @@ func (c *msgClient) MigrateTssFunds(ctx context.Context, in *MsgMigrateTssFunds, // MsgServer is the server API for Msg service. type MsgServer interface { AddToOutTxTracker(context.Context, *MsgAddToOutTxTracker) (*MsgAddToOutTxTrackerResponse, error) + AddToInTxTracker(context.Context, *MsgAddToInTxTracker) (*MsgAddToInTxTrackerResponse, error) RemoveFromOutTxTracker(context.Context, *MsgRemoveFromOutTxTracker) (*MsgRemoveFromOutTxTrackerResponse, error) CreateTSSVoter(context.Context, *MsgCreateTSSVoter) (*MsgCreateTSSVoterResponse, error) GasPriceVoter(context.Context, *MsgGasPriceVoter) (*MsgGasPriceVoterResponse, error) @@ -1573,6 +1717,9 @@ type UnimplementedMsgServer struct { func (*UnimplementedMsgServer) AddToOutTxTracker(ctx context.Context, req *MsgAddToOutTxTracker) (*MsgAddToOutTxTrackerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddToOutTxTracker not implemented") } +func (*UnimplementedMsgServer) AddToInTxTracker(ctx context.Context, req *MsgAddToInTxTracker) (*MsgAddToInTxTrackerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddToInTxTracker not implemented") +} func (*UnimplementedMsgServer) RemoveFromOutTxTracker(ctx context.Context, req *MsgRemoveFromOutTxTracker) (*MsgRemoveFromOutTxTrackerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveFromOutTxTracker not implemented") } @@ -1623,6 +1770,24 @@ func _Msg_AddToOutTxTracker_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Msg_AddToInTxTracker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAddToInTxTracker) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AddToInTxTracker(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.crosschain.Msg/AddToInTxTracker", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AddToInTxTracker(ctx, req.(*MsgAddToInTxTracker)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_RemoveFromOutTxTracker_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgRemoveFromOutTxTracker) if err := dec(in); err != nil { @@ -1793,6 +1958,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "AddToOutTxTracker", Handler: _Msg_AddToOutTxTracker_Handler, }, + { + MethodName: "AddToInTxTracker", + Handler: _Msg_AddToInTxTracker_Handler, + }, { MethodName: "RemoveFromOutTxTracker", Handler: _Msg_RemoveFromOutTxTracker_Handler, @@ -1902,6 +2071,100 @@ func (m *MsgMigrateTssFundsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } +func (m *MsgAddToInTxTracker) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddToInTxTracker) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddToInTxTracker) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TxIndex != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.TxIndex)) + i-- + dAtA[i] = 0x38 + } + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x32 + } + if m.Proof != nil { + { + size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.CoinType != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CoinType)) + i-- + dAtA[i] = 0x20 + } + if len(m.TxHash) > 0 { + i -= len(m.TxHash) + copy(dAtA[i:], m.TxHash) + i = encodeVarintTx(dAtA, i, uint64(len(m.TxHash))) + i-- + dAtA[i] = 0x1a + } + if m.ChainId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ChainId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAddToInTxTrackerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAddToInTxTrackerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAddToInTxTrackerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgUpdateTssAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2792,7 +3055,7 @@ func (m *MsgMigrateTssFundsResponse) Size() (n int) { return n } -func (m *MsgUpdateTssAddress) Size() (n int) { +func (m *MsgAddToInTxTracker) Size() (n int) { if m == nil { return 0 } @@ -2802,14 +3065,31 @@ func (m *MsgUpdateTssAddress) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.TssPubkey) + if m.ChainId != 0 { + n += 1 + sovTx(uint64(m.ChainId)) + } + l = len(m.TxHash) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.CoinType != 0 { + n += 1 + sovTx(uint64(m.CoinType)) + } + if m.Proof != nil { + l = m.Proof.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BlockHash) if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if m.TxIndex != 0 { + n += 1 + sovTx(uint64(m.TxIndex)) + } return n } -func (m *MsgUpdateTssAddressResponse) Size() (n int) { +func (m *MsgAddToInTxTrackerResponse) Size() (n int) { if m == nil { return 0 } @@ -2818,7 +3098,7 @@ func (m *MsgUpdateTssAddressResponse) Size() (n int) { return n } -func (m *MsgWhitelistERC20) Size() (n int) { +func (m *MsgUpdateTssAddress) Size() (n int) { if m == nil { return 0 } @@ -2828,7 +3108,33 @@ func (m *MsgWhitelistERC20) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Erc20Address) + l = len(m.TssPubkey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateTssAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWhitelistERC20) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Erc20Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -3374,6 +3680,295 @@ func (m *MsgMigrateTssFundsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAddToInTxTracker) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddToInTxTracker: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddToInTxTracker: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) + } + m.ChainId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ChainId |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TxHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CoinType", wireType) + } + m.CoinType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CoinType |= common.CoinType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proof == nil { + m.Proof = &common.Proof{} + } + if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType) + } + m.TxIndex = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TxIndex |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAddToInTxTrackerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAddToInTxTrackerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAddToInTxTrackerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgUpdateTssAddress) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/emissions/types/events.pb.go b/x/emissions/types/events.pb.go index a1a96178cc..201211e96f 100644 --- a/x/emissions/types/events.pb.go +++ b/x/emissions/types/events.pb.go @@ -51,8 +51,8 @@ func (EmissionType) EnumDescriptor() ([]byte, []int) { } type ObserverEmission struct { - EmissionType EmissionType `protobuf:"varint,1,opt,name=emission_type,json=emissionType,proto3,enum=zetachain.zetacore.emissions.EmissionType" json:"emission_type,omitempty"` - ObserverAddress string `protobuf:"bytes,2,opt,name=observer_address,json=observerAddress,proto3" json:"observer_address,omitempty"` + EmissionType EmissionType `protobuf:"varint,1,opt,name=emission_type,json=emissionType,proto3,enum=zetachain.zetacore.emissions.EmissionType" json:"emission_type,omitempty"` + ObserverAddress string `protobuf:"bytes,2,opt,name=observer_address,json=observerAddress,proto3" json:"observer_address,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` } diff --git a/x/observer/keeper/keeper.go b/x/observer/keeper/keeper.go index 10c8c9e21f..bb0d40e9c8 100644 --- a/x/observer/keeper/keeper.go +++ b/x/observer/keeper/keeper.go @@ -47,3 +47,11 @@ func NewKeeper( func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } + +func (k Keeper) StoreKey() storetypes.StoreKey { + return k.storeKey +} + +func (k Keeper) Codec() codec.BinaryCodec { + return k.cdc +} diff --git a/x/observer/keeper/migrator.go b/x/observer/keeper/migrator.go index daed1e08f8..190de610cd 100644 --- a/x/observer/keeper/migrator.go +++ b/x/observer/keeper/migrator.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" v2 "github.com/zeta-chain/zetacore/x/observer/migrations/v2" v3 "github.com/zeta-chain/zetacore/x/observer/migrations/v3" + v4 "github.com/zeta-chain/zetacore/x/observer/migrations/v4" ) // Migrator is a struct for handling in-place store migrations. @@ -27,3 +28,7 @@ func (m Migrator) Migrate1to2(ctx sdk.Context) error { func (m Migrator) Migrate2to3(ctx sdk.Context) error { return v3.MigrateStore(ctx, m.observerKeeper) } + +func (m Migrator) Migrate3to4(ctx sdk.Context) error { + return v4.MigrateStore(ctx, m.observerKeeper.storeKey, m.observerKeeper.cdc) +} diff --git a/x/observer/keeper/msg_server_update_crosschain_flags.go b/x/observer/keeper/msg_server_update_crosschain_flags.go index 57d4478163..8d9a9fc98e 100644 --- a/x/observer/keeper/msg_server_update_crosschain_flags.go +++ b/x/observer/keeper/msg_server_update_crosschain_flags.go @@ -36,14 +36,19 @@ func (k msgServer) UpdateCrosschainFlags(goCtx context.Context, msg *types.MsgUp flags.GasPriceIncreaseFlags = msg.GasPriceIncreaseFlags } + if msg.BlockHeaderVerificationFlags != nil { + flags.BlockHeaderVerificationFlags = msg.BlockHeaderVerificationFlags + } + k.SetCrosschainFlags(ctx, flags) err := ctx.EventManager().EmitTypedEvents(&types.EventCrosschainFlagsUpdated{ - MsgTypeUrl: sdk.MsgTypeURL(&types.MsgUpdateCrosschainFlags{}), - IsInboundEnabled: msg.IsInboundEnabled, - IsOutboundEnabled: msg.IsOutboundEnabled, - GasPriceIncreaseFlags: msg.GasPriceIncreaseFlags, - Signer: msg.Creator, + MsgTypeUrl: sdk.MsgTypeURL(&types.MsgUpdateCrosschainFlags{}), + IsInboundEnabled: msg.IsInboundEnabled, + IsOutboundEnabled: msg.IsOutboundEnabled, + GasPriceIncreaseFlags: msg.GasPriceIncreaseFlags, + BlockHeaderVerificationFlags: msg.BlockHeaderVerificationFlags, + Signer: msg.Creator, }) if err != nil { ctx.Logger().Error("Error emitting EventCrosschainFlagsUpdated :", err) diff --git a/x/observer/keeper/msg_server_update_crosschain_flags_test.go b/x/observer/keeper/msg_server_update_crosschain_flags_test.go index 73c8a4d9de..6481b44ee0 100644 --- a/x/observer/keeper/msg_server_update_crosschain_flags_test.go +++ b/x/observer/keeper/msg_server_update_crosschain_flags_test.go @@ -41,6 +41,10 @@ func TestMsgServer_UpdateCrosschainFlags(t *testing.T) { RetryInterval: time.Minute * 42, GasPriceIncreasePercent: 42, }, + BlockHeaderVerificationFlags: &types.BlockHeaderVerificationFlags{ + IsEthTypeChainEnabled: true, + IsBtcTypeChainEnabled: false, + }, }) require.NoError(t, err) @@ -51,7 +55,8 @@ func TestMsgServer_UpdateCrosschainFlags(t *testing.T) { require.Equal(t, int64(42), flags.GasPriceIncreaseFlags.EpochLength) require.Equal(t, time.Minute*42, flags.GasPriceIncreaseFlags.RetryInterval) require.Equal(t, uint32(42), flags.GasPriceIncreaseFlags.GasPriceIncreasePercent) - + require.True(t, flags.BlockHeaderVerificationFlags.IsEthTypeChainEnabled) + require.False(t, flags.BlockHeaderVerificationFlags.IsBtcTypeChainEnabled) setAdminCrossChainFlags(ctx, k, admin, types.Policy_Type_group2) // can update flags again @@ -64,6 +69,10 @@ func TestMsgServer_UpdateCrosschainFlags(t *testing.T) { RetryInterval: time.Minute * 43, GasPriceIncreasePercent: 43, }, + BlockHeaderVerificationFlags: &types.BlockHeaderVerificationFlags{ + IsEthTypeChainEnabled: false, + IsBtcTypeChainEnabled: false, + }, }) require.NoError(t, err) @@ -74,7 +83,8 @@ func TestMsgServer_UpdateCrosschainFlags(t *testing.T) { require.Equal(t, int64(43), flags.GasPriceIncreaseFlags.EpochLength) require.Equal(t, time.Minute*43, flags.GasPriceIncreaseFlags.RetryInterval) require.Equal(t, uint32(43), flags.GasPriceIncreaseFlags.GasPriceIncreasePercent) - + require.False(t, flags.BlockHeaderVerificationFlags.IsEthTypeChainEnabled) + require.False(t, flags.BlockHeaderVerificationFlags.IsBtcTypeChainEnabled) // group 1 should be able to disable inbound and outbound setAdminCrossChainFlags(ctx, k, admin, types.Policy_Type_group1) diff --git a/x/observer/migrations/v4/migrate.go b/x/observer/migrations/v4/migrate.go new file mode 100644 index 0000000000..dbf1e5c7df --- /dev/null +++ b/x/observer/migrations/v4/migrate.go @@ -0,0 +1,30 @@ +package v4 + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/store/prefix" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +func MigrateStore(ctx sdk.Context, observerStoreKey storetypes.StoreKey, cdc codec.BinaryCodec) error { + newCrossChainFlags := types.DefaultCrosschainFlags() + var val types.LegacyCrosschainFlags + store := prefix.NewStore(ctx.KVStore(observerStoreKey), types.KeyPrefix(types.CrosschainFlagsKey)) + b := store.Get([]byte{0}) + if b != nil { + cdc.MustUnmarshal(b, &val) + if val.GasPriceIncreaseFlags != nil { + newCrossChainFlags.GasPriceIncreaseFlags = val.GasPriceIncreaseFlags + } + newCrossChainFlags.IsOutboundEnabled = val.IsOutboundEnabled + newCrossChainFlags.IsInboundEnabled = val.IsInboundEnabled + } + b, err := cdc.Marshal(newCrossChainFlags) + if err != nil { + return err + } + store.Set([]byte{0}, b) + return nil +} diff --git a/x/observer/migrations/v4/migrate_test.go b/x/observer/migrations/v4/migrate_test.go new file mode 100644 index 0000000000..98f4439403 --- /dev/null +++ b/x/observer/migrations/v4/migrate_test.go @@ -0,0 +1,30 @@ +package v4_test + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/store/prefix" + "github.com/stretchr/testify/assert" + keepertest "github.com/zeta-chain/zetacore/testutil/keeper" + v4 "github.com/zeta-chain/zetacore/x/observer/migrations/v4" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +func TestMigrateStore(t *testing.T) { + + k, ctx := keepertest.ObserverKeeper(t) + store := prefix.NewStore(ctx.KVStore(k.StoreKey()), types.KeyPrefix(types.CrosschainFlagsKey)) + legacyFlags := types.LegacyCrosschainFlags{ + IsInboundEnabled: false, + IsOutboundEnabled: false, + GasPriceIncreaseFlags: &types.DefaultGasPriceIncreaseFlags, + } + val := k.Codec().MustMarshal(&legacyFlags) + store.Set([]byte{0}, val) + err := v4.MigrateStore(ctx, k.StoreKey(), k.Codec()) + assert.NoError(t, err) + flags, found := k.GetCrosschainFlags(ctx) + assert.True(t, found) + assert.False(t, flags.BlockHeaderVerificationFlags.IsBtcTypeChainEnabled) + assert.False(t, flags.BlockHeaderVerificationFlags.IsEthTypeChainEnabled) +} diff --git a/x/observer/module.go b/x/observer/module.go index 1f991b978c..0e63ab0e08 100644 --- a/x/observer/module.go +++ b/x/observer/module.go @@ -150,6 +150,9 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { if err := cfg.RegisterMigration(types.ModuleName, 2, m.Migrate2to3); err != nil { panic(err) } + if err := cfg.RegisterMigration(types.ModuleName, 3, m.Migrate3to4); err != nil { + panic(err) + } } // RegisterInvariants registers the observer module's invariants. diff --git a/x/observer/types/crosschain_flags.go b/x/observer/types/crosschain_flags.go index f85fce5130..696bc94ff6 100644 --- a/x/observer/types/crosschain_flags.go +++ b/x/observer/types/crosschain_flags.go @@ -20,5 +20,9 @@ func DefaultCrosschainFlags() *CrosschainFlags { IsInboundEnabled: true, IsOutboundEnabled: true, GasPriceIncreaseFlags: &DefaultGasPriceIncreaseFlags, + BlockHeaderVerificationFlags: &BlockHeaderVerificationFlags{ + IsEthTypeChainEnabled: false, + IsBtcTypeChainEnabled: false, + }, } } diff --git a/x/observer/types/crosschain_flags.pb.go b/x/observer/types/crosschain_flags.pb.go index 8bb7de6ad7..d50542a509 100644 --- a/x/observer/types/crosschain_flags.pb.go +++ b/x/observer/types/crosschain_flags.pb.go @@ -88,17 +88,70 @@ func (m *GasPriceIncreaseFlags) GetGasPriceIncreasePercent() uint32 { return 0 } +type BlockHeaderVerificationFlags struct { + IsEthTypeChainEnabled bool `protobuf:"varint,1,opt,name=isEthTypeChainEnabled,proto3" json:"isEthTypeChainEnabled,omitempty"` + IsBtcTypeChainEnabled bool `protobuf:"varint,2,opt,name=isBtcTypeChainEnabled,proto3" json:"isBtcTypeChainEnabled,omitempty"` +} + +func (m *BlockHeaderVerificationFlags) Reset() { *m = BlockHeaderVerificationFlags{} } +func (m *BlockHeaderVerificationFlags) String() string { return proto.CompactTextString(m) } +func (*BlockHeaderVerificationFlags) ProtoMessage() {} +func (*BlockHeaderVerificationFlags) Descriptor() ([]byte, []int) { + return fileDescriptor_b948b59e4d986f49, []int{1} +} +func (m *BlockHeaderVerificationFlags) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockHeaderVerificationFlags) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockHeaderVerificationFlags.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockHeaderVerificationFlags) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockHeaderVerificationFlags.Merge(m, src) +} +func (m *BlockHeaderVerificationFlags) XXX_Size() int { + return m.Size() +} +func (m *BlockHeaderVerificationFlags) XXX_DiscardUnknown() { + xxx_messageInfo_BlockHeaderVerificationFlags.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockHeaderVerificationFlags proto.InternalMessageInfo + +func (m *BlockHeaderVerificationFlags) GetIsEthTypeChainEnabled() bool { + if m != nil { + return m.IsEthTypeChainEnabled + } + return false +} + +func (m *BlockHeaderVerificationFlags) GetIsBtcTypeChainEnabled() bool { + if m != nil { + return m.IsBtcTypeChainEnabled + } + return false +} + type CrosschainFlags struct { - IsInboundEnabled bool `protobuf:"varint,1,opt,name=isInboundEnabled,proto3" json:"isInboundEnabled,omitempty"` - IsOutboundEnabled bool `protobuf:"varint,2,opt,name=isOutboundEnabled,proto3" json:"isOutboundEnabled,omitempty"` - GasPriceIncreaseFlags *GasPriceIncreaseFlags `protobuf:"bytes,3,opt,name=gasPriceIncreaseFlags,proto3" json:"gasPriceIncreaseFlags,omitempty"` + IsInboundEnabled bool `protobuf:"varint,1,opt,name=isInboundEnabled,proto3" json:"isInboundEnabled,omitempty"` + IsOutboundEnabled bool `protobuf:"varint,2,opt,name=isOutboundEnabled,proto3" json:"isOutboundEnabled,omitempty"` + GasPriceIncreaseFlags *GasPriceIncreaseFlags `protobuf:"bytes,3,opt,name=gasPriceIncreaseFlags,proto3" json:"gasPriceIncreaseFlags,omitempty"` + BlockHeaderVerificationFlags *BlockHeaderVerificationFlags `protobuf:"bytes,4,opt,name=blockHeaderVerificationFlags,proto3" json:"blockHeaderVerificationFlags,omitempty"` } func (m *CrosschainFlags) Reset() { *m = CrosschainFlags{} } func (m *CrosschainFlags) String() string { return proto.CompactTextString(m) } func (*CrosschainFlags) ProtoMessage() {} func (*CrosschainFlags) Descriptor() ([]byte, []int) { - return fileDescriptor_b948b59e4d986f49, []int{1} + return fileDescriptor_b948b59e4d986f49, []int{2} } func (m *CrosschainFlags) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -148,38 +201,113 @@ func (m *CrosschainFlags) GetGasPriceIncreaseFlags() *GasPriceIncreaseFlags { return nil } +func (m *CrosschainFlags) GetBlockHeaderVerificationFlags() *BlockHeaderVerificationFlags { + if m != nil { + return m.BlockHeaderVerificationFlags + } + return nil +} + +type LegacyCrosschainFlags struct { + IsInboundEnabled bool `protobuf:"varint,1,opt,name=isInboundEnabled,proto3" json:"isInboundEnabled,omitempty"` + IsOutboundEnabled bool `protobuf:"varint,2,opt,name=isOutboundEnabled,proto3" json:"isOutboundEnabled,omitempty"` + GasPriceIncreaseFlags *GasPriceIncreaseFlags `protobuf:"bytes,3,opt,name=gasPriceIncreaseFlags,proto3" json:"gasPriceIncreaseFlags,omitempty"` +} + +func (m *LegacyCrosschainFlags) Reset() { *m = LegacyCrosschainFlags{} } +func (m *LegacyCrosschainFlags) String() string { return proto.CompactTextString(m) } +func (*LegacyCrosschainFlags) ProtoMessage() {} +func (*LegacyCrosschainFlags) Descriptor() ([]byte, []int) { + return fileDescriptor_b948b59e4d986f49, []int{3} +} +func (m *LegacyCrosschainFlags) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyCrosschainFlags) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyCrosschainFlags.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LegacyCrosschainFlags) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyCrosschainFlags.Merge(m, src) +} +func (m *LegacyCrosschainFlags) XXX_Size() int { + return m.Size() +} +func (m *LegacyCrosschainFlags) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyCrosschainFlags.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyCrosschainFlags proto.InternalMessageInfo + +func (m *LegacyCrosschainFlags) GetIsInboundEnabled() bool { + if m != nil { + return m.IsInboundEnabled + } + return false +} + +func (m *LegacyCrosschainFlags) GetIsOutboundEnabled() bool { + if m != nil { + return m.IsOutboundEnabled + } + return false +} + +func (m *LegacyCrosschainFlags) GetGasPriceIncreaseFlags() *GasPriceIncreaseFlags { + if m != nil { + return m.GasPriceIncreaseFlags + } + return nil +} + func init() { proto.RegisterType((*GasPriceIncreaseFlags)(nil), "zetachain.zetacore.observer.GasPriceIncreaseFlags") + proto.RegisterType((*BlockHeaderVerificationFlags)(nil), "zetachain.zetacore.observer.BlockHeaderVerificationFlags") proto.RegisterType((*CrosschainFlags)(nil), "zetachain.zetacore.observer.CrosschainFlags") + proto.RegisterType((*LegacyCrosschainFlags)(nil), "zetachain.zetacore.observer.LegacyCrosschainFlags") } func init() { proto.RegisterFile("observer/crosschain_flags.proto", fileDescriptor_b948b59e4d986f49) } var fileDescriptor_b948b59e4d986f49 = []byte{ - // 364 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xcf, 0x6b, 0xe2, 0x40, - 0x14, 0xc7, 0x33, 0x0a, 0x8b, 0x8c, 0xc8, 0xee, 0x86, 0x95, 0x75, 0x5d, 0x88, 0xc1, 0x93, 0x2c, - 0xdb, 0x19, 0xb0, 0x97, 0x9e, 0xed, 0x2f, 0x02, 0x85, 0x4a, 0x8e, 0xbd, 0x94, 0x49, 0x7c, 0x4e, - 0x02, 0xe9, 0x8c, 0xcc, 0x4c, 0xa4, 0xf6, 0xaf, 0xe8, 0xb1, 0x7f, 0x4d, 0xcf, 0x1e, 0xbd, 0x14, - 0x7a, 0x6a, 0x8b, 0xfe, 0x23, 0xc5, 0x49, 0x95, 0x5a, 0x6d, 0x6f, 0x2f, 0xef, 0xbd, 0x6f, 0x3e, - 0x5f, 0xbe, 0x6f, 0x70, 0x4b, 0x46, 0x1a, 0xd4, 0x18, 0x14, 0x8d, 0x95, 0xd4, 0x3a, 0x4e, 0x58, - 0x2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x3d, 0x70, 0x13, 0x5c, 0xe7, 0xbb, 0xd2, 0xb2, 0x2e, - 0xab, 0xdd, 0x2e, 0xf9, 0xe2, 0x42, 0x64, 0x67, 0xce, 0xe1, 0xee, 0x1f, 0xf6, 0x82, 0xe9, 0xdc, - 0x43, 0xb3, 0xb9, 0x87, 0x5e, 0xe6, 0x1e, 0xba, 0x5d, 0x78, 0xce, 0x6c, 0xe1, 0x39, 0x8f, 0x0b, - 0xcf, 0xb9, 0xa0, 0x3c, 0x35, 0x49, 0x1e, 0x91, 0x58, 0x5e, 0xd1, 0x25, 0x64, 0xcf, 0xf2, 0xe8, - 0x8a, 0x47, 0xaf, 0xe9, 0xfa, 0x1d, 0x99, 0xc9, 0x08, 0x74, 0xf4, 0xcd, 0x1e, 0x62, 0xff, 0x35, - 0x00, 0x00, 0xff, 0xff, 0xc1, 0xe4, 0x6d, 0x3a, 0x60, 0x02, 0x00, 0x00, + // 452 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x94, 0xc1, 0x8a, 0xd3, 0x40, + 0x18, 0xc7, 0x3b, 0x5d, 0x91, 0x65, 0xca, 0xa2, 0x06, 0x8b, 0x75, 0x5d, 0xd2, 0xd2, 0x53, 0x11, + 0x9d, 0x81, 0xea, 0x41, 0xaf, 0x5d, 0x57, 0x0d, 0x2c, 0xb8, 0x04, 0xf1, 0xe0, 0x45, 0x26, 0xd3, + 0xaf, 0x93, 0xc1, 0x38, 0x53, 0x66, 0x26, 0x8b, 0x11, 0x7c, 0x01, 0x4f, 0x1e, 0x7d, 0x1a, 0xcf, + 0x7b, 0xdc, 0x83, 0x07, 0x41, 0x50, 0x69, 0x5f, 0x44, 0x32, 0x31, 0x8b, 0xb5, 0x31, 0x0f, 0xe0, + 0x6d, 0xf2, 0xfd, 0xe7, 0x3f, 0xbf, 0x7c, 0xdf, 0x3f, 0x19, 0x3c, 0xd4, 0x89, 0x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c, 0xe1, 0xb0, 0x9c, 0xdd, 0x91, 0x62, 0x49, 0x06, 0x73, 0xdf, 0xd1, + 0x6e, 0xdc, 0x2c, 0x56, 0xae, 0x99, 0xe3, 0x5b, 0xae, 0x6e, 0xed, 0x6a, 0x10, 0xc7, 0x5f, 0xba, + 0xf8, 0xca, 0xe1, 0x45, 0x76, 0x15, 0xff, 0x36, 0xbe, 0x2a, 0x6d, 0xa4, 0x12, 0x9d, 0xab, 0xf9, + 0x26, 0x7a, 0xab, 0x1e, 0xdc, 0xc1, 0xd7, 0xa4, 0x7d, 0x96, 0xbb, 0x8d, 0xcd, 0x15, 0x71, 0x5b, + 0x08, 0x52, 0xdc, 0x17, 0x4d, 0xd1, 0xf9, 0x91, 0xf5, 0xa6, 0x53, 0xd2, 0xf2, 0xb9, 0x90, 0xc6, + 0xd0, 0xe3, 0xe6, 0x03, 0x83, 0xf7, 0xf8, 0x20, 0x69, 0x99, 0xf1, 0xe0, 0x92, 0x07, 0x3e, 0x6c, + 0x05, 0xb6, 0x85, 0x14, 0xb7, 0x1e, 0x3f, 0xfe, 0x86, 0x70, 0xff, 0x18, 0x04, 0xe3, 0xc5, 0x7f, + 0x38, 0xdc, 0x59, 0x74, 0xb6, 0x0a, 0xd1, 0xf9, 0x2a, 0x44, 0x3f, 0x57, 0x21, 0xfa, 0xb8, 0x0e, + 0x3b, 0xe7, 0xeb, 0xb0, 0xf3, 0x75, 0x1d, 0x76, 0x5e, 0x52, 0x21, 0x5d, 0x9a, 0x27, 0x84, 0xeb, + 0x37, 0xb4, 0x84, 0xdc, 0xf5, 0x3c, 0x5a, 0xf3, 0xe8, 0x5b, 0x7a, 0x71, 0x63, 0xb8, 0x62, 0x09, + 0x36, 0xb9, 0xec, 0x7f, 0xb9, 0x7b, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x23, 0xb8, 0x6d, 0xec, + 0x4a, 0x04, 0x00, 0x00, } func (m *GasPriceIncreaseFlags) Marshal() (dAtA []byte, err error) { @@ -223,6 +351,49 @@ func (m *GasPriceIncreaseFlags) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BlockHeaderVerificationFlags) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockHeaderVerificationFlags) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockHeaderVerificationFlags) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsBtcTypeChainEnabled { + i-- + if m.IsBtcTypeChainEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.IsEthTypeChainEnabled { + i-- + if m.IsEthTypeChainEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func (m *CrosschainFlags) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -239,6 +410,73 @@ func (m *CrosschainFlags) MarshalTo(dAtA []byte) (int, error) { } func (m *CrosschainFlags) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BlockHeaderVerificationFlags != nil { + { + size, err := m.BlockHeaderVerificationFlags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrosschainFlags(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.GasPriceIncreaseFlags != nil { + { + size, err := m.GasPriceIncreaseFlags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCrosschainFlags(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.IsOutboundEnabled { + i-- + if m.IsOutboundEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.IsInboundEnabled { + i-- + if m.IsInboundEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LegacyCrosschainFlags) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LegacyCrosschainFlags) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyCrosschainFlags) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -306,7 +544,45 @@ func (m *GasPriceIncreaseFlags) Size() (n int) { return n } +func (m *BlockHeaderVerificationFlags) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IsEthTypeChainEnabled { + n += 2 + } + if m.IsBtcTypeChainEnabled { + n += 2 + } + return n +} + func (m *CrosschainFlags) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IsInboundEnabled { + n += 2 + } + if m.IsOutboundEnabled { + n += 2 + } + if m.GasPriceIncreaseFlags != nil { + l = m.GasPriceIncreaseFlags.Size() + n += 1 + l + sovCrosschainFlags(uint64(l)) + } + if m.BlockHeaderVerificationFlags != nil { + l = m.BlockHeaderVerificationFlags.Size() + n += 1 + l + sovCrosschainFlags(uint64(l)) + } + return n +} + +func (m *LegacyCrosschainFlags) Size() (n int) { if m == nil { return 0 } @@ -452,6 +728,96 @@ func (m *GasPriceIncreaseFlags) Unmarshal(dAtA []byte) error { } return nil } +func (m *BlockHeaderVerificationFlags) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockHeaderVerificationFlags: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockHeaderVerificationFlags: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsEthTypeChainEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsEthTypeChainEnabled = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsBtcTypeChainEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsBtcTypeChainEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipCrosschainFlags(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrosschainFlags + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *CrosschainFlags) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -481,6 +847,168 @@ func (m *CrosschainFlags) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: CrosschainFlags: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsInboundEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsInboundEnabled = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsOutboundEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsOutboundEnabled = bool(v != 0) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPriceIncreaseFlags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrosschainFlags + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrosschainFlags + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.GasPriceIncreaseFlags == nil { + m.GasPriceIncreaseFlags = &GasPriceIncreaseFlags{} + } + if err := m.GasPriceIncreaseFlags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeaderVerificationFlags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCrosschainFlags + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCrosschainFlags + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockHeaderVerificationFlags == nil { + m.BlockHeaderVerificationFlags = &BlockHeaderVerificationFlags{} + } + if err := m.BlockHeaderVerificationFlags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCrosschainFlags(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCrosschainFlags + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LegacyCrosschainFlags) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LegacyCrosschainFlags: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LegacyCrosschainFlags: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field IsInboundEnabled", wireType) diff --git a/x/observer/types/events.pb.go b/x/observer/types/events.pb.go index 14068f968d..dbbaef3f5a 100644 --- a/x/observer/types/events.pb.go +++ b/x/observer/types/events.pb.go @@ -237,11 +237,12 @@ func (m *EventNewObserverAdded) GetObserverLastBlockCount() uint64 { } type EventCrosschainFlagsUpdated struct { - MsgTypeUrl string `protobuf:"bytes,1,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` - IsInboundEnabled bool `protobuf:"varint,2,opt,name=isInboundEnabled,proto3" json:"isInboundEnabled,omitempty"` - IsOutboundEnabled bool `protobuf:"varint,3,opt,name=isOutboundEnabled,proto3" json:"isOutboundEnabled,omitempty"` - GasPriceIncreaseFlags *GasPriceIncreaseFlags `protobuf:"bytes,4,opt,name=gasPriceIncreaseFlags,proto3" json:"gasPriceIncreaseFlags,omitempty"` - Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` + MsgTypeUrl string `protobuf:"bytes,1,opt,name=msg_type_url,json=msgTypeUrl,proto3" json:"msg_type_url,omitempty"` + IsInboundEnabled bool `protobuf:"varint,2,opt,name=isInboundEnabled,proto3" json:"isInboundEnabled,omitempty"` + IsOutboundEnabled bool `protobuf:"varint,3,opt,name=isOutboundEnabled,proto3" json:"isOutboundEnabled,omitempty"` + GasPriceIncreaseFlags *GasPriceIncreaseFlags `protobuf:"bytes,4,opt,name=gasPriceIncreaseFlags,proto3" json:"gasPriceIncreaseFlags,omitempty"` + Signer string `protobuf:"bytes,5,opt,name=signer,proto3" json:"signer,omitempty"` + BlockHeaderVerificationFlags *BlockHeaderVerificationFlags `protobuf:"bytes,6,opt,name=blockHeaderVerificationFlags,proto3" json:"blockHeaderVerificationFlags,omitempty"` } func (m *EventCrosschainFlagsUpdated) Reset() { *m = EventCrosschainFlagsUpdated{} } @@ -312,6 +313,13 @@ func (m *EventCrosschainFlagsUpdated) GetSigner() string { return "" } +func (m *EventCrosschainFlagsUpdated) GetBlockHeaderVerificationFlags() *BlockHeaderVerificationFlags { + if m != nil { + return m.BlockHeaderVerificationFlags + } + return nil +} + func init() { proto.RegisterType((*EventBallotCreated)(nil), "zetachain.zetacore.observer.EventBallotCreated") proto.RegisterType((*EventKeygenBlockUpdated)(nil), "zetachain.zetacore.observer.EventKeygenBlockUpdated") @@ -322,43 +330,45 @@ func init() { func init() { proto.RegisterFile("observer/events.proto", fileDescriptor_1f1ca57368474456) } var fileDescriptor_1f1ca57368474456 = []byte{ - // 564 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0xba, 0x31, 0x81, 0x3b, 0x58, 0x67, 0xd1, 0x35, 0xeb, 0xa4, 0x6c, 0x54, 0x42, 0xe2, - 0x67, 0x22, 0x8d, 0x13, 0x88, 0x0b, 0xad, 0xc6, 0xa8, 0x40, 0x6c, 0xaa, 0xd8, 0x85, 0x4b, 0xe4, - 0x24, 0x6f, 0x49, 0xd4, 0xd4, 0xae, 0x6c, 0x67, 0x50, 0xee, 0xdc, 0xb9, 0x22, 0xfe, 0x21, 0x8e, - 0x3b, 0x72, 0xe0, 0x80, 0xda, 0x7f, 0x04, 0xd9, 0x4e, 0xd3, 0xa2, 0x56, 0xa8, 0x37, 0xfb, 0x7b, - 0xdf, 0xf7, 0xfc, 0xbd, 0x1f, 0x46, 0x0d, 0x16, 0x08, 0xe0, 0x57, 0xc0, 0x3d, 0xb8, 0x02, 0x2a, - 0x85, 0x3b, 0xe2, 0x4c, 0x32, 0x7c, 0xf0, 0x05, 0x24, 0x09, 0x13, 0x92, 0x52, 0x57, 0x9f, 0x18, - 0x07, 0x77, 0xc6, 0x6c, 0xdd, 0x8d, 0x59, 0xcc, 0x34, 0xcf, 0x53, 0x27, 0x23, 0x69, 0x1d, 0x96, - 0x99, 0x42, 0xce, 0x84, 0xd0, 0x62, 0xff, 0x32, 0x23, 0x71, 0x91, 0xb3, 0xd5, 0x2c, 0x09, 0xb3, - 0x83, 0x09, 0xb4, 0x7f, 0x5b, 0x08, 0x9f, 0xa8, 0xd7, 0x3b, 0x24, 0xcb, 0x98, 0xec, 0x72, 0x20, - 0x12, 0x22, 0x7c, 0x84, 0xb6, 0x87, 0x22, 0xf6, 0xe5, 0x78, 0x04, 0x7e, 0xce, 0x33, 0xdb, 0x3a, - 0xb2, 0x1e, 0xdc, 0xea, 0xa3, 0xa1, 0x88, 0x3f, 0x8c, 0x47, 0x70, 0xc1, 0x33, 0xfc, 0x18, 0xed, - 0x06, 0x5a, 0xe2, 0xa7, 0x11, 0x50, 0x99, 0x5e, 0xa6, 0xc0, 0xed, 0xaa, 0xa6, 0xd5, 0x4d, 0xa0, - 0x57, 0xe2, 0xf8, 0x21, 0xaa, 0x9b, 0x77, 0x89, 0x4c, 0x19, 0xf5, 0x13, 0x22, 0x12, 0x7b, 0x43, - 0x73, 0x77, 0x16, 0xf0, 0x37, 0x44, 0x24, 0x2a, 0xef, 0x22, 0x55, 0x97, 0x62, 0x6f, 0x9a, 0xbc, - 0x0b, 0x81, 0xae, 0xc2, 0xf1, 0x21, 0xaa, 0x15, 0x26, 0x94, 0x53, 0xfb, 0x86, 0x71, 0x69, 0x20, - 0x65, 0xb4, 0xfd, 0xd5, 0x42, 0x4d, 0x5d, 0xde, 0x5b, 0x18, 0xc7, 0x40, 0x3b, 0x19, 0x0b, 0x07, - 0x17, 0xa3, 0x68, 0xcd, 0x1a, 0xef, 0xa1, 0xed, 0x81, 0xd6, 0xf9, 0x81, 0x12, 0x16, 0xe5, 0xd5, - 0x06, 0xf3, 0x5c, 0xf8, 0x3e, 0xba, 0x53, 0x50, 0x46, 0x79, 0x30, 0x80, 0xb1, 0x28, 0xea, 0xba, - 0x6d, 0xd0, 0x73, 0x03, 0xb6, 0xbf, 0x57, 0x51, 0x43, 0xfb, 0x78, 0x0f, 0x9f, 0xce, 0x8a, 0x09, - 0xbc, 0x8a, 0xa2, 0xb5, 0x5c, 0x94, 0xcd, 0x03, 0xee, 0x93, 0x28, 0xe2, 0x20, 0x44, 0xe1, 0x64, - 0x87, 0xcd, 0x53, 0x29, 0x18, 0xbf, 0x44, 0x2d, 0xbd, 0x32,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, 0xd9, - 0xd0, 0x53, 0x8f, 0x3f, 0xd5, 0x3e, 0xbc, 0x99, 0x0f, 0xef, 0x73, 0xf9, 0xd7, 0x3d, 0xd5, 0x3b, - 0x11, 0x6c, 0xe9, 0x2f, 0xff, 0xec, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0x1b, 0xca, 0x44, - 0x78, 0x04, 0x00, 0x00, + // 599 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xcf, 0x6f, 0xd3, 0x30, + 0x14, 0x5e, 0xb6, 0x31, 0x81, 0x37, 0xd8, 0x66, 0xb1, 0x2d, 0xeb, 0x50, 0x36, 0x2a, 0x21, 0xf1, + 0x33, 0x91, 0xc6, 0x69, 0x88, 0x0b, 0xad, 0xc6, 0x56, 0x81, 0xd8, 0x54, 0x31, 0x0e, 0x5c, 0x22, + 0x27, 0x79, 0x4b, 0xac, 0x66, 0x76, 0x65, 0x3b, 0x83, 0x22, 0x71, 0xe4, 0xce, 0x15, 0xfe, 0x22, + 0x8e, 0x3b, 0x72, 0xe0, 0x80, 0xd6, 0x7f, 0x04, 0xd9, 0x4e, 0xd3, 0xa2, 0x56, 0x55, 0x6f, 0xce, + 0x7b, 0xdf, 0xf7, 0xbd, 0xef, 0xbd, 0xe7, 0x18, 0x6d, 0xf0, 0x48, 0x82, 0xb8, 0x04, 0x11, 0xc0, + 0x25, 0x30, 0x25, 0xfd, 0xae, 0xe0, 0x8a, 0xe3, 0x9d, 0x2f, 0xa0, 0x48, 0x9c, 0x11, 0xca, 0x7c, + 0x73, 0xe2, 0x02, 0xfc, 0x01, 0xb2, 0x76, 0x37, 0xe5, 0x29, 0x37, 0xb8, 0x40, 0x9f, 0x2c, 0xa5, + 0xb6, 0x5b, 0x29, 0xc5, 0x82, 0x4b, 0x69, 0xc8, 0xe1, 0x79, 0x4e, 0xd2, 0x52, 0xb3, 0xb6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, 0x25, 0xc9, 0x4c, 0x2e, 0xaa, 0xe1, 0x81, 0x08, 0x49, 0x92, 0x08, 0x90, + 0xb2, 0x74, 0xb2, 0xca, 0x87, 0x52, 0x3a, 0x8c, 0x5f, 0xa2, 0x9a, 0xb9, 0x32, 0x39, 0x05, 0xa6, + 0xc2, 0x54, 0x10, 0xa6, 0x00, 0x2a, 0x92, 0x75, 0xe6, 0x0e, 0x11, 0x47, 0x16, 0x30, 0x60, 0xbf, + 0x40, 0xdb, 0x13, 0xd8, 0xb6, 0xaf, 0x72, 0x05, 0x5b, 0x63, 0x64, 0xdb, 0x21, 0x3e, 0x40, 0xdb, + 0x95, 0xc9, 0x9c, 0x48, 0x65, 0x27, 0x16, 0xc6, 0xbc, 0x60, 0xca, 0xec, 0x65, 0xb1, 0xbd, 0x39, + 0x00, 0xbc, 0x25, 0x52, 0x99, 0xe9, 0x35, 0x75, 0xb6, 0xfe, 0x73, 0x01, 0xed, 0x98, 0xd9, 0x34, + 0xab, 0xbb, 0xfb, 0x5a, 0x5f, 0xdd, 0xd9, 0xf7, 0xf4, 0x18, 0xad, 0x51, 0xd9, 0x62, 0x11, 0x2f, + 0x58, 0x72, 0xc8, 0x48, 0x94, 0x43, 0x62, 0x26, 0x74, 0xb3, 0x3d, 0x16, 0xc7, 0x4f, 0xd1, 0x3a, + 0x95, 0x27, 0x85, 0xfa, 0x0f, 0xbc, 0x60, 0xc0, 0xe3, 0x09, 0x9c, 0xa1, 0x8d, 0x94, 0xc8, 0x53, + 0x41, 0x63, 0x68, 0xb1, 0x58, 0x00, 0x91, 0x60, 0xbc, 0x99, 0x71, 0x2c, 0xef, 0xef, 0xfb, 0x53, + 0xfe, 0x55, 0xff, 0x68, 0x12, 0xb3, 0x3d, 0x59, 0x10, 0x6f, 0xa2, 0x25, 0x49, 0x53, 0x06, 0xa2, + 0xbc, 0xc5, 0xe5, 0x17, 0xfe, 0x8a, 0xee, 0x99, 0x51, 0x1e, 0x03, 0x49, 0x40, 0x7c, 0x00, 0x41, + 0xcf, 0x69, 0x6c, 0x7e, 0x01, 0x6b, 0x64, 0xc9, 0x18, 0x39, 0x98, 0x6a, 0xa4, 0x31, 0x45, 0xa0, + 0x3d, 0x55, 0xbe, 0xd1, 0xfa, 0x75, 0xed, 0x39, 0x57, 0xd7, 0x9e, 0xf3, 0xf7, 0xda, 0x73, 0xbe, + 0xf7, 0xbd, 0xb9, 0xab, 0xbe, 0x37, 0xf7, 0xbb, 0xef, 0xcd, 0x7d, 0x0c, 0x52, 0xaa, 0xb2, 0x22, + 0xf2, 0x63, 0x7e, 0x11, 0xe8, 0x92, 0xcf, 0x4c, 0xf5, 0x60, 0x50, 0x3d, 0xf8, 0x5c, 0x3d, 0x35, + 0x81, 0x5e, 0x9d, 0x8c, 0x96, 0xcc, 0x8b, 0xf3, 0xfc, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xea, + 0x9e, 0x8b, 0x9e, 0xf7, 0x04, 0x00, 0x00, } func (m *EventBallotCreated) Marshal() (dAtA []byte, err error) { @@ -539,6 +549,18 @@ func (m *EventCrosschainFlagsUpdated) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l + if m.BlockHeaderVerificationFlags != nil { + { + size, err := m.BlockHeaderVerificationFlags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } if len(m.Signer) > 0 { i -= len(m.Signer) copy(dAtA[i:], m.Signer) @@ -701,6 +723,10 @@ func (m *EventCrosschainFlagsUpdated) Size() (n int) { if l > 0 { n += 1 + l + sovEvents(uint64(l)) } + if m.BlockHeaderVerificationFlags != nil { + l = m.BlockHeaderVerificationFlags.Size() + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -1432,6 +1458,42 @@ func (m *EventCrosschainFlagsUpdated) Unmarshal(dAtA []byte) error { } m.Signer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeaderVerificationFlags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockHeaderVerificationFlags == nil { + m.BlockHeaderVerificationFlags = &BlockHeaderVerificationFlags{} + } + if err := m.BlockHeaderVerificationFlags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/x/observer/types/tx.pb.go b/x/observer/types/tx.pb.go index e7cfe8f234..567b27d987 100644 --- a/x/observer/types/tx.pb.go +++ b/x/observer/types/tx.pb.go @@ -431,10 +431,11 @@ func (m *MsgAddBlameVoteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgAddBlameVoteResponse proto.InternalMessageInfo type MsgUpdateCrosschainFlags struct { - Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - IsInboundEnabled bool `protobuf:"varint,3,opt,name=isInboundEnabled,proto3" json:"isInboundEnabled,omitempty"` - IsOutboundEnabled bool `protobuf:"varint,4,opt,name=isOutboundEnabled,proto3" json:"isOutboundEnabled,omitempty"` - GasPriceIncreaseFlags *GasPriceIncreaseFlags `protobuf:"bytes,5,opt,name=gasPriceIncreaseFlags,proto3" json:"gasPriceIncreaseFlags,omitempty"` + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + IsInboundEnabled bool `protobuf:"varint,3,opt,name=isInboundEnabled,proto3" json:"isInboundEnabled,omitempty"` + IsOutboundEnabled bool `protobuf:"varint,4,opt,name=isOutboundEnabled,proto3" json:"isOutboundEnabled,omitempty"` + GasPriceIncreaseFlags *GasPriceIncreaseFlags `protobuf:"bytes,5,opt,name=gasPriceIncreaseFlags,proto3" json:"gasPriceIncreaseFlags,omitempty"` + BlockHeaderVerificationFlags *BlockHeaderVerificationFlags `protobuf:"bytes,6,opt,name=blockHeaderVerificationFlags,proto3" json:"blockHeaderVerificationFlags,omitempty"` } func (m *MsgUpdateCrosschainFlags) Reset() { *m = MsgUpdateCrosschainFlags{} } @@ -498,6 +499,13 @@ func (m *MsgUpdateCrosschainFlags) GetGasPriceIncreaseFlags() *GasPriceIncreaseF return nil } +func (m *MsgUpdateCrosschainFlags) GetBlockHeaderVerificationFlags() *BlockHeaderVerificationFlags { + if m != nil { + return m.BlockHeaderVerificationFlags + } + return nil +} + type MsgUpdateCrosschainFlagsResponse struct { } @@ -640,56 +648,58 @@ func init() { func init() { proto.RegisterFile("observer/tx.proto", fileDescriptor_1bcd40fa296a2b1d) } var fileDescriptor_1bcd40fa296a2b1d = []byte{ - // 774 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x4f, 0xdb, 0x48, - 0x18, 0x8e, 0x97, 0xcf, 0xbc, 0x41, 0x7c, 0x18, 0x02, 0x4e, 0x10, 0x21, 0xf2, 0x65, 0xb3, 0xbb, - 0x6c, 0xcc, 0x86, 0xdd, 0x55, 0x55, 0xa9, 0x87, 0xd0, 0x0f, 0x88, 0x2a, 0x0a, 0xb2, 0xd4, 0x1e, - 0x7a, 0xb1, 0xc6, 0x9e, 0xc1, 0xb6, 0x48, 0x66, 0x22, 0x8f, 0x53, 0x25, 0x3d, 0xf4, 0xde, 0x43, - 0xa5, 0xfe, 0x95, 0xfe, 0x87, 0x1e, 0x38, 0x72, 0xec, 0xa9, 0xaa, 0xe0, 0xd2, 0x9f, 0xd0, 0x63, - 0xe5, 0xf1,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xef, 0x22, 0xba, 0xed, 0x51, 0x7c, 0x30, 0xad, 0x47, 0x12, - 0xdf, 0x83, 0xa5, 0xa1, 0xc5, 0xd8, 0x9b, 0x20, 0x89, 0x04, 0x5d, 0xfc, 0x77, 0x1a, 0x74, 0x12, - 0xf3, 0x83, 0x04, 0xf9, 0xf1, 0x63, 0xfe, 0xdf, 0x84, 0x79, 0x0c, 0xbb, 0x15, 0x1f, 0xdd, 0xcb, - 0x6d, 0xb0, 0x06, 0x43, 0x73, 0xb5, 0x37, 0x19, 0x5d, 0x88, 0xbe, 0xbb, 0x06, 0xe3, 0x06, 0x4e, - 0xee, 0xc2, 0xf2, 0xad, 0x6f, 0x5b, 0x75, 0xa2, 0x5a, 0x26, 0xf8, 0xe2, 0xff, 0xd3, 0xe1, 0xe3, - 0xc8, 0x87, 0x8d, 0xcb, 0xeb, 0x92, 0x74, 0x75, 0x5d, 0x92, 0xbe, 0x5d, 0x97, 0xa4, 0x8f, 0x37, - 0xa5, 0xcc, 0xd5, 0x4d, 0x29, 0xf3, 0xe5, 0xa6, 0x94, 0x79, 0xad, 0xd9, 0xae, 0xef, 0x74, 0xcc, - 0xe0, 0x3b, 0xa7, 0x05, 0x8c, 0x7f, 0x0b, 0x72, 0x2d, 0x26, 0xd7, 0xba, 0x5a, 0xff, 0x67, 0x45, - 0xaf, 0x4d, 0xb8, 0x39, 0x2f, 0xbe, 0xd5, 0x07, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x60, - 0xf7, 0xb4, 0x6f, 0x08, 0x00, 0x00, + // 803 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4b, 0x4f, 0xeb, 0x46, + 0x14, 0x8e, 0x2f, 0x17, 0x2e, 0x39, 0x41, 0x3c, 0x06, 0x02, 0x4e, 0x28, 0x21, 0xf2, 0xa6, 0x69, + 0x4b, 0x63, 0x1a, 0xda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, 0xa8, 0xaf, 0xaa, 0x4a, 0x6d, + 0xc9, 0x78, 0x23, 0xef, 0x2d, 0x82, 0x0e, 0x00, 0xac, 0x90, 0xc3, 0x74, 0xb1, 0x70, 0xd5, 0xa5, + 0xaa, 0x52, 0x5b, 0x33, 0xf2, 0xd2, 0x72, 0x8e, 0x85, 0x8b, 0x76, 0x61, 0xc5, 0xa5, 0x9e, 0xe3, + 0x06, 0xea, 0x6b, 0xe9, 0x17, 0xdf, 0xd0, 0x71, 0x68, 0x0f, 0x55, 0xd5, 0xe5, 0xaa, 0x52, 0x2b, + 0x34, 0x50, 0x3d, 0xae, 0x4e, 0x14, 0xcb, 0xd7, 0x38, 0xc0, 0xa7, 0xaf, 0x6f, 0xff, 0x39, 0xcc, + 0x19, 0x31, 0x4e, 0xdb, 0x87, 0xd2, 0x54, 0xc8, 0x06, 0x15, 0x3d, 0xce, 0x04, 0xd5, 0x06, 0xb0, + 0x7d, 0x21, 0x9c, 0x1f, 0x7a, 0x04, 0x07, 0xf4, 0x2b, 0xee, 0xd3, 0x2b, 0x99, 0x6d, 0x46, 0x46, + 0x67, 0x00, 0x76, 0x8a, 0x93, 0x39, 0x15, 0x1a, 0xef, 0xd6, 0x33, 0xba, 0x58, 0x1f, 0xd1, 0x1a, + 0x63, 0xae, 0xda, 0x01, 0xec, 0xcf, 0x50, 0x4e, 0x03, 0xfb, 0x4b, 0x81, 0xf5, 0x28, 0xec, 0xcb, + 0x98, 0x28, 0x23, 0xa8, 0xf7, 0x60, 0x33, 0x91, 0x33, 0x31, 0x21, 0x3e, 0x15, 0x51, 0x68, 0x79, + 0x63, 0x23, 0xb1, 0x37, 0x23, 0x33, 0xfa, 0x02, 0x4a, 0x32, 0xc4, 0x8e, 0x47, 0x59, 0x60, 0x3a, + 0x3e, 0x66, 0x01, 0xa5, 0x66, 0xaf, 0x6f, 0xdd, 0xd0, 0xa1, 0xec, 0x42, 0xde, 0xd8, 0x1b, 0x01, + 0xce, 0xa2, 0xf7, 0x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x85, 0x3f, 0xb3, + 0x7a, 0xc8, 0xf8, 0xa1, 0x24, 0xd7, 0x13, 0x72, 0x7d, 0xa0, 0x8f, 0xbe, 0x6a, 0x86, 0x3d, 0x2a, + 0xac, 0x15, 0xf9, 0xa9, 0x70, 0xf2, 0x36, 0x00, 0x00, 0xff, 0xff, 0x46, 0x18, 0xe1, 0x9b, 0xee, + 0x08, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1264,6 +1274,18 @@ func (m *MsgUpdateCrosschainFlags) MarshalToSizedBuffer(dAtA []byte) (int, error _ = i var l int _ = l + if m.BlockHeaderVerificationFlags != nil { + { + size, err := m.BlockHeaderVerificationFlags.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } if m.GasPriceIncreaseFlags != nil { { size, err := m.GasPriceIncreaseFlags.MarshalToSizedBuffer(dAtA[:i]) @@ -1540,6 +1562,10 @@ func (m *MsgUpdateCrosschainFlags) Size() (n int) { l = m.GasPriceIncreaseFlags.Size() n += 1 + l + sovTx(uint64(l)) } + if m.BlockHeaderVerificationFlags != nil { + l = m.BlockHeaderVerificationFlags.Size() + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2528,6 +2554,42 @@ func (m *MsgUpdateCrosschainFlags) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeaderVerificationFlags", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BlockHeaderVerificationFlags == nil { + m.BlockHeaderVerificationFlags = &BlockHeaderVerificationFlags{} + } + if err := m.BlockHeaderVerificationFlags.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index 42a31c39dd..4fc07e89bd 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -57,8 +57,8 @@ type BitcoinChainClient struct { lastBlockScanned int64 BlockTime uint64 // block time in seconds - mu *sync.Mutex // lock for pending nonce, all the maps, utxos and core params - pendingNonce uint64 // the artificial pending nonce (next nonce to process) for outTx + Mu *sync.Mutex // lock for all the maps, utxos and core params + pendingNonce uint64 includedTxHashes map[string]uint64 // key: tx hash includedTxResults map[string]btcjson.GetTransactionResult // key: chain-tss-nonce broadcastedTx map[string]string // key: chain-tss-nonce, value: outTx hash @@ -76,20 +76,48 @@ type BitcoinChainClient struct { const ( minConfirmations = 0 maxHeightDiff = 10000 - dustOffset = 2000 - bytesPerKB = 1000 btcBlocksPerDay = 144 + bytesPerKB = 1000 ) +func (ob *BitcoinChainClient) WithZetaClient(bridge *ZetaCoreBridge) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.zetaClient = bridge +} +func (ob *BitcoinChainClient) WithLogger(logger zerolog.Logger) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.logger = BTCLog{ + ChainLogger: logger, + WatchInTx: logger.With().Str("module", "WatchInTx").Logger(), + ObserveOutTx: logger.With().Str("module", "observeOutTx").Logger(), + WatchUTXOS: logger.With().Str("module", "WatchUTXOS").Logger(), + WatchGasPrice: logger.With().Str("module", "WatchGasPrice").Logger(), + } +} + +func (ob *BitcoinChainClient) WithBtcClient(client *rpcclient.Client) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.rpcClient = client +} + +func (ob *BitcoinChainClient) WithChain(chain common.Chain) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.chain = chain +} + func (ob *BitcoinChainClient) SetCoreParams(params observertypes.CoreParams) { - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() ob.params = params } func (ob *BitcoinChainClient) GetCoreParams() observertypes.CoreParams { - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() return ob.params } @@ -101,7 +129,7 @@ func NewBitcoinClient(chain common.Chain, bridge *ZetaCoreBridge, tss TSSSigner, } ob.stop = make(chan struct{}) ob.chain = chain - ob.mu = &sync.Mutex{} + ob.Mu = &sync.Mutex{} chainLogger := logger.With().Str("chain", chain.ChainName.String()).Logger() ob.logger = BTCLog{ ChainLogger: chainLogger, @@ -164,6 +192,7 @@ func (ob *BitcoinChainClient) Start() { go ob.observeOutTx() go ob.WatchUTXOS() go ob.WatchGasPrice() + go ob.ExternalChainWatcherForNewInboundTrackerSuggestions() } func (ob *BitcoinChainClient) Stop() { @@ -216,8 +245,8 @@ func (ob *BitcoinChainClient) GetLastBlockHeightScanned() int64 { } func (ob *BitcoinChainClient) GetPendingNonce() uint64 { - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() return ob.pendingNonce } @@ -317,29 +346,8 @@ func (ob *BitcoinChainClient) observeInTx() error { inTxs := FilterAndParseIncomingTx(res.Block.Tx, uint64(res.Block.Height), tssAddress, &ob.logger.WatchInTx) for _, inTx := range inTxs { - ob.logger.WatchInTx.Debug().Msgf("Processing inTx: %s", inTx.TxHash) - sats, err := getSatoshis(inTx.Value) - if err != nil { - ob.logger.WatchInTx.Error().Err(err).Msgf("getSatoshis error: %s", err) - continue - } - amountInt := big.NewInt(sats) - message := hex.EncodeToString(inTx.MemoBytes) - zetaHash, err := ob.zetaClient.PostSend( - inTx.FromAddress, - ob.chain.ChainId, - inTx.FromAddress, - inTx.FromAddress, - common.ZetaChain().ChainId, - math.NewUintFromBigInt(amountInt), - message, - inTx.TxHash, - inTx.BlockNumber, - 0, - common.CoinType_Gas, - PostSendEVMGasLimit, - "", - ) + msg := ob.GetInboundVoteMessageFromBtcEvent(inTx) + zetaHash, err := ob.zetaClient.PostSend(PostSendEVMGasLimit, msg) if err != nil { ob.logger.WatchInTx.Error().Err(err).Msg("error posting to zeta core") continue @@ -370,10 +378,10 @@ func (ob *BitcoinChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64 outTxID := ob.GetTxID(nonce) logger.Info().Msgf("IsSendOutTxProcessed %s", outTxID) - ob.mu.Lock() + ob.Mu.Lock() txnHash, broadcasted := ob.broadcastedTx[outTxID] res, included := ob.includedTxResults[outTxID] - ob.mu.Unlock() + ob.Mu.Unlock() // Get original cctx parameters params, err := ob.GetPendingCctxParams(nonce) @@ -382,6 +390,20 @@ func (ob *BitcoinChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64 return false, false, err } + // Get original cctx parameters + params, err = ob.GetPendingCctxParams(nonce) + if err != nil { + ob.logger.ObserveOutTx.Info().Msgf("IsSendOutTxProcessed: can't find pending cctx for nonce %d", nonce) + return false, false, err + } + + // Get original cctx parameters + params, err = ob.GetPendingCctxParams(nonce) + if err != nil { + ob.logger.ObserveOutTx.Info().Msgf("IsSendOutTxProcessed: can't find pending cctx for nonce %d", nonce) + return false, false, err + } + if !included { if !broadcasted { return false, false, nil @@ -407,9 +429,9 @@ func (ob *BitcoinChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64 } // Get tx result again in case it is just included - ob.mu.Lock() + ob.Mu.Lock() res, included = ob.includedTxResults[outTxID] - ob.mu.Unlock() + ob.Mu.Unlock() if !included { return false, false, nil } @@ -526,86 +548,117 @@ func FilterAndParseIncomingTx(txs []btcjson.TxRawResult, blockNumber uint64, tar if idx == 0 { continue // the first tx is coinbase; we do not process coinbase tx } - found := false - var value float64 - var memo []byte - if len(tx.Vout) >= 2 { - // first vout must to addressed to the targetAddress with p2wpkh scriptPubKey - out := tx.Vout[0] - script := out.ScriptPubKey.Hex - if len(script) == 44 && script[:4] == "0014" { // segwit output: 0x00 + 20 bytes of pubkey hash - hash, err := hex.DecodeString(script[4:]) + inTx, err := GetBtcEvent(tx, targetAddress, blockNumber, logger) + if err != nil { + logger.Error().Err(err).Msg("error getting btc event") + continue + } + if inTx != nil { + inTxs = append(inTxs, inTx) + } + } + return inTxs +} + +func (ob *BitcoinChainClient) GetInboundVoteMessageFromBtcEvent(inTx *BTCInTxEvnet) *types.MsgVoteOnObservedInboundTx { + ob.logger.WatchInTx.Debug().Msgf("Processing inTx: %s", inTx.TxHash) + amount := big.NewFloat(inTx.Value) + amount = amount.Mul(amount, big.NewFloat(1e8)) + amountInt, _ := amount.Int(nil) + message := hex.EncodeToString(inTx.MemoBytes) + return GetInBoundVoteMessage( + inTx.FromAddress, + ob.chain.ChainId, + inTx.FromAddress, + inTx.FromAddress, + common.ZetaChain().ChainId, + math.NewUintFromBigInt(amountInt), + message, + inTx.TxHash, + inTx.BlockNumber, + 0, + common.CoinType_Gas, + "", + ob.zetaClient.keys.GetOperatorAddress().String(), + ) +} + +func GetBtcEvent(tx btcjson.TxRawResult, targetAddress string, blockNumber uint64, logger *zerolog.Logger) (*BTCInTxEvnet, error) { + found := false + var value float64 + var memo []byte + if len(tx.Vout) >= 2 { + // first vout must to addressed to the targetAddress with p2wpkh scriptPubKey + out := tx.Vout[0] + script := out.ScriptPubKey.Hex + if len(script) == 44 && script[:4] == "0014" { // segwit output: 0x00 + 20 bytes of pubkey hash + hash, err := hex.DecodeString(script[4:]) + if err != nil { + return nil, err + } + wpkhAddress, err := btcutil.NewAddressWitnessPubKeyHash(hash, config.BitconNetParams) + if err != nil { + return nil, err + } + if wpkhAddress.EncodeAddress() != targetAddress { + return nil, err + } + value = out.Value + out = tx.Vout[1] + script = out.ScriptPubKey.Hex + if len(script) >= 4 && script[:2] == "6a" { // OP_RETURN + memoSize, err := strconv.ParseInt(script[2:4], 16, 32) if err != nil { - continue + return nil, errors.Wrapf(err, "error decoding pubkey hash") } - wpkhAddress, err := btcutil.NewAddressWitnessPubKeyHash(hash, config.BitconNetParams) - if err != nil { - continue + if int(memoSize) != (len(script)-4)/2 { + return nil, fmt.Errorf("memo size mismatch: %d != %d", memoSize, (len(script)-4)/2) } - if wpkhAddress.EncodeAddress() != targetAddress { - continue + memoBytes, err := hex.DecodeString(script[4:]) + if err != nil { + logger.Warn().Err(err).Msgf("error hex decoding memo") + return nil, fmt.Errorf("error hex decoding memo: %s", err) } - value = out.Value - out = tx.Vout[1] - script = out.ScriptPubKey.Hex - if len(script) >= 4 && script[:2] == "6a" { // OP_RETURN - memoSize, err := strconv.ParseInt(script[2:4], 16, 32) - if err != nil { - logger.Warn().Err(err).Msgf("error decoding pubkey hash") - continue - } - if int(memoSize) != (len(script)-4)/2 { - logger.Warn().Msgf("memo size mismatch: %d != %d", memoSize, (len(script)-4)/2) - continue - } - memoBytes, err := hex.DecodeString(script[4:]) - if err != nil { - logger.Warn().Err(err).Msgf("error hex decoding memo") - continue - } - if bytes.Compare(memoBytes, []byte(DonationMessage)) == 0 { - logger.Info().Msgf("donation tx: %s; value %f", tx.Txid, value) - continue - } - memo = memoBytes - found = true - + if bytes.Compare(memoBytes, []byte(DonationMessage)) == 0 { + logger.Info().Msgf("donation tx: %s; value %f", tx.Txid, value) + return nil, fmt.Errorf("donation tx: %s; value %f", tx.Txid, value) } + memo = memoBytes + found = true } - } - if found { - var fromAddress string - if len(tx.Vin) > 0 { - vin := tx.Vin[0] - //log.Info().Msgf("vin: %v", vin.Witness) - if len(vin.Witness) == 2 { - pk := vin.Witness[1] - pkBytes, err := hex.DecodeString(pk) - if err != nil { - logger.Warn().Msgf("error decoding pubkey: %s", err) - break - } - hash := btcutil.Hash160(pkBytes) - addr, err := btcutil.NewAddressWitnessPubKeyHash(hash, config.BitconNetParams) - if err != nil { - logger.Warn().Msgf("error decoding pubkey hash: %s", err) - break - } - fromAddress = addr.EncodeAddress() + + } + if found { + fmt.Println("found tx: ", tx.Txid) + var fromAddress string + if len(tx.Vin) > 0 { + vin := tx.Vin[0] + //log.Info().Msgf("vin: %v", vin.Witness) + if len(vin.Witness) == 2 { + pk := vin.Witness[1] + pkBytes, err := hex.DecodeString(pk) + if err != nil { + return nil, errors.Wrapf(err, "error decoding pubkey") + } + hash := btcutil.Hash160(pkBytes) + addr, err := btcutil.NewAddressWitnessPubKeyHash(hash, config.BitconNetParams) + if err != nil { + return nil, errors.Wrapf(err, "error decoding pubkey hash") } + fromAddress = addr.EncodeAddress() } - inTxs = append(inTxs, &BTCInTxEvnet{ - FromAddress: fromAddress, - ToAddress: targetAddress, - Value: value, - MemoBytes: memo, - BlockNumber: blockNumber, - TxHash: tx.Txid, - }) } - } - return inTxs + return &BTCInTxEvnet{ + FromAddress: fromAddress, + ToAddress: targetAddress, + Value: value, + MemoBytes: memo, + BlockNumber: blockNumber, + TxHash: tx.Txid, + }, nil + } + return nil, nil } func (ob *BitcoinChainClient) WatchUTXOS() { @@ -669,10 +722,10 @@ func (ob *BitcoinChainClient) FetchUTXOS() error { return utxos[i].Amount < utxos[j].Amount }) - ob.mu.Lock() + ob.Mu.Lock() ob.ts.SetNumberOfUTXOs(len(utxos)) ob.utxos = utxos - ob.mu.Unlock() + ob.Mu.Unlock() return nil } @@ -688,9 +741,9 @@ func (ob *BitcoinChainClient) refreshPendingNonce() { } // increase pending nonce if lagged behind - ob.mu.Lock() + ob.Mu.Lock() pendingNonce := ob.pendingNonce - ob.mu.Unlock() + ob.Mu.Unlock() // #nosec G701 always non-negative nonceLow := uint64(p.NonceLow) @@ -702,18 +755,17 @@ func (ob *BitcoinChainClient) refreshPendingNonce() { } // set 'NonceLow' as the new pending nonce - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() ob.pendingNonce = nonceLow ob.logger.ChainLogger.Info().Msgf("refreshPendingNonce: increase pending nonce to %d with txid %s", ob.pendingNonce, txid) } } -// Set `test` flag to true in unit test to bypass query to zetacore func (ob *BitcoinChainClient) getOutTxidByNonce(nonce uint64, test bool) (string, error) { - ob.mu.Lock() + ob.Mu.Lock() res, included := ob.includedTxResults[ob.GetTxID(nonce)] - ob.mu.Unlock() + ob.Mu.Unlock() // There are 2 types of txids an observer can trust // 1. The ones had been verified and saved by observer self. @@ -772,16 +824,16 @@ func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxoCap uint8, nonce u idx := -1 if nonce == 0 { // for nonce = 0; make exception; no need to include nonce-mark utxo - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() } else { // for nonce > 0; we proceed only when we see the nonce-mark utxo preTxid, err := ob.getOutTxidByNonce(nonce-1, test) if err != nil { return nil, 0, err } - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() idx, err = ob.findNonceMarkUTXO(nonce-1, preTxid) if err != nil { return nil, 0, err @@ -826,9 +878,9 @@ func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxoCap uint8, nonce u // Save successfully broadcasted transaction func (ob *BitcoinChainClient) SaveBroadcastedTx(txHash string, nonce uint64) { outTxID := ob.GetTxID(nonce) - ob.mu.Lock() + ob.Mu.Lock() ob.broadcastedTx[outTxID] = txHash - ob.mu.Unlock() + ob.Mu.Unlock() broadcastEntry := clienttypes.ToOutTxHashSQLType(txHash, outTxID) if err := ob.db.Save(&broadcastEntry).Error; err != nil { @@ -906,8 +958,8 @@ func (ob *BitcoinChainClient) checkNSaveIncludedTx(txHash string, params types.O return false, errors.Wrapf(err, "checkNSaveIncludedTx: error verify bitcoin outTx %s outTxID %s", txHash, outTxID) } - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() nonce, foundHash := ob.includedTxHashes[txHash] res, foundRes := ob.includedTxResults[outTxID] @@ -1205,9 +1257,3 @@ func (ob *BitcoinChainClient) GetBlockByNumberCached(blockNumber int64) (*BTCBlo ob.BlockCache.Add(hash, blockNheader) return blockNheader, nil } - -// A very special value to mark current nonce in UTXO -func NonceMarkAmount(nonce uint64) int64 { - // #nosec G701 always in range - return int64(nonce) + config.DustOffset // +2000 to avoid being a dust rejection -} diff --git a/zetaclient/btc_signer_test.go b/zetaclient/btc_signer_test.go index 631f110982..5f3eb9a250 100644 --- a/zetaclient/btc_signer_test.go +++ b/zetaclient/btc_signer_test.go @@ -213,7 +213,7 @@ func createTestClient(t *testing.T) *BitcoinChainClient { // Create BitcoinChainClient client := &BitcoinChainClient{ Tss: tss, - mu: &sync.Mutex{}, + Mu: &sync.Mutex{}, includedTxResults: make(map[string]btcjson.GetTransactionResult), } diff --git a/zetaclient/chainclient.go b/zetaclient/chainclient.go index 25f9e895cb..c92f29a77e 100644 --- a/zetaclient/chainclient.go +++ b/zetaclient/chainclient.go @@ -22,4 +22,5 @@ type ChainClient interface { GetPromGauge(name string) (prometheus.Gauge, error) GetPromCounter(name string) (prometheus.Counter, error) GetTxID(nonce uint64) string + ExternalChainWatcherForNewInboundTrackerSuggestions() } diff --git a/zetaclient/config/config_mainnet.go b/zetaclient/config/config_mainnet.go index 2a52abfc24..646b8b3460 100644 --- a/zetaclient/config/config_mainnet.go +++ b/zetaclient/config/config_mainnet.go @@ -9,7 +9,6 @@ import ( ) const ( - DustOffset = 0 BtcConfirmationCount = 1 DevEthConfirmationCount = 2 ) diff --git a/zetaclient/config/config_mock_mainnet.go b/zetaclient/config/config_mock_mainnet.go index 1f3f82970b..fe7195d1cd 100644 --- a/zetaclient/config/config_mock_mainnet.go +++ b/zetaclient/config/config_mock_mainnet.go @@ -9,7 +9,6 @@ import ( ) const ( - DustOffset = 2000 BtcConfirmationCount = 1 DevEthConfirmationCount = 2 ) diff --git a/zetaclient/config/config_privnet.go b/zetaclient/config/config_privnet.go index 7d8063310b..d801c8dbd7 100644 --- a/zetaclient/config/config_privnet.go +++ b/zetaclient/config/config_privnet.go @@ -9,7 +9,6 @@ import ( ) const ( - DustOffset = 2000 TssTestPrivkey = "2082bc9775d6ee5a05ef221a9d1c00b3cc3ecb274a4317acc0a182bc1e05d1bb" TssTestAddress = "0xE80B6467863EbF8865092544f441da8fD3cF6074" ) diff --git a/zetaclient/config/config_testnet.go b/zetaclient/config/config_testnet.go index b7524e22ca..5a3bf948e0 100644 --- a/zetaclient/config/config_testnet.go +++ b/zetaclient/config/config_testnet.go @@ -9,7 +9,6 @@ import ( ) const ( - DustOffset = 2000 TssTestPrivkey = "2082bc9775d6ee5a05ef221a9d1c00b3cc3ecb274a4317acc0a182bc1e05d1bb" TssTestAddress = "0xE80B6467863EbF8865092544f441da8fD3cF6074" //TestReceiver = "0x566bF3b1993FFd4BA134c107A63bb2aebAcCdbA0" diff --git a/zetaclient/evm_client.go b/zetaclient/evm_client.go index d828364f63..43ecf196e2 100644 --- a/zetaclient/evm_client.go +++ b/zetaclient/evm_client.go @@ -3,28 +3,24 @@ package zetaclient import ( "bytes" "context" - "encoding/base64" - "encoding/hex" "fmt" math2 "math" "math/big" "os" "sort" "strconv" - "strings" "sync" "sync/atomic" "time" - "cosmossdk.io/math" - "github.com/ethereum/go-ethereum/rlp" - lru "github.com/hashicorp/golang-lru" - "github.com/pkg/errors" "gorm.io/driver/sqlite" "gorm.io/gorm" "github.com/ethereum/go-ethereum/accounts/abi/bind" ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/rlp" + lru "github.com/hashicorp/golang-lru" + "github.com/pkg/errors" erc20custody "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/erc20custody.sol" "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/zetaconnector.non-eth.sol" @@ -70,7 +66,7 @@ const ( type EVMChainClient struct { *ChainMetrics chain common.Chain - EvmClient *ethclient.Client + evmClient *ethclient.Client KlaytnClient *KlaytnClient zetaClient *ZetaCoreBridge Tss TSSSigner @@ -78,7 +74,7 @@ type EVMChainClient struct { lastBlock int64 BlockTimeExternalChain uint64 // block time in seconds txWatchList map[ethcommon.Hash]string - mu *sync.Mutex + Mu *sync.Mutex db *gorm.DB outTXConfirmedReceipts map[string]*ethtypes.Receipt outTXConfirmedTransaction map[string]*ethtypes.Transaction @@ -114,7 +110,7 @@ func NewEVMChainClient(bridge *ZetaCoreBridge, tss TSSSigner, dbpath string, met ob.params = evmCfg.CoreParams ob.stop = make(chan struct{}) ob.chain = evmCfg.Chain - ob.mu = &sync.Mutex{} + ob.Mu = &sync.Mutex{} ob.zetaClient = bridge ob.txWatchList = make(map[ethcommon.Hash]string) ob.Tss = tss @@ -135,7 +131,7 @@ func NewEVMChainClient(bridge *ZetaCoreBridge, tss TSSSigner, dbpath string, met ob.logger.ChainLogger.Error().Err(err).Msg("eth Client Dial") return nil, err } - ob.EvmClient = client + ob.evmClient = client ob.BlockCache, err = lru.New(1000) if err != nil { @@ -175,30 +171,77 @@ func NewEVMChainClient(bridge *ZetaCoreBridge, tss TSSSigner, dbpath string, met return &ob, nil } +func (ob *EVMChainClient) WithChain(chain common.Chain) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.chain = chain +} +func (ob *EVMChainClient) WithLogger(logger zerolog.Logger) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.logger = EVMLog{ + ChainLogger: logger, + ExternalChainWatcher: logger.With().Str("module", "ExternalChainWatcher").Logger(), + WatchGasPrice: logger.With().Str("module", "WatchGasPrice").Logger(), + ObserveOutTx: logger.With().Str("module", "ObserveOutTx").Logger(), + } +} + +func (ob *EVMChainClient) WithEvmClient(client *ethclient.Client) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.evmClient = client +} + +func (ob *EVMChainClient) WithZetaClient(bridge *ZetaCoreBridge) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.zetaClient = bridge +} + +func (ob *EVMChainClient) WithParams(params observertypes.CoreParams) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.params = params +} + +func (ob *EVMChainClient) SetConfig(cfg *config.Config) { + ob.Mu.Lock() + defer ob.Mu.Unlock() + ob.cfg = cfg +} func (ob *EVMChainClient) SetCoreParams(params observertypes.CoreParams) { - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() ob.params = params } func (ob *EVMChainClient) GetCoreParams() observertypes.CoreParams { - ob.mu.Lock() - defer ob.mu.Unlock() + ob.Mu.Lock() + defer ob.Mu.Unlock() return ob.params } func (ob *EVMChainClient) GetConnectorContract() (*zetaconnector.ZetaConnectorNonEth, error) { addr := ethcommon.HexToAddress(ob.GetCoreParams().ConnectorContractAddress) - return zetaconnector.NewZetaConnectorNonEth(addr, ob.EvmClient) + return FetchConnectorContract(addr, ob.evmClient) } +func FetchConnectorContract(addr ethcommon.Address, client *ethclient.Client) (*zetaconnector.ZetaConnectorNonEth, error) { + return zetaconnector.NewZetaConnectorNonEth(addr, client) +} func (ob *EVMChainClient) GetERC20CustodyContract() (*erc20custody.ERC20Custody, error) { addr := ethcommon.HexToAddress(ob.GetCoreParams().Erc20CustodyContractAddress) - return erc20custody.NewERC20Custody(addr, ob.EvmClient) + return FetchERC20CustodyContract(addr, ob.evmClient) +} + +func FetchERC20CustodyContract(addr ethcommon.Address, client *ethclient.Client) (*erc20custody.ERC20Custody, error) { + return erc20custody.NewERC20Custody(addr, client) } func (ob *EVMChainClient) Start() { + go ob.ExternalChainWatcherForNewInboundTrackerSuggestions() go ob.ExternalChainWatcher() // Observes external Chains for incoming trasnactions go ob.WatchGasPrice() // Observes external Chains for Gas prices and posts to core go ob.observeOutTx() // Populates receipts and confirmed outbound transactions @@ -224,11 +267,11 @@ func (ob *EVMChainClient) Stop() { // returns: isIncluded, isConfirmed, Error // If isConfirmed, it also post to ZetaCore func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, cointype common.CoinType, logger zerolog.Logger) (bool, bool, error) { - ob.mu.Lock() + ob.Mu.Lock() params := ob.params receipt, found1 := ob.outTXConfirmedReceipts[ob.GetTxID(nonce)] transaction, found2 := ob.outTXConfirmedTransaction[ob.GetTxID(nonce)] - ob.mu.Unlock() + ob.Mu.Unlock() found := found1 && found2 if !found { return false, false, nil @@ -509,9 +552,9 @@ func (ob *EVMChainClient) observeOutTx() { ob.logger.ObserveOutTx.Warn().Msgf("observeOutTx timeout on chain %d nonce %d", ob.chain.ChainId, nonceInt) break TRACKERLOOP default: - ob.mu.Lock() + ob.Mu.Lock() _, found := ob.outTXConfirmedReceipts[ob.GetTxID(nonceInt)] - ob.mu.Unlock() + ob.Mu.Unlock() if found { continue } @@ -519,10 +562,10 @@ func (ob *EVMChainClient) observeOutTx() { receipt, transaction, err := ob.queryTxByHash(txHash.TxHash, nonceInt) time.Sleep(time.Duration(rpcRestTime) * time.Millisecond) if err == nil && receipt != nil { // confirmed - ob.mu.Lock() + ob.Mu.Lock() ob.outTXConfirmedReceipts[ob.GetTxID(nonceInt)] = receipt ob.outTXConfirmedTransaction[ob.GetTxID(nonceInt)] = transaction - ob.mu.Unlock() + ob.Mu.Unlock() break TXHASHLOOP } @@ -553,14 +596,14 @@ func (ob *EVMChainClient) queryTxByHash(txHash string, nonce uint64) (*ethtypes. ctxt, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() - receipt, err := ob.EvmClient.TransactionReceipt(ctxt, ethcommon.HexToHash(txHash)) + receipt, err := ob.evmClient.TransactionReceipt(ctxt, ethcommon.HexToHash(txHash)) if err != nil { if err != ethereum.NotFound { logger.Warn().Err(err).Msg("TransactionReceipt/TransactionByHash error") } return nil, nil, err } - transaction, _, err := ob.EvmClient.TransactionByHash(ctxt, ethcommon.HexToHash(txHash)) + transaction, _, err := ob.evmClient.TransactionByHash(ctxt, ethcommon.HexToHash(txHash)) if err != nil { return nil, nil, err } @@ -648,7 +691,7 @@ func (ob *EVMChainClient) ExternalChainWatcher() { } func (ob *EVMChainClient) observeInTX() error { - header, err := ob.EvmClient.HeaderByNumber(context.Background(), nil) + header, err := ob.evmClient.HeaderByNumber(context.Background(), nil) if err != nil { return err } @@ -723,43 +766,16 @@ func (ob *EVMChainClient) observeInTX() error { } // Pull out arguments from logs for logs.Next() { - event := logs.Event - ob.logger.ExternalChainWatcher.Info().Msgf("TxBlockNumber %d Transaction Hash: %s Message : %s", event.Raw.BlockNumber, event.Raw.TxHash, event.Message) - destChain := common.GetChainFromChainID(event.DestinationChainId.Int64()) - if destChain == nil { - ob.logger.ExternalChainWatcher.Warn().Msgf("chain id not supported %d", event.DestinationChainId.Int64()) + msg, err := ob.GetInboundVoteMsgForZetaSentEvent(logs.Event) + if err != nil { + ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error getting inbound vote msg") continue } - destAddr := clienttypes.BytesToEthHex(event.DestinationAddress) - if destChain.IsExternalChain() { - cfgDest, found := ob.cfg.GetEVMConfig(destChain.ChainId) - if !found { - ob.logger.ExternalChainWatcher.Warn().Msgf("chain id not present in EVMChainConfigs %d", event.DestinationChainId.Int64()) - continue - } - if strings.EqualFold(destAddr, cfgDest.ZetaTokenContractAddress) { - ob.logger.ExternalChainWatcher.Warn().Msgf("potential attack attempt: %s destination address is ZETA token contract address %s", destChain, destAddr) - continue - } - } - zetaHash, err := ob.zetaClient.PostSend( - event.ZetaTxSenderAddress.Hex(), - ob.chain.ChainId, - event.SourceTxOriginAddress.Hex(), - clienttypes.BytesToEthHex(event.DestinationAddress), - destChain.ChainId, - math.NewUintFromBigInt(event.ZetaValueAndGas), - base64.StdEncoding.EncodeToString(event.Message), - event.Raw.TxHash.Hex(), - event.Raw.BlockNumber, - event.DestinationGasLimit.Uint64(), - common.CoinType_Zeta, - PostSendNonEVMGasLimit, - "", - ) + + zetaHash, err := ob.zetaClient.PostSend(PostSendNonEVMGasLimit, &msg) if err != nil { ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error posting to zeta core") - continue + return } ob.logger.ExternalChainWatcher.Info().Msgf("ZetaSent event detected and reported: PostSend zeta tx: %s", zetaHash) } @@ -794,45 +810,14 @@ func (ob *EVMChainClient) observeInTX() error { // Pull out arguments from logs for depositedLogs.Next() { - event := depositedLogs.Event - ob.logger.ExternalChainWatcher.Info().Msgf("TxBlockNumber %d Transaction Hash: %s Message : %s", event.Raw.BlockNumber, event.Raw.TxHash, event.Message) - // TODO :add logger to POSTSEND - if bytes.Compare(event.Message, []byte(DonationMessage)) == 0 { - ob.logger.ExternalChainWatcher.Info().Msgf("thank you rich folk for your donation!: %s", event.Raw.TxHash.Hex()) - continue - } - - // get the sender of the event's transaction - tx, _, err := ob.EvmClient.TransactionByHash(context.Background(), event.Raw.TxHash) - if err != nil { - ob.logger.ExternalChainWatcher.Error().Err(err).Msg(fmt.Sprintf("failed to get transaction by hash: %s", event.Raw.TxHash.Hex())) - continue - } - signer := ethtypes.NewLondonSigner(big.NewInt(ob.chain.ChainId)) - sender, err := signer.Sender(tx) + msg, err := ob.GetInboundVoteMsgForDepositedEvent(depositedLogs.Event) if err != nil { - ob.logger.ExternalChainWatcher.Error().Err(err).Msg(fmt.Sprintf("can't recover the sender from the tx hash: %s", event.Raw.TxHash.Hex())) continue } - - zetaHash, err := ob.zetaClient.PostSend( - sender.Hex(), - ob.chain.ChainId, - "", - clienttypes.BytesToEthHex(event.Recipient), - common.ZetaChain().ChainId, - math.NewUintFromBigInt(event.Amount), - hex.EncodeToString(event.Message), - event.Raw.TxHash.Hex(), - event.Raw.BlockNumber, - 1_500_000, - common.CoinType_ERC20, - PostSendEVMGasLimit, - event.Asset.String(), - ) + zetaHash, err := ob.zetaClient.PostSend(PostSendEVMGasLimit, &msg) if err != nil { ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error posting to zeta core") - continue + return } ob.logger.ExternalChainWatcher.Info().Msgf("ZRC20Custody Deposited event detected and reported: PostSend zeta tx: %s", zetaHash) } @@ -881,17 +866,17 @@ func (ob *EVMChainClient) observeInTX() error { } if *tx.To() == tssAddress { - receipt, err := ob.EvmClient.TransactionReceipt(context.Background(), tx.Hash()) + receipt, err := ob.evmClient.TransactionReceipt(context.Background(), tx.Hash()) if err != nil { ob.logger.ExternalChainWatcher.Err(err).Msg("TransactionReceipt error") continue } if receipt.Status != 1 { // 1: successful, 0: failed - ob.logger.ExternalChainWatcher.Info().Msgf("tx %s failed; don't act", tx.Hash().Hex()) + ob.logger.ExternalChainWatcher.Info().Msgf("tx %s failed; don't act", tx.Hash()) continue } - from, err := ob.EvmClient.TransactionSender(context.Background(), tx, block.Hash(), receipt.TransactionIndex) + from, err := ob.evmClient.TransactionSender(context.Background(), tx, block.Hash(), receipt.TransactionIndex) if err != nil { ob.logger.ExternalChainWatcher.Err(err).Msg("TransactionSender error; trying local recovery (assuming LondonSigner dynamic fee tx type) of sender address") signer := ethtypes.NewLondonSigner(big.NewInt(ob.chain.ChainId)) @@ -901,8 +886,11 @@ func (ob *EVMChainClient) observeInTX() error { continue } } - - zetaHash, err := ob.ReportTokenSentToTSS(tx.Hash(), tx.Value(), receipt, from, tx.Data()) + msg := ob.GetInboundVoteMsgForTokenSentToTSS(tx.Hash(), tx.Value(), receipt, from, tx.Data()) + if msg == nil { + continue + } + zetaHash, err := ob.zetaClient.PostSend(PostSendEVMGasLimit, msg) if err != nil { ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error posting to zeta core") continue @@ -924,7 +912,7 @@ func (ob *EVMChainClient) observeInTX() error { continue } if *tx.To == tssAddress { - receipt, err := ob.EvmClient.TransactionReceipt(context.Background(), tx.Hash) + receipt, err := ob.evmClient.TransactionReceipt(context.Background(), tx.Hash) if err != nil { ob.logger.ExternalChainWatcher.Err(err).Msg("TransactionReceipt error") continue @@ -936,8 +924,11 @@ func (ob *EVMChainClient) observeInTX() error { from := *tx.From value := tx.Value.ToInt() - - zetaHash, err := ob.ReportTokenSentToTSS(tx.Hash, value, receipt, from, tx.Input) + msg := ob.GetInboundVoteMsgForTokenSentToTSS(tx.Hash, value, receipt, from, tx.Input) + if msg == nil { + continue + } + zetaHash, err := ob.zetaClient.PostSend(PostSendEVMGasLimit, msg) if err != nil { ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error posting to zeta core") continue @@ -956,32 +947,6 @@ func (ob *EVMChainClient) observeInTX() error { return nil } -func (ob *EVMChainClient) ReportTokenSentToTSS(txhash ethcommon.Hash, value *big.Int, receipt *ethtypes.Receipt, from ethcommon.Address, data []byte) (string, error) { - ob.logger.ExternalChainWatcher.Info().Msgf("TSS inTx detected: %s, blocknum %d", txhash.Hex(), receipt.BlockNumber) - ob.logger.ExternalChainWatcher.Info().Msgf("TSS inTx value: %s", value.String()) - ob.logger.ExternalChainWatcher.Info().Msgf("TSS inTx from: %s", from.Hex()) - message := "" - if len(data) != 0 { - message = hex.EncodeToString(data) - } - zetaHash, err := ob.zetaClient.PostSend( - from.Hex(), - ob.chain.ChainId, - from.Hex(), - from.Hex(), - common.ZetaChain().ChainId, - math.NewUintFromBigInt(value), - message, - txhash.Hex(), - receipt.BlockNumber.Uint64(), - 90_000, - common.CoinType_Gas, - PostSendEVMGasLimit, - "", - ) - return zetaHash, err -} - func (ob *EVMChainClient) WatchGasPrice() { err := ob.PostGasPrice() @@ -1017,12 +982,12 @@ func (ob *EVMChainClient) WatchGasPrice() { func (ob *EVMChainClient) PostGasPrice() error { // GAS PRICE - gasPrice, err := ob.EvmClient.SuggestGasPrice(context.TODO()) + gasPrice, err := ob.evmClient.SuggestGasPrice(context.TODO()) if err != nil { ob.logger.WatchGasPrice.Err(err).Msg("Err SuggestGasPrice:") return err } - blockNum, err := ob.EvmClient.BlockNumber(context.TODO()) + blockNum, err := ob.evmClient.BlockNumber(context.TODO()) if err != nil { ob.logger.WatchGasPrice.Err(err).Msg("Err Fetching Most recent Block : ") return err @@ -1061,7 +1026,7 @@ func (ob *EVMChainClient) BuildBlockIndex() error { if scanFromBlock != "" { logger.Info().Msgf("envvar %s is set; scan from block %s", envvar, scanFromBlock) if scanFromBlock == clienttypes.EnvVarLatest { - header, err := ob.EvmClient.HeaderByNumber(context.Background(), nil) + header, err := ob.evmClient.HeaderByNumber(context.Background(), nil) if err != nil { return err } @@ -1084,7 +1049,7 @@ func (ob *EVMChainClient) BuildBlockIndex() error { ob.SetLastBlockHeightScanned(lastheight) // if ZetaCore does not have last heard block height, then use current if ob.GetLastBlockHeightScanned() == 0 { - header, err := ob.EvmClient.HeaderByNumber(context.Background(), nil) + header, err := ob.evmClient.HeaderByNumber(context.Background(), nil) if err != nil { return err } @@ -1212,7 +1177,7 @@ func (ob *EVMChainClient) GetBlockByNumberCached(blockNumber int64) (*ethtypes.B if block, ok := ob.BlockCache.Get(blockNumber); ok { return block.(*ethtypes.Block), nil } - block, err := ob.EvmClient.BlockByNumber(context.Background(), big.NewInt(blockNumber)) + block, err := ob.evmClient.BlockByNumber(context.Background(), big.NewInt(blockNumber)) if err != nil { return nil, err } diff --git a/zetaclient/inbound_tracker.go b/zetaclient/inbound_tracker.go new file mode 100644 index 0000000000..8e6c7c01d2 --- /dev/null +++ b/zetaclient/inbound_tracker.go @@ -0,0 +1,260 @@ +package zetaclient + +import ( + "errors" + "fmt" + "math/big" + + "github.com/btcsuite/btcd/chaincfg/chainhash" + ethcommon "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/x/crosschain/types" + "golang.org/x/net/context" +) + +// ExternalChainWatcherForNewInboundTrackerSuggestions At each tick, gets a list of Inbound tracker suggestions from zeta-core and tries to check if the in-tx was confirmed. +// If it was, it tries to broadcast the confirmation vote. If this zeta client has previously broadcast the vote, the tx would be rejected +func (ob *EVMChainClient) ExternalChainWatcherForNewInboundTrackerSuggestions() { + ticker := NewDynamicTicker(fmt.Sprintf("EVM_ExternalChainWatcher_InboundTrackerSuggestions_%d", ob.chain.ChainId), ob.GetCoreParams().InTxTicker) + defer ticker.Stop() + ob.logger.ExternalChainWatcher.Info().Msg("ExternalChainWatcher for inboundTrackerSuggestions started") + for { + select { + case <-ticker.C(): + err := ob.ObserveTrackerSuggestions() + if err != nil { + ob.logger.ExternalChainWatcher.Err(err).Msg("ObserveTrackerSuggestions error") + } + ticker.UpdateInterval(ob.GetCoreParams().InTxTicker, ob.logger.ExternalChainWatcher) + case <-ob.stop: + ob.logger.ExternalChainWatcher.Info().Msg("ExternalChainWatcher for inboundTrackerSuggestions stopped") + return + } + } +} + +func (ob *BitcoinChainClient) ExternalChainWatcherForNewInboundTrackerSuggestions() { + ticker := NewDynamicTicker("Bitcoin_WatchInTx_InboundTrackerSuggestions", ob.GetCoreParams().InTxTicker) + defer ticker.Stop() + for { + select { + case <-ticker.C(): + err := ob.ObserveTrackerSuggestions() + if err != nil { + ob.logger.WatchInTx.Error().Err(err).Msg("error observing in tx") + } + ticker.UpdateInterval(ob.GetCoreParams().InTxTicker, ob.logger.WatchInTx) + case <-ob.stop: + ob.logger.WatchInTx.Info().Msg("ExternalChainWatcher for BTC inboundTrackerSuggestions stopped") + return + } + } +} + +func (ob *BitcoinChainClient) ObserveTrackerSuggestions() error { + trackers, err := ob.zetaClient.GetInboundTrackersForChain(ob.chain.ChainId) + if err != nil { + return err + } + for _, tracker := range trackers { + ob.logger.WatchInTx.Info().Msgf("checking tracker with hash :%s and coin-type :%s ", tracker.TxHash, tracker.CoinType) + ballotIdentifier, err := ob.CheckReceiptForBtcTxHash(tracker.TxHash, true) + if err != nil { + return err + } + ob.logger.WatchInTx.Info().Msgf("Vote submitted for inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_Gas.String()) + } + return nil +} + +func (ob *BitcoinChainClient) CheckReceiptForBtcTxHash(txHash string, vote bool) (string, error) { + hash, err := chainhash.NewHashFromStr(txHash) + if err != nil { + return "", err + } + tx, err := ob.rpcClient.GetRawTransactionVerbose(hash) + if err != nil { + return "", err + } + blockHash, err := chainhash.NewHashFromStr(tx.BlockHash) + if err != nil { + return "", err + } + block, err := ob.rpcClient.GetBlockVerbose(blockHash) + if err != nil { + return "", err + } + tss, err := ob.zetaClient.GetBtcTssAddress() + if err != nil { + return "", err + } + // #nosec G701 always positive + event, err := GetBtcEvent(*tx, tss, uint64(block.Height), &ob.logger.WatchInTx) + if err != nil { + return "", err + } + if event == nil { + return "", errors.New("no btc deposit event found") + } + msg := ob.GetInboundVoteMessageFromBtcEvent(event) + if !vote { + return msg.Digest(), nil + } + zetaHash, err := ob.zetaClient.PostSend(PostSendEVMGasLimit, msg) + if err != nil { + ob.logger.WatchInTx.Error().Err(err).Msg("error posting to zeta core") + return "", err + } + ob.logger.WatchInTx.Info().Msgf("ZetaSent event detected and reported: PostSend zeta tx: %s", zetaHash) + return msg.Digest(), nil +} + +func (ob *EVMChainClient) ObserveTrackerSuggestions() error { + trackers, err := ob.zetaClient.GetInboundTrackersForChain(ob.chain.ChainId) + if err != nil { + return err + } + for _, tracker := range trackers { + ob.logger.ExternalChainWatcher.Info().Msgf("checking tracker with hash :%s and coin-type :%s ", tracker.TxHash, tracker.CoinType) + switch tracker.CoinType { + case common.CoinType_Zeta: + ballotIdentifier, err := ob.CheckReceiptForCoinTypeZeta(tracker.TxHash, true) + if err != nil { + return err + } + ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_Zeta.String()) + case common.CoinType_ERC20: + ballotIdentifier, err := ob.CheckReceiptForCoinTypeERC20(tracker.TxHash, true) + if err != nil { + return err + } + ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_ERC20.String()) + case common.CoinType_Gas: + ballotIdentifier, err := ob.CheckReceiptForCoinTypeGas(tracker.TxHash, true) + if err != nil { + return err + } + ob.logger.ExternalChainWatcher.Info().Msgf("Vote submitted for inbound Tracker,Chain : %s,Ballot Identifier : %s, coin-type %s", ob.chain.ChainName, ballotIdentifier, common.CoinType_Gas.String()) + } + } + return nil +} + +func (ob *EVMChainClient) CheckReceiptForCoinTypeZeta(txHash string, vote bool) (string, error) { + connector, err := ob.GetConnectorContract() + if err != nil { + return "", err + } + hash := ethcommon.HexToHash(txHash) + receipt, err := ob.evmClient.TransactionReceipt(context.Background(), hash) + if err != nil { + return "", err + } + + var msg types.MsgVoteOnObservedInboundTx + for _, log := range receipt.Logs { + event, err := connector.ParseZetaSent(*log) + if err == nil && event != nil { + msg, err = ob.GetInboundVoteMsgForZetaSentEvent(event) + if err == nil { + break + } + } + } + if !vote { + return msg.Digest(), nil + } + + zetaHash, err := ob.zetaClient.PostSend(PostSendNonEVMGasLimit, &msg) + if err != nil { + ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error posting to zeta core") + return "", err + } + ob.logger.ExternalChainWatcher.Info().Msgf("ZetaSent event detected and reported: PostSend zeta tx: %s", zetaHash) + + return msg.Digest(), nil +} + +func (ob *EVMChainClient) CheckReceiptForCoinTypeERC20(txHash string, vote bool) (string, error) { + custody, err := ob.GetERC20CustodyContract() + if err != nil { + return "", err + } + hash := ethcommon.HexToHash(txHash) + receipt, err := ob.evmClient.TransactionReceipt(context.Background(), hash) + if err != nil { + return "", err + } + var msg types.MsgVoteOnObservedInboundTx + for _, log := range receipt.Logs { + zetaDeposited, err := custody.ParseDeposited(*log) + if err == nil && zetaDeposited != nil { + msg, err = ob.GetInboundVoteMsgForDepositedEvent(zetaDeposited) + if err == nil { + break + } + } + } + if !vote { + return msg.Digest(), nil + } + + zetaHash, err := ob.zetaClient.PostSend(PostSendEVMGasLimit, &msg) + if err != nil { + ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error posting to zeta core") + return "", err + } + ob.logger.ExternalChainWatcher.Info().Msgf("ZetaSent event detected and reported: PostSend zeta tx: %s", zetaHash) + + return msg.Digest(), nil +} + +func (ob *EVMChainClient) CheckReceiptForCoinTypeGas(txHash string, vote bool) (string, error) { + hash := ethcommon.HexToHash(txHash) + tx, isPending, err := ob.evmClient.TransactionByHash(context.Background(), hash) + if err != nil { + return "", err + } + if isPending { + return "", errors.New("tx is still pending") + } + + receipt, err := ob.evmClient.TransactionReceipt(context.Background(), hash) + if err != nil { + ob.logger.ExternalChainWatcher.Err(err).Msg("TransactionReceipt error") + return "", err + } + if receipt.Status != 1 { // 1: successful, 0: failed + ob.logger.ExternalChainWatcher.Info().Msgf("tx %s failed; don't act", tx.Hash().Hex()) + return "", errors.New("tx not successful yet") + } + block, err := ob.evmClient.BlockByNumber(context.Background(), receipt.BlockNumber) + if err != nil { + ob.logger.ExternalChainWatcher.Err(err).Msg("BlockByNumber error") + return "", err + } + from, err := ob.evmClient.TransactionSender(context.Background(), tx, block.Hash(), receipt.TransactionIndex) + if err != nil { + ob.logger.ExternalChainWatcher.Err(err).Msg("TransactionSender error; trying local recovery (assuming LondonSigner dynamic fee tx type) of sender address") + signer := ethtypes.NewLondonSigner(big.NewInt(ob.chain.ChainId)) + from, err = signer.Sender(tx) + if err != nil { + ob.logger.ExternalChainWatcher.Err(err).Msg("local recovery of sender address failed") + return "", err + } + } + msg := ob.GetInboundVoteMsgForTokenSentToTSS(tx.Hash(), tx.Value(), receipt, from, tx.Data()) + if !vote { + return msg.Digest(), nil + } + + zetaHash, err := ob.zetaClient.PostSend(PostSendEVMGasLimit, msg) + if err != nil { + ob.logger.ExternalChainWatcher.Error().Err(err).Msg("error posting to zeta core") + return "", err + } + ob.logger.ExternalChainWatcher.Info().Msgf("Gas Deposit detected and reported: PostSend zeta tx: %s", zetaHash) + + return msg.Digest(), nil +} diff --git a/zetaclient/keys.go b/zetaclient/keys.go index 5519e0b884..af45452275 100644 --- a/zetaclient/keys.go +++ b/zetaclient/keys.go @@ -24,7 +24,7 @@ type Keys struct { signerName string password string // TODO this is a bad way , need to fix it kb ckeys.Keyring - operatorAddress sdk.AccAddress + OperatorAddress sdk.AccAddress } // NewKeysWithKeybase create a new instance of Keys @@ -33,7 +33,7 @@ func NewKeysWithKeybase(kb ckeys.Keyring, granterAddress sdk.AccAddress, grantee signerName: granteeName, password: password, kb: kb, - operatorAddress: granterAddress, + OperatorAddress: granterAddress, } } @@ -106,7 +106,7 @@ func (k *Keys) GetSignerInfo() *ckeys.Record { } func (k *Keys) GetOperatorAddress() sdk.AccAddress { - return k.operatorAddress + return k.OperatorAddress } func (k *Keys) GetAddress() sdk.AccAddress { diff --git a/zetaclient/query.go b/zetaclient/query.go index 909e2bdc56..d84d335e0c 100644 --- a/zetaclient/query.go +++ b/zetaclient/query.go @@ -230,6 +230,24 @@ func (b *ZetaCoreBridge) GetKeyGen() (*zetaObserverTypes.Keygen, error) { } +func (b *ZetaCoreBridge) GetBallot(ballotIdentifier string) (*zetaObserverTypes.QueryBallotByIdentifierResponse, error) { + client := zetaObserverTypes.NewQueryClient(b.grpcConn) + resp, err := client.BallotByIdentifier(context.Background(), &zetaObserverTypes.QueryBallotByIdentifierRequest{BallotIdentifier: ballotIdentifier}) + if err != nil { + return nil, err + } + return resp, nil +} + +func (b *ZetaCoreBridge) GetInboundTrackersForChain(chainID int64) ([]types.InTxTracker, error) { + client := types.NewQueryClient(b.grpcConn) + resp, err := client.InTxTrackerAllByChain(context.Background(), &types.QueryAllInTxTrackerByChainRequest{ChainId: chainID}) + if err != nil { + return nil, err + } + return resp.InTxTracker, nil +} + func (b *ZetaCoreBridge) GetCurrentTss() (*types.TSS, error) { client := types.NewQueryClient(b.grpcConn) resp, err := client.TSS(context.Background(), &types.QueryGetTSSRequest{}) @@ -239,6 +257,24 @@ func (b *ZetaCoreBridge) GetCurrentTss() (*types.TSS, error) { return resp.TSS, nil } +func (b *ZetaCoreBridge) GetEthTssAddress() (string, error) { + client := types.NewQueryClient(b.grpcConn) + resp, err := client.GetTssAddress(context.Background(), &types.QueryGetTssAddressRequest{}) + if err != nil { + return "", err + } + return resp.Eth, nil +} + +func (b *ZetaCoreBridge) GetBtcTssAddress() (string, error) { + client := types.NewQueryClient(b.grpcConn) + resp, err := client.GetTssAddress(context.Background(), &types.QueryGetTssAddressRequest{}) + if err != nil { + return "", err + } + return resp.Btc, nil +} + func (b *ZetaCoreBridge) GetTssHistory() ([]types.TSS, error) { client := types.NewQueryClient(b.grpcConn) resp, err := client.TssHistory(context.Background(), &types.QueryTssHistoryRequest{}) diff --git a/zetaclient/tx.go b/zetaclient/tx.go index 85505d5623..872062b6ce 100644 --- a/zetaclient/tx.go +++ b/zetaclient/tx.go @@ -31,6 +31,11 @@ const ( DefaultRetryInterval = 5 ) +func GetInBoundVoteMessage(sender string, senderChain int64, txOrigin string, receiver string, receiverChain int64, amount math.Uint, message string, inTxHash string, inBlockHeight uint64, gasLimit uint64, coinType common.CoinType, asset string, signerAddress string) *types.MsgVoteOnObservedInboundTx { + msg := types.NewMsgVoteOnObservedInboundTx(signerAddress, sender, senderChain, txOrigin, receiver, receiverChain, amount, message, inTxHash, inBlockHeight, gasLimit, coinType, asset) + return msg +} + func (b *ZetaCoreBridge) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, AuthZSigner) { msgURL := sdk.MsgTypeURL(msg) authzSigner := GetSigner(msgURL) @@ -66,11 +71,8 @@ func (b *ZetaCoreBridge) AddTxHashToOutTxTracker(chainID int64, nonce uint64, tx return zetaTxHash, nil } -func (b *ZetaCoreBridge) PostSend(sender string, senderChain int64, txOrigin string, receiver string, receiverChain int64, amount math.Uint, message string, inTxHash string, inBlockHeight uint64, gasLimit uint64, coinType common.CoinType, zetaGasLimit uint64, asset string) (string, error) { - signerAddress := b.keys.GetOperatorAddress().String() - msg := types.NewMsgVoteOnObservedInboundTx(signerAddress, sender, senderChain, txOrigin, receiver, receiverChain, amount, message, inTxHash, inBlockHeight, gasLimit, coinType, asset) +func (b *ZetaCoreBridge) PostSend(zetaGasLimit uint64, msg *types.MsgVoteOnObservedInboundTx) (string, error) { authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) - for i := 0; i < DefaultRetryCount; i++ { zetaTxHash, err := b.Broadcast(zetaGasLimit, authzMsg, authzSigner) if err == nil { @@ -79,7 +81,6 @@ func (b *ZetaCoreBridge) PostSend(sender string, senderChain int64, txOrigin str b.logger.Debug().Err(err).Msgf("PostSend broadcast fail | Retry count : %d", i+1) time.Sleep(DefaultRetryInterval * time.Second) } - return "", fmt.Errorf("post send failed after %d retries", DefaultRetryInterval) } diff --git a/zetaclient/utils.go b/zetaclient/utils.go index 56ba3000d9..1983396152 100644 --- a/zetaclient/utils.go +++ b/zetaclient/utils.go @@ -1,12 +1,27 @@ package zetaclient import ( - "errors" + "bytes" + "context" + "encoding/base64" + "encoding/hex" + "fmt" "math" + "math/big" + "strings" "time" + sdkmath "cosmossdk.io/math" "github.com/btcsuite/btcd/txscript" + ethcommon "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/pkg/errors" "github.com/rs/zerolog" + "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/erc20custody.sol" + "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/zetaconnector.non-eth.sol" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/x/crosschain/types" + clienttypes "github.com/zeta-chain/zetacore/zetaclient/types" ) const ( @@ -76,3 +91,99 @@ func (t *DynamicTicker) UpdateInterval(newInterval uint64, logger zerolog.Logger func (t *DynamicTicker) Stop() { t.impl.Stop() } + +func (ob *EVMChainClient) GetInboundVoteMsgForDepositedEvent(event *erc20custody.ERC20CustodyDeposited) (types.MsgVoteOnObservedInboundTx, error) { + ob.logger.ExternalChainWatcher.Info().Msgf("TxBlockNumber %d Transaction Hash: %s Message : %s", event.Raw.BlockNumber, event.Raw.TxHash, event.Message) + if bytes.Compare(event.Message, []byte(DonationMessage)) == 0 { + ob.logger.ExternalChainWatcher.Info().Msgf("thank you rich folk for your donation!: %s", event.Raw.TxHash.Hex()) + return types.MsgVoteOnObservedInboundTx{}, fmt.Errorf("thank you rich folk for your donation!: %s", event.Raw.TxHash.Hex()) + } + // get the sender of the event's transaction + tx, _, err := ob.evmClient.TransactionByHash(context.Background(), event.Raw.TxHash) + if err != nil { + ob.logger.ExternalChainWatcher.Error().Err(err).Msg(fmt.Sprintf("failed to get transaction by hash: %s", event.Raw.TxHash.Hex())) + return types.MsgVoteOnObservedInboundTx{}, errors.Wrap(err, fmt.Sprintf("failed to get transaction by hash: %s", event.Raw.TxHash.Hex())) + } + signer := ethtypes.NewLondonSigner(big.NewInt(ob.chain.ChainId)) + sender, err := signer.Sender(tx) + if err != nil { + ob.logger.ExternalChainWatcher.Error().Err(err).Msg(fmt.Sprintf("can't recover the sender from the tx hash: %s", event.Raw.TxHash.Hex())) + return types.MsgVoteOnObservedInboundTx{}, errors.Wrap(err, fmt.Sprintf("can't recover the sender from the tx hash: %s", event.Raw.TxHash.Hex())) + + } + return *GetInBoundVoteMessage( + sender.Hex(), + ob.chain.ChainId, + "", + clienttypes.BytesToEthHex(event.Recipient), + common.ZetaChain().ChainId, + sdkmath.NewUintFromBigInt(event.Amount), + hex.EncodeToString(event.Message), + event.Raw.TxHash.Hex(), + event.Raw.BlockNumber, + 1_500_000, + common.CoinType_ERC20, + event.Asset.String(), + ob.zetaClient.keys.GetOperatorAddress().String(), + ), nil +} + +func (ob *EVMChainClient) GetInboundVoteMsgForZetaSentEvent(event *zetaconnector.ZetaConnectorNonEthZetaSent) (types.MsgVoteOnObservedInboundTx, error) { + ob.logger.ExternalChainWatcher.Info().Msgf("TxBlockNumber %d Transaction Hash: %s Message : %s", event.Raw.BlockNumber, event.Raw.TxHash, event.Message) + destChain := common.GetChainFromChainID(event.DestinationChainId.Int64()) + if destChain == nil { + ob.logger.ExternalChainWatcher.Warn().Msgf("chain id not supported %d", event.DestinationChainId.Int64()) + return types.MsgVoteOnObservedInboundTx{}, fmt.Errorf("chain id not supported %d", event.DestinationChainId.Int64()) + } + destAddr := clienttypes.BytesToEthHex(event.DestinationAddress) + if *destChain != common.ZetaChain() { + cfgDest, found := ob.cfg.GetEVMConfig(destChain.ChainId) + if !found { + return types.MsgVoteOnObservedInboundTx{}, fmt.Errorf("chain id not present in EVMChainConfigs %d", event.DestinationChainId.Int64()) + } + if strings.EqualFold(destAddr, cfgDest.ZetaTokenContractAddress) { + ob.logger.ExternalChainWatcher.Warn().Msgf("potential attack attempt: %s destination address is ZETA token contract address %s", destChain, destAddr) + return types.MsgVoteOnObservedInboundTx{}, fmt.Errorf("potential attack attempt: %s destination address is ZETA token contract address %s", destChain, destAddr) + } + } + return *GetInBoundVoteMessage( + event.ZetaTxSenderAddress.Hex(), + ob.chain.ChainId, + event.SourceTxOriginAddress.Hex(), + clienttypes.BytesToEthHex(event.DestinationAddress), + destChain.ChainId, + sdkmath.NewUintFromBigInt(event.ZetaValueAndGas), + base64.StdEncoding.EncodeToString(event.Message), + event.Raw.TxHash.Hex(), + event.Raw.BlockNumber, + event.DestinationGasLimit.Uint64(), + common.CoinType_Zeta, + "", + ob.zetaClient.keys.GetOperatorAddress().String(), + ), nil +} + +func (ob *EVMChainClient) GetInboundVoteMsgForTokenSentToTSS(txhash ethcommon.Hash, value *big.Int, receipt *ethtypes.Receipt, from ethcommon.Address, data []byte) *types.MsgVoteOnObservedInboundTx { + ob.logger.ExternalChainWatcher.Info().Msgf("TSS inTx detected: %s, blocknum %d", txhash.Hex(), receipt.BlockNumber) + ob.logger.ExternalChainWatcher.Info().Msgf("TSS inTx value: %s", value.String()) + ob.logger.ExternalChainWatcher.Info().Msgf("TSS inTx from: %s", from.Hex()) + message := "" + if len(data) != 0 { + message = hex.EncodeToString(data) + } + return GetInBoundVoteMessage( + from.Hex(), + ob.chain.ChainId, + from.Hex(), + from.Hex(), + common.ZetaChain().ChainId, + sdkmath.NewUintFromBigInt(value), + message, + txhash.Hex(), + receipt.BlockNumber.Uint64(), + 90_000, + common.CoinType_Gas, + "", + ob.zetaClient.keys.GetOperatorAddress().String(), + ) +}