From 9c0eed2c44c77042daed66f3565d785da97877ef Mon Sep 17 00:00:00 2001 From: Billy Yang <97488959+billyyang423@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:08:34 -0600 Subject: [PATCH 01/26] Remove A2 workflows (#1319) Co-authored-by: Billy Yang --- .github/workflows/chain-operations.yml | 62 ------------ .github/workflows/deploy.yml | 126 ------------------------- 2 files changed, 188 deletions(-) delete mode 100644 .github/workflows/chain-operations.yml delete mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/chain-operations.yml b/.github/workflows/chain-operations.yml deleted file mode 100644 index 88bd4c06c6..0000000000 --- a/.github/workflows/chain-operations.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Node Operations - Athens2 -on: - workflow_dispatch: - inputs: - ENVIRONMENT: - description: 'Which environment to update?' - type: environment - required: true - ZETACORED_STATUS: - description: 'Do you want to start, stop, or restart the zetacored?' - type: choice - options: - - 'start' - - 'stop' - - 'restart' - required: true - ZETACLIENTD_STATUS: - description: 'Do you want to start, stop, or restart the zetaclientd?' - type: choice - options: - - 'start' - - 'stop' - - 'restart' - required: true - -env: - AWS_REGION: "us-east-1" - -jobs: - start-stop-processes: - runs-on: ubuntu-latest - environment: ${{ github.event.inputs.ENVIRONMENT }} - steps: - - uses: actions/checkout@v3 - - - name: Install Pipeline Dependencies - uses: ./.github/actions/install-dependencies - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - - - name: Change Zetacored Status - run: | - source .github/actions/deploy-binaries/functions - COMMAND_ID=$(run_ssm_cmds_validators "systemctl ${{ github.event.inputs.ZETACORED_STATUS }} cosmovisor") - check_cmd_status $COMMAND_ID - COMMAND_ID=$(run_ssm_cmds_api_nodes "systemctl ${{ github.event.inputs.ZETACORED_STATUS }} cosmovisor") - check_cmd_status $COMMAND_ID - COMMAND_ID=$(run_ssm_cmds_archive_nodes "systemctl ${{ github.event.inputs.ZETACORED_STATUS }} cosmovisor") - check_cmd_status $COMMAND_ID - - - - name: Change Zetaclientd Status - run: | - source .github/actions/deploy-binaries/functions - COMMAND_ID=$(run_ssm_cmds_validators "systemctl ${{ github.event.inputs.ZETACLIENTD_STATUS }} zetaclientd") - check_cmd_status $COMMAND_ID - diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index e5f234ca6e..0000000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: Deploy ZetaChain Update - Athens2 -on: - workflow_dispatch: - inputs: - ENVIRONMENT: - description: 'What Environment to deploy into (athens2, development)?' - type: environment - required: true - UPGRADE_BLOCK_HEIGHT: - description: 'What block height to stop and upgrade? (Cosmovisor Only)' - type: string - required: false - DEPLOYMENT_METHOD: - description: 'Do you want to use Cosmovisor or the more dangerous binary replacement method?' - type: choice - required: true - options: - - cosmovisor - - binary_replacement - -env: - S3_BUCKET_PATH: "zetachain-deployment-files/builds/zeta-node" - AWS_REGION: "us-east-1" - -jobs: - deploy-cosmovisor-upgrade: - runs-on: ["zeta-runners-athens2"] - environment: ${{ github.event.inputs.ENVIRONMENT }} - steps: - - uses: actions/checkout@v3 - - - name: Install Pipeline Dependencies - uses: ./.github/actions/install-dependencies - - # - name: setup-git-credentials - # uses: de-vri-es/setup-git-credentials@v2.0.8 - # with: - # credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ env.AWS_REGION }} - - - name: Set Chain ID Automatically based on Environment - run: | - if [ ${{ github.event.inputs.ENVIRONMENT }} == "development" ]; then - echo "using development chain id: develop_101-1" - echo "CHAIN_ID=develop_101-1" >> $GITHUB_ENV - elif [ ${{ github.event.inputs.ENVIRONMENT }} == "athens2" ]; then - echo "using athens2 chain id" - echo "CHAIN_ID=athens_7001-1" >> $GITHUB_ENV - fi - - # Approval needed to deploy to environments other than development - # - uses: trstringer/manual-approval@v1 - # if : ${{ github.event.inputs.ENVIRONMENT != 'development' }} - # with: - # secret: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} - # approvers: charliemc0, brewmaster012, kingpinXD, afzeta, chriskzeta, lucas-janon - # minimum-approvals: 1 - # issue-title: "Protocol Upgrade ${{ github.ref_name }} Env: ${{ github.event.inputs.ENVIRONMENT }}" - # exclude-workflow-initiator-as-approver: false - - - name: Test Inputs - if: ${{ env.ACT }} - run: | - echo ${{ github.ref_name }} - echo ${{ github.event.inputs.ENVIRONMENT }} - echo ${{ env.CHAIN_ID }} - echo ${{ github.event.inputs.UPGRADE_BLOCK_HEIGHT }} - echo ${{ env.ZETACORED_CHECKSUM }} - echo ${{ env.ZETACLIENTD_CHECKSUM }} - echo ${{ github.event.inputs.DEPLOYMENT_METHOD }} - - name: Update Nodes via Binary Replacement (Dangerous Method) - uses: ./.github/actions/deploy-binaries - if: ${{ github.event.inputs.DEPLOYMENT_METHOD == 'binary_replacement' }} - with: - S3_BUCKET_PATH: ${{ env.S3_BUCKET_PATH }} - TAKE_SNAPSHOTS: true - BRANCH_OR_TAG_NAME: ${{ github.ref_name }} - - ## Cosmovisor Actions Start Here - - name: Block Dangerous Updates To Public Networks - if: ${{ github.event.inputs.DEPLOYMENT_METHOD == 'binary_replacement' && github.event.inputs.ENVIRONMENT != 'development' }} - run: | - echo "ERROR: CANNOT USE DANGEROUS DEPLOYMENT METHODS FOR ATHENS AND OTHER PUBLIC NETWORKS" - exit 1 - - - name: Check Upgrade Handler Name Matches Tag - if: ${{ github.event.inputs.DEPLOYMENT_METHOD == 'cosmovisor' }} - run: | - UPGRADE_HANDLER_NAME=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"') - echo $UPGRADE_HANDLER_NAME - if [ ${{ github.ref_name }} != $UPGRADE_HANDLER_NAME ]; then - echo "ERROR: The name of this release does not match the releaseVersion const in app/setup_handlers.go" - echo "Did you forget to update the 'releaseVersion' const in app/setup_handlers.go?" - exit 1 - fi - echo "releaseVersion' const in app/setup_handlers.go matches this tagged release - Moving Forward!" - - - name: Get Checksum - if: ${{ github.event.inputs.DEPLOYMENT_METHOD == 'cosmovisor' }} - run: | - aws s3 cp s3://${{ env.S3_BUCKET_PATH }}/${{ github.ref_name }}/zetacored ./ || exit 1 - aws s3 cp s3://${{ env.S3_BUCKET_PATH }}/${{ github.ref_name }}/zetaclientd ./ || exit 1 - ZETACORED_CHECKSUM=$(shasum -b -a 256 zetacored | cut -d ' ' -f 1) - ZETACLIENTD_CHECKSUM=$(shasum -b -a 256 zetaclientd | cut -d ' ' -f 1) - echo "ZETACORED_CHECKSUM=$ZETACORED_CHECKSUM" >> $GITHUB_ENV - echo "ZETACLIENTD_CHECKSUM=$ZETACLIENTD_CHECKSUM" >> $GITHUB_ENV - - - name: Update Nodes via Cosmovisor Upgrade Proposal - uses: ./.github/actions/cosmovisor-upgrade - if: ${{ github.event.inputs.DEPLOYMENT_METHOD == 'cosmovisor' }} - with: - UPGRADE_NAME: ${{ github.ref_name }} - CHAIN_ID: ${{ env.CHAIN_ID }} - DESCRIPTION: ${{ github.event.inputs.UPGRADE_NAME }} - ZETACORED_CHECKSUM: ${{ env.ZETACORED_CHECKSUM }} - ZETACORED_URL: "https://${{ env.S3_BUCKET_PATH }}.s3.amazonaws.com/${{ github.ref_name }}/zetacored" - ZETACLIENTD_CHECKSUM: ${{ env.ZETACLIENTD_CHECKSUM }} - ZETACLIENTD_URL: "https://${{ env.S3_BUCKET_PATH }}.s3.amazonaws.com/${{ github.ref_name }}/zetaclientd" - API_ENDPOINT: "https://api.${{ github.event.inputs.ENVIRONMENT }}.zetachain.com" - UPGRADE_BLOCK_HEIGHT: ${{ github.event.inputs.UPGRADE_BLOCK_HEIGHT }} \ No newline at end of file From 161406eb7a936c6a9b7081f26017ce8545a0accb Mon Sep 17 00:00:00 2001 From: Tanmay Date: Wed, 18 Oct 2023 21:19:21 -0400 Subject: [PATCH 02/26] feat: inbound tx tracker (#1105) --- app/setup_handlers.go | 3 +- cmd/zetaclientd/debug.go | 189 +++ common/chain.go | 5 + common/coin.go | 17 +- common/default_chains_mainnet.go | 4 + common/default_chains_mock_mainnet.go | 4 + common/default_chains_privnet.go | 4 + common/default_chains_testnet.go | 4 + common/headers_test.go | 51 +- common/proof_test.go | 33 +- common/utils.go | 6 +- docs/openapi/openapi.swagger.yaml | 116 ++ docs/spec/crosschain/messages.md | 18 +- docs/spec/observer/messages.md | 1 + proto/crosschain/genesis.proto | 2 + proto/crosschain/in_tx_tracker.proto | 12 + proto/crosschain/query.proto | 24 + proto/crosschain/tx.proto | 12 + proto/observer/crosschain_flags.proto | 11 + proto/observer/events.proto | 1 + proto/observer/tx.proto | 1 + testutil/network/genesis_state.go | 10 + x/crosschain/client/cli/cli_in_tx_tracker.go | 104 ++ x/crosschain/client/cli/query.go | 2 + x/crosschain/client/cli/tx.go | 1 + .../client/querytests/in_tx_tracker.go | 103 ++ x/crosschain/genesis.go | 6 + .../keeper/grpc_query_in_tx_tracker.go | 28 + x/crosschain/keeper/in_tx_tracker.go | 79 + x/crosschain/keeper/in_tx_tracker_test.go | 78 + .../keeper_cross_chain_tx_vote_inbound_tx.go | 1 + x/crosschain/keeper/keeper_out_tx_tracker.go | 181 --- .../keeper/msg_server_add_to_intx_tracker.go | 105 ++ .../keeper/msg_server_add_to_outtx_tracker.go | 181 +++ x/crosschain/keeper/verify_block_header.go | 53 + x/crosschain/types/errors.go | 7 +- x/crosschain/types/genesis.pb.go | 127 +- x/crosschain/types/in_tx_tracker.pb.go | 391 +++++ x/crosschain/types/keys.go | 1 + .../types/message_add_to_in_tx_tracker.go | 61 + .../message_add_to_in_tx_tracker_test.go | 64 + x/crosschain/types/query.pb.go | 1318 ++++++++++++++--- x/crosschain/types/query.pb.gw.go | 184 +++ x/crosschain/types/tx.pb.go | 827 +++++++++-- x/emissions/types/events.pb.go | 4 +- x/observer/keeper/keeper.go | 8 + x/observer/keeper/migrator.go | 5 + .../msg_server_update_crosschain_flags.go | 15 +- ...msg_server_update_crosschain_flags_test.go | 14 +- x/observer/migrations/v4/migrate.go | 30 + x/observer/migrations/v4/migrate_test.go | 30 + x/observer/module.go | 3 + x/observer/types/crosschain_flags.go | 4 + x/observer/types/crosschain_flags.pb.go | 584 +++++++- x/observer/types/events.pb.go | 146 +- x/observer/types/tx.pb.go | 170 ++- zetaclient/bitcoin_client.go | 308 ++-- zetaclient/btc_signer_test.go | 2 +- zetaclient/chainclient.go | 1 + zetaclient/config/config_mainnet.go | 1 - zetaclient/config/config_mock_mainnet.go | 1 - zetaclient/config/config_privnet.go | 1 - zetaclient/config/config_testnet.go | 1 - zetaclient/evm_client.go | 229 ++- zetaclient/inbound_tracker.go | 260 ++++ zetaclient/keys.go | 6 +- zetaclient/query.go | 36 + zetaclient/tx.go | 11 +- zetaclient/utils.go | 113 +- 69 files changed, 5364 insertions(+), 1049 deletions(-) create mode 100644 cmd/zetaclientd/debug.go create mode 100644 proto/crosschain/in_tx_tracker.proto create mode 100644 x/crosschain/client/cli/cli_in_tx_tracker.go create mode 100644 x/crosschain/client/querytests/in_tx_tracker.go create mode 100644 x/crosschain/keeper/grpc_query_in_tx_tracker.go create mode 100644 x/crosschain/keeper/in_tx_tracker.go create mode 100644 x/crosschain/keeper/in_tx_tracker_test.go create mode 100644 x/crosschain/keeper/msg_server_add_to_intx_tracker.go create mode 100644 x/crosschain/keeper/msg_server_add_to_outtx_tracker.go create mode 100644 x/crosschain/keeper/verify_block_header.go create mode 100644 x/crosschain/types/in_tx_tracker.pb.go create mode 100644 x/crosschain/types/message_add_to_in_tx_tracker.go create mode 100644 x/crosschain/types/message_add_to_in_tx_tracker_test.go create mode 100644 x/observer/migrations/v4/migrate.go create mode 100644 x/observer/migrations/v4/migrate_test.go create mode 100644 zetaclient/inbound_tracker.go 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, 0x59, 0x6a, 0x00, 0x99, 0x8b, 0x62, 0x12, 0x65, 0x6a, - 0xa2, 0xa0, 0x80, 0x70, 0x5a, 0x6a, 0xd4, 0x7c, 0xeb, 0x9b, 0x42, 0x41, 0x8d, 0x90, 0x2a, 0x5d, - 0xaa, 0xf0, 0x56, 0xdc, 0xdd, 0x72, 0x8c, 0xf4, 0x4d, 0x27, 0x7a, 0x22, 0x95, 0x75, 0x77, 0xb7, - 0xdd, 0xb6, 0x29, 0xd3, 0x5a, 0x84, 0x95, 0x15, 0x74, 0xdd, 0xc1, 0x02, 0xd2, 0x69, 0x59, 0x48, - 0x65, 0x7b, 0x2f, 0x9c, 0x1e, 0x79, 0xd2, 0x5c, 0x40, 0x9e, 0xa2, 0x4e, 0xa5, 0xbc, 0x01, 0xf4, - 0x1c, 0xd1, 0x99, 0x00, 0x4c, 0xc7, 0x67, 0x5a, 0x9e, 0xa6, 0xb9, 0x2a, 0xb2, 0x1c, 0x57, 0xa4, - 0xd0, 0x33, 0x34, 0x24, 0x2c, 0x85, 0x3c, 0x55, 0xa5, 0x15, 0x3c, 0x77, 0x04, 0x53, 0x51, 0x8a, - 0xf3, 0xeb, 0xfc, 0xcf, 0x9c, 0x06, 0xc2, 0xcd, 0xdf, 0x4c, 0x67, 0x9a, 0xca, 0xc8, 0x54, 0xf5, - 0xdf, 0xde, 0xef, 0x0d, 0xb6, 0x79, 0x50, 0x9f, 0xdd, 0x08, 0x05, 0x2a, 0x3e, 0x60, 0xed, 0x1a, - 0xe6, 0x7b, 0x3b, 0xde, 0x6e, 0x67, 0xff, 0x65, 0xf8, 0xdf, 0xb3, 0x0c, 0x4f, 0x48, 0xdc, 0x5f, - 0xbf, 0xfc, 0xb9, 0xdd, 0x8a, 0xad, 0x95, 0x7f, 0x61, 0x4f, 0xf4, 0x0c, 0x93, 0x2a, 0xa9, 0x03, - 0x1f, 0x17, 0x80, 0xfe, 0xbd, 0x9d, 0xb5, 0xdd, 0xce, 0xfe, 0x9b, 0x06, 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, 0xac, + 0x6a, 0xaf, 0xac, 0x1a, 0x7a, 0x58, 0xc2, 0x21, 0x61, 0x5a, 0x31, 0x21, 0xee, 0x00, 0xde, 0x92, + 0x48, 0xe7, 0x5c, 0x5c, 0xc8, 0xbc, 0xaa, 0xf7, 0xac, 0xfa, 0x84, 0x83, 0x66, 0xe3, 0x89, 0x12, + 0x17, 0x2c, 0x91, 0x69, 0x9c, 0xe8, 0x15, 0x29, 0xd5, 0x4c, 0x2f, 0x43, 0x5e, 0x5a, 0x82, 0x29, + 0xcf, 0xf9, 0xe5, 0xed, 0xff, 0x7b, 0x61, 0x15, 0x34, 0xdc, 0x7d, 0x8d, 0x55, 0xac, 0xf0, 0x18, + 0x98, 0x53, 0xf9, 0xb5, 0xf7, 0xb3, 0x4d, 0xb6, 0x8e, 0xca, 0xbb, 0x1d, 0x69, 0xae, 0x25, 0x1d, + 0x90, 0x76, 0x09, 0x73, 0x9d, 0x3d, 0x67, 0xbf, 0x73, 0xf8, 0xda, 0xff, 0xef, 0x5d, 0xfb, 0x67, + 0x28, 0xee, 0x6f, 0x5e, 0xff, 0xde, 0x6d, 0x85, 0x95, 0x95, 0x9e, 0x93, 0x67, 0x6a, 0xa6, 0xa3, + 0x22, 0x2a, 0x03, 0x9f, 0xa6, 0xa0, 0xdd, 0x07, 0x7b, 0x1b, 0xfb, 0x9d, 0xc3, 0x77, 0x0d, 0xb8, + 0xcf, 0x96, 0xad, 0x82, 0x2e, 0xa1, 0xe8, 0x47, 0xb2, 0xa1, 0x01, 0xdc, 0x4d, 0x0c, 0xd8, 0x6b, + 0x20, 0x46, 0xa3, 0x51, 0x68, 0xe4, 0xf4, 0x84, 0x6c, 0xc5, 0x1c, 0xce, 0xcc, 0x5b, 0x62, 0xa0, + 0x87, 0x18, 0xe8, 0x4d, 0x83, 0xfd, 0xa8, 0xb2, 0x84, 0x35, 0x33, 0x8d, 0xc8, 0x36, 0xd6, 0x3f, + 0xe1, 0x60, 0x21, 0xaf, 0x8d, 0xbc, 0xb7, 0x0d, 0xbc, 0xc1, 0xbd, 0x2b, 0xfc, 0x17, 0x41, 0xbf, + 0x90, 0xa7, 0x03, 0x23, 0x45, 0x51, 0x54, 0x80, 0xfb, 0x68, 0xad, 0x4b, 0xb3, 0x3d, 0x61, 0x9d, + 0x40, 0xbf, 0x91, 0xe7, 0x66, 0xc2, 0xfa, 0x66, 0xc0, 0x86, 0x38, 0x5f, 0x18, 0xf6, 0x31, 0x82, + 0xfd, 0x06, 0xf0, 0x69, 0xdd, 0x19, 0xae, 0x42, 0x51, 0x41, 0xa8, 0x69, 0x35, 0xe4, 0x90, 0x44, + 0x6a, 0x20, 0x74, 0x81, 0x0d, 0x9e, 0x60, 0x83, 0x83, 0x86, 0x06, 0xc7, 0x35, 0x63, 0xf5, 0xe0, + 0x2b, 0x70, 0xf4, 0x98, 0x74, 0x34, 0x00, 0x4b, 0x52, 0xd0, 0x2a, 0xbf, 0x72, 0x09, 0xd2, 0xd7, + 0x78, 0xfa, 0x0a, 0x49, 0x34, 0xc0, 0xb0, 0xf4, 0xd2, 0x73, 0x93, 0xd7, 0x5a, 0x27, 0x36, 0x31, + 0x79, 0x3b, 0x6b, 0xbd, 0x9e, 0xc9, 0x5b, 0x9f, 0xce, 0xed, 0x34, 0xab, 0x0d, 0x67, 0xff, 0xe4, + 0x7a, 0xee, 0x39, 0x37, 0x73, 0xcf, 0xf9, 0x33, 0xf7, 0x9c, 0x1f, 0x0b, 0xaf, 0x75, 0xb3, 0xf0, + 0x5a, 0xbf, 0x16, 0x5e, 0xeb, 0xeb, 0xfb, 0x38, 0xd5, 0xc9, 0x6c, 0xec, 0x0b, 0x75, 0x19, 0x18, + 0xf8, 0x41, 0xb9, 0xa2, 0xb7, 0x7d, 0x82, 0x22, 0xb0, 0x17, 0xf7, 0x6a, 0x2a, 0x61, 0xdc, 0xc6, + 0x2d, 0xfd, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x12, 0x5d, 0x65, 0x0b, 0x05, 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, 0xb3, 0x3b, 0xb3, 0xbf, 0x99, 0x9d, 0xd9, 0x9d, 0xbd, 0x11, 0x39, 0x6e, 0x79, - 0x2e, 0xe7, 0xd6, 0x96, 0x69, 0xd7, 0x8a, 0xef, 0x35, 0x98, 0xb7, 0x5b, 0xa8, 0x7b, 0xae, 0x70, - 0xe9, 0xc9, 0xf7, 0x99, 0x30, 0x81, 0x5c, 0x80, 0x96, 0xeb, 0xb1, 0x42, 0x38, 0x35, 0x77, 0xc1, - 0x72, 0x79, 0xd5, 0xe5, 0xc5, 0x4d, 0x93, 0x33, 0x9f, 0xaf, 0xb8, 0x7d, 0x65, 0x93, 0x09, 0xf3, - 0x4a, 0xb1, 0x6e, 0x56, 0xec, 0x9a, 0x29, 0x6c, 0xb7, 0xe6, 0x8b, 0xca, 0x9d, 0x54, 0x96, 0x80, - 0xbf, 0xa5, 0x9a, 0x5b, 0xb3, 0x18, 0xc7, 0xe1, 0xbc, 0x3a, 0x2c, 0x9b, 0x25, 0x7f, 0x92, 0xd8, - 0xc1, 0x09, 0x39, 0x65, 0x42, 0xc5, 0xe4, 0xa5, 0xba, 0x67, 0x5b, 0x0c, 0xc7, 0x4e, 0x2b, 0x63, - 0xc0, 0x53, 0xda, 0x32, 0xf9, 0x56, 0x49, 0xb8, 0x25, 0xcb, 0x6a, 0x0b, 0xd0, 0x95, 0x49, 0x8e, - 0xc9, 0x45, 0x69, 0xd3, 0x71, 0xad, 0x87, 0xa5, 0x2d, 0x66, 0x57, 0xb6, 0x04, 0xce, 0x59, 0x50, - 0xe6, 0x00, 0xbc, 0x0e, 0x19, 0x2a, 0x4a, 0xb7, 0x21, 0xe4, 0x4a, 0xc2, 0x33, 0xad, 0x87, 0xcc, - 0xc3, 0x09, 0x4f, 0x2a, 0x13, 0xea, 0xa6, 0x67, 0x56, 0x03, 0xfd, 0xe6, 0x95, 0x01, 0xc1, 0xdb, - 0xd4, 0x8a, 0x5b, 0x71, 0xa1, 0x59, 0x94, 0x2d, 0xa4, 0x9e, 0xa8, 0xb8, 0x6e, 0xc5, 0x61, 0x45, - 0xb3, 0x6e, 0x17, 0xcd, 0x5a, 0xcd, 0x15, 0x60, 0x47, 0xe4, 0xd1, 0xb3, 0xe4, 0xf8, 0x57, 0xa5, - 0xa9, 0x37, 0x38, 0x7f, 0xc3, 0xe6, 0xc2, 0xf5, 0x76, 0x0d, 0xf6, 0x5e, 0x83, 0x71, 0xa1, 0x7f, - 0x87, 0x3c, 0xd9, 0x35, 0xc2, 0xeb, 0x6e, 0x8d, 0x33, 0x7a, 0x9b, 0x8c, 0x0b, 0xce, 0x4b, 0x8e, - 0xcd, 0x45, 0x56, 0x3b, 0x95, 0x39, 0x3f, 0xb9, 0xa8, 0x17, 0xf6, 0xdd, 0xdb, 0xc2, 0xc6, 0xfa, - 0xfa, 0xf2, 0xf0, 0xe7, 0xcd, 0xfc, 0x11, 0x63, 0x4c, 0x70, 0xbe, 0x6a, 0x73, 0xa1, 0xcf, 0x13, - 0x0a, 0xf2, 0xd7, 0x40, 0xb1, 0x60, 0xd5, 0xfb, 0xe4, 0x58, 0x84, 0xda, 0x5e, 0x71, 0xd4, 0x37, - 0x40, 0x56, 0x3b, 0xa5, 0x9d, 0x9f, 0x5c, 0x3c, 0xd3, 0x63, 0x3d, 0x9f, 0x1d, 0x97, 0x44, 0x56, - 0xfd, 0x2d, 0xf2, 0x34, 0xc8, 0x5e, 0x61, 0xe2, 0x9d, 0x86, 0xd8, 0xd8, 0xd9, 0xf0, 0x8d, 0x8d, - 0x4b, 0xd3, 0x2c, 0x19, 0x03, 0xe6, 0x7b, 0x77, 0x60, 0x91, 0x8c, 0x11, 0x74, 0xe9, 0x3c, 0x19, - 0x81, 0xfd, 0xcb, 0x0e, 0x9d, 0xd2, 0xce, 0x0f, 0x1b, 0x7e, 0x47, 0x6f, 0x90, 0x13, 0xf1, 0xe2, - 0x10, 0xf3, 0xbb, 0x64, 0xca, 0x55, 0xe8, 0x88, 0xfc, 0x62, 0x0f, 0xe4, 0xaa, 0x28, 0xc4, 0x1f, - 0x11, 0xa3, 0x33, 0xd4, 0x62, 0xc9, 0x71, 0xe2, 0xb4, 0xb8, 0x4b, 0x48, 0x18, 0x2d, 0xb8, 0xe6, - 0xd9, 0x82, 0x1f, 0x5a, 0x05, 0x19, 0x5a, 0x05, 0x3f, 0x24, 0x31, 0xb4, 0x0a, 0x6b, 0x66, 0x85, - 0x21, 0xaf, 0xa1, 0x70, 0xea, 0x9f, 0x6a, 0xa8, 0x5e, 0xd7, 0x3a, 0x89, 0xea, 0x65, 0x06, 0xa0, - 0x1e, 0x5d, 0x89, 0xe0, 0x1f, 0x02, 0xfc, 0xe7, 0x7a, 0xe2, 0xf7, 0x31, 0x45, 0x14, 0xf8, 0x40, - 0x23, 0x7a, 0x9c, 0x02, 0xcb, 0xbb, 0xb7, 0x25, 0x92, 0xc0, 0x5e, 0xf3, 0x64, 0x04, 0x90, 0xe1, - 0x9e, 0xfb, 0x9d, 0x0e, 0x2b, 0x0e, 0xf5, 0x6d, 0xc5, 0xdf, 0x6b, 0xe4, 0xf4, 0xbe, 0x20, 0xfe, - 0x4f, 0x8c, 0x79, 0x93, 0x9c, 0x0c, 0x7c, 0xfd, 0x5e, 0x6d, 0x63, 0xe7, 0x0d, 0x93, 0x6f, 0x6d, - 0xb8, 0xb7, 0x2d, 0xb1, 0x13, 0x98, 0x31, 0x47, 0xc6, 0x6d, 0x1c, 0x00, 0x4b, 0x4e, 0x18, 0xed, - 0xbe, 0xbe, 0x47, 0x16, 0x92, 0x98, 0x51, 0xfd, 0x6f, 0x91, 0x19, 0x3b, 0x32, 0x82, 0x8e, 0x7b, - 0xb9, 0x87, 0x01, 0xa2, 0xe2, 0xd0, 0x04, 0x1d, 0xa2, 0xf4, 0x5b, 0xb8, 0x7c, 0x74, 0xf2, 0x1d, - 0x53, 0x98, 0x69, 0xc0, 0xbf, 0x4f, 0xf2, 0x89, 0xdc, 0x88, 0xfe, 0xeb, 0x64, 0xfa, 0xb6, 0xc4, - 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, 0x6b, 0xc4, 0x2a, 0x91, 0xe9, 0x4b, 0x89, 0xc1, 0x79, - 0xe0, 0x62, 0xe8, 0x44, 0x10, 0xc7, 0x6f, 0x43, 0x5e, 0xba, 0xff, 0x16, 0x3d, 0x0c, 0x13, 0x93, - 0x08, 0x0f, 0x2a, 0xb8, 0x4a, 0x26, 0x15, 0x32, 0x9a, 0xf1, 0x42, 0xaf, 0xd3, 0x45, 0x11, 0xa4, - 0xb2, 0xeb, 0x65, 0x04, 0xb8, 0xe4, 0x38, 0x31, 0x00, 0x07, 0xb5, 0x63, 0x1f, 0x6b, 0x61, 0x9a, - 0x92, 0x4a, 0xa7, 0xcc, 0x21, 0x74, 0x1a, 0xdc, 0xee, 0x2d, 0x84, 0x49, 0xcf, 0x1a, 0xab, 0x95, - 0xed, 0x5a, 0x25, 0x62, 0x1e, 0x5d, 0x84, 0x27, 0x72, 0xc7, 0x38, 0xea, 0xb5, 0x4e, 0x66, 0xea, - 0xfe, 0x00, 0xbe, 0x48, 0x50, 0xb5, 0x4b, 0xbd, 0x12, 0xd6, 0x88, 0xb4, 0xe9, 0xba, 0xda, 0xd5, - 0x5f, 0x21, 0xa7, 0xfc, 0xa4, 0x58, 0xa5, 0x76, 0xe4, 0x31, 0x4f, 0x91, 0x71, 0xff, 0x8d, 0x63, - 0x97, 0xa3, 0xe9, 0x6b, 0x59, 0xff, 0x2e, 0x79, 0x66, 0x1f, 0x76, 0x04, 0xfe, 0xcd, 0x18, 0xe0, - 0xda, 0x41, 0x81, 0x07, 0xd7, 0x58, 0x14, 0xfe, 0xf5, 0xf0, 0xfe, 0x5f, 0x35, 0xb9, 0x58, 0x96, - 0x2f, 0xa5, 0x37, 0xe0, 0xa1, 0xb4, 0x7f, 0x58, 0x3c, 0xc2, 0xab, 0x37, 0x8e, 0x0f, 0x51, 0x7f, - 0x83, 0xcc, 0x76, 0x0c, 0x21, 0xec, 0x42, 0x0f, 0xd8, 0x9d, 0x02, 0x3b, 0xc5, 0xe8, 0x5b, 0xe1, - 0x8d, 0x98, 0x00, 0x7a, 0x50, 0xa1, 0xf2, 0x3b, 0x0d, 0xf5, 0x8c, 0x5b, 0x6a, 0x3f, 0x3d, 0x33, - 0x03, 0xd0, 0x73, 0x70, 0xa1, 0x73, 0x31, 0xbc, 0xe5, 0xd4, 0x14, 0x25, 0x7e, 0x6b, 0x57, 0x95, - 0x53, 0x52, 0xa6, 0x05, 0xbb, 0xe0, 0x2a, 0xfd, 0xbe, 0xc4, 0x2a, 0x64, 0x3e, 0xba, 0x34, 0x5a, - 0xed, 0x1d, 0x32, 0xa5, 0x26, 0x54, 0x29, 0x5f, 0x60, 0x2a, 0x8b, 0x11, 0x11, 0xa0, 0x7f, 0x1b, - 0x75, 0x94, 0x87, 0xda, 0x7f, 0x20, 0x0d, 0xfb, 0x48, 0x43, 0x45, 0xda, 0xf2, 0x13, 0x15, 0xc9, - 0x1c, 0x4a, 0x91, 0xc1, 0xed, 0xfa, 0xf7, 0x94, 0xdb, 0xc4, 0x12, 0x3b, 0x78, 0x1a, 0xf4, 0x3e, - 0x94, 0x06, 0xf6, 0xc2, 0xfa, 0x44, 0xbd, 0x68, 0x54, 0x04, 0xff, 0xf3, 0xa6, 0x3b, 0x81, 0xa6, - 0x93, 0x11, 0x79, 0x9f, 0x09, 0x33, 0x72, 0xba, 0xe8, 0xd7, 0x50, 0xad, 0xce, 0x51, 0x54, 0xeb, - 0x38, 0x19, 0x55, 0xce, 0xbb, 0x8c, 0x81, 0x3d, 0x7d, 0x03, 0x2f, 0xb0, 0xdb, 0x6e, 0x6d, 0x9b, - 0x79, 0x32, 0xe3, 0xdb, 0x70, 0x25, 0x7b, 0x57, 0x68, 0x75, 0x6d, 0x48, 0x8e, 0x8c, 0x57, 0x4c, - 0xbe, 0x6a, 0x57, 0x6d, 0x81, 0x29, 0x6d, 0xbb, 0xaf, 0xff, 0x58, 0xc3, 0x7b, 0xaf, 0x5b, 0x2c, - 0xe2, 0xb9, 0x44, 0x8e, 0xba, 0x0d, 0xb1, 0xe9, 0x36, 0x6a, 0xe5, 0x15, 0x93, 0xdf, 0xab, 0xc9, - 0x41, 0x0c, 0xf9, 0xee, 0x01, 0x39, 0x1b, 0x3e, 0x3f, 0x59, 0xae, 0x73, 0x97, 0x31, 0x9c, 0xed, - 0x2f, 0xda, 0x3d, 0x40, 0xcf, 0x93, 0x59, 0xf9, 0xab, 0x1e, 0x7e, 0x19, 0x08, 0xff, 0x4e, 0xb2, - 0x7e, 0x8e, 0x9c, 0x01, 0x98, 0x6f, 0x31, 0xce, 0xcd, 0x0a, 0x5b, 0x33, 0x39, 0xb7, 0x6b, 0x95, - 0xb5, 0x50, 0x62, 0x60, 0xdd, 0xbb, 0xe4, 0x6c, 0xaf, 0x89, 0xa8, 0xd8, 0x09, 0x32, 0xf1, 0xa0, - 0x0d, 0x11, 0x9f, 0x0c, 0x6d, 0x82, 0x7e, 0x13, 0x17, 0xbc, 0xff, 0xfa, 0xd7, 0xde, 0x92, 0xe9, - 0xbd, 0x67, 0xd6, 0xb8, 0x69, 0xc9, 0xed, 0x35, 0x98, 0xc5, 0xec, 0x7a, 0xfb, 0xb2, 0xa0, 0x64, - 0x78, 0x2b, 0x7c, 0x5e, 0x42, 0x5b, 0xff, 0xd7, 0x30, 0xa2, 0xd8, 0x87, 0xbb, 0x6d, 0x5e, 0x82, - 0x1f, 0x18, 0xdb, 0x42, 0x96, 0xa7, 0x5b, 0xcd, 0xfc, 0x04, 0x50, 0xe5, 0x4b, 0xca, 0x08, 0x9b, - 0x74, 0x91, 0x4c, 0xf9, 0xb3, 0x6b, 0x8d, 0xea, 0x26, 0xf3, 0x7c, 0xcb, 0x2e, 0xcf, 0xb6, 0x9a, - 0xf9, 0x49, 0xa0, 0xbf, 0x0d, 0x64, 0x43, 0xed, 0xd0, 0x57, 0xc9, 0x9c, 0xe5, 0xd6, 0x84, 0x67, - 0x5a, 0xa2, 0x64, 0xfa, 0x4f, 0x1f, 0xb0, 0xf2, 0xc4, 0xf2, 0xb1, 0x56, 0x33, 0x3f, 0x1b, 0x8c, - 0x05, 0xaf, 0xa2, 0x4e, 0x02, 0x7d, 0x9d, 0x1c, 0xb3, 0x1a, 0xd5, 0x86, 0x63, 0x0a, 0x7b, 0x9b, - 0x95, 0x2a, 0x26, 0x2f, 0x35, 0x38, 0x2b, 0x67, 0x87, 0x41, 0xc4, 0x13, 0xad, 0x66, 0xfe, 0x68, - 0x38, 0xbc, 0x62, 0xf2, 0x77, 0x39, 0x2b, 0x1b, 0xdd, 0x24, 0x7a, 0x82, 0x0c, 0x3f, 0xf0, 0xdc, - 0x6a, 0x76, 0x04, 0xf8, 0xc6, 0x5b, 0xcd, 0x3c, 0xf4, 0x0d, 0xf8, 0x4b, 0xcf, 0x82, 0x8f, 0xfa, - 0x92, 0x47, 0x61, 0xc6, 0x64, 0xab, 0x99, 0x1f, 0xab, 0xa0, 0xbc, 0xa0, 0x21, 0xcd, 0xe5, 0xb8, - 0x15, 0x5e, 0xda, 0x74, 0x5c, 0xb7, 0x9a, 0x1d, 0x0b, 0xcd, 0x25, 0xa9, 0xcb, 0x92, 0x68, 0x84, - 0x4d, 0xaa, 0x93, 0x51, 0x2e, 0x4c, 0xd1, 0xe0, 0xd9, 0x71, 0x98, 0x49, 0x5a, 0xcd, 0x3c, 0x52, - 0x0c, 0xfc, 0xa5, 0xc7, 0xc9, 0x90, 0x70, 0xb3, 0x13, 0x30, 0x3e, 0xda, 0x6a, 0xe6, 0x87, 0x84, - 0x6b, 0x0c, 0x09, 0x57, 0x9a, 0x4d, 0x84, 0xdb, 0xe6, 0x6f, 0x0f, 0x09, 0xcd, 0xa6, 0x8c, 0xc1, - 0x26, 0x75, 0x12, 0xe8, 0x12, 0x39, 0xaa, 0xf2, 0xfb, 0x57, 0xe5, 0x24, 0x08, 0x98, 0x6f, 0x35, - 0xf3, 0xaa, 0xf0, 0x7b, 0x72, 0xcc, 0xe8, 0xa2, 0xd0, 0xeb, 0x64, 0x58, 0xea, 0x92, 0x9d, 0x4a, - 0xf5, 0x25, 0x76, 0xd5, 0xad, 0x18, 0x30, 0x5f, 0xff, 0x20, 0x43, 0x32, 0xab, 0x6e, 0x45, 0x1e, - 0x09, 0xc1, 0x86, 0xfb, 0xde, 0x19, 0x74, 0xe5, 0x21, 0x23, 0xdc, 0xba, 0x6d, 0xf1, 0xec, 0xd0, - 0xa9, 0xcc, 0xf9, 0x09, 0x03, 0x7b, 0xd2, 0x99, 0xcb, 0xa6, 0x30, 0x7d, 0xff, 0x30, 0xa0, 0xdd, - 0xe5, 0x73, 0x72, 0xe3, 0x87, 0x7b, 0xfb, 0x5c, 0x97, 0xf1, 0x46, 0x0e, 0x6b, 0xbc, 0x51, 0x58, - 0x38, 0xad, 0xf1, 0xa2, 0x81, 0x35, 0xd6, 0x23, 0xb0, 0x9e, 0x23, 0xd2, 0x6d, 0x70, 0xa1, 0x71, - 0x58, 0x68, 0xaa, 0xd5, 0xcc, 0x8f, 0x3b, 0x6e, 0xc5, 0x5f, 0xa0, 0xdd, 0xa2, 0x67, 0xc8, 0x98, - 0xc7, 0xaa, 0xee, 0x36, 0x2b, 0x83, 0xd7, 0x8c, 0xfb, 0x9e, 0x8a, 0x24, 0x23, 0x68, 0xe8, 0x57, - 0x31, 0xcd, 0x8c, 0x3b, 0x02, 0x92, 0x4f, 0x8e, 0x7f, 0x0e, 0x63, 0xca, 0x18, 0xc7, 0xf6, 0x5f, - 0x3b, 0x32, 0x82, 0x58, 0xcd, 0xc4, 0xc6, 0xea, 0x53, 0x24, 0x53, 0x31, 0x39, 0x1e, 0x00, 0x63, - 0xad, 0x66, 0x5e, 0x76, 0x0d, 0xf9, 0x47, 0x9a, 0xb1, 0x5d, 0x74, 0xc1, 0x0d, 0x07, 0x33, 0x56, - 0xda, 0xef, 0xf2, 0xa0, 0x25, 0xd7, 0x00, 0xfc, 0xa3, 0xe1, 0x1a, 0xb2, 0xef, 0xdb, 0x81, 0xe6, - 0x65, 0x72, 0x59, 0x6f, 0x08, 0xdc, 0xb8, 0x89, 0x56, 0x33, 0xef, 0x13, 0x0c, 0xff, 0x47, 0x4e, - 0xf0, 0xf3, 0xc5, 0xf1, 0x70, 0x02, 0x10, 0x30, 0x75, 0x4c, 0x8c, 0xeb, 0x58, 0xd7, 0x22, 0x07, - 0x8a, 0xcb, 0x3c, 0x19, 0xd9, 0x36, 0x9d, 0x06, 0xc3, 0x70, 0x86, 0xb5, 0x81, 0x60, 0xf8, 0x3f, - 0x52, 0x37, 0xb1, 0x5b, 0x67, 0xd9, 0xa9, 0x50, 0x37, 0xd9, 0x37, 0xe0, 0x2f, 0x2d, 0x92, 0x49, - 0xd3, 0xb2, 0x58, 0x50, 0x67, 0x99, 0x96, 0x11, 0xb8, 0x3c, 0xd3, 0x6a, 0xe6, 0x89, 0x4f, 0x5e, - 0xb5, 0x65, 0x26, 0x14, 0xb6, 0xe5, 0xe1, 0xd8, 0x4e, 0xb6, 0x66, 0xc2, 0xc3, 0x11, 0xef, 0xf7, - 0xf0, 0xa2, 0x3f, 0x46, 0xb4, 0xed, 0xec, 0x2c, 0x4c, 0x18, 0x69, 0x35, 0xf3, 0xda, 0xb6, 0xa1, - 0x6d, 0x4b, 0xa2, 0x97, 0x9d, 0x0b, 0x89, 0x9e, 0xa1, 0x79, 0x92, 0xc8, 0xb3, 0x47, 0x43, 0x22, - 0x37, 0x34, 0xae, 0xdf, 0xc0, 0xc7, 0x28, 0xba, 0x1e, 0x5c, 0xbf, 0xcb, 0xbb, 0xe8, 0x1f, 0xe8, - 0xb3, 0xc7, 0xc9, 0xe8, 0x56, 0x98, 0x9d, 0x0c, 0x1b, 0xd8, 0xd3, 0xff, 0x3a, 0x86, 0x4f, 0xd1, - 0x78, 0x66, 0xf4, 0x5c, 0x9d, 0x8c, 0xa2, 0x17, 0x6a, 0xe1, 0x79, 0xec, 0x53, 0x0c, 0xfc, 0x6d, - 0xfb, 0xc5, 0x50, 0xac, 0x5f, 0x14, 0xc9, 0x64, 0xdd, 0xf4, 0x58, 0x4d, 0xf8, 0xce, 0xef, 0x3b, - 0x28, 0xd8, 0xce, 0x27, 0x83, 0xf7, 0x2b, 0xed, 0xd0, 0x4f, 0x86, 0x13, 0xfc, 0xa4, 0x48, 0x26, - 0xf9, 0x96, 0xf9, 0x42, 0xa9, 0x51, 0xb3, 0x1c, 0xc6, 0xd1, 0x69, 0x41, 0xa2, 0x24, 0xbf, 0x0b, - 0x54, 0x43, 0x69, 0x77, 0x5c, 0x41, 0xa3, 0x3d, 0xae, 0xa0, 0xa8, 0xbb, 0xf1, 0x92, 0xe7, 0xba, - 0x81, 0x53, 0x77, 0xba, 0x1b, 0x37, 0x5c, 0x57, 0x18, 0x5d, 0x14, 0xb9, 0xa0, 0xbc, 0xab, 0x98, - 0xcf, 0x3b, 0x1e, 0x2e, 0x08, 0x54, 0x60, 0x0a, 0x9b, 0xf4, 0x1a, 0x99, 0xf6, 0xfc, 0x1c, 0x03, - 0x17, 0xf3, 0x43, 0x60, 0xae, 0xd5, 0xcc, 0x4f, 0x05, 0x03, 0xc0, 0x13, 0xe9, 0x49, 0x3b, 0x55, - 0xed, 0x1a, 0xf3, 0x30, 0x14, 0xc0, 0x4e, 0x40, 0x30, 0xfc, 0x1f, 0x5a, 0x20, 0xa4, 0x6c, 0x3f, - 0x78, 0x60, 0x5b, 0x0d, 0x47, 0xec, 0xa2, 0xe7, 0x83, 0x99, 0x42, 0xaa, 0xa1, 0xb4, 0xe1, 0x0a, - 0x70, 0x85, 0xe9, 0x94, 0x14, 0xae, 0x29, 0xe5, 0x0a, 0x90, 0x63, 0x77, 0x42, 0xd6, 0x4e, 0x82, - 0xd4, 0x9a, 0xed, 0x08, 0xcf, 0x2c, 0xc1, 0x85, 0x34, 0x1d, 0x6a, 0x0d, 0x54, 0xf8, 0x4c, 0x1f, - 0x36, 0xa5, 0xd7, 0x70, 0xfb, 0x7d, 0x86, 0xe1, 0x01, 0x5e, 0x23, 0xfb, 0x06, 0xfc, 0x0d, 0x8e, - 0x25, 0x07, 0x52, 0xe0, 0xd9, 0xc8, 0xb1, 0x04, 0x69, 0x70, 0x98, 0x10, 0x47, 0x12, 0x91, 0xb9, - 0x7d, 0x12, 0x91, 0x8b, 0x64, 0x42, 0xd8, 0x55, 0xc6, 0x85, 0x59, 0xad, 0x63, 0x24, 0x01, 0xba, - 0x36, 0xd1, 0x08, 0x9b, 0xf4, 0x2a, 0x99, 0x52, 0x77, 0x35, 0x4b, 0x21, 0xe4, 0x61, 0x4b, 0x22, - 0xbb, 0x1d, 0xe9, 0xc9, 0x68, 0x41, 0xa7, 0x3c, 0x06, 0xf3, 0x21, 0x5a, 0x7c, 0x8a, 0x81, 0xbf, - 0xf4, 0x06, 0x99, 0x93, 0x2f, 0x93, 0xd2, 0x03, 0xc6, 0x4a, 0x75, 0xe6, 0xc9, 0xf4, 0x2c, 0x3b, - 0x0f, 0x68, 0x8e, 0xb6, 0x9a, 0xf9, 0x69, 0x39, 0x76, 0x97, 0xb1, 0x35, 0xe6, 0xad, 0x98, 0xdc, - 0x88, 0x76, 0xa5, 0xaa, 0x55, 0xdb, 0xaf, 0x81, 0x67, 0x9f, 0x08, 0x55, 0xad, 0xda, 0xf0, 0x01, - 0xdf, 0x08, 0x1a, 0x8b, 0x1f, 0x3d, 0x4b, 0x46, 0x20, 0xb6, 0xe9, 0x0f, 0x34, 0x32, 0xea, 0x17, - 0x60, 0xe9, 0x95, 0x1e, 0xd9, 0x48, 0x77, 0x05, 0x38, 0xb7, 0x78, 0x10, 0x16, 0xff, 0xc4, 0xd0, - 0xcf, 0x7c, 0xf0, 0xa7, 0x7f, 0x7c, 0x7f, 0x28, 0x4f, 0x4f, 0x16, 0x25, 0xc7, 0x65, 0xa5, 0xf0, - 0xaf, 0x16, 0xcf, 0xe9, 0x67, 0x1a, 0x99, 0x52, 0x6b, 0x66, 0xf4, 0x46, 0x9a, 0xb5, 0xe2, 0xcb, - 0xc5, 0xb9, 0x9b, 0x7d, 0xf1, 0x22, 0xe0, 0x57, 0x00, 0xf0, 0x8b, 0xf4, 0x5a, 0x02, 0x60, 0xb5, - 0x8a, 0x57, 0x7c, 0x84, 0x5f, 0x3f, 0xf6, 0x8a, 0x8f, 0xe0, 0x30, 0xda, 0xa3, 0x9f, 0x68, 0x64, - 0x56, 0x95, 0xbb, 0xe4, 0x38, 0xe9, 0x74, 0x89, 0x2f, 0x1a, 0xa7, 0xd3, 0x25, 0xa1, 0x10, 0xac, - 0x5f, 0x04, 0x5d, 0xce, 0xd0, 0xd3, 0x29, 0x74, 0xa1, 0x7f, 0xd3, 0xc8, 0xf1, 0x0e, 0xe4, 0xf8, - 0x25, 0x92, 0x2e, 0xf5, 0x01, 0x22, 0xfa, 0x11, 0x34, 0xb7, 0x7c, 0x18, 0x11, 0xa8, 0xce, 0x0d, - 0x50, 0xe7, 0x2a, 0x5d, 0x4c, 0xa1, 0x0e, 0xf2, 0xe2, 0x0e, 0xed, 0xd1, 0x3f, 0x68, 0x64, 0x26, - 0x5a, 0xf0, 0xa2, 0xb7, 0x52, 0xba, 0x49, 0x6c, 0x81, 0x2f, 0xf7, 0x4a, 0x9f, 0xdc, 0xa8, 0xcb, - 0x4b, 0xa0, 0xcb, 0x22, 0x7d, 0x3e, 0x41, 0x97, 0x68, 0x19, 0xae, 0xf8, 0x28, 0xe8, 0xef, 0xd1, - 0x3f, 0x6b, 0x84, 0x76, 0x97, 0x3c, 0x69, 0x2a, 0x3c, 0x89, 0x85, 0xd6, 0xdc, 0xab, 0xfd, 0xb2, - 0xa3, 0x3e, 0x4b, 0xa0, 0xcf, 0x4d, 0xfa, 0x72, 0xa2, 0x3e, 0x9d, 0xff, 0xae, 0x03, 0xf7, 0x82, - 0xaa, 0xd8, 0x6f, 0x34, 0x72, 0x34, 0xba, 0x82, 0x0c, 0x9e, 0x5b, 0x29, 0x1d, 0xe7, 0x10, 0xbb, - 0x94, 0x58, 0x5a, 0xd5, 0x2f, 0x83, 0x56, 0xe7, 0xe8, 0x99, 0x54, 0xbb, 0x44, 0x3f, 0xd6, 0xc8, - 0x74, 0xa4, 0x44, 0x49, 0x5f, 0x4a, 0xe9, 0x25, 0x5d, 0x25, 0xd1, 0xdc, 0xcb, 0x7d, 0x70, 0x22, - 0xea, 0x02, 0xa0, 0x3e, 0x4f, 0xcf, 0x26, 0xa0, 0xae, 0x30, 0x51, 0x12, 0x9c, 0x07, 0x1f, 0x13, - 0xe8, 0x87, 0x1a, 0xd4, 0x3b, 0xd3, 0x5d, 0x09, 0x91, 0x02, 0x6a, 0xba, 0x2b, 0x21, 0x5a, 0x5d, - 0xd5, 0x75, 0x80, 0x77, 0x82, 0xe6, 0x12, 0xe0, 0x49, 0x28, 0x3f, 0xd7, 0xc2, 0xd2, 0x21, 0xbd, - 0x9e, 0x72, 0x91, 0x8e, 0x1a, 0x67, 0xee, 0xc5, 0x03, 0xf3, 0x21, 0xc2, 0x22, 0x20, 0x7c, 0x8e, - 0x9e, 0x4b, 0x32, 0x20, 0x32, 0x48, 0xef, 0x2d, 0xb3, 0x9d, 0x3d, 0xfa, 0x53, 0x8d, 0x4c, 0x06, - 0x52, 0xa4, 0xd3, 0x5e, 0x4f, 0xe9, 0x76, 0x7d, 0x21, 0x8e, 0xa9, 0xb4, 0xea, 0xe7, 0x00, 0xf1, - 0x33, 0x34, 0xdf, 0x03, 0x31, 0xfd, 0x54, 0x23, 0x73, 0x9d, 0x9f, 0x0a, 0x69, 0xaa, 0x4b, 0x26, - 0xe1, 0xbb, 0x65, 0xee, 0x56, 0x7f, 0xcc, 0x29, 0x4d, 0x6d, 0x75, 0x62, 0xfd, 0x4c, 0x23, 0x93, - 0xca, 0xd7, 0x40, 0x7a, 0x27, 0xcd, 0xf2, 0xbd, 0xbe, 0x3a, 0xe6, 0x5e, 0x3f, 0xa4, 0x14, 0xd4, - 0xe6, 0x02, 0x68, 0xf3, 0x2c, 0xd5, 0x93, 0xb2, 0x1d, 0x05, 0xf8, 0xaf, 0xb4, 0x48, 0xa1, 0x95, - 0xa6, 0x0d, 0xf8, 0xee, 0xd2, 0x70, 0xee, 0x46, 0x3f, 0xac, 0x08, 0x79, 0x11, 0x20, 0x5f, 0xa2, - 0x17, 0x92, 0x36, 0x20, 0xe4, 0x69, 0xbb, 0xfb, 0x2f, 0x34, 0x32, 0xa3, 0xc8, 0x92, 0x1e, 0xff, - 0x72, 0x4a, 0xcf, 0xed, 0x17, 0x7d, 0x7c, 0xb1, 0xba, 0xa7, 0xc1, 0x15, 0xf4, 0xf4, 0xd7, 0x1a, - 0x99, 0x8b, 0xd4, 0x44, 0x25, 0xee, 0xb4, 0xf9, 0x55, 0x5c, 0xcd, 0x39, 0x77, 0xab, 0x3f, 0x66, - 0xc4, 0x7e, 0x09, 0xb0, 0x9f, 0xa5, 0xcf, 0x26, 0x39, 0x8b, 0xca, 0x45, 0xff, 0xa8, 0x91, 0xf9, - 0xb8, 0x32, 0x31, 0xfd, 0x4a, 0xaa, 0xac, 0x3c, 0xb9, 0x3e, 0x9d, 0x7b, 0xad, 0x7f, 0x01, 0xa8, - 0xc9, 0x8b, 0xa0, 0xc9, 0x15, 0x5a, 0x4c, 0xa3, 0x09, 0xa6, 0x64, 0x25, 0xbb, 0xbc, 0x47, 0x3f, - 0xd7, 0xba, 0xaa, 0xa7, 0x34, 0x6d, 0x62, 0x15, 0x5f, 0xfb, 0x4d, 0x97, 0xc8, 0x24, 0xd7, 0xad, - 0xf5, 0xeb, 0xa0, 0xcb, 0xf3, 0xb4, 0x90, 0xa0, 0x8b, 0x13, 0xe5, 0x6b, 0xc7, 0xc4, 0x6f, 0x35, - 0x42, 0x3b, 0x64, 0x4a, 0xff, 0x4a, 0x9b, 0x80, 0x1c, 0x46, 0x9b, 0xe4, 0xea, 0x74, 0xcf, 0x54, - 0xa0, 0x43, 0x1b, 0xfa, 0x23, 0x8d, 0x0c, 0x43, 0x2a, 0x93, 0xf6, 0x62, 0x57, 0x93, 0xad, 0x17, - 0x0e, 0xc4, 0x93, 0xf2, 0x8d, 0x62, 0x61, 0xfa, 0x0b, 0x46, 0xfe, 0x58, 0x9e, 0x99, 0x61, 0x55, - 0x3a, 0xfd, 0x99, 0xd9, 0x55, 0xc9, 0xee, 0x0f, 0xec, 0x35, 0x00, 0x5b, 0xa4, 0x97, 0xf7, 0x05, - 0xdb, 0xf5, 0x28, 0xfc, 0xa1, 0x46, 0xc6, 0x82, 0x7c, 0x76, 0x31, 0xed, 0x69, 0x77, 0x50, 0xc3, - 0x76, 0x54, 0xa6, 0xf5, 0xd3, 0x80, 0xf5, 0x24, 0x7d, 0x7a, 0x1f, 0xac, 0xfe, 0x49, 0xee, 0x23, - 0xc3, 0x08, 0x4f, 0x7f, 0x92, 0x77, 0x15, 0x95, 0xd3, 0x9f, 0xe4, 0xdd, 0xd5, 0xe0, 0xde, 0x27, - 0x79, 0xc8, 0x43, 0x7f, 0xa9, 0x91, 0x99, 0x68, 0xf5, 0x35, 0x1d, 0xea, 0xd8, 0x7a, 0x6e, 0x3a, - 0xd4, 0xf1, 0xc5, 0xde, 0x9e, 0x0f, 0x04, 0x27, 0x8a, 0xf2, 0x27, 0x1a, 0x21, 0xe1, 0x7f, 0xed, - 0xd3, 0x6b, 0x69, 0x56, 0xee, 0xfa, 0xff, 0xff, 0xdc, 0xf5, 0x83, 0xb2, 0x21, 0xd8, 0xe7, 0x00, - 0xec, 0x69, 0xfa, 0x4c, 0x02, 0x58, 0xd1, 0x66, 0x59, 0x7e, 0xf3, 0xf3, 0x2f, 0x17, 0xb4, 0x2f, - 0xbe, 0x5c, 0xd0, 0xfe, 0xfe, 0xe5, 0x82, 0xf6, 0xe1, 0xe3, 0x85, 0x23, 0x5f, 0x3c, 0x5e, 0x38, - 0xf2, 0x97, 0xc7, 0x0b, 0x47, 0xee, 0x5f, 0xa9, 0xd8, 0x62, 0xab, 0xb1, 0x59, 0xb0, 0xdc, 0xaa, - 0x2a, 0x26, 0xc0, 0x51, 0xdc, 0x89, 0x48, 0xdc, 0xad, 0x33, 0xbe, 0x39, 0x0a, 0x69, 0xcf, 0x0b, - 0xff, 0x0e, 0x00, 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, 0x5e, 0xd8, 0x34, 0x39, 0x73, 0xf9, 0x0a, 0xdb, 0x57, 0x36, + 0x99, 0x30, 0xaf, 0x14, 0x1a, 0x66, 0xc5, 0xaa, 0x9b, 0xc2, 0xb2, 0xeb, 0xae, 0xa8, 0xec, 0x29, + 0x65, 0x0a, 0xf8, 0x5b, 0xac, 0xdb, 0xf5, 0x12, 0xe3, 0x38, 0x9c, 0x53, 0x87, 0x65, 0xb3, 0xe8, + 0x3e, 0x24, 0x76, 0xf0, 0x81, 0xac, 0xf2, 0x40, 0xc5, 0xe4, 0xc5, 0x86, 0x63, 0x95, 0x18, 0x8e, + 0x9d, 0x51, 0xc6, 0x80, 0xa7, 0xb8, 0x65, 0xf2, 0xad, 0xa2, 0xb0, 0x8b, 0xa5, 0x52, 0x47, 0xc0, + 0x5c, 0xe8, 0x21, 0xe1, 0x98, 0xa5, 0x07, 0xcc, 0xc1, 0x71, 0x5d, 0x19, 0xaf, 0x9a, 0x5c, 0x14, + 0x37, 0xab, 0x76, 0xe9, 0x41, 0x71, 0x8b, 0x59, 0x95, 0x2d, 0x11, 0x21, 0x03, 0xe0, 0x77, 0xcd, + 0xa1, 0x6a, 0x61, 0x37, 0x45, 0x78, 0x92, 0xc7, 0x95, 0x07, 0x1a, 0xa6, 0x63, 0xd6, 0x3c, 0xfd, + 0x67, 0x95, 0x01, 0xc1, 0x3b, 0xd4, 0x8a, 0x5d, 0xb1, 0xa1, 0x59, 0x90, 0x2d, 0xa4, 0x9e, 0xac, + 0xd8, 0x76, 0xa5, 0xca, 0x0a, 0x66, 0xc3, 0x2a, 0x98, 0xf5, 0xba, 0x2d, 0xc0, 0xce, 0xc8, 0xa3, + 0x67, 0xc8, 0x89, 0x2f, 0xcb, 0xa5, 0xd8, 0xe0, 0xfc, 0x35, 0x8b, 0x0b, 0xdb, 0xd9, 0x35, 0xd8, + 0x3b, 0x4d, 0xc6, 0x85, 0xfe, 0x2d, 0xf2, 0x78, 0x68, 0x84, 0x37, 0xec, 0x3a, 0x67, 0xf4, 0x16, + 0x19, 0x17, 0x9c, 0x17, 0xab, 0x16, 0x17, 0x19, 0xed, 0x74, 0xea, 0x7c, 0x7a, 0x41, 0xcf, 0xef, + 0xbb, 0xf6, 0xf9, 0x8d, 0xf5, 0xf5, 0xe5, 0xe1, 0x8f, 0x5b, 0xb9, 0x23, 0xc6, 0x98, 0xe0, 0x7c, + 0xd5, 0xe2, 0x42, 0x9f, 0x25, 0x14, 0xe4, 0xaf, 0x81, 0x62, 0xde, 0xac, 0xf7, 0xc8, 0xf1, 0x00, + 0xb5, 0x33, 0xe3, 0xa8, 0x6b, 0x80, 0x8c, 0x76, 0x5a, 0x3b, 0x9f, 0x5e, 0x38, 0xdb, 0x63, 0x3e, + 0x97, 0x1d, 0xa7, 0x44, 0x56, 0xfd, 0x0d, 0xf2, 0x24, 0xc8, 0x5e, 0x61, 0xe2, 0xad, 0xa6, 0xd8, + 0xd8, 0xd9, 0x70, 0x8d, 0x8d, 0x53, 0xd3, 0x0c, 0x19, 0x03, 0xe6, 0xbb, 0xb7, 0x61, 0x92, 0x94, + 0xe1, 0x75, 0xe9, 0x2c, 0x19, 0x81, 0xf5, 0xcb, 0x0c, 0x9d, 0xd6, 0xce, 0x0f, 0x1b, 0x6e, 0x47, + 0x6f, 0x92, 0x93, 0xd1, 0xe2, 0x10, 0xf3, 0xdb, 0x64, 0xd2, 0x56, 0xe8, 0x88, 0xfc, 0x62, 0x0f, + 0xe4, 0xaa, 0x28, 0xc4, 0x1f, 0x10, 0xa3, 0x33, 0xd4, 0x62, 0xa9, 0x5a, 0x8d, 0xd2, 0xe2, 0x0e, + 0x21, 0x7e, 0x34, 0xe1, 0x9c, 0xe7, 0xf2, 0x6e, 0xe8, 0xe5, 0x65, 0xe8, 0xe5, 0xdd, 0x90, 0xc5, + 0xd0, 0xcb, 0xaf, 0x99, 0x15, 0x86, 0xbc, 0x86, 0xc2, 0xa9, 0x7f, 0xa4, 0xa1, 0x7a, 0xa1, 0x79, + 0x62, 0xd5, 0x4b, 0x0d, 0x40, 0x3d, 0xba, 0x12, 0xc0, 0x3f, 0x04, 0xf8, 0xe7, 0x7b, 0xe2, 0x77, + 0x31, 0x05, 0x14, 0x78, 0x4f, 0x23, 0x7a, 0x94, 0x02, 0xcb, 0xbb, 0xb7, 0x24, 0x12, 0xcf, 0x5e, + 0xb3, 0x64, 0x04, 0x90, 0xe1, 0x9a, 0xbb, 0x9d, 0x2e, 0x2b, 0x0e, 0xf5, 0x6d, 0xc5, 0x3f, 0x68, + 0xe4, 0xcc, 0xbe, 0x20, 0xfe, 0x4f, 0x8c, 0xf9, 0x5d, 0x8d, 0x3c, 0xe5, 0xe9, 0x71, 0xb7, 0x1e, + 0x67, 0xcb, 0x27, 0xc8, 0xb8, 0xbb, 0x0f, 0x5b, 0xe5, 0x60, 0x08, 0x95, 0x07, 0x66, 0xd0, 0xdf, + 0x2a, 0xab, 0x1a, 0x05, 0x04, 0xed, 0x69, 0x90, 0xb4, 0x55, 0xef, 0x36, 0xe7, 0x85, 0x1e, 0xe6, + 0x54, 0xe5, 0xb9, 0xd6, 0x54, 0x85, 0x0c, 0xce, 0x98, 0xa7, 0xfc, 0x08, 0x56, 0xa6, 0xec, 0x6c, + 0x81, 0x8e, 0x1f, 0x78, 0xc1, 0xe1, 0xcf, 0x4f, 0x37, 0xfd, 0x06, 0x39, 0xe5, 0xed, 0x65, 0xf2, + 0xc9, 0xd7, 0x4c, 0xbe, 0xb5, 0x61, 0xdf, 0x2a, 0x89, 0x1d, 0x6f, 0x69, 0xb3, 0x64, 0xdc, 0xc2, + 0x01, 0x58, 0xda, 0x09, 0xa3, 0xd3, 0xd7, 0xf7, 0xc8, 0x5c, 0x1c, 0x33, 0x42, 0xfe, 0x06, 0x39, + 0x6a, 0x05, 0x46, 0x70, 0x63, 0xba, 0x9c, 0x00, 0xb5, 0xcf, 0x84, 0xc0, 0xbb, 0x44, 0xe9, 0x37, + 0x71, 0xfa, 0xe0, 0xc3, 0xb7, 0x4d, 0x61, 0x26, 0x01, 0xff, 0x2e, 0xc9, 0xc5, 0x72, 0x23, 0xfa, + 0xaf, 0x92, 0xa9, 0x5b, 0x12, 0x13, 0xb8, 0xd8, 0xc6, 0x0e, 0x4f, 0x18, 0x9d, 0x2a, 0x0f, 0x42, + 0x0f, 0xca, 0xd1, 0x2b, 0x68, 0x75, 0x5c, 0xe9, 0xb0, 0xd5, 0x07, 0xb5, 0x99, 0x3f, 0xd2, 0xd0, + 0x46, 0x11, 0x33, 0xed, 0xb3, 0x44, 0xa9, 0x01, 0x2d, 0xd1, 0xe0, 0x42, 0xe7, 0x06, 0x79, 0xc2, + 0x73, 0xb5, 0x0d, 0xce, 0x97, 0xca, 0x65, 0x87, 0x71, 0x2f, 0x70, 0xe8, 0x1c, 0x49, 0xcb, 0xb4, + 0xa4, 0xd1, 0xdc, 0x2c, 0x3e, 0x60, 0xbb, 0xb8, 0xd2, 0x13, 0x82, 0xf3, 0xb5, 0xe6, 0xe6, 0xeb, + 0x6c, 0x57, 0x7f, 0x85, 0x64, 0xa3, 0x98, 0xd1, 0x00, 0x33, 0x24, 0xc5, 0x84, 0xe7, 0x1f, 0xb2, + 0x29, 0x29, 0x9b, 0xa2, 0x04, 0x70, 0x27, 0x0c, 0xd9, 0xec, 0xe4, 0x2c, 0x52, 0xc2, 0xfa, 0xba, + 0x17, 0xb0, 0xaf, 0x63, 0xce, 0xe2, 0x51, 0x51, 0xe0, 0x55, 0x92, 0xda, 0x58, 0x5f, 0xc7, 0x55, + 0x4b, 0x90, 0x20, 0x19, 0xf2, 0x71, 0xbd, 0x80, 0x69, 0xd7, 0x0a, 0x13, 0x2b, 0x26, 0x5f, 0x93, + 0x79, 0xab, 0x72, 0x54, 0x59, 0xf5, 0x32, 0xdb, 0x41, 0x8c, 0x6e, 0x47, 0x2f, 0x92, 0x4c, 0x98, + 0xc1, 0x4f, 0xd4, 0x3c, 0x1a, 0xe2, 0x98, 0xef, 0x81, 0xa3, 0x23, 0xa2, 0xc3, 0xa8, 0x9b, 0x88, + 0x68, 0xa9, 0x5a, 0xed, 0x46, 0x34, 0x28, 0xff, 0xfc, 0xa9, 0x86, 0x4a, 0x04, 0xe6, 0x88, 0x54, + 0x22, 0xd5, 0x97, 0x12, 0x83, 0xf3, 0xc0, 0x05, 0xdf, 0x89, 0x20, 0x8e, 0xdf, 0x84, 0x7b, 0xc9, + 0xfe, 0x4b, 0xf4, 0xc0, 0x4f, 0x3c, 0x03, 0x3c, 0xa8, 0xe0, 0x2a, 0x49, 0x2b, 0x64, 0x34, 0x63, + 0xaf, 0x0d, 0x5d, 0x15, 0xa4, 0xb2, 0xeb, 0x65, 0x04, 0xb8, 0x54, 0xad, 0x46, 0x00, 0x1c, 0xd4, + 0x8a, 0x7d, 0xa0, 0xf9, 0x87, 0x58, 0x22, 0x9d, 0x52, 0x87, 0xd0, 0x69, 0x70, 0xab, 0x37, 0xe7, + 0x9f, 0xad, 0x6b, 0xac, 0x5e, 0xb6, 0xea, 0x95, 0x80, 0x79, 0x74, 0xe1, 0xef, 0xc8, 0x5d, 0xe3, + 0xa8, 0xd7, 0x3a, 0x39, 0xda, 0x70, 0x07, 0xf0, 0x46, 0x8a, 0xaa, 0x5d, 0xea, 0x75, 0x21, 0x09, + 0x48, 0x9b, 0x6a, 0xa8, 0x5d, 0xfd, 0x25, 0x72, 0xda, 0xbd, 0xf4, 0xa8, 0xd4, 0xc4, 0xb9, 0x95, + 0xfe, 0x6d, 0xcc, 0xcd, 0xa2, 0xd9, 0x11, 0xf8, 0xd7, 0x23, 0x80, 0x6b, 0x07, 0x05, 0xee, 0x1d, + 0x63, 0x41, 0xf8, 0x8b, 0xfe, 0xf9, 0xbf, 0x6a, 0x72, 0xb1, 0x2c, 0x6f, 0xc2, 0xaf, 0xc1, 0x45, + 0x78, 0xff, 0xb0, 0x78, 0x88, 0x47, 0x6f, 0x14, 0x1f, 0xa2, 0xfe, 0x1a, 0x99, 0xee, 0x1a, 0x42, + 0xd8, 0xf9, 0x1e, 0xb0, 0xbb, 0x05, 0x76, 0x8b, 0xd1, 0xb7, 0xfc, 0x13, 0x31, 0x06, 0xf4, 0xa0, + 0x42, 0xe5, 0xf7, 0x1a, 0xea, 0x19, 0x35, 0xd5, 0x7e, 0x7a, 0xa6, 0x06, 0xa0, 0xe7, 0xe0, 0x42, + 0xe7, 0xa2, 0x7f, 0xca, 0xa9, 0x29, 0x4a, 0xf4, 0xd2, 0xae, 0x2a, 0xbb, 0xa4, 0x4c, 0x0b, 0x76, + 0xc1, 0x55, 0xfa, 0xbd, 0x69, 0x57, 0xc8, 0x6c, 0x70, 0x6a, 0xb4, 0xda, 0x5b, 0x64, 0x52, 0x4d, + 0xa8, 0x12, 0xde, 0xb0, 0x55, 0x16, 0x23, 0x20, 0x40, 0xff, 0x26, 0xea, 0x28, 0x37, 0xb5, 0xcf, + 0x21, 0x0d, 0xfb, 0xb9, 0x86, 0x8a, 0x74, 0xe4, 0xc7, 0x2a, 0x92, 0x3a, 0x94, 0x22, 0x83, 0x5b, + 0xf5, 0xef, 0x28, 0xa7, 0x49, 0x49, 0xec, 0xe0, 0x6e, 0xf0, 0x05, 0x5e, 0xf8, 0x3e, 0x54, 0x0f, + 0x1a, 0x15, 0xc1, 0xff, 0xbc, 0xe9, 0x4e, 0xa2, 0xe9, 0x64, 0x44, 0xde, 0x63, 0xc2, 0x0c, 0xec, + 0x2e, 0xfa, 0x35, 0x54, 0xab, 0x7b, 0x14, 0xd5, 0x3a, 0x41, 0x46, 0x95, 0xfd, 0x2e, 0x65, 0x60, + 0x4f, 0xdf, 0xc0, 0x03, 0xec, 0x96, 0x5d, 0xdf, 0x66, 0x8e, 0xcc, 0xf8, 0x36, 0x6c, 0xc9, 0x1e, + 0x0a, 0xad, 0xd0, 0x82, 0x64, 0xc9, 0x78, 0xc5, 0xe4, 0xab, 0x56, 0xcd, 0x12, 0x98, 0xd2, 0x76, + 0xfa, 0xfa, 0x8f, 0x34, 0x3c, 0xf7, 0xc2, 0x62, 0x11, 0xcf, 0x25, 0x72, 0xcc, 0x6e, 0x8a, 0x4d, + 0xbb, 0x59, 0x2f, 0xaf, 0x98, 0xfc, 0x6e, 0x5d, 0x0e, 0x62, 0xc8, 0x87, 0x07, 0xe4, 0xd3, 0xf0, + 0x7a, 0xb1, 0x64, 0x57, 0xef, 0x30, 0x86, 0x4f, 0xbb, 0x93, 0x86, 0x07, 0xe8, 0x79, 0x32, 0x2d, + 0x7f, 0xd5, 0xcd, 0x2f, 0x05, 0xe1, 0xdf, 0x4d, 0xd6, 0xe7, 0xc9, 0x59, 0x80, 0xf9, 0x06, 0xe3, + 0xdc, 0xac, 0xb0, 0x35, 0x93, 0x73, 0xab, 0x5e, 0x59, 0xf3, 0x25, 0x7a, 0xd6, 0xbd, 0x43, 0xce, + 0xf5, 0x7a, 0x10, 0x15, 0x3b, 0x49, 0x26, 0xee, 0x77, 0x20, 0xe2, 0x95, 0xa1, 0x43, 0xd0, 0x6f, + 0xe0, 0x84, 0xf7, 0x5e, 0xfd, 0xca, 0x1b, 0x32, 0xbd, 0x77, 0xcc, 0x3a, 0x37, 0x4b, 0x72, 0x79, + 0x0d, 0x56, 0x62, 0x56, 0xa3, 0x73, 0x58, 0x50, 0x32, 0xbc, 0xe5, 0x5f, 0x2f, 0xa1, 0xad, 0xff, + 0x67, 0x18, 0x51, 0xec, 0xc3, 0xdd, 0x31, 0x2f, 0xc1, 0x17, 0xc8, 0x1d, 0x21, 0xcb, 0x53, 0xed, + 0x56, 0x6e, 0x02, 0xa8, 0xf2, 0x26, 0x65, 0xf8, 0x4d, 0xba, 0x40, 0x26, 0xdd, 0xa7, 0xeb, 0xcd, + 0xda, 0x26, 0x73, 0x5c, 0xcb, 0x2e, 0x4f, 0xb7, 0x5b, 0xb9, 0x34, 0xd0, 0xdf, 0x04, 0xb2, 0xa1, + 0x76, 0xe8, 0xcb, 0x64, 0xa6, 0x64, 0xd7, 0x85, 0x63, 0x96, 0x44, 0xd1, 0x74, 0xaf, 0x3e, 0x60, + 0xe5, 0x89, 0xe5, 0xe3, 0xed, 0x56, 0x6e, 0xda, 0x1b, 0xf3, 0x6e, 0x45, 0xdd, 0x04, 0xfa, 0x2a, + 0x39, 0x5e, 0x6a, 0xd6, 0x9a, 0x55, 0x53, 0x58, 0xdb, 0xac, 0x58, 0x31, 0x79, 0xb1, 0xc9, 0x59, + 0x39, 0x33, 0x0c, 0x22, 0x1e, 0x6b, 0xb7, 0x72, 0xc7, 0xfc, 0xe1, 0x15, 0x93, 0xbf, 0xcd, 0x59, + 0xd9, 0x08, 0x93, 0xe8, 0x49, 0x32, 0x7c, 0xdf, 0xb1, 0x6b, 0x99, 0x11, 0xe0, 0x1b, 0x6f, 0xb7, + 0x72, 0xd0, 0x37, 0xe0, 0x2f, 0x3d, 0x07, 0x3e, 0xea, 0x4a, 0x1e, 0x85, 0x27, 0xd2, 0xed, 0x56, + 0x6e, 0xac, 0x82, 0xf2, 0xbc, 0x86, 0x34, 0x57, 0xd5, 0xae, 0xf0, 0xe2, 0x66, 0xd5, 0xb6, 0x6b, + 0x99, 0x31, 0xdf, 0x5c, 0x92, 0xba, 0x2c, 0x89, 0x86, 0xdf, 0xa4, 0x3a, 0x19, 0xe5, 0xc2, 0x14, + 0x4d, 0x9e, 0x19, 0x87, 0x27, 0x49, 0xbb, 0x95, 0x43, 0x8a, 0x81, 0xbf, 0xf4, 0x04, 0x19, 0x12, + 0x76, 0x66, 0x02, 0xc6, 0x47, 0xdb, 0xad, 0xdc, 0x90, 0xb0, 0x8d, 0x21, 0x61, 0x4b, 0xb3, 0x09, + 0x7f, 0xd9, 0xdc, 0xe5, 0x21, 0xbe, 0xd9, 0x94, 0x31, 0x58, 0xa4, 0x6e, 0x02, 0x5d, 0x22, 0xc7, + 0x54, 0x7e, 0xf7, 0xa8, 0x4c, 0x83, 0x80, 0xd9, 0x76, 0x2b, 0xa7, 0x0a, 0xbf, 0x2b, 0xc7, 0x8c, + 0x10, 0x85, 0x2e, 0x92, 0x61, 0xa9, 0x4b, 0x66, 0x32, 0xd1, 0x9b, 0xf6, 0x55, 0xbb, 0x62, 0xc0, + 0xf3, 0xfa, 0x7b, 0x29, 0x92, 0x5a, 0xb5, 0x2b, 0x72, 0x4b, 0xf0, 0x16, 0xdc, 0xf5, 0x4e, 0xaf, + 0x2b, 0x37, 0x19, 0x61, 0x37, 0xac, 0x12, 0xcf, 0x0c, 0x9d, 0x4e, 0x9d, 0x9f, 0x30, 0xb0, 0x27, + 0x9d, 0xb9, 0x6c, 0x0a, 0xd3, 0xf5, 0x0f, 0x03, 0xda, 0x21, 0x9f, 0x93, 0x0b, 0x3f, 0xdc, 0xdb, + 0xe7, 0x42, 0xc6, 0x1b, 0x39, 0xac, 0xf1, 0x46, 0x61, 0xe2, 0xa4, 0xc6, 0x0b, 0x06, 0xd6, 0x58, + 0x8f, 0xc0, 0x7a, 0x86, 0x48, 0xb7, 0xc1, 0x89, 0xc6, 0x61, 0xa2, 0xc9, 0x76, 0x2b, 0x37, 0x5e, + 0xb5, 0x2b, 0xee, 0x04, 0x9d, 0x16, 0x3d, 0x4b, 0xc6, 0x1c, 0x56, 0xb3, 0xb7, 0x59, 0x19, 0xbc, + 0x66, 0xdc, 0xf5, 0x54, 0x24, 0x19, 0x5e, 0x43, 0xbf, 0x8a, 0x69, 0x66, 0xd4, 0x16, 0x10, 0xbf, + 0x73, 0xfc, 0x7b, 0x18, 0x53, 0xc6, 0x28, 0xb6, 0x2f, 0x6c, 0xcb, 0xf0, 0x62, 0x35, 0x15, 0x19, + 0xab, 0x4f, 0x90, 0x54, 0xc5, 0xe4, 0xb8, 0x01, 0x8c, 0xb5, 0x5b, 0x39, 0xd9, 0x35, 0xe4, 0x1f, + 0x69, 0xc6, 0x4e, 0xd1, 0x0d, 0x17, 0x1c, 0xcc, 0x58, 0xe9, 0xdc, 0xcb, 0xbd, 0x96, 0x9c, 0x03, + 0xf0, 0x8f, 0xfa, 0x73, 0xc8, 0xbe, 0x6b, 0x07, 0x9a, 0x93, 0xc9, 0x65, 0xa3, 0x29, 0x70, 0xe1, + 0x26, 0xda, 0xad, 0x9c, 0x4b, 0x30, 0xdc, 0x1f, 0xf9, 0x80, 0x9b, 0x2f, 0x8e, 0xfb, 0x0f, 0x00, + 0x01, 0x53, 0xc7, 0xd8, 0xb8, 0x8e, 0x74, 0x2d, 0x72, 0xa0, 0xb8, 0xcc, 0x91, 0x91, 0x6d, 0xb3, + 0xda, 0x64, 0x18, 0xce, 0x30, 0x37, 0x10, 0x0c, 0xf7, 0x47, 0xea, 0x26, 0x76, 0x1b, 0x2c, 0x33, + 0xe9, 0xeb, 0x26, 0xfb, 0x06, 0xfc, 0xa5, 0x05, 0x92, 0x36, 0x4b, 0x25, 0xe6, 0xd5, 0xd1, 0xa6, + 0x64, 0x04, 0x2e, 0x1f, 0x6d, 0xb7, 0x72, 0xc4, 0x25, 0xaf, 0x5a, 0x32, 0x13, 0xf2, 0xdb, 0x72, + 0x73, 0xec, 0x24, 0x5b, 0x47, 0xfd, 0xcd, 0x11, 0xcf, 0x77, 0xff, 0xa0, 0x3f, 0x4e, 0xb4, 0xed, + 0xcc, 0x34, 0x3c, 0x30, 0xd2, 0x6e, 0xe5, 0xb4, 0x6d, 0x43, 0xdb, 0x96, 0x44, 0x27, 0x33, 0xe3, + 0x13, 0x1d, 0x43, 0x73, 0x24, 0x91, 0x67, 0x8e, 0xf9, 0x44, 0x6e, 0x68, 0x5c, 0xbf, 0x8e, 0x97, + 0x51, 0x74, 0x3d, 0x38, 0x7e, 0x97, 0x77, 0xd1, 0x3f, 0xd0, 0x67, 0x4f, 0x90, 0xd1, 0x2d, 0x3f, + 0x3b, 0x19, 0x36, 0xb0, 0xa7, 0xff, 0x6d, 0x0c, 0xaf, 0xa2, 0xd1, 0xcc, 0xe8, 0xb9, 0x3a, 0x19, + 0x45, 0x2f, 0xd4, 0xfc, 0xfd, 0xd8, 0xa5, 0x18, 0xf8, 0xdb, 0xf1, 0x8b, 0xa1, 0x48, 0xbf, 0x28, + 0x90, 0x74, 0xc3, 0x74, 0x58, 0x5d, 0xb8, 0xce, 0xef, 0x3a, 0x28, 0xd8, 0xce, 0x25, 0x83, 0xf7, + 0x2b, 0x6d, 0xdf, 0x4f, 0x86, 0x63, 0xfc, 0xa4, 0x40, 0xd2, 0x7c, 0xcb, 0x7c, 0xae, 0xd8, 0xac, + 0x97, 0xaa, 0x8c, 0xa3, 0xd3, 0x82, 0x44, 0x49, 0x7e, 0x1b, 0xa8, 0x86, 0xd2, 0xee, 0x3a, 0x82, + 0x46, 0x7b, 0x1c, 0x41, 0x41, 0x77, 0xe3, 0x45, 0xc7, 0xb6, 0x3d, 0xa7, 0xee, 0x76, 0x37, 0x6e, + 0xd8, 0xb6, 0x30, 0x42, 0x14, 0x39, 0xa1, 0x3c, 0xab, 0x98, 0xcb, 0x3b, 0xee, 0x4f, 0x08, 0x54, + 0x60, 0xf2, 0x9b, 0xf4, 0x1a, 0x99, 0x72, 0xdc, 0x1c, 0x03, 0x27, 0x73, 0x43, 0x60, 0xa6, 0xdd, + 0xca, 0x4d, 0x7a, 0x03, 0xc0, 0x13, 0xe8, 0x49, 0x3b, 0xd5, 0xac, 0x3a, 0x73, 0x30, 0x14, 0xc0, + 0x4e, 0x40, 0x30, 0xdc, 0x1f, 0x9a, 0x27, 0xa4, 0x6c, 0xdd, 0xbf, 0x6f, 0x95, 0x9a, 0x55, 0xb1, + 0x8b, 0x9e, 0x0f, 0x66, 0xf2, 0xa9, 0x86, 0xd2, 0x86, 0x23, 0xc0, 0x16, 0x66, 0xb5, 0xa8, 0x70, + 0x4d, 0x2a, 0x47, 0x80, 0x1c, 0xbb, 0xed, 0xb3, 0x76, 0x13, 0xa4, 0xd6, 0x6c, 0x47, 0x38, 0x66, + 0x11, 0x0e, 0xa4, 0x29, 0x5f, 0x6b, 0xa0, 0xc2, 0x6b, 0x7a, 0xbf, 0x29, 0xbd, 0x86, 0x5b, 0xef, + 0x32, 0x0c, 0x0f, 0xf0, 0x1a, 0xd9, 0x37, 0xe0, 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, + 0x2f, 0x02, 0x7e, 0x09, 0x00, 0x3f, 0x4f, 0xaf, 0xc5, 0x00, 0x56, 0xab, 0xb4, 0x85, 0x87, 0xf8, + 0xf6, 0x63, 0xaf, 0xf0, 0x10, 0x36, 0xa3, 0x3d, 0xfa, 0xa1, 0x46, 0xa6, 0x55, 0xb9, 0x4b, 0xd5, + 0x6a, 0x32, 0x5d, 0xa2, 0x3f, 0x0a, 0x48, 0xa6, 0x4b, 0x4c, 0xa1, 0x5f, 0xbf, 0x08, 0xba, 0x9c, + 0xa5, 0x67, 0x12, 0xe8, 0x42, 0xff, 0xa1, 0x91, 0x13, 0x5d, 0xc8, 0xf1, 0x4d, 0x24, 0x5d, 0xea, + 0x03, 0x44, 0xf0, 0x25, 0x68, 0x76, 0xf9, 0x30, 0x22, 0x50, 0x9d, 0xeb, 0xa0, 0xce, 0x55, 0xba, + 0x90, 0x40, 0x1d, 0xe4, 0xc5, 0x15, 0xda, 0xa3, 0x7f, 0xd7, 0xc8, 0x63, 0x4a, 0x25, 0x55, 0x51, + 0xee, 0x95, 0x84, 0xc8, 0x62, 0x8b, 0xe7, 0xd9, 0xa5, 0x43, 0x48, 0x40, 0xd5, 0x6e, 0x82, 0x6a, + 0x8b, 0xf4, 0x6a, 0x8c, 0x6a, 0x56, 0x3d, 0x46, 0xb3, 0xa2, 0x55, 0xde, 0xa3, 0xbf, 0xd4, 0xc8, + 0xd1, 0xa0, 0x72, 0x89, 0x7d, 0x2e, 0xa2, 0x8c, 0x9d, 0xd8, 0xe7, 0xa2, 0x6a, 0xdc, 0x3d, 0x7d, + 0x4e, 0xd1, 0x84, 0xd3, 0x3f, 0x22, 0x70, 0xa5, 0xe0, 0x78, 0x33, 0x61, 0xf0, 0x46, 0x96, 0x5d, + 0xb3, 0x2f, 0xf5, 0xc9, 0x8d, 0xe0, 0x5f, 0x00, 0xf0, 0x0b, 0xf4, 0xd9, 0x7d, 0xc0, 0xfb, 0x6c, + 0x85, 0x87, 0x5e, 0x7f, 0x8f, 0xfe, 0x45, 0x23, 0x34, 0x5c, 0x88, 0xa6, 0x89, 0xf0, 0xc4, 0x96, + 0xbf, 0xb3, 0x2f, 0xf7, 0xcb, 0x8e, 0xfa, 0x2c, 0x81, 0x3e, 0x37, 0xe8, 0x8b, 0xb1, 0xfa, 0x74, + 0x7f, 0x44, 0x07, 0xa7, 0xb5, 0xaa, 0xd8, 0x6f, 0x34, 0x72, 0x2c, 0x38, 0x83, 0x74, 0xaf, 0x9b, + 0x07, 0x70, 0x91, 0x3e, 0x57, 0x29, 0xb6, 0xe0, 0xad, 0x5f, 0x06, 0xad, 0xe6, 0xe9, 0xd9, 0x44, + 0xab, 0x44, 0x3f, 0xd0, 0xc8, 0x54, 0xa0, 0x70, 0x4c, 0x5f, 0x48, 0xe8, 0x25, 0xa1, 0x42, 0x75, + 0xf6, 0xc5, 0x3e, 0x38, 0x11, 0x75, 0x1e, 0x50, 0x9f, 0xa7, 0xe7, 0x62, 0x50, 0x57, 0x98, 0x28, + 0x0a, 0xce, 0xbd, 0x57, 0x3c, 0xf4, 0x7d, 0x0d, 0xaa, 0xd0, 0xc9, 0x0e, 0xea, 0x40, 0x59, 0x3b, + 0xd9, 0x41, 0x1d, 0xac, 0x79, 0xeb, 0x3a, 0xc0, 0x3b, 0x49, 0xb3, 0x31, 0xf0, 0x24, 0x94, 0x9f, + 0x69, 0x7e, 0x41, 0x97, 0x2e, 0x26, 0x9c, 0xa4, 0xab, 0xf2, 0x9c, 0x7d, 0xfe, 0xc0, 0x7c, 0x88, + 0xb0, 0x00, 0x08, 0x9f, 0xa1, 0xf3, 0x71, 0x06, 0x44, 0x06, 0xe9, 0xbd, 0x65, 0xb6, 0xb3, 0x47, + 0x7f, 0xa2, 0x91, 0xb4, 0x27, 0x45, 0x3a, 0xed, 0x62, 0x42, 0xb7, 0xeb, 0x0b, 0x71, 0x44, 0xfd, + 0x5b, 0x9f, 0x07, 0xc4, 0x4f, 0xd1, 0x5c, 0x0f, 0xc4, 0xf4, 0x23, 0x8d, 0xcc, 0x74, 0xbf, 0xc0, + 0xa5, 0x89, 0xb6, 0xe1, 0x98, 0xb7, 0xc9, 0xd9, 0x9b, 0xfd, 0x31, 0x27, 0x34, 0x75, 0xa9, 0x1b, + 0xeb, 0x23, 0x8d, 0xa4, 0x95, 0x77, 0xb4, 0xf4, 0x76, 0x92, 0xe9, 0x7b, 0xbd, 0x0b, 0xce, 0xbe, + 0x7a, 0x48, 0x29, 0xa8, 0xcd, 0x05, 0xd0, 0xe6, 0x69, 0xaa, 0xc7, 0xe5, 0xa0, 0x0a, 0xf0, 0x5f, + 0x69, 0x81, 0xf2, 0x37, 0x4d, 0x1a, 0xf0, 0xe1, 0x82, 0x7d, 0xf6, 0x7a, 0x3f, 0xac, 0x08, 0x79, + 0x01, 0x20, 0x5f, 0xa2, 0x17, 0xe2, 0x16, 0xc0, 0xe7, 0xe9, 0xb8, 0xfb, 0x2f, 0x34, 0x72, 0x54, + 0x91, 0x25, 0x3d, 0xfe, 0xc5, 0x84, 0x9e, 0xdb, 0x2f, 0xfa, 0xe8, 0x4f, 0x08, 0x7a, 0x1a, 0x5c, + 0x41, 0x4f, 0x7f, 0xad, 0x91, 0x99, 0x40, 0xa5, 0x5a, 0xe2, 0x4e, 0x9a, 0x81, 0x44, 0x7d, 0x09, + 0x90, 0xbd, 0xd9, 0x1f, 0x33, 0x62, 0xbf, 0x04, 0xd8, 0xcf, 0xd1, 0xa7, 0xe3, 0x9c, 0x45, 0xe5, + 0xa2, 0x7f, 0xd2, 0xc8, 0x6c, 0x54, 0xf1, 0x9e, 0x7e, 0x29, 0xd1, 0x5d, 0x29, 0xfe, 0xab, 0x81, + 0xec, 0x2b, 0xfd, 0x0b, 0x40, 0x4d, 0x9e, 0x07, 0x4d, 0xae, 0xd0, 0x42, 0x12, 0x4d, 0xd4, 0x74, + 0xf2, 0x63, 0x2d, 0x54, 0xd3, 0xa6, 0x49, 0x13, 0xab, 0xe8, 0x8a, 0x7c, 0xb2, 0x44, 0x26, 0xfe, + 0x6b, 0x02, 0x7d, 0x11, 0x74, 0x79, 0x96, 0xe6, 0x63, 0x74, 0xa9, 0x06, 0xf9, 0x3a, 0x31, 0xf1, + 0x3b, 0x8d, 0xd0, 0x2e, 0x99, 0xd2, 0xbf, 0x92, 0x26, 0x20, 0x87, 0xd1, 0x26, 0xfe, 0x9b, 0x81, + 0x9e, 0xa9, 0x40, 0x97, 0x36, 0xf4, 0x87, 0x1a, 0x19, 0x86, 0x54, 0x26, 0xe9, 0xc1, 0xae, 0x26, + 0x5b, 0xcf, 0x1d, 0x88, 0x27, 0x61, 0x16, 0x5f, 0xc2, 0xf4, 0x17, 0x8c, 0xfc, 0x81, 0xdc, 0x33, + 0xfd, 0x6f, 0x05, 0x92, 0xef, 0x99, 0xa1, 0xef, 0x0b, 0xfa, 0x03, 0x7b, 0x0d, 0xc0, 0x16, 0xe8, + 0xe5, 0x7d, 0xc1, 0x86, 0xae, 0xea, 0x3f, 0xd0, 0xc8, 0x98, 0x97, 0xcf, 0x2e, 0x24, 0xdd, 0xed, + 0x0e, 0x6a, 0xd8, 0xae, 0xef, 0x05, 0xf4, 0x33, 0x80, 0xf5, 0x14, 0x7d, 0x72, 0x1f, 0xac, 0xee, + 0x4e, 0xee, 0x22, 0xc3, 0x08, 0x4f, 0xbe, 0x93, 0x87, 0x4a, 0xfd, 0xc9, 0x77, 0xf2, 0x70, 0x8d, + 0xbe, 0xf7, 0x4e, 0xee, 0xf3, 0xc0, 0x2d, 0x34, 0x58, 0x13, 0x4f, 0x86, 0x3a, 0xb2, 0xca, 0x9e, + 0x0c, 0x75, 0x74, 0x09, 0xbe, 0xe7, 0x05, 0xa1, 0x1a, 0x44, 0xf9, 0x63, 0x8d, 0x10, 0xff, 0x7f, + 0x65, 0xe8, 0xb5, 0x24, 0x33, 0x87, 0xfe, 0xeb, 0x26, 0xbb, 0x78, 0x50, 0x36, 0x04, 0xfb, 0x0c, + 0x80, 0x3d, 0x43, 0x9f, 0x8a, 0x01, 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, 0xdb, 0xc6, - 0x12, 0x37, 0x9f, 0x6d, 0x59, 0x1a, 0x5b, 0x8e, 0xbd, 0x76, 0x62, 0x86, 0x8e, 0xe5, 0x84, 0x7e, - 0xc9, 0x0b, 0x1e, 0x62, 0x29, 0x51, 0xde, 0x43, 0x93, 0xb4, 0x87, 0xc6, 0x46, 0xe2, 0xb8, 0xa9, - 0xec, 0x80, 0x56, 0x5a, 0x20, 0x17, 0x82, 0x22, 0xd7, 0x14, 0x61, 0x91, 0x2b, 0x70, 0x57, 0x86, - 0x64, 0x14, 0x28, 0x50, 0xa0, 0x87, 0xde, 0x8a, 0xa2, 0x40, 0x8b, 0x7e, 0x81, 0x7e, 0x95, 0xa0, - 0xa7, 0xa0, 0xa7, 0xa6, 0x87, 0xa0, 0x4d, 0xbe, 0x41, 0x3f, 0x41, 0xb1, 0xbb, 0x24, 0x2d, 0xca, - 0x96, 0x64, 0x39, 0xe8, 0x49, 0x3b, 0xb3, 0xf3, 0x9b, 0x7f, 0x3b, 0xb3, 0x3b, 0x22, 0x2c, 0xd8, - 0x21, 0xa1, 0xd4, 0xae, 0x5b, 0x5e, 0x50, 0x62, 0xed, 0x62, 0x33, 0x24, 0x8c, 0xa0, 0x95, 0x23, - 0xcc, 0x2c, 0xc1, 0x2b, 0x8a, 0x15, 0x09, 0x71, 0xf1, 0x58, 0x4e, 0x5b, 0xb0, 0x89, 0xef, 0x93, - 0xa0, 0x24, 0x7f, 0x24, 0x46, 0x5b, 0x74, 0x89, 0x4b, 0xc4, 0xb2, 0xc4, 0x57, 0x92, 0xab, 0x7f, - 0xa7, 0x00, 0xaa, 0x50, 0xb7, 0xe2, 0xb9, 0xa1, 0xc5, 0x70, 0x95, 0xd2, 0xc7, 0xad, 0xc0, 0xa1, - 0x48, 0x85, 0x29, 0x3b, 0xc4, 0x16, 0x23, 0xa1, 0xaa, 0x5c, 0x55, 0x6e, 0xe6, 0x8c, 0x98, 0x44, - 0x97, 0x21, 0x2b, 0x8c, 0x98, 0x9e, 0xa3, 0xfe, 0xeb, 0xaa, 0x72, 0x73, 0xdc, 0x98, 0x12, 0xf4, - 0xb6, 0x83, 0xb6, 0x20, 0x63, 0xf9, 0xa4, 0x15, 0x30, 0x75, 0x9c, 0x63, 0x36, 0x4a, 0x2f, 0xdf, - 0xac, 0x8e, 0xfd, 0xfe, 0x66, 0xf5, 0x3f, 0xae, 0xc7, 0xea, 0xad, 0x5a, 0xd1, 0x26, 0x7e, 0xc9, - 0x26, 0xd4, 0x27, 0x34, 0xfa, 0x59, 0xa7, 0xce, 0x41, 0x89, 0x75, 0x9a, 0x98, 0x16, 0x9f, 0x7b, - 0x01, 0x33, 0x22, 0xb8, 0x7e, 0x05, 0xb4, 0x93, 0x3e, 0x19, 0x98, 0x36, 0x49, 0x40, 0xb1, 0xbe, - 0x03, 0x0b, 0x15, 0xea, 0x3e, 0x6f, 0x3a, 0x72, 0xf3, 0xa1, 0xe3, 0x84, 0x98, 0x0e, 0x72, 0x79, - 0x05, 0x80, 0x51, 0x6a, 0x36, 0x5b, 0xb5, 0x03, 0xdc, 0x11, 0x4e, 0xe7, 0x8c, 0x1c, 0xa3, 0xf4, - 0x99, 0x60, 0xe8, 0x2b, 0xb0, 0x7c, 0x8a, 0xbe, 0xc4, 0xdc, 0xaf, 0x0a, 0xcc, 0x57, 0xa8, 0xfb, - 0x79, 0xdd, 0x63, 0xb8, 0xe1, 0x51, 0xf6, 0xc8, 0xd8, 0x2c, 0xdf, 0x1e, 0x60, 0x6d, 0x0d, 0xf2, - 0x38, 0xb4, 0xcb, 0xb7, 0x4d, 0x4b, 0x2a, 0x8a, 0x0c, 0xce, 0x08, 0x66, 0xec, 0x6c, 0x77, 0x16, - 0xc7, 0xd3, 0x59, 0x44, 0x30, 0x11, 0x58, 0x3e, 0x56, 0x27, 0x04, 0x4c, 0xac, 0xd1, 0x25, 0xc8, - 0xd0, 0x8e, 0x5f, 0x23, 0x0d, 0x75, 0x52, 0x70, 0x23, 0x0a, 0x69, 0x90, 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, 0x6b, 0x7d, 0xed, 0x24, 0xce, 0xfc, 0x2c, 0xcb, 0x77, 0x93, 0x1b, 0xc1, - 0xd5, 0xbd, 0xbd, 0xcf, 0x08, 0x1b, 0xe8, 0xc5, 0xe0, 0x66, 0x41, 0xff, 0x85, 0xb9, 0x03, 0xdc, - 0xd9, 0xc2, 0xc1, 0x0b, 0xcc, 0xac, 0x27, 0xd8, 0x73, 0xeb, 0x2c, 0x2a, 0xe0, 0x13, 0x7c, 0xb4, - 0x0e, 0x19, 0xca, 0x2c, 0xd6, 0xa2, 0xe2, 0x78, 0x66, 0xcb, 0x17, 0xe3, 0x73, 0x30, 0xb0, 0x8d, - 0xbd, 0x43, 0xbc, 0x27, 0x36, 0x8d, 0x48, 0x48, 0x5f, 0x16, 0x69, 0x4b, 0x3b, 0x9a, 0x84, 0xf1, - 0xa3, 0x02, 0x73, 0x15, 0xea, 0x6e, 0x59, 0xf4, 0x59, 0xe8, 0xd9, 0x78, 0x58, 0x14, 0x83, 0x73, - 0xd9, 0xe4, 0x2a, 0xe2, 0x5c, 0x0a, 0x02, 0x5d, 0x83, 0x19, 0x59, 0x0d, 0x41, 0xcb, 0xaf, 0xe1, - 0x50, 0x78, 0x3c, 0x61, 0x4c, 0x0b, 0xde, 0x8e, 0x60, 0x89, 0x26, 0x6c, 0x35, 0x9b, 0x8d, 0x4e, - 0xd2, 0x84, 0x82, 0xd2, 0x35, 0x50, 0x7b, 0x3d, 0x4b, 0xdc, 0x7e, 0x01, 0xf9, 0x0a, 0x75, 0x77, - 0xf8, 0x71, 0xbd, 0x9f, 0xcb, 0xa7, 0x1c, 0xff, 0x12, 0x5c, 0x4c, 0xe9, 0x4e, 0x8c, 0xbe, 0x9e, - 0x14, 0x37, 0x1a, 0x67, 0xee, 0x06, 0xbb, 0x35, 0x8a, 0xc3, 0x43, 0xec, 0xec, 0xb6, 0x58, 0x8d, - 0xb4, 0x02, 0xa7, 0xda, 0x1e, 0xe0, 0xc3, 0x32, 0x88, 0x16, 0x96, 0x2d, 0x21, 0xcf, 0x3e, 0xcb, - 0x19, 0xa2, 0x23, 0x8a, 0xb0, 0x40, 0x22, 0x65, 0x26, 0xe1, 0xa5, 0x26, 0xc5, 0xc4, 0x5d, 0x6f, - 0xcc, 0x93, 0x63, 0x3b, 0x55, 0x29, 0xff, 0x11, 0x68, 0x3d, 0xf2, 0xb2, 0xbb, 0x64, 0xd1, 0xc8, - 0x04, 0xab, 0x29, 0xd8, 0xc6, 0xf1, 0x3e, 0xfa, 0x3f, 0x2c, 0xf5, 0xa0, 0xf9, 0x6d, 0xd6, 0xa2, - 0xd8, 0x51, 0x41, 0x40, 0x17, 0x53, 0xd0, 0x2d, 0x8b, 0x3e, 0xa7, 0xd8, 0x41, 0x47, 0xa0, 0xf7, - 0xc0, 0xf0, 0xfe, 0x3e, 0xb6, 0x99, 0x77, 0x88, 0x85, 0x02, 0x79, 0xf4, 0xd3, 0xe2, 0x7d, 0x2a, - 0x46, 0xef, 0xd3, 0x8d, 0x33, 0xbc, 0x4f, 0xdb, 0x01, 0x33, 0x0a, 0x29, 0x8b, 0x8f, 0x62, 0xbd, - 0xf1, 0xc9, 0xa3, 0x4f, 0x86, 0xd8, 0x96, 0x57, 0xf1, 0x8c, 0xf0, 0xbe, 0xbf, 0x2e, 0x71, 0x41, - 0x23, 0x02, 0xb3, 0x87, 0x56, 0xa3, 0x85, 0xcd, 0x50, 0xf6, 0x8a, 0x23, 0x8b, 0x6e, 0xe3, 0xc9, - 0x88, 0x6f, 0xea, 0x5f, 0x6f, 0x56, 0x2f, 0x76, 0x2c, 0xbf, 0xf1, 0x40, 0x4f, 0xab, 0xd3, 0x8d, - 0xbc, 0x60, 0x44, 0xad, 0xe8, 0x74, 0x35, 0x6b, 0xe6, 0x0c, 0xcd, 0x8a, 0x56, 0x61, 0x5a, 0x86, - 0x28, 0x6a, 0x34, 0xba, 0x21, 0x41, 0xb0, 0x36, 0x39, 0x07, 0xdd, 0x80, 0x0b, 0x52, 0x80, 0xdf, - 0x26, 0xb2, 0x7a, 0xb3, 0x22, 0xf2, 0xbc, 0x60, 0x57, 0x29, 0x15, 0x95, 0x8b, 0xd6, 0x21, 0x67, - 0x13, 0x2f, 0x30, 0xb9, 0xcb, 0x6a, 0x4e, 0x98, 0x9e, 0x8b, 0x4d, 0x6f, 0x12, 0x2f, 0xa8, 0x76, - 0x9a, 0xd8, 0xc8, 0xda, 0xd1, 0x4a, 0xbf, 0x0e, 0x6b, 0x03, 0x4a, 0x3b, 0x69, 0x81, 0x3f, 0xc7, - 0xc5, 0x08, 0x91, 0x96, 0xdb, 0x0e, 0x86, 0x77, 0x00, 0x6f, 0x72, 0x1c, 0x38, 0x38, 0x8c, 0xca, - 0x3f, 0xa2, 0x78, 0x38, 0x72, 0x65, 0xf6, 0xbc, 0xdb, 0x79, 0xc9, 0xde, 0x8c, 0x5a, 0x55, 0x83, - 0x6c, 0x94, 0xe2, 0x30, 0x7a, 0x94, 0x12, 0x1a, 0x5d, 0x87, 0xd9, 0x78, 0x1d, 0xa5, 0x6d, 0x52, - 0xaa, 0x88, 0xb9, 0x32, 0x73, 0xc7, 0x63, 0x54, 0xe6, 0xbd, 0xc6, 0x28, 0x1e, 0xa5, 0x8f, 0x29, - 0xb5, 0x5c, 0x99, 0xfa, 0x9c, 0x11, 0x93, 0xe8, 0x0a, 0x00, 0x4f, 0x79, 0xd4, 0xc1, 0x39, 0xe9, - 0xa7, 0x17, 0x44, 0x8d, 0x7b, 0x03, 0x2e, 0x78, 0x81, 0x19, 0x3d, 0x8e, 0xb2, 0x5b, 0x65, 0xcb, - 0xe5, 0xbd, 0xa0, 0xbb, 0x45, 0x53, 0x13, 0xc6, 0xb4, 0x90, 0x48, 0x26, 0x8c, 0xf4, 0xb9, 0xce, - 0x0c, 0x3b, 0x57, 0xae, 0x8b, 0xb5, 0x4d, 0x12, 0x7a, 0xae, 0x17, 0xa8, 0x79, 0xe9, 0x10, 0x6b, - 0xef, 0x0a, 0x9a, 0xdf, 0x7f, 0x16, 0xa5, 0x98, 0xa9, 0xb3, 0x62, 0x43, 0x12, 0xfa, 0xbf, 0x41, - 0xef, 0x7f, 0xc4, 0x49, 0x25, 0x7c, 0xa3, 0xc0, 0x6c, 0x85, 0xba, 0x7b, 0x98, 0xed, 0x10, 0x07, - 0x3f, 0xc5, 0x9d, 0x41, 0x93, 0x62, 0x09, 0x72, 0xf2, 0xe1, 0xdb, 0xc3, 0x4c, 0x14, 0xc0, 0x74, - 0x79, 0x3e, 0x19, 0x1e, 0x5a, 0xb5, 0xa7, 0x62, 0xc3, 0x38, 0x96, 0x41, 0xb7, 0x00, 0xf1, 0xfa, - 0xa6, 0x9e, 0x1b, 0xe0, 0xd0, 0x8c, 0x66, 0xa3, 0xe8, 0x4a, 0x9c, 0x63, 0x94, 0xee, 0x89, 0x8d, - 0x88, 0xaf, 0xab, 0x70, 0x29, 0xed, 0x4a, 0xec, 0x65, 0xf9, 0x17, 0x80, 0xf1, 0x0a, 0x75, 0xd1, - 0xd7, 0x0a, 0xcc, 0x9f, 0x9c, 0x99, 0xee, 0x16, 0x07, 0xce, 0xfb, 0xc5, 0xd3, 0xa6, 0x11, 0xed, - 0xc3, 0x73, 0x80, 0x92, 0x11, 0xf0, 0x7b, 0x05, 0x2e, 0xf5, 0x19, 0x60, 0xee, 0x0d, 0xd7, 0x7b, - 0x3a, 0x52, 0xfb, 0xf8, 0xbc, 0xc8, 0xc4, 0xad, 0x2f, 0x60, 0xb6, 0x67, 0x90, 0xb9, 0x3d, 0x5c, - 0x67, 0x1a, 0xa1, 0xdd, 0x1b, 0x15, 0x91, 0x58, 0xef, 0x40, 0x3e, 0x3d, 0x7f, 0x94, 0x86, 0xab, - 0x4a, 0x01, 0xb4, 0x0f, 0x46, 0x04, 0x24, 0xa6, 0x9b, 0x00, 0x5d, 0x43, 0xc4, 0xad, 0xe1, 0x6a, - 0x8e, 0xa5, 0xb5, 0xff, 0x8d, 0x22, 0x9d, 0x58, 0xfc, 0x49, 0x01, 0xb5, 0xef, 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, 0x49, + 0x51, 0x15, 0xec, 0xc4, 0x69, 0xd5, 0x24, 0xed, 0x45, 0x03, 0x4a, 0x08, 0x4d, 0x0d, 0xd1, 0xe2, + 0xb4, 0x52, 0x6e, 0x56, 0xeb, 0xdd, 0x61, 0xbd, 0xc2, 0xbb, 0x63, 0xed, 0x8c, 0x91, 0x8d, 0x2a, + 0x55, 0xaa, 0xd4, 0x8b, 0xde, 0x55, 0x55, 0xa5, 0x56, 0x7d, 0x81, 0xbe, 0x4a, 0xee, 0x1a, 0xf5, + 0xaa, 0xe9, 0x45, 0xd4, 0x26, 0x4f, 0xd0, 0x3e, 0x41, 0xb5, 0x33, 0xb3, 0x8b, 0xd7, 0xe0, 0x2f, + 0xa2, 0x5c, 0x79, 0xce, 0xd9, 0xf9, 0x9d, 0xef, 0x33, 0x73, 0xc6, 0x30, 0x6f, 0x05, 0x98, 0x10, + 0xab, 0x66, 0xba, 0x7e, 0x91, 0xb6, 0x0a, 0x8d, 0x00, 0x53, 0x2c, 0x2f, 0x1f, 0x23, 0x6a, 0x32, + 0x5e, 0x81, 0xad, 0x70, 0x80, 0x0a, 0x27, 0xfb, 0xd4, 0x79, 0x0b, 0x7b, 0x1e, 0xf6, 0x8b, 0xfc, + 0x87, 0x63, 0xd4, 0x05, 0x07, 0x3b, 0x98, 0x2d, 0x8b, 0xe1, 0x8a, 0x73, 0xb5, 0x1f, 0x24, 0x90, + 0xcb, 0xc4, 0x29, 0xbb, 0x4e, 0x60, 0x52, 0x54, 0x21, 0xe4, 0x61, 0xd3, 0xb7, 0x89, 0xac, 0xc0, + 0x94, 0x15, 0x20, 0x93, 0xe2, 0x40, 0x91, 0x56, 0xa5, 0xf5, 0x8c, 0x1e, 0x91, 0xf2, 0x65, 0x48, + 0x33, 0x25, 0x86, 0x6b, 0x2b, 0xff, 0x5b, 0x95, 0xd6, 0xc7, 0xf5, 0x29, 0x46, 0xef, 0xd8, 0xf2, + 0x36, 0xa4, 0x4c, 0x0f, 0x37, 0x7d, 0xaa, 0x8c, 0x87, 0x98, 0xcd, 0xe2, 0xf3, 0x57, 0x2b, 0x63, + 0x7f, 0xbe, 0x5a, 0x79, 0xcf, 0x71, 0x69, 0xad, 0x59, 0x2d, 0x58, 0xd8, 0x2b, 0x5a, 0x98, 0x78, + 0x98, 0x88, 0x9f, 0x0d, 0x62, 0x1f, 0x16, 0x69, 0xbb, 0x81, 0x48, 0xe1, 0xa9, 0xeb, 0x53, 0x5d, + 0xc0, 0xb5, 0x2b, 0xa0, 0x9e, 0xb6, 0x49, 0x47, 0xa4, 0x81, 0x7d, 0x82, 0xb4, 0x7f, 0x24, 0x98, + 0x2f, 0x13, 0xe7, 0xbe, 0x6d, 0x57, 0xf0, 0x8e, 0x5f, 0x69, 0x55, 0x02, 0xd3, 0x3a, 0x44, 0xc1, + 0xf9, 0x6c, 0x5e, 0x84, 0x29, 0xda, 0x32, 0x6a, 0x26, 0xa9, 0x71, 0xa3, 0xf5, 0x14, 0x6d, 0x3d, + 0x32, 0x49, 0x4d, 0xde, 0x80, 0x8c, 0x85, 0x5d, 0xdf, 0x08, 0xcd, 0x53, 0x26, 0x56, 0xa5, 0xf5, + 0x99, 0xd2, 0x6c, 0x41, 0x04, 0x74, 0x0b, 0xbb, 0x7e, 0xa5, 0xdd, 0x40, 0x7a, 0xda, 0x12, 0x2b, + 0x79, 0x0d, 0x26, 0x1b, 0x01, 0xc6, 0x07, 0xca, 0xe4, 0xaa, 0xb4, 0x9e, 0x2d, 0xe5, 0xa2, 0xad, + 0x4f, 0x42, 0xa6, 0xce, 0xbf, 0xc9, 0xcb, 0x00, 0xd5, 0x3a, 0xb6, 0x0e, 0xb9, 0xbe, 0x14, 0xd3, + 0x97, 0x61, 0x1c, 0xa6, 0xf2, 0x32, 0xa4, 0x69, 0xcb, 0x70, 0x7d, 0x1b, 0xb5, 0x94, 0x29, 0x6e, + 0x26, 0x6d, 0xed, 0x84, 0xa4, 0xb6, 0x0c, 0x4b, 0x67, 0xb8, 0x1c, 0x87, 0x64, 0x97, 0x45, 0xe4, + 0x69, 0xc3, 0xe6, 0xf1, 0xba, 0x6f, 0xdb, 0x01, 0x22, 0xfd, 0xb2, 0xb8, 0x0c, 0x40, 0x09, 0x31, + 0x1a, 0xcd, 0xea, 0x21, 0x6a, 0xb3, 0x98, 0x64, 0xf4, 0x0c, 0x25, 0xe4, 0x09, 0x63, 0x08, 0x75, + 0xdd, 0xf2, 0x62, 0x75, 0xbf, 0x4b, 0x30, 0x57, 0x26, 0xce, 0x97, 0x35, 0x97, 0xa2, 0xba, 0x4b, + 0xe8, 0x03, 0x7d, 0xab, 0x74, 0xb3, 0x8f, 0xb6, 0x35, 0xc8, 0xa1, 0xc0, 0x2a, 0xdd, 0x34, 0x4c, + 0x2e, 0x48, 0x28, 0x9c, 0x66, 0xcc, 0xc8, 0xd8, 0xce, 0x24, 0x8d, 0x27, 0x93, 0x24, 0xc3, 0x84, + 0x6f, 0x7a, 0x3c, 0x0d, 0x19, 0x9d, 0xad, 0xe5, 0x4b, 0x90, 0x22, 0x6d, 0xaf, 0x8a, 0xeb, 0x2c, + 0xe2, 0x19, 0x5d, 0x50, 0xb2, 0x0a, 0x69, 0x1b, 0x59, 0xae, 0x67, 0xd6, 0x09, 0x8b, 0x70, 0x4e, + 0x8f, 0x69, 0x79, 0x09, 0x32, 0x8e, 0x49, 0x8c, 0xba, 0xeb, 0xb9, 0x54, 0x44, 0x38, 0xed, 0x98, + 0xe4, 0xf3, 0x90, 0xd6, 0x0c, 0xb8, 0x7c, 0xca, 0xa7, 0xc8, 0xe3, 0xd0, 0x83, 0xe3, 0x84, 0x07, + 0xdc, 0xc3, 0xe9, 0xe3, 0x4e, 0x0f, 0x96, 0x01, 0x2c, 0x2b, 0xce, 0xa0, 0x08, 0x6a, 0xc8, 0xe1, + 0x39, 0x7c, 0x29, 0xc1, 0x42, 0x94, 0xc4, 0xbd, 0x26, 0x7d, 0xcb, 0xc2, 0x5d, 0x80, 0x49, 0x1f, + 0xfb, 0x16, 0x62, 0xb1, 0x9a, 0xd0, 0x39, 0xd1, 0x59, 0xce, 0x13, 0x89, 0x72, 0x7e, 0xc7, 0xf5, + 0x99, 0x87, 0x2b, 0x67, 0xb9, 0x16, 0x57, 0xcc, 0x01, 0x0b, 0xae, 0x8e, 0x3c, 0x7c, 0x84, 0x1e, + 0x06, 0xd8, 0x7b, 0x47, 0xfe, 0x6b, 0x6b, 0x70, 0xb5, 0xa7, 0x9e, 0xd8, 0x98, 0x5f, 0x79, 0xf9, + 0x6e, 0x85, 0x4a, 0x50, 0x65, 0x7f, 0xff, 0x0b, 0x4c, 0xfb, 0x5a, 0xd1, 0xbf, 0x59, 0xe4, 0xf7, + 0x61, 0xf6, 0x10, 0xb5, 0xb7, 0x91, 0xff, 0x0c, 0x51, 0xf3, 0x11, 0x72, 0x9d, 0x1a, 0x15, 0x05, + 0x7c, 0x8a, 0x2f, 0x6f, 0x40, 0x8a, 0x50, 0x93, 0x36, 0x89, 0x38, 0x52, 0x2e, 0x46, 0x79, 0xd0, + 0x91, 0x85, 0xdc, 0x23, 0xb4, 0xcf, 0x3e, 0xea, 0x62, 0x93, 0xb6, 0xc4, 0xc2, 0x96, 0x34, 0x34, + 0x76, 0xe3, 0x67, 0x09, 0x66, 0xcb, 0xc4, 0xd9, 0x36, 0xc9, 0x93, 0xc0, 0xb5, 0xd0, 0x20, 0x2f, + 0xfa, 0xc7, 0xb2, 0x11, 0x8a, 0x88, 0x62, 0xc9, 0x08, 0xf9, 0x2a, 0x4c, 0xf3, 0x6a, 0xf0, 0x9b, + 0x5e, 0x15, 0x05, 0xcc, 0xe2, 0x09, 0x3d, 0xcb, 0x78, 0xbb, 0x8c, 0xc5, 0x9a, 0xb0, 0xd9, 0x68, + 0xd4, 0xdb, 0x71, 0x13, 0x32, 0x4a, 0x53, 0x41, 0xe9, 0xb6, 0x2c, 0x36, 0xfb, 0x19, 0xe4, 0xca, + 0xc4, 0xd9, 0x0d, 0xd3, 0xf5, 0x76, 0x26, 0x9f, 0x91, 0xfe, 0x45, 0xb8, 0x98, 0x90, 0x1d, 0x2b, + 0x7d, 0x39, 0xc9, 0x4e, 0xb4, 0x90, 0xb9, 0xe7, 0xef, 0x55, 0x09, 0x0a, 0x8e, 0x90, 0xbd, 0xd7, + 0xa4, 0x55, 0xdc, 0xf4, 0xed, 0x4a, 0xab, 0x8f, 0x0d, 0x4b, 0xc0, 0x5a, 0x98, 0xb7, 0x04, 0xcf, + 0x7d, 0x3a, 0x64, 0xb0, 0x8e, 0x28, 0xc0, 0x3c, 0x16, 0xc2, 0x0c, 0x1c, 0x96, 0x5a, 0xe7, 0x4d, + 0x32, 0x87, 0x4f, 0xf4, 0x54, 0xf8, 0xfe, 0x4f, 0x40, 0xed, 0xda, 0xcf, 0xbb, 0x8b, 0x17, 0x0d, + 0x0f, 0xb0, 0x92, 0x80, 0x6d, 0x9e, 0x7c, 0x97, 0x3f, 0x84, 0xc5, 0x2e, 0x74, 0x78, 0x9a, 0x35, + 0x09, 0xb2, 0x15, 0x60, 0xd0, 0x85, 0x04, 0x74, 0xdb, 0x24, 0x4f, 0x09, 0xb2, 0xe5, 0x63, 0xd0, + 0xba, 0x60, 0xe8, 0xe0, 0x00, 0x59, 0xd4, 0x3d, 0x42, 0x4c, 0x00, 0x4f, 0x7d, 0x96, 0x5d, 0xd9, + 0x05, 0x71, 0x65, 0x5f, 0x1f, 0xe2, 0xca, 0xde, 0xf1, 0xa9, 0x9e, 0x4f, 0x68, 0x7c, 0x10, 0xc9, + 0x8d, 0x32, 0x2f, 0x7f, 0x36, 0x40, 0x37, 0x3f, 0x8a, 0xa7, 0x99, 0xf5, 0xbd, 0x65, 0xb1, 0x03, + 0x5a, 0xc6, 0x30, 0x73, 0x64, 0xd6, 0x9b, 0xc8, 0x08, 0x78, 0xaf, 0xd8, 0xbc, 0xe8, 0x36, 0x1f, + 0x8d, 0x38, 0x66, 0xfc, 0xfb, 0x6a, 0xe5, 0x62, 0xdb, 0xf4, 0xea, 0xf7, 0xb4, 0xa4, 0x38, 0x4d, + 0xcf, 0x31, 0x86, 0x68, 0x45, 0xbb, 0xa3, 0x59, 0x53, 0x43, 0x34, 0xab, 0xbc, 0x02, 0x59, 0xee, + 0x22, 0xab, 0x51, 0x71, 0x42, 0x02, 0x63, 0x6d, 0x85, 0x1c, 0xf9, 0x3a, 0x5c, 0xe0, 0x1b, 0xc2, + 0xd3, 0x84, 0x57, 0x6f, 0x9a, 0x79, 0x9e, 0x63, 0xec, 0x0a, 0x21, 0xac, 0x72, 0x93, 0xa3, 0x47, + 0x66, 0xd0, 0xe8, 0xa1, 0x5d, 0x83, 0xb5, 0x3e, 0xa5, 0x1d, 0xb7, 0xc0, 0xdf, 0xe3, 0x6c, 0xaa, + 0x4a, 0xee, 0xdb, 0xf1, 0x07, 0x77, 0x40, 0xd8, 0xe4, 0xc8, 0xb7, 0x51, 0x20, 0xca, 0x5f, 0x50, + 0xa1, 0x3b, 0x7c, 0x65, 0x74, 0xdd, 0xdb, 0x39, 0xce, 0xde, 0x12, 0xad, 0xaa, 0x42, 0x5a, 0x84, + 0x38, 0x10, 0x97, 0x52, 0x4c, 0xcb, 0xd7, 0x60, 0x26, 0x5a, 0x8b, 0xb0, 0x4d, 0x72, 0x11, 0x11, + 0x97, 0x47, 0xee, 0x64, 0xb2, 0x4c, 0xbd, 0xd5, 0x64, 0x19, 0x7a, 0xe9, 0x21, 0x42, 0x4c, 0x87, + 0x87, 0x3e, 0xa3, 0x47, 0xa4, 0x7c, 0x05, 0x20, 0x0c, 0xb9, 0xe8, 0xe0, 0x0c, 0xb7, 0xd3, 0xf5, + 0x45, 0xe3, 0x5e, 0x87, 0x0b, 0xae, 0x6f, 0x88, 0xcb, 0x91, 0x77, 0x2b, 0x6f, 0xb9, 0x9c, 0xeb, + 0x77, 0xb6, 0x68, 0x62, 0xc2, 0xc8, 0xb2, 0x1d, 0xf1, 0x84, 0x91, 0xcc, 0xeb, 0xf4, 0xc0, 0x91, + 0x72, 0x09, 0x32, 0xb4, 0x65, 0xe0, 0xc0, 0x75, 0x5c, 0x5f, 0xc9, 0x71, 0x83, 0x68, 0x6b, 0x8f, + 0xd1, 0xe1, 0xf9, 0x67, 0x12, 0x82, 0xa8, 0x32, 0xc3, 0x3e, 0x70, 0x42, 0xfb, 0x3f, 0x68, 0xbd, + 0x53, 0x1c, 0x57, 0xc2, 0x77, 0x12, 0xcc, 0x94, 0x89, 0xb3, 0x8f, 0xe8, 0x2e, 0xb6, 0xd1, 0x63, + 0xd4, 0xee, 0x37, 0x29, 0x16, 0x21, 0xc3, 0x2f, 0xbe, 0x7d, 0x44, 0x59, 0x01, 0x64, 0x4b, 0x73, + 0xf1, 0xf0, 0xd0, 0xac, 0x3e, 0x66, 0x1f, 0xf4, 0x93, 0x3d, 0xf2, 0x0d, 0x90, 0xc3, 0xfa, 0x26, + 0xae, 0xe3, 0xa3, 0xc0, 0x10, 0xb3, 0x91, 0x38, 0x12, 0x67, 0x29, 0x21, 0xfb, 0xec, 0x83, 0xe0, + 0x6b, 0x0a, 0x5c, 0x4a, 0x9a, 0x12, 0x59, 0x59, 0xfa, 0x2d, 0x0b, 0xe3, 0x65, 0xe2, 0xc8, 0xdf, + 0x4a, 0x30, 0x77, 0x7a, 0x66, 0xba, 0x5d, 0xe8, 0xfb, 0x04, 0x2a, 0x9c, 0x35, 0x8d, 0xa8, 0x1f, + 0x9f, 0x03, 0x14, 0x8f, 0x80, 0xdf, 0x48, 0x30, 0x7b, 0xea, 0xcd, 0x51, 0x1a, 0x52, 0x62, 0x07, + 0x46, 0xbd, 0x37, 0x3a, 0x26, 0x36, 0xe2, 0x47, 0x09, 0x2e, 0xf5, 0x98, 0xa2, 0xee, 0x0c, 0x16, + 0x7b, 0x36, 0x52, 0xfd, 0xf4, 0xbc, 0xc8, 0xd8, 0xac, 0xaf, 0x60, 0xa6, 0x6b, 0x9a, 0xba, 0x39, + 0x58, 0x66, 0x12, 0xa1, 0xde, 0x19, 0x15, 0x11, 0x6b, 0x6f, 0x43, 0x2e, 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, - 0x2a, 0x2e, 0x87, 0x19, 0xe3, 0x9a, 0x8c, 0x94, 0x34, 0xd2, 0xfd, 0x7b, 0x03, 0x86, 0xd9, 0x36, - 0xb1, 0x95, 0x54, 0x40, 0x56, 0x9a, 0xe6, 0x2f, 0x2e, 0xb9, 0xb4, 0x7b, 0x74, 0x59, 0x15, 0x92, - 0xa6, 0xc7, 0xa5, 0xe4, 0x19, 0x50, 0xfb, 0x15, 0xe5, 0x43, 0x3a, 0xc8, 0x15, 0x33, 0xa9, 0x14, - 0xc5, 0xbc, 0x7d, 0x8f, 0x70, 0xfd, 0x94, 0xe9, 0xbe, 0x4a, 0x63, 0x08, 0x44, 0xac, 0x80, 0x69, - 0x38, 0x59, 0x22, 0x5d, 0x1f, 0x57, 0x61, 0x24, 0xe3, 0xe4, 0x0c, 0x04, 0x37, 0x49, 0x03, 0xf9, - 0xa8, 0x53, 0x0e, 0xdf, 0xb7, 0xdc, 0x00, 0xd7, 0x14, 0x18, 0x35, 0x09, 0x84, 0x01, 0x35, 0x66, - 0x59, 0xa3, 0xe4, 0xa3, 0x4e, 0xb5, 0xfb, 0x87, 0x14, 0x4c, 0xb2, 0x62, 0x92, 0xa3, 0x37, 0x66, - 0xaf, 0x32, 0x7d, 0x6a, 0x39, 0x77, 0xcf, 0x2d, 0x14, 0x6e, 0x2a, 0xdd, 0x03, 0xfc, 0x9b, 0x7f, - 0x70, 0xd1, 0x07, 0x15, 0x83, 0x30, 0x8d, 0xb2, 0x8f, 0x3a, 0xb5, 0xf0, 0xb3, 0x71, 0xfb, 0x01, - 0xe1, 0xef, 0x87, 0xeb, 0xb8, 0x0a, 0xeb, 0xff, 0xf0, 0x8f, 0x54, 0x07, 0x22, 0x92, 0xb9, 0x18, - 0x1c, 0x0b, 0x16, 0x65, 0x30, 0xb0, 0xfe, 0x2b, 0xe1, 0x56, 0xdf, 0xfd, 0x8f, 0x7f, 0xa6, 0xfa, - 0x3c, 0x37, 0x1b, 0xcb, 0x25, 0xbb, 0xbc, 0x3d, 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, 0x05, 0x73, 0x0a, + 0x86, 0x72, 0xa3, 0xad, 0xe5, 0x29, 0x93, 0xea, 0xd5, 0x22, 0x63, 0xc2, 0x92, 0xa5, 0xd1, 0x4e, + 0x07, 0xb7, 0xde, 0x81, 0x63, 0xbe, 0x4c, 0xfc, 0x4a, 0x1b, 0x20, 0xb5, 0x67, 0xff, 0xba, 0xd0, + 0x42, 0xfb, 0x7d, 0xb4, 0x5c, 0x55, 0x96, 0xfd, 0x50, 0x68, 0x2d, 0x32, 0xa0, 0xfe, 0x29, 0xc9, + 0x17, 0x74, 0x9e, 0x1b, 0xe6, 0xa4, 0x56, 0x95, 0x3e, 0xfe, 0x8c, 0x70, 0xff, 0x09, 0xb3, 0x27, + 0x46, 0x72, 0x88, 0x14, 0x37, 0xc0, 0x2c, 0x3c, 0x2e, 0x91, 0xc1, 0x08, 0xf7, 0x60, 0xa9, 0x79, + 0x7a, 0x0c, 0x4a, 0xb8, 0x74, 0x80, 0x46, 0x68, 0xb2, 0x13, 0xff, 0x59, 0x0a, 0x22, 0xbc, 0x67, + 0xc0, 0x99, 0x22, 0x52, 0x0e, 0xcc, 0x29, 0xcb, 0x06, 0xdd, 0x11, 0x9a, 0xf4, 0xa6, 0x37, 0x49, + 0xc5, 0x24, 0x35, 0x93, 0x3c, 0xfa, 0xcd, 0x9c, 0xed, 0x9e, 0x7d, 0x1f, 0x76, 0x3e, 0xfd, 0x18, + 0xa2, 0x78, 0xd3, 0x19, 0x3c, 0xc0, 0x37, 0xc4, 0x5f, 0x6f, 0x71, 0x02, 0x86, 0x83, 0x72, 0x83, + 0x9d, 0x11, 0x9a, 0xec, 0xc5, 0xff, 0x92, 0xc7, 0x1f, 0x10, 0x3e, 0x98, 0x65, 0x9a, 0xbf, 0x7e, + 0x0a, 0x6c, 0x0e, 0xe6, 0x05, 0x18, 0xb9, 0x90, 0xdc, 0xe3, 0xaa, 0x3e, 0xee, 0xe3, 0xbe, 0xb4, + 0x47, 0x2e, 0x7d, 0x5e, 0x2c, 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, 0x59, 0x0a, 0x54, 0xfa, 0x31, 0x27, - 0x54, 0x02, 0x94, 0x22, 0xe3, 0xcc, 0x9e, 0x33, 0x4e, 0x0d, 0x61, 0xa6, 0x7e, 0x81, 0xf6, 0x57, - 0xa8, 0x4d, 0x5d, 0xc5, 0x08, 0x9a, 0x4b, 0x62, 0x53, 0x21, 0x7e, 0x8e, 0xf6, 0x4b, 0x93, 0x19, - 0x11, 0xd2, 0x74, 0xcc, 0x0f, 0x59, 0x4e, 0xa5, 0x9e, 0xcb, 0x66, 0x7f, 0x6f, 0x46, 0x78, 0x47, - 0x84, 0xd4, 0xdd, 0xeb, 0xaa, 0x68, 0xfb, 0x47, 0x15, 0x1d, 0xe8, 0xde, 0x74, 0xcb, 0xdd, 0x7d, - 0xad, 0x56, 0x77, 0xfd, 0x39, 0x3d, 0x42, 0xf5, 0x54, 0xf4, 0x68, 0xc0, 0x72, 0x1a, 0x9d, 0x50, - 0x12, 0x64, 0x10, 0xe9, 0x0e, 0xdd, 0xec, 0x2f, 0xe1, 0xf8, 0x09, 0xda, 0x4d, 0xc5, 0x59, 0x2e, - 0xff, 0x21, 0x6f, 0x68, 0xf2, 0x72, 0x00, 0x27, 0xa8, 0x11, 0x13, 0x71, 0xce, 0xd3, 0x10, 0x7a, - 0x34, 0xe4, 0x40, 0x04, 0x68, 0x6f, 0xba, 0x1d, 0xb5, 0xe3, 0x63, 0xf7, 0x3f, 0x7f, 0xd5, 0x3d, - 0x5d, 0xa5, 0xec, 0xaf, 0x4e, 0x88, 0xf7, 0xd0, 0x96, 0x48, 0x63, 0x0a, 0xbc, 0xd8, 0xe2, 0xe2, - 0xd6, 0xe9, 0xfd, 0x9c, 0x38, 0xd6, 0xf5, 0xc4, 0xb1, 0xfe, 0x4c, 0x1c, 0xeb, 0xdb, 0xd4, 0xa9, - 0x5c, 0x4f, 0x9d, 0xca, 0xaf, 0xa9, 0x53, 0xf9, 0xe8, 0xc5, 0xa9, 0x4c, 0xf2, 0xc0, 0x0d, 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, 0x55, + 0x01, 0x06, 0x07, 0x9b, 0xa8, 0xff, 0x71, 0x10, 0x3e, 0xd4, 0xd5, 0x1b, 0x24, 0xcf, 0xb9, 0x6a, + 0x0a, 0x20, 0x0a, 0x12, 0xbc, 0x87, 0x56, 0x2e, 0x64, 0x1a, 0xaa, 0x5e, 0x17, 0xc2, 0x42, 0xe4, + 0xae, 0xb3, 0xe7, 0x3c, 0xbc, 0xd5, 0x46, 0x17, 0x32, 0x7d, 0xdf, 0xeb, 0xc2, 0x99, 0xc8, 0xf1, + 0x13, 0xb4, 0x1e, 0x19, 0x4a, 0x48, 0x13, 0x60, 0x8a, 0x9e, 0x53, 0x10, 0xee, 0xbc, 0x81, 0xad, + 0xd9, 0x44, 0xab, 0x8a, 0xe3, 0x47, 0x68, 0xcd, 0xd6, 0x25, 0x8a, 0x72, 0x16, 0x66, 0x44, 0x66, + 0xee, 0x82, 0xc1, 0xae, 0x8e, 0xc4, 0x8f, 0x89, 0xcc, 0xb4, 0xee, 0x28, 0xd4, 0xb4, 0xe2, 0x2e, + 0x5a, 0xdd, 0x91, 0x44, 0x53, 0xc7, 0xf1, 0x2e, 0x5a, 0x2e, 0x4d, 0x68, 0xa7, 0xee, 0x0d, 0xeb, + 0xd2, 0x86, 0xb4, 0xd1, 0xfa, 0x37, 0x07, 0x6d, 0x99, 0xf6, 0xde, 0x40, 0x2f, 0x05, 0xd6, 0xc8, + 0x79, 0xdc, 0x39, 0xeb, 0x26, 0x33, 0xf6, 0x78, 0x1f, 0xad, 0x74, 0x0c, 0x2f, 0x8c, 0x34, 0xb1, + 0x6c, 0x6f, 0xb9, 0x33, 0xd4, 0xc2, 0x0f, 0xd0, 0x9d, 0x12, 0xd2, 0x2d, 0xa2, 0x0e, 0xf4, 0x64, + 0xd9, 0xd7, 0x6d, 0x1b, 0x3d, 0xb5, 0xc1, 0xfa, 0x8f, 0x79, 0xb4, 0x61, 0x7c, 0xbc, 0x83, 0x4f, + 0x27, 0xe5, 0x06, 0x5e, 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, 0x47, 0x12, 0x92, 0x9a, 0x84, 0x13, 0x33, 0xef, 0x3c, 0xef, 0xf3, 0x3e, 0xef, 0x17, - 0x0e, 0xac, 0x31, 0x93, 0x13, 0xef, 0x0d, 0xf1, 0x34, 0xbf, 0x5b, 0x6d, 0x7b, 0xcc, 0x67, 0xf2, - 0xf6, 0x5b, 0xe2, 0x23, 0xcb, 0x41, 0x2e, 0xad, 0x8a, 0x13, 0xf3, 0x48, 0x35, 0x46, 0x15, 0xd7, - 0x2d, 0xd6, 0x6a, 0x31, 0xaa, 0x85, 0x7f, 0x42, 0x8f, 0xe2, 0x86, 0xcd, 0x6c, 0x26, 0x8e, 0x5a, - 0x70, 0x8a, 0xad, 0x09, 0xb5, 0xd9, 0x44, 0x2d, 0x12, 0x59, 0x77, 0x13, 0xab, 0xe5, 0x31, 0xce, - 0x45, 0x1c, 0xe3, 0xbc, 0x89, 0x6c, 0x1e, 0x01, 0xb6, 0x12, 0x40, 0x7c, 0x88, 0x1e, 0xf2, 0xc9, - 0x43, 0x1b, 0x79, 0xa8, 0x15, 0xe1, 0xd5, 0x4f, 0x12, 0xac, 0x9d, 0x70, 0xbb, 0x8e, 0xf1, 0x61, - 0x93, 0x59, 0x17, 0xc7, 0x04, 0x61, 0xe2, 0xc9, 0x0a, 0x2c, 0x58, 0x1e, 0x41, 0x3e, 0xf3, 0x14, - 0xa9, 0x2c, 0x55, 0xb2, 0x7a, 0x7c, 0x95, 0x0b, 0xb0, 0x18, 0x06, 0x75, 0xb1, 0xf2, 0x5b, 0x59, - 0xaa, 0xcc, 0xe8, 0x0b, 0xe2, 0xde, 0xc0, 0xf2, 0x0e, 0x80, 0x19, 0x70, 0x18, 0x0e, 0xe2, 0x8e, - 0x32, 0x53, 0x96, 0x2a, 0x4b, 0x7a, 0x56, 0x58, 0x8e, 0x11, 0x77, 0xe4, 0x4d, 0x98, 0x77, 0x88, - 0x6b, 0x3b, 0xbe, 0x32, 0x2b, 0xfc, 0xa2, 0x9b, 0xbc, 0x1f, 0xd8, 0x83, 0xa8, 0xca, 0x5c, 0x59, - 0xaa, 0xe4, 0x6a, 0x72, 0x35, 0xaa, 0x4e, 0xa8, 0xe5, 0x09, 0xf2, 0xd1, 0xe1, 0xec, 0xe5, 0xd7, - 0xdd, 0x8c, 0x1e, 0xe1, 0xd4, 0x6d, 0x28, 0x8c, 0x48, 0xd6, 0x09, 0x6f, 0x33, 0xca, 0x89, 0xda, - 0x85, 0xf5, 0x13, 0x6e, 0xbf, 0x6c, 0x63, 0xe4, 0x93, 0xc7, 0xcc, 0x23, 0x67, 0x22, 0xdb, 0x94, - 0x8c, 0x8e, 0x00, 0xac, 0x04, 0x27, 0x72, 0xca, 0xd5, 0x7e, 0xaf, 0xa6, 0x74, 0xb1, 0xda, 0xa7, - 0xd5, 0x07, 0x5c, 0xd5, 0x1d, 0xd8, 0x1e, 0x13, 0x39, 0x11, 0xf6, 0x59, 0x82, 0xe5, 0x50, 0xf6, - 0x69, 0x44, 0x94, 0x22, 0xea, 0x0f, 0x58, 0x8d, 0xc3, 0x19, 0x08, 0x63, 0x8f, 0xf0, 0x50, 0x5a, - 0x56, 0x5f, 0x89, 0xed, 0xf5, 0xd0, 0x2c, 0x3f, 0x84, 0x82, 0x90, 0xd8, 0x74, 0x09, 0xf5, 0x0d, - 0xdb, 0x43, 0xd4, 0x27, 0xc4, 0x68, 0x77, 0xcc, 0x0b, 0xd2, 0x13, 0x5d, 0xc8, 0xea, 0x5b, 0x7d, - 0xc0, 0x51, 0xf8, 0x7e, 0x26, 0x9e, 0xe5, 0x7f, 0x20, 0x8f, 0x30, 0x36, 0x28, 0xc3, 0xc4, 0x40, - 0x96, 0xc5, 0x3a, 0xd4, 0x37, 0x18, 0x6d, 0xf6, 0x44, 0x8b, 0x16, 0x75, 0x19, 0x61, 0xfc, 0x82, - 0x61, 0x52, 0x0f, 0x9f, 0x4e, 0x69, 0xb3, 0xa7, 0x2a, 0xb0, 0x39, 0x9c, 0x45, 0x92, 0xe0, 0x7b, - 0x09, 0x56, 0xe2, 0xbe, 0xa0, 0x16, 0x79, 0xc5, 0x7c, 0x72, 0xbf, 0x41, 0xaa, 0x07, 0x83, 0x84, - 0x5a, 0xc4, 0x70, 0xe9, 0x39, 0x13, 0x29, 0xe4, 0x6a, 0x6a, 0x6a, 0x47, 0x44, 0xc0, 0x60, 0xd8, - 0x50, 0x8b, 0x34, 0xe8, 0x39, 0x53, 0x0b, 0xb0, 0x75, 0x4b, 0x4a, 0x22, 0xf3, 0x87, 0x04, 0x4a, - 0xbf, 0x4f, 0xc9, 0x16, 0x3d, 0x0b, 0x96, 0x28, 0x45, 0xef, 0x9f, 0xb0, 0xea, 0xf2, 0x06, 0x35, - 0x59, 0x87, 0xe2, 0xa7, 0x14, 0x99, 0x4d, 0x82, 0x85, 0xb4, 0x45, 0x7d, 0xc4, 0x2e, 0xef, 0xc1, - 0x9a, 0xcb, 0x4f, 0x3b, 0xfe, 0x10, 0x38, 0x2c, 0xe9, 0xe8, 0x83, 0xec, 0x40, 0xde, 0x46, 0xfc, - 0xcc, 0x73, 0x2d, 0xd2, 0xa0, 0x41, 0x38, 0x4e, 0x84, 0x98, 0x68, 0x1f, 0x6a, 0xa9, 0x99, 0x1f, - 0x8d, 0xf3, 0xd4, 0xc7, 0x13, 0xaa, 0x2a, 0x94, 0x7f, 0x95, 0x79, 0x52, 0x9e, 0xba, 0x68, 0x62, - 0x88, 0x79, 0x4e, 0x7a, 0x36, 0xa1, 0x29, 0x45, 0xd9, 0x80, 0x39, 0xb1, 0xe0, 0x51, 0x07, 0xc3, - 0x4b, 0x54, 0xfc, 0x41, 0x8a, 0x98, 0xbd, 0xf6, 0x7d, 0x0e, 0x66, 0x4e, 0xb8, 0x2d, 0x33, 0xc8, - 0x0d, 0x2e, 0xc2, 0x5f, 0xa9, 0x39, 0x0e, 0xcf, 0x5b, 0xf1, 0x60, 0x0a, 0x70, 0x1c, 0x58, 0x7e, - 0x07, 0xab, 0x23, 0xff, 0x13, 0xf6, 0xef, 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, 0xaa, 0xad, 0xd4, 0x45, 0xe8, 0x03, 0xa2, 0x8a, 0x82, 0x2c, 0x95, 0x45, + 0x37, 0xd6, 0xd8, 0x33, 0xb1, 0x2d, 0x92, 0x99, 0xc8, 0xe3, 0x54, 0x49, 0xa5, 0x76, 0xdf, 0x45, + 0xa5, 0xfe, 0x95, 0xfe, 0x87, 0x2e, 0x58, 0xb2, 0xec, 0xaa, 0xaa, 0x60, 0xd3, 0x7f, 0xd0, 0xed, + 0x95, 0xc7, 0x8f, 0x24, 0x24, 0x98, 0x84, 0x15, 0x33, 0x67, 0xbe, 0xf3, 0x7d, 0xe7, 0x49, 0x0c, + 0x5b, 0xdc, 0x12, 0xd4, 0xff, 0x89, 0xfa, 0x7a, 0x30, 0xa8, 0xf7, 0x7c, 0x1e, 0x70, 0xb4, 0xff, + 0x33, 0x0d, 0xb0, 0xed, 0x62, 0x8f, 0xd5, 0xe5, 0x89, 0xfb, 0xb4, 0x9e, 0xa0, 0xca, 0xdb, 0x36, + 0xef, 0x76, 0x39, 0xd3, 0xa3, 0x3f, 0x91, 0x47, 0x79, 0xc7, 0xe1, 0x0e, 0x97, 0x47, 0x3d, 0x3c, + 0x25, 0xd6, 0x94, 0xda, 0xea, 0xe0, 0x2e, 0x8d, 0xad, 0x87, 0xa9, 0xd5, 0xf6, 0xb9, 0x10, 0x52, + 0xc7, 0x6c, 0x77, 0xb0, 0x23, 0x62, 0xc0, 0x5e, 0x0a, 0x48, 0x0e, 0xf1, 0x43, 0x31, 0x7d, 0xe8, + 0x61, 0x1f, 0x77, 0x63, 0xbc, 0xf6, 0xa7, 0x02, 0x5b, 0x17, 0xc2, 0x69, 0x12, 0x72, 0xda, 0xe1, + 0xf6, 0xcd, 0x39, 0xc5, 0x84, 0xfa, 0x48, 0x85, 0x37, 0xb6, 0x4f, 0x71, 0xc0, 0x7d, 0x55, 0xa9, + 0x2a, 0xb5, 0xbc, 0x91, 0x5c, 0x51, 0x09, 0x56, 0x23, 0x51, 0x8f, 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, 0x2b, 0xf9, 0x8c, 0x3e, 0x82, 0x22, 0x26, 0xc4, 0x64, 0x9c, 0x50, 0x13, 0xdb, + 0x36, 0xef, 0xb3, 0xc0, 0xe4, 0xac, 0x33, 0x94, 0x2d, 0x5a, 0x35, 0x10, 0x26, 0xe4, 0x7b, 0x4e, + 0x68, 0x33, 0x7a, 0xba, 0x64, 0x9d, 0xa1, 0xa6, 0xc2, 0xee, 0x64, 0x16, 0x69, 0x82, 0xbf, 0x29, + 0xb0, 0x91, 0xf4, 0x05, 0x77, 0xe9, 0x35, 0x0f, 0xe8, 0xcb, 0x06, 0xa9, 0x19, 0x0e, 0x12, 0xee, + 0x52, 0xd3, 0x63, 0x6d, 0x2e, 0x53, 0x28, 0x34, 0xb4, 0xcc, 0x8e, 0x48, 0xc1, 0x70, 0xd8, 0x70, + 0x97, 0xb6, 0x58, 0x9b, 0x6b, 0x25, 0xd8, 0x7b, 0x14, 0x4a, 0x1a, 0xe6, 0xff, 0xaf, 0x40, 0x1d, + 0xf5, 0x29, 0xdd, 0xa2, 0x6f, 0xc3, 0x25, 0xca, 0x88, 0xf7, 0x7d, 0xd8, 0xf4, 0x44, 0x8b, 0x59, + 0xbc, 0xcf, 0xc8, 0x37, 0x0c, 0x5b, 0x1d, 0x4a, 0x64, 0x68, 0xab, 0xc6, 0x94, 0x1d, 0x1d, 0xc1, + 0x96, 0x27, 0x2e, 0xfb, 0xc1, 0x04, 0x38, 0x2a, 0xe9, 0xf4, 0x03, 0x72, 0xa1, 0xe8, 0x60, 0x71, + 0xe5, 0x7b, 0x36, 0x6d, 0xb1, 0x50, 0x4e, 0x50, 0x19, 0x4c, 0xbc, 0x0f, 0x8d, 0xcc, 0xcc, 0xcf, + 0x66, 0x79, 0x1a, 0xb3, 0x09, 0xd1, 0x2f, 0xf0, 0x8e, 0x35, 0x5a, 0x99, 0x6b, 0xea, 0x7b, 0x6d, + 0xcf, 0xc6, 0x81, 0xc7, 0xa3, 0xec, 0xd5, 0x15, 0x29, 0xf8, 0xf9, 0x33, 0xa5, 0x7e, 0x9a, 0xc0, + 0xc8, 0xa4, 0xd7, 0x34, 0xa8, 0x3e, 0x55, 0xf8, 0xb4, 0x3b, 0x4d, 0x39, 0x43, 0x11, 0xe6, 0x3b, + 0x3a, 0x74, 0x28, 0xcb, 0xe8, 0xc9, 0x0e, 0x2c, 0x4b, 0xc1, 0x78, 0x80, 0xa2, 0x4b, 0xdc, 0xfb, + 0x71, 0x8a, 0x84, 0xbd, 0xf1, 0xdf, 0x32, 0x2c, 0x5d, 0x08, 0x07, 0x71, 0x28, 0x8c, 0xef, 0xe1, + 0x07, 0x99, 0x19, 0x4f, 0x8e, 0x7b, 0xf9, 0x64, 0x01, 0x70, 0x22, 0x8c, 0x7e, 0x85, 0xcd, 0xa9, + 0x7f, 0x49, 0xc7, 0xcf, 0x11, 0x3d, 0xf6, 0x28, 0x7f, 0xb6, 0xa8, 0x47, 0xaa, 0xef, 0xc3, 0xda, + 0xc4, 0x5e, 0x1e, 0xcd, 0x91, 0x44, 0x8a, 0x2e, 0x7f, 0xbc, 0x08, 0x3a, 0xd5, 0xfc, 0x5d, 0x81, + 0xe2, 0xec, 0x2d, 0xfb, 0x64, 0xce, 0x3c, 0x26, 0xdd, 0xca, 0x5f, 0xbe, 0xc8, 0x6d, 0xbc, 0x06, + 0x13, 0x73, 0x75, 0x34, 0x1f, 0x5d, 0x84, 0x7e, 0xbe, 0x06, 0xb3, 0x06, 0x0e, 0x0d, 0x60, 0xfd, + 0xd1, 0x4f, 0x6b, 0x7d, 0xae, 0x5a, 0xa6, 0xf8, 0xf2, 0xa7, 0x8b, 0xe1, 0x13, 0xe5, 0xd3, 0xd6, + 0xed, 0x7d, 0x45, 0xb9, 0xbb, 0xaf, 0x28, 0xff, 0xde, 0x57, 0x94, 0x3f, 0x1e, 0x2a, 0xb9, 0xbb, + 0x87, 0x4a, 0xee, 0xef, 0x87, 0x4a, 0xee, 0x47, 0xdd, 0xf1, 0x02, 0xb7, 0x6f, 0x85, 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(), + ) +} From 4935c30da9414694e07ebdff48c9c10451ffb66c Mon Sep 17 00:00:00 2001 From: Luke Ma <867273263@qq.com> Date: Fri, 20 Oct 2023 02:07:28 +0800 Subject: [PATCH 03/26] fix: CallEVM(addLiquidityETH) wrong parameter call (#1311) * fix wrong addLiquidityETH params * modify unit test params * remove unused package --------- Co-authored-by: Lucas Bertrand --- x/crosschain/keeper/gas_payment_test.go | 6 +++--- x/fungible/keeper/gas_coin_and_pool.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x/crosschain/keeper/gas_payment_test.go b/x/crosschain/keeper/gas_payment_test.go index d15bf96e94..014cc3278d 100644 --- a/x/crosschain/keeper/gas_payment_test.go +++ b/x/crosschain/keeper/gas_payment_test.go @@ -217,7 +217,7 @@ var ( // gasLimit = big.NewInt(21_000) - value used in SetupChainGasCoinAndPool for gas limit initialization withdrawFee uint64 = 1000 gasPrice uint64 = 2 - inputAmount uint64 = 100000 + inputAmount uint64 = 1e16 ) func TestKeeper_PayGasNativeAndUpdateCctx(t *testing.T) { @@ -258,10 +258,10 @@ func TestKeeper_PayGasNativeAndUpdateCctx(t *testing.T) { } // total fees must be 21000*2+1000=43000 - // if the input amount of the cctx is 100000, the output amount must be 100000-43000=57000 + // if the input amount of the cctx is 1e16, the output amount must be 1e16-43000=9999999999957000 err = k.PayGasNativeAndUpdateCctx(ctx, chainID, &cctx, math.NewUint(inputAmount)) require.NoError(t, err) - require.Equal(t, uint64(57000), cctx.GetCurrentOutTxParam().Amount.Uint64()) + require.Equal(t, uint64(9999999999957000), cctx.GetCurrentOutTxParam().Amount.Uint64()) require.Equal(t, uint64(21_000), cctx.GetCurrentOutTxParam().OutboundTxGasLimit) require.Equal(t, "2", cctx.GetCurrentOutTxParam().OutboundTxGasPrice) }) diff --git a/x/fungible/keeper/gas_coin_and_pool.go b/x/fungible/keeper/gas_coin_and_pool.go index ce725743cb..d33c3ddec6 100644 --- a/x/fungible/keeper/gas_coin_and_pool.go +++ b/x/fungible/keeper/gas_coin_and_pool.go @@ -107,7 +107,7 @@ func (k Keeper) SetupChainGasCoinAndPool( // address to, // uint deadline //) external payable returns (uint amountToken, uint amountETH, uint liquidity); - res, err := k.CallEVM(ctx, *routerABI, types.ModuleAddressEVM, routerAddress, amount, big.NewInt(5_000_000), true, false, + res, err := k.CallEVM(ctx, *routerABI, types.ModuleAddressEVM, routerAddress, amountAZeta, big.NewInt(5_000_000), true, false, "addLiquidityETH", zrc20Addr, amount, BigIntZero, BigIntZero, types.ModuleAddressEVM, amountAZeta) if err != nil { return ethcommon.Address{}, sdkerrors.Wrapf(err, "failed to CallEVM method addLiquidityETH(%s, %s)", zrc20Addr.String(), amountAZeta.String()) From ff85f062dc1df551866d7404e12e4e2e40a9d73c Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Thu, 19 Oct 2023 13:20:24 -0700 Subject: [PATCH 04/26] refactor: set gas limit associated to the ZRC20 for cctx revert outbound (#1317) * initialize * udpate expected keeper * implement gas limit method * change revert tx gas limit * make generate * initialize test * get gas limit test --------- Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com> --- testutil/keeper/mocks/crosschain/account.go | 2 +- testutil/keeper/mocks/crosschain/bank.go | 2 +- testutil/keeper/mocks/crosschain/fungible.go | 26 +++- testutil/keeper/mocks/crosschain/observer.go | 2 +- testutil/keeper/mocks/crosschain/staking.go | 2 +- testutil/keeper/mocks/fungible/account.go | 2 +- testutil/keeper/mocks/fungible/bank.go | 2 +- testutil/keeper/mocks/fungible/evm.go | 2 +- testutil/keeper/mocks/fungible/observer.go | 2 +- x/crosschain/keeper/cctx_utils.go | 37 ++++- x/crosschain/keeper/cctx_utils_test.go | 140 ++++++++++++++++++ .../keeper_cross_chain_tx_vote_inbound_tx.go | 28 ++-- .../keeper_cross_chain_tx_vote_outbound_tx.go | 31 ++-- x/crosschain/types/expected_keepers.go | 1 + 14 files changed, 250 insertions(+), 29 deletions(-) diff --git a/testutil/keeper/mocks/crosschain/account.go b/testutil/keeper/mocks/crosschain/account.go index 69df546af1..fa43ac3d58 100644 --- a/testutil/keeper/mocks/crosschain/account.go +++ b/testutil/keeper/mocks/crosschain/account.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/testutil/keeper/mocks/crosschain/bank.go b/testutil/keeper/mocks/crosschain/bank.go index 8b4e4c1b04..eb339a5880 100644 --- a/testutil/keeper/mocks/crosschain/bank.go +++ b/testutil/keeper/mocks/crosschain/bank.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/testutil/keeper/mocks/crosschain/fungible.go b/testutil/keeper/mocks/crosschain/fungible.go index 1a1452f5c7..ab960b49a9 100644 --- a/testutil/keeper/mocks/crosschain/fungible.go +++ b/testutil/keeper/mocks/crosschain/fungible.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks @@ -262,6 +262,30 @@ func (_m *CrosschainFungibleKeeper) GetForeignCoins(ctx types.Context, zrc20Addr return r0, r1 } +// GetGasCoinForForeignCoin provides a mock function with given fields: ctx, chainID +func (_m *CrosschainFungibleKeeper) GetGasCoinForForeignCoin(ctx types.Context, chainID int64) (fungibletypes.ForeignCoins, bool) { + ret := _m.Called(ctx, chainID) + + var r0 fungibletypes.ForeignCoins + var r1 bool + if rf, ok := ret.Get(0).(func(types.Context, int64) (fungibletypes.ForeignCoins, bool)); ok { + return rf(ctx, chainID) + } + if rf, ok := ret.Get(0).(func(types.Context, int64) fungibletypes.ForeignCoins); ok { + r0 = rf(ctx, chainID) + } else { + r0 = ret.Get(0).(fungibletypes.ForeignCoins) + } + + if rf, ok := ret.Get(1).(func(types.Context, int64) bool); ok { + r1 = rf(ctx, chainID) + } else { + r1 = ret.Get(1).(bool) + } + + return r0, r1 +} + // GetSystemContract provides a mock function with given fields: ctx func (_m *CrosschainFungibleKeeper) GetSystemContract(ctx types.Context) (fungibletypes.SystemContract, bool) { ret := _m.Called(ctx) diff --git a/testutil/keeper/mocks/crosschain/observer.go b/testutil/keeper/mocks/crosschain/observer.go index 8ddc1504cd..17adf0ae87 100644 --- a/testutil/keeper/mocks/crosschain/observer.go +++ b/testutil/keeper/mocks/crosschain/observer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/testutil/keeper/mocks/crosschain/staking.go b/testutil/keeper/mocks/crosschain/staking.go index 7288ae4125..921aecb21b 100644 --- a/testutil/keeper/mocks/crosschain/staking.go +++ b/testutil/keeper/mocks/crosschain/staking.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/testutil/keeper/mocks/fungible/account.go b/testutil/keeper/mocks/fungible/account.go index 6a77932f69..fb67fadaab 100644 --- a/testutil/keeper/mocks/fungible/account.go +++ b/testutil/keeper/mocks/fungible/account.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/testutil/keeper/mocks/fungible/bank.go b/testutil/keeper/mocks/fungible/bank.go index d04228faf7..32213347fb 100644 --- a/testutil/keeper/mocks/fungible/bank.go +++ b/testutil/keeper/mocks/fungible/bank.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/testutil/keeper/mocks/fungible/evm.go b/testutil/keeper/mocks/fungible/evm.go index fe04262d80..0dbfc1fe14 100644 --- a/testutil/keeper/mocks/fungible/evm.go +++ b/testutil/keeper/mocks/fungible/evm.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/testutil/keeper/mocks/fungible/observer.go b/testutil/keeper/mocks/fungible/observer.go index d627f7d980..03e67b1a7b 100644 --- a/testutil/keeper/mocks/fungible/observer.go +++ b/testutil/keeper/mocks/fungible/observer.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.35.2. DO NOT EDIT. +// Code generated by mockery v2.36.0. DO NOT EDIT. package mocks diff --git a/x/crosschain/keeper/cctx_utils.go b/x/crosschain/keeper/cctx_utils.go index d77d928017..63c30746e2 100644 --- a/x/crosschain/keeper/cctx_utils.go +++ b/x/crosschain/keeper/cctx_utils.go @@ -1,16 +1,17 @@ package keeper import ( - "errors" "fmt" cosmoserrors "cosmossdk.io/errors" "cosmossdk.io/math" + "github.com/pkg/errors" sdk "github.com/cosmos/cosmos-sdk/types" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" + fungibletypes "github.com/zeta-chain/zetacore/x/fungible/types" zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types" ) @@ -86,3 +87,37 @@ func (k Keeper) RefundAmountOnZetaChain(ctx sdk.Context, cctx types.CrossChainTx return nil } + +// GetRevertGasLimit returns the gas limit for the revert transaction in a CCTX +// It returns 0 if there is no error but the gas limit can't be determined from the CCTX data +func (k Keeper) GetRevertGasLimit(ctx sdk.Context, cctx types.CrossChainTx) (uint64, error) { + if cctx.InboundTxParams == nil { + return 0, nil + } + + if cctx.InboundTxParams.CoinType == common.CoinType_Gas { + // get the gas limit of the gas token + fc, found := k.fungibleKeeper.GetGasCoinForForeignCoin(ctx, cctx.InboundTxParams.SenderChainId) + if !found { + return 0, types.ErrForeignCoinNotFound + } + gasLimit, err := k.fungibleKeeper.QueryGasLimit(ctx, ethcommon.HexToAddress(fc.Zrc20ContractAddress)) + if err != nil { + return 0, errors.Wrap(fungibletypes.ErrContractCall, err.Error()) + } + return gasLimit.Uint64(), nil + } else if cctx.InboundTxParams.CoinType == common.CoinType_ERC20 { + // get the gas limit of the associated asset + fc, found := k.fungibleKeeper.GetForeignCoinFromAsset(ctx, cctx.InboundTxParams.Asset, cctx.InboundTxParams.SenderChainId) + if !found { + return 0, types.ErrForeignCoinNotFound + } + gasLimit, err := k.fungibleKeeper.QueryGasLimit(ctx, ethcommon.HexToAddress(fc.Zrc20ContractAddress)) + if err != nil { + return 0, errors.Wrap(fungibletypes.ErrContractCall, err.Error()) + } + return gasLimit.Uint64(), nil + } + + return 0, nil +} diff --git a/x/crosschain/keeper/cctx_utils_test.go b/x/crosschain/keeper/cctx_utils_test.go index bdeb9eff4d..2d122bce7a 100644 --- a/x/crosschain/keeper/cctx_utils_test.go +++ b/x/crosschain/keeper/cctx_utils_test.go @@ -1,6 +1,7 @@ package keeper_test import ( + "math/big" "testing" "cosmossdk.io/math" @@ -138,3 +139,142 @@ func TestKeeper_RefundAmountOnZetaChain(t *testing.T) { require.ErrorContains(t, err, "zrc not found") }) } + +func TestGetRevertGasLimit(t *testing.T) { + t.Run("should return 0 if no inbound tx params", func(t *testing.T) { + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + + gasLimit, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{}) + require.NoError(t, err) + require.Equal(t, uint64(0), gasLimit) + }) + + t.Run("should return 0 if coin type is not gas or erc20", func(t *testing.T) { + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + + gasLimit, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{ + InboundTxParams: &types.InboundTxParams{ + CoinType: common.CoinType_Zeta, + }}) + require.NoError(t, err) + require.Equal(t, uint64(0), gasLimit) + }) + + t.Run("should return the gas limit of the gas token", func(t *testing.T) { + k, ctx, sdkk, zk := keepertest.CrosschainKeeper(t) + k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) + + chainID := getValidEthChainID(t) + deploySystemContracts(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper) + gas := setupGasCoin(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper, chainID, "foo", "FOO") + + _, err := zk.FungibleKeeper.UpdateZRC20GasLimit(ctx, gas, big.NewInt(42)) + require.NoError(t, err) + + gasLimit, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{ + InboundTxParams: &types.InboundTxParams{ + CoinType: common.CoinType_Gas, + SenderChainId: chainID, + }}) + require.NoError(t, err) + require.Equal(t, uint64(42), gasLimit) + }) + + t.Run("should return the gas limit of the associated asset", func(t *testing.T) { + k, ctx, sdkk, zk := keepertest.CrosschainKeeper(t) + k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) + + chainID := getValidEthChainID(t) + deploySystemContracts(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper) + asset := sample.EthAddress().String() + zrc20Addr := deployZRC20( + t, + ctx, + zk.FungibleKeeper, + sdkk.EvmKeeper, + chainID, + "bar", + asset, + "bar", + ) + + _, err := zk.FungibleKeeper.UpdateZRC20GasLimit(ctx, zrc20Addr, big.NewInt(42)) + require.NoError(t, err) + + gasLimit, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{ + InboundTxParams: &types.InboundTxParams{ + CoinType: common.CoinType_ERC20, + SenderChainId: chainID, + Asset: asset, + }}) + require.NoError(t, err) + require.Equal(t, uint64(42), gasLimit) + }) + + t.Run("should fail if no gas coin found", func(t *testing.T) { + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + + _, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{ + InboundTxParams: &types.InboundTxParams{ + CoinType: common.CoinType_Gas, + SenderChainId: 999999, + }}) + require.ErrorIs(t, err, types.ErrForeignCoinNotFound) + }) + + t.Run("should fail if query gas limit for gas coin fails", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) + + chainID := getValidEthChainID(t) + + zk.FungibleKeeper.SetForeignCoins(ctx, fungibletypes.ForeignCoins{ + Zrc20ContractAddress: sample.EthAddress().String(), + ForeignChainId: chainID, + CoinType: common.CoinType_Gas, + }) + + // no contract deployed therefore will fail + _, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{ + InboundTxParams: &types.InboundTxParams{ + CoinType: common.CoinType_Gas, + SenderChainId: chainID, + }}) + require.ErrorIs(t, err, fungibletypes.ErrContractCall) + }) + + t.Run("should fail if no asset found", func(t *testing.T) { + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + + _, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{ + InboundTxParams: &types.InboundTxParams{ + CoinType: common.CoinType_ERC20, + SenderChainId: 999999, + }}) + require.ErrorIs(t, err, types.ErrForeignCoinNotFound) + }) + + t.Run("should fail if query gas limit for asset fails", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) + + chainID := getValidEthChainID(t) + asset := sample.EthAddress().String() + + zk.FungibleKeeper.SetForeignCoins(ctx, fungibletypes.ForeignCoins{ + Zrc20ContractAddress: sample.EthAddress().String(), + ForeignChainId: chainID, + CoinType: common.CoinType_ERC20, + Asset: asset, + }) + + // no contract deployed therefore will fail + _, err := k.GetRevertGasLimit(ctx, types.CrossChainTx{ + InboundTxParams: &types.InboundTxParams{ + CoinType: common.CoinType_ERC20, + SenderChainId: chainID, + Asset: asset, + }}) + require.ErrorIs(t, err, fungibletypes.ErrContractCall) + }) +} 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 ac82cd022f..8e36f2983b 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 @@ -143,16 +143,26 @@ func (k msgServer) VoteOnObservedInboundTx(goCtx context.Context, msg *types.Msg cctx.CctxStatus.ChangeStatus(types.CctxStatus_Aborted, "invalid sender chain") return &types.MsgVoteOnObservedInboundTxResponse{}, nil } + + gasLimit, err := k.GetRevertGasLimit(ctx, cctx) + if err != nil { + cctx.CctxStatus.ChangeStatus(types.CctxStatus_Aborted, "can't get revert tx gas limit"+err.Error()) + return &types.MsgVoteOnObservedInboundTxResponse{}, nil + } + if gasLimit == 0 { + // use same gas limit of outbound as a fallback -- should not happen + gasLimit = msg.GasLimit + } + // create new OutboundTxParams for the revert - cctx.OutboundTxParams = append(cctx.OutboundTxParams, &types.OutboundTxParams{ - Receiver: cctx.InboundTxParams.Sender, - ReceiverChainId: cctx.InboundTxParams.SenderChainId, - Amount: cctx.InboundTxParams.Amount, - CoinType: cctx.InboundTxParams.CoinType, - // use same gas limit as outbound - //TODO: determine a specific revert gas limit https://github.com/zeta-chain/node/issues/1065 - OutboundTxGasLimit: msg.GasLimit, - }) + revertTxParams := &types.OutboundTxParams{ + Receiver: cctx.InboundTxParams.Sender, + ReceiverChainId: cctx.InboundTxParams.SenderChainId, + Amount: cctx.InboundTxParams.Amount, + CoinType: cctx.InboundTxParams.CoinType, + OutboundTxGasLimit: gasLimit, + } + cctx.OutboundTxParams = append(cctx.OutboundTxParams, revertTxParams) // we create a new cached context, and we don't commit the previous one with EVM deposit tmpCtx, commit := ctx.CacheContext() diff --git a/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go b/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go index 3a07546157..31cf4bfcb1 100644 --- a/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go +++ b/x/crosschain/keeper/keeper_cross_chain_tx_vote_outbound_tx.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "errors" "fmt" "math/big" @@ -160,17 +161,27 @@ func (k msgServer) VoteOnObservedOutboundTx(goCtx context.Context, msg *types.Ms } else { switch oldStatus { case types.CctxStatus_PendingOutbound: + + gasLimit, err := k.GetRevertGasLimit(ctx, cctx) + if err != nil { + return errors.New("can't get revert tx gas limit" + err.Error()) + } + if gasLimit == 0 { + // use same gas limit of outbound as a fallback -- should not happen + gasLimit = cctx.OutboundTxParams[0].OutboundTxGasLimit + } + // create new OutboundTxParams for the revert - cctx.OutboundTxParams = append(cctx.OutboundTxParams, &types.OutboundTxParams{ - Receiver: cctx.InboundTxParams.Sender, - ReceiverChainId: cctx.InboundTxParams.SenderChainId, - Amount: cctx.InboundTxParams.Amount, - CoinType: cctx.InboundTxParams.CoinType, - // NOTE(pwu): revert gas limit = initial outbound gas limit set by user - //TODO: determine a specific revert gas limit https://github.com/zeta-chain/node/issues/1065 - OutboundTxGasLimit: cctx.OutboundTxParams[0].OutboundTxGasLimit, - }) - err := k.PayGasAndUpdateCctx( + revertTxParams := &types.OutboundTxParams{ + Receiver: cctx.InboundTxParams.Sender, + ReceiverChainId: cctx.InboundTxParams.SenderChainId, + Amount: cctx.InboundTxParams.Amount, + CoinType: cctx.InboundTxParams.CoinType, + OutboundTxGasLimit: gasLimit, + } + cctx.OutboundTxParams = append(cctx.OutboundTxParams, revertTxParams) + + err = k.PayGasAndUpdateCctx( tmpCtx, cctx.InboundTxParams.SenderChainId, &cctx, diff --git a/x/crosschain/types/expected_keepers.go b/x/crosschain/types/expected_keepers.go index 5b83869099..8330c4c66d 100644 --- a/x/crosschain/types/expected_keepers.go +++ b/x/crosschain/types/expected_keepers.go @@ -75,6 +75,7 @@ type FungibleKeeper interface { SetForeignCoins(ctx sdk.Context, foreignCoins fungibletypes.ForeignCoins) GetAllForeignCoinsForChain(ctx sdk.Context, foreignChainID int64) (list []fungibletypes.ForeignCoins) GetForeignCoinFromAsset(ctx sdk.Context, asset string, chainID int64) (fungibletypes.ForeignCoins, bool) + GetGasCoinForForeignCoin(ctx sdk.Context, chainID int64) (fungibletypes.ForeignCoins, bool) GetSystemContract(ctx sdk.Context) (val fungibletypes.SystemContract, found bool) QuerySystemContractGasCoinZRC20(ctx sdk.Context, chainID *big.Int) (eth.Address, error) GetUniswapV2Router02Address(ctx sdk.Context) (eth.Address, error) From 036b13277086378fe2927e7808fba6e96e87cf0c Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Thu, 19 Oct 2023 14:06:20 -0700 Subject: [PATCH 05/26] feat(`zetaclient`): use `ValidateBasic` before broadcasting messages (#1239) * add message validation * remvove long lines --- zetaclient/tx.go | 76 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 14 deletions(-) diff --git a/zetaclient/tx.go b/zetaclient/tx.go index 872062b6ce..5d478317c8 100644 --- a/zetaclient/tx.go +++ b/zetaclient/tx.go @@ -8,12 +8,12 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/zeta-chain/zetacore/zetaclient/config" - "gitlab.com/thorchain/tss/go-tss/blame" "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" + "gitlab.com/thorchain/tss/go-tss/blame" ) const ( @@ -36,17 +36,27 @@ func GetInBoundVoteMessage(sender string, senderChain int64, txOrigin string, re return msg } -func (b *ZetaCoreBridge) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, AuthZSigner) { +func (b *ZetaCoreBridge) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, AuthZSigner, error) { msgURL := sdk.MsgTypeURL(msg) + + // verify message validity + if err := msg.ValidateBasic(); err != nil { + return nil, AuthZSigner{}, fmt.Errorf("%s invalid msg | %s", msgURL, err.Error()) + } + authzSigner := GetSigner(msgURL) authzMessage := authz.NewMsgExec(authzSigner.GranteeAddress, []sdk.Msg{msg}) - return &authzMessage, authzSigner + return &authzMessage, authzSigner, nil } func (b *ZetaCoreBridge) PostGasPrice(chain common.Chain, gasPrice uint64, supply string, blockNum uint64) (string, error) { signerAddress := b.keys.GetOperatorAddress().String() msg := types.NewMsgGasPriceVoter(signerAddress, chain.ChainId, gasPrice, supply, blockNum) - authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) + + authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) + if err != nil { + return "", err + } for i := 0; i < DefaultRetryCount; i++ { zetaTxHash, err := b.Broadcast(PostGasPriceGasLimit, authzMsg, authzSigner) @@ -60,10 +70,22 @@ func (b *ZetaCoreBridge) PostGasPrice(chain common.Chain, gasPrice uint64, suppl return "", fmt.Errorf("post gasprice failed after %d retries", DefaultRetryInterval) } -func (b *ZetaCoreBridge) AddTxHashToOutTxTracker(chainID int64, nonce uint64, txHash string, proof *common.Proof, blockHash string, txIndex int64) (string, error) { +func (b *ZetaCoreBridge) AddTxHashToOutTxTracker( + chainID int64, + nonce uint64, + txHash string, + proof *common.Proof, + blockHash string, + txIndex int64, +) (string, error) { signerAddress := b.keys.GetOperatorAddress().String() msg := types.NewMsgAddToOutTxTracker(signerAddress, chainID, nonce, txHash, proof, blockHash, txIndex) - authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) + + authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) + if err != nil { + return "", err + } + zetaTxHash, err := b.Broadcast(AddTxHashToOutTxTrackerGasLimit, authzMsg, authzSigner) if err != nil { return "", err @@ -72,7 +94,11 @@ func (b *ZetaCoreBridge) AddTxHashToOutTxTracker(chainID int64, nonce uint64, tx } func (b *ZetaCoreBridge) PostSend(zetaGasLimit uint64, msg *types.MsgVoteOnObservedInboundTx) (string, error) { - authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) + authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) + if err != nil { + return "", err + } + for i := 0; i < DefaultRetryCount; i++ { zetaTxHash, err := b.Broadcast(zetaGasLimit, authzMsg, authzSigner) if err == nil { @@ -99,7 +125,11 @@ func (b *ZetaCoreBridge) PostReceiveConfirmation( ) (string, error) { lastReport, found := b.lastOutTxReportTime[outTxHash] if found && time.Since(lastReport) < 10*time.Minute { - return "", fmt.Errorf("PostReceiveConfirmation: outTxHash %s already reported in last 10min; last report %s", outTxHash, lastReport) + return "", fmt.Errorf( + "PostReceiveConfirmation: outTxHash %s already reported in last 10min; last report %s", + outTxHash, + lastReport, + ) } signerAddress := b.keys.GetOperatorAddress().String() @@ -117,7 +147,12 @@ func (b *ZetaCoreBridge) PostReceiveConfirmation( nonce, coinType, ) - authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) + + authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) + if err != nil { + return "", err + } + // FIXME: remove this gas limit stuff; in the special ante handler with no gas limit, add // NewMsgReceiveConfirmation to it. var gasLimit uint64 = PostReceiveConfirmationGasLimit @@ -139,9 +174,12 @@ func (b *ZetaCoreBridge) PostReceiveConfirmation( func (b *ZetaCoreBridge) SetTSS(tssPubkey string, keyGenZetaHeight int64, status common.ReceiveStatus) (string, error) { signerAddress := b.keys.GetOperatorAddress().String() msg := types.NewMsgCreateTSSVoter(signerAddress, tssPubkey, keyGenZetaHeight, status) - authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) - var err error + authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) + if err != nil { + return "", err + } + zetaTxHash := "" for i := 0; i <= DefaultRetryCount; i++ { zetaTxHash, err = b.Broadcast(DefaultGasLimit, authzMsg, authzSigner) @@ -181,7 +219,12 @@ func (b *ZetaCoreBridge) PostBlameData(blame *blame.Blame, chainID int64, index Nodes: observerTypes.ConvertNodes(blame.BlameNodes), } msg := observerTypes.NewMsgAddBlameVoteMsg(signerAddress, chainID, zetaBlame) - authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) + + authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) + if err != nil { + return "", err + } + var gasLimit uint64 = PostBlameDataGasLimit for i := 0; i < DefaultRetryCount; i++ { @@ -197,8 +240,13 @@ func (b *ZetaCoreBridge) PostBlameData(blame *blame.Blame, chainID int64, index func (b *ZetaCoreBridge) PostAddBlockHeader(chainID int64, blockHash []byte, height int64, header common.HeaderData) (string, error) { signerAddress := b.keys.GetOperatorAddress().String() + msg := observerTypes.NewMsgAddBlockHeader(signerAddress, chainID, blockHash, height, header) - authzMsg, authzSigner := b.WrapMessageWithAuthz(msg) + + authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) + if err != nil { + return "", err + } var gasLimit uint64 = DefaultGasLimit for i := 0; i < DefaultRetryCount; i++ { From 7437b356f4761b5d1f68610c1e5cbb3ce2da9daf Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Fri, 20 Oct 2023 14:38:45 -0700 Subject: [PATCH 06/26] feat(`crosschain`): add gas price increase limit (#1322) * add gas price limit * add get gas price method * fix tests * add gas price limit * complete tests * fix err * use default max if not defined --- docs/openapi/openapi.swagger.yaml | 6 + proto/observer/crosschain_flags.proto | 4 + x/crosschain/keeper/abci.go | 39 ++--- x/crosschain/keeper/abci_test.go | 139 +++++++++++++----- x/crosschain/keeper/gas_payment_test.go | 2 +- x/crosschain/types/cctx_utils.go | 19 ++- x/crosschain/types/cctx_utils_test.go | 15 ++ .../types/messages_migrate_tss_funds_test.go | 4 +- x/observer/types/crosschain_flags.go | 4 + x/observer/types/crosschain_flags.pb.go | 98 ++++++++---- 10 files changed, 242 insertions(+), 88 deletions(-) diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index c53284398a..5bc7f67767 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -51169,6 +51169,12 @@ definitions: gasPriceIncreasePercent: type: integer format: int64 + gasPriceIncreaseMax: + type: integer + format: int64 + title: |- + Maximum gas price increase in percent of the median gas price + Default is used if 0 observerKeygen: type: object properties: diff --git a/proto/observer/crosschain_flags.proto b/proto/observer/crosschain_flags.proto index 32e7ae8669..5eebbd865d 100644 --- a/proto/observer/crosschain_flags.proto +++ b/proto/observer/crosschain_flags.proto @@ -13,6 +13,10 @@ message GasPriceIncreaseFlags { (gogoproto.stdduration) = true ]; uint32 gasPriceIncreasePercent = 3; + + // Maximum gas price increase in percent of the median gas price + // Default is used if 0 + uint32 gasPriceIncreaseMax = 4; } message BlockHeaderVerificationFlags { bool isEthTypeChainEnabled = 1; diff --git a/x/crosschain/keeper/abci.go b/x/crosschain/keeper/abci.go index 6ad3b8cd6d..6621c45d36 100644 --- a/x/crosschain/keeper/abci.go +++ b/x/crosschain/keeper/abci.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "strconv" "time" cosmoserrors "cosmossdk.io/errors" @@ -57,7 +56,7 @@ func (k Keeper) IterateAndUpdateCctxGasPrice(ctx sdk.Context) error { } // CheckAndUpdateCctxGasPrice checks if the retry interval is reached and updates the gas price if so -// The function returns the gas price increase and the additional fees paid +// The function returns the gas price increase and the additional fees paid from the gas stability pool func (k Keeper) CheckAndUpdateCctxGasPrice( ctx sdk.Context, cctx types.CrossChainTx, @@ -85,6 +84,23 @@ func (k Keeper) CheckAndUpdateCctxGasPrice( } gasPriceIncrease := medianGasPrice.MulUint64(uint64(flags.GasPriceIncreasePercent)).QuoUint64(100) + // compute new gas price + currentGasPrice, err := cctx.GetCurrentOutTxParam().GetGasPrice() + if err != nil { + return math.ZeroUint(), math.ZeroUint(), err + } + newGasPrice := math.NewUint(currentGasPrice).Add(gasPriceIncrease) + + // check limit -- use default limit if not set + gasPriceIncreaseMax := flags.GasPriceIncreaseMax + if gasPriceIncreaseMax == 0 { + gasPriceIncreaseMax = observertypes.DefaultGasPriceIncreaseFlags.GasPriceIncreaseMax + } + limit := medianGasPrice.MulUint64(uint64(gasPriceIncreaseMax)).QuoUint64(100) + if newGasPrice.GT(limit) { + return math.ZeroUint(), math.ZeroUint(), nil + } + // withdraw additional fees from the gas stability pool gasLimit := math.NewUint(cctx.GetCurrentOutTxParam().OutboundTxGasLimit) additionalFees := gasLimit.Mul(gasPriceIncrease) @@ -95,23 +111,10 @@ func (k Keeper) CheckAndUpdateCctxGasPrice( ) } - // Increase the cctx value - err := k.IncreaseCctxGasPrice(ctx, cctx, gasPriceIncrease) - - return gasPriceIncrease, additionalFees, err -} - -// IncreaseCctxGasPrice increases the gas price associated with a CCTX and updates it in the store -func (k Keeper) IncreaseCctxGasPrice(ctx sdk.Context, cctx types.CrossChainTx, gasPriceIncrease math.Uint) error { - currentGasPrice, err := strconv.ParseUint(cctx.GetCurrentOutTxParam().OutboundTxGasPrice, 10, 64) - if err != nil { - return fmt.Errorf("unable to parse cctx gas price %s: %s", cctx.GetCurrentOutTxParam().OutboundTxGasPrice, err.Error()) - } - - // increase gas price and set last update timestamp - cctx.GetCurrentOutTxParam().OutboundTxGasPrice = math.NewUint(currentGasPrice).Add(gasPriceIncrease).String() + // set new gas price and last update timestamp + cctx.GetCurrentOutTxParam().OutboundTxGasPrice = newGasPrice.String() cctx.CctxStatus.LastUpdateTimestamp = ctx.BlockHeader().Time.Unix() k.SetCrossChainTx(ctx, cctx) - return nil + return gasPriceIncrease, additionalFees, nil } diff --git a/x/crosschain/keeper/abci_test.go b/x/crosschain/keeper/abci_test.go index 383d77e6fb..12263a3587 100644 --- a/x/crosschain/keeper/abci_test.go +++ b/x/crosschain/keeper/abci_test.go @@ -8,7 +8,6 @@ import ( "cosmossdk.io/math" "github.com/stretchr/testify/require" testkeeper "github.com/zeta-chain/zetacore/testutil/keeper" - "github.com/zeta-chain/zetacore/testutil/sample" "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) @@ -21,6 +20,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { tt := []struct { name string cctx types.CrossChainTx + flags observertypes.GasPriceIncreaseFlags blockTimestamp time.Time medianGasPrice uint64 withdrawFromGasStabilityPoolReturn error @@ -44,6 +44,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { }, }, }, + flags: observertypes.DefaultGasPriceIncreaseFlags, blockTimestamp: retryIntervalReached, medianGasPrice: 50, withdrawFromGasStabilityPoolReturn: nil, @@ -51,6 +52,89 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { expectedGasPriceIncrease: math.NewUint(50), // 100% medianGasPrice expectedAdditionalFees: math.NewUint(50000), // gasLimit * increase }, + { + name: "can update gas price at max limit", + cctx: types.CrossChainTx{ + Index: "a2", + CctxStatus: &types.Status{ + LastUpdateTimestamp: sampleTimestamp.Unix(), + }, + OutboundTxParams: []*types.OutboundTxParams{ + { + ReceiverChainId: 42, + OutboundTxGasLimit: 1000, + OutboundTxGasPrice: "100", + }, + }, + }, + flags: observertypes.GasPriceIncreaseFlags{ + EpochLength: 100, + RetryInterval: time.Minute * 10, + GasPriceIncreasePercent: 200, // Increase gas price to 100+50*2 = 200 + GasPriceIncreaseMax: 400, // Max gas price is 50*4 = 200 + }, + blockTimestamp: retryIntervalReached, + medianGasPrice: 50, + withdrawFromGasStabilityPoolReturn: nil, + expectWithdrawFromGasStabilityPoolCall: true, + expectedGasPriceIncrease: math.NewUint(100), // 200% medianGasPrice + expectedAdditionalFees: math.NewUint(100000), // gasLimit * increase + }, + { + name: "default gas price increase limit used if not defined", + cctx: types.CrossChainTx{ + Index: "a3", + CctxStatus: &types.Status{ + LastUpdateTimestamp: sampleTimestamp.Unix(), + }, + OutboundTxParams: []*types.OutboundTxParams{ + { + ReceiverChainId: 42, + OutboundTxGasLimit: 1000, + OutboundTxGasPrice: "100", + }, + }, + }, + flags: observertypes.GasPriceIncreaseFlags{ + EpochLength: 100, + RetryInterval: time.Minute * 10, + GasPriceIncreasePercent: 100, + GasPriceIncreaseMax: 0, // Limit should not be reached + }, + blockTimestamp: retryIntervalReached, + medianGasPrice: 50, + withdrawFromGasStabilityPoolReturn: nil, + expectWithdrawFromGasStabilityPoolCall: true, + expectedGasPriceIncrease: math.NewUint(50), // 100% medianGasPrice + expectedAdditionalFees: math.NewUint(50000), // gasLimit * increase + }, + { + name: "skip if max limit reached", + cctx: types.CrossChainTx{ + Index: "b0", + CctxStatus: &types.Status{ + LastUpdateTimestamp: sampleTimestamp.Unix(), + }, + OutboundTxParams: []*types.OutboundTxParams{ + { + ReceiverChainId: 42, + OutboundTxGasLimit: 1000, + OutboundTxGasPrice: "100", + }, + }, + }, + flags: observertypes.GasPriceIncreaseFlags{ + EpochLength: 100, + RetryInterval: time.Minute * 10, + GasPriceIncreasePercent: 200, // Increase gas price to 100+50*2 = 200 + GasPriceIncreaseMax: 300, // Max gas price is 50*3 = 150 + }, + blockTimestamp: retryIntervalReached, + medianGasPrice: 50, + expectWithdrawFromGasStabilityPoolCall: false, + expectedGasPriceIncrease: math.NewUint(0), + expectedAdditionalFees: math.NewUint(0), + }, { name: "skip if gas price is not set", cctx: types.CrossChainTx{ @@ -66,6 +150,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { }, }, }, + flags: observertypes.DefaultGasPriceIncreaseFlags, blockTimestamp: retryIntervalReached, medianGasPrice: 100, expectWithdrawFromGasStabilityPoolCall: false, @@ -87,6 +172,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { }, }, }, + flags: observertypes.DefaultGasPriceIncreaseFlags, blockTimestamp: retryIntervalReached, medianGasPrice: 100, expectWithdrawFromGasStabilityPoolCall: false, @@ -108,6 +194,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { }, }, }, + flags: observertypes.DefaultGasPriceIncreaseFlags, blockTimestamp: retryIntervalNotReached, medianGasPrice: 100, expectWithdrawFromGasStabilityPoolCall: false, @@ -129,6 +216,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { }, }, }, + flags: observertypes.DefaultGasPriceIncreaseFlags, expectWithdrawFromGasStabilityPoolCall: false, blockTimestamp: retryIntervalReached, medianGasPrice: 0, @@ -149,6 +237,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { }, }, }, + flags: observertypes.DefaultGasPriceIncreaseFlags, blockTimestamp: retryIntervalReached, medianGasPrice: 50, expectWithdrawFromGasStabilityPoolCall: true, @@ -164,6 +253,10 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { k, ctx := testkeeper.CrosschainKeeperAllMocks(t) fungibleMock := testkeeper.GetCrosschainFungibleMock(t, k) chainID := tc.cctx.GetCurrentOutTxParam().ReceiverChainId + previousGasPrice, err := tc.cctx.GetCurrentOutTxParam().GetGasPrice() + if err != nil { + previousGasPrice = 0 + } // set median gas price if not zero if tc.medianGasPrice != 0 { @@ -189,7 +282,7 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { } // check and update gas price - gasPriceIncrease, feesPaid, err := k.CheckAndUpdateCctxGasPrice(ctx, tc.cctx, observertypes.DefaultGasPriceIncreaseFlags) + gasPriceIncrease, feesPaid, err := k.CheckAndUpdateCctxGasPrice(ctx, tc.cctx, tc.flags) if tc.isError { require.Error(t, err) @@ -200,38 +293,16 @@ func TestKeeper_CheckAndUpdateCctxGasPrice(t *testing.T) { // check values require.True(t, gasPriceIncrease.Equal(tc.expectedGasPriceIncrease), "expected %s, got %s", tc.expectedGasPriceIncrease.String(), gasPriceIncrease.String()) require.True(t, feesPaid.Equal(tc.expectedAdditionalFees), "expected %s, got %s", tc.expectedAdditionalFees.String(), feesPaid.String()) + + // check cctx + if !tc.expectedGasPriceIncrease.IsZero() { + cctx, found := k.GetCrossChainTx(ctx, tc.cctx.Index) + require.True(t, found) + newGasPrice, err := cctx.GetCurrentOutTxParam().GetGasPrice() + require.NoError(t, err) + require.EqualValues(t, tc.expectedGasPriceIncrease.AddUint64(previousGasPrice).Uint64(), newGasPrice, "%d - %d", tc.expectedGasPriceIncrease.Uint64(), previousGasPrice) + require.EqualValues(t, tc.blockTimestamp.Unix(), cctx.CctxStatus.LastUpdateTimestamp) + } }) } } - -func TestKeeper_IncreaseCctxGasPrice(t *testing.T) { - k, ctx, _, _ := testkeeper.CrosschainKeeper(t) - - t.Run("can increase gas", func(t *testing.T) { - // sample cctx - cctx := *sample.CrossChainTx(t, "foo") - previousGasPrice, ok := math.NewIntFromString(cctx.GetCurrentOutTxParam().OutboundTxGasPrice) - require.True(t, ok) - - // increase gas price - err := k.IncreaseCctxGasPrice(ctx, cctx, math.NewUint(42)) - require.NoError(t, err) - - // can retrieve cctx - cctx, found := k.GetCrossChainTx(ctx, "foo") - require.True(t, found) - - // gas price increased - currentGasPrice, ok := math.NewIntFromString(cctx.GetCurrentOutTxParam().OutboundTxGasPrice) - require.True(t, ok) - require.True(t, currentGasPrice.Equal(previousGasPrice.Add(math.NewInt(42)))) - }) - - t.Run("fail if invalid cctx", func(t *testing.T) { - cctx := *sample.CrossChainTx(t, "foo") - cctx.GetCurrentOutTxParam().OutboundTxGasPrice = "invalid" - err := k.IncreaseCctxGasPrice(ctx, cctx, math.NewUint(42)) - require.Error(t, err) - }) - -} diff --git a/x/crosschain/keeper/gas_payment_test.go b/x/crosschain/keeper/gas_payment_test.go index 014cc3278d..9f771ba542 100644 --- a/x/crosschain/keeper/gas_payment_test.go +++ b/x/crosschain/keeper/gas_payment_test.go @@ -261,7 +261,7 @@ func TestKeeper_PayGasNativeAndUpdateCctx(t *testing.T) { // if the input amount of the cctx is 1e16, the output amount must be 1e16-43000=9999999999957000 err = k.PayGasNativeAndUpdateCctx(ctx, chainID, &cctx, math.NewUint(inputAmount)) require.NoError(t, err) - require.Equal(t, uint64(9999999999957000), cctx.GetCurrentOutTxParam().Amount.Uint64()) + require.Equal(t, uint64(9999999999957000), cctx.GetCurrentOutTxParam().Amount.Uint64()) require.Equal(t, uint64(21_000), cctx.GetCurrentOutTxParam().OutboundTxGasLimit) require.Equal(t, "2", cctx.GetCurrentOutTxParam().OutboundTxGasPrice) }) diff --git a/x/crosschain/types/cctx_utils.go b/x/crosschain/types/cctx_utils.go index d6807b63b1..d15fe58970 100644 --- a/x/crosschain/types/cctx_utils.go +++ b/x/crosschain/types/cctx_utils.go @@ -1,8 +1,11 @@ package types import ( + "fmt" + "strconv" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/zeta-chain/zetacore/x/observer/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) // GetCurrentOutTxParam returns the current outbound tx params. @@ -41,7 +44,17 @@ func GetAllAuthzZetaclientTxTypes() []string { sdk.MsgTypeURL(&MsgCreateTSSVoter{}), sdk.MsgTypeURL(&MsgAddToOutTxTracker{}), sdk.MsgTypeURL(&MsgSetNodeKeys{}), - sdk.MsgTypeURL(&types.MsgAddBlameVote{}), - sdk.MsgTypeURL(&types.MsgAddBlockHeader{}), + sdk.MsgTypeURL(&observertypes.MsgAddBlameVote{}), + sdk.MsgTypeURL(&observertypes.MsgAddBlockHeader{}), } } + +// GetGasPrice returns the gas price of the outbound tx +func (m OutboundTxParams) GetGasPrice() (uint64, error) { + gasPrice, err := strconv.ParseUint(m.OutboundTxGasPrice, 10, 64) + if err != nil { + return 0, fmt.Errorf("unable to parse cctx gas price %s: %s", m.OutboundTxGasPrice, err.Error()) + } + + return gasPrice, nil +} diff --git a/x/crosschain/types/cctx_utils_test.go b/x/crosschain/types/cctx_utils_test.go index 4fec09f3b6..381ef47f6c 100644 --- a/x/crosschain/types/cctx_utils_test.go +++ b/x/crosschain/types/cctx_utils_test.go @@ -50,3 +50,18 @@ func TestCrossChainTx_OriginalDestinationChainID(t *testing.T) { cctx.OutboundTxParams = []*types.OutboundTxParams{sample.OutboundTxParams(r), sample.OutboundTxParams(r)} require.Equal(t, cctx.OutboundTxParams[0].ReceiverChainId, cctx.OriginalDestinationChainID()) } + +func TestOutboundTxParams_GetGasPrice(t *testing.T) { + // #nosec G404 - random seed is not used for security purposes + r := rand.New(rand.NewSource(42)) + outTxParams := sample.OutboundTxParams(r) + + outTxParams.OutboundTxGasPrice = "42" + gasPrice, err := outTxParams.GetGasPrice() + require.NoError(t, err) + require.EqualValues(t, uint64(42), gasPrice) + + outTxParams.OutboundTxGasPrice = "invalid" + _, err = outTxParams.GetGasPrice() + require.Error(t, err) +} diff --git a/x/crosschain/types/messages_migrate_tss_funds_test.go b/x/crosschain/types/messages_migrate_tss_funds_test.go index bde8ebf02d..6823553e29 100644 --- a/x/crosschain/types/messages_migrate_tss_funds_test.go +++ b/x/crosschain/types/messages_migrate_tss_funds_test.go @@ -20,7 +20,7 @@ func TestNewMsgMigrateTssFunds(t *testing.T) { name: "invalid creator", msg: types.MsgMigrateTssFunds{ Creator: "invalid_address", - ChainId: common.GoerliChain().ChainId, + ChainId: common.DefaultChainsList()[0].ChainId, Amount: sdkmath.NewUintFromString("100000"), }, error: true, @@ -38,7 +38,7 @@ func TestNewMsgMigrateTssFunds(t *testing.T) { name: "valid msg", msg: types.MsgMigrateTssFunds{ Creator: "zeta15ruj2tc76pnj9xtw64utktee7cc7w6vzaes73z", - ChainId: common.GoerliChain().ChainId, + ChainId: common.DefaultChainsList()[0].ChainId, Amount: sdkmath.NewUintFromString("100000"), }, error: false, diff --git a/x/observer/types/crosschain_flags.go b/x/observer/types/crosschain_flags.go index 696bc94ff6..4dccfbc8c4 100644 --- a/x/observer/types/crosschain_flags.go +++ b/x/observer/types/crosschain_flags.go @@ -12,6 +12,10 @@ var DefaultGasPriceIncreaseFlags = GasPriceIncreaseFlags{ // GasPriceIncreasePercent is the percentage of median gas price by which to increase the gas price during an increment // 100 means the gas price is increased by the median gas price GasPriceIncreasePercent: 100, + + // Maximum gas price increase in percent of the median gas price + // 500 means the gas price can be increased by 5 times the median gas price at most + GasPriceIncreaseMax: 500, } // DefaultCrosschainFlags returns the default crosschain flags used when not defined diff --git a/x/observer/types/crosschain_flags.pb.go b/x/observer/types/crosschain_flags.pb.go index d50542a509..a09b683689 100644 --- a/x/observer/types/crosschain_flags.pb.go +++ b/x/observer/types/crosschain_flags.pb.go @@ -32,6 +32,9 @@ type GasPriceIncreaseFlags struct { EpochLength int64 `protobuf:"varint,1,opt,name=epochLength,proto3" json:"epochLength,omitempty"` RetryInterval time.Duration `protobuf:"bytes,2,opt,name=retryInterval,proto3,stdduration" json:"retryInterval"` GasPriceIncreasePercent uint32 `protobuf:"varint,3,opt,name=gasPriceIncreasePercent,proto3" json:"gasPriceIncreasePercent,omitempty"` + // Maximum gas price increase in percent of the median gas price + // Default is used if 0 + GasPriceIncreaseMax uint32 `protobuf:"varint,4,opt,name=gasPriceIncreaseMax,proto3" json:"gasPriceIncreaseMax,omitempty"` } func (m *GasPriceIncreaseFlags) Reset() { *m = GasPriceIncreaseFlags{} } @@ -88,6 +91,13 @@ func (m *GasPriceIncreaseFlags) GetGasPriceIncreasePercent() uint32 { return 0 } +func (m *GasPriceIncreaseFlags) GetGasPriceIncreaseMax() uint32 { + if m != nil { + return m.GasPriceIncreaseMax + } + 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"` @@ -278,36 +288,37 @@ func init() { func init() { proto.RegisterFile("observer/crosschain_flags.proto", fileDescriptor_b948b59e4d986f49) } var fileDescriptor_b948b59e4d986f49 = []byte{ - // 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, 0x05, 0x73, 0x0a, - 0x86, 0x72, 0xa3, 0xad, 0xe5, 0x29, 0x93, 0xea, 0xd5, 0x22, 0x63, 0xc2, 0x92, 0xa5, 0xd1, 0x4e, - 0x07, 0xb7, 0xde, 0x81, 0x63, 0xbe, 0x4c, 0xfc, 0x4a, 0x1b, 0x20, 0xb5, 0x67, 0xff, 0xba, 0xd0, - 0x42, 0xfb, 0x7d, 0xb4, 0x5c, 0x55, 0x96, 0xfd, 0x50, 0x68, 0x2d, 0x32, 0xa0, 0xfe, 0x29, 0xc9, - 0x17, 0x74, 0x9e, 0x1b, 0xe6, 0xa4, 0x56, 0x95, 0x3e, 0xfe, 0x8c, 0x70, 0xff, 0x09, 0xb3, 0x27, - 0x46, 0x72, 0x88, 0x14, 0x37, 0xc0, 0x2c, 0x3c, 0x2e, 0x91, 0xc1, 0x08, 0xf7, 0x60, 0xa9, 0x79, - 0x7a, 0x0c, 0x4a, 0xb8, 0x74, 0x80, 0x46, 0x68, 0xb2, 0x13, 0xff, 0x59, 0x0a, 0x22, 0xbc, 0x67, - 0xc0, 0x99, 0x22, 0x52, 0x0e, 0xcc, 0x29, 0xcb, 0x06, 0xdd, 0x11, 0x9a, 0xf4, 0xa6, 0x37, 0x49, - 0xc5, 0x24, 0x35, 0x93, 0x3c, 0xfa, 0xcd, 0x9c, 0xed, 0x9e, 0x7d, 0x1f, 0x76, 0x3e, 0xfd, 0x18, - 0xa2, 0x78, 0xd3, 0x19, 0x3c, 0xc0, 0x37, 0xc4, 0x5f, 0x6f, 0x71, 0x02, 0x86, 0x83, 0x72, 0x83, - 0x9d, 0x11, 0x9a, 0xec, 0xc5, 0xff, 0x92, 0xc7, 0x1f, 0x10, 0x3e, 0x98, 0x65, 0x9a, 0xbf, 0x7e, - 0x0a, 0x6c, 0x0e, 0xe6, 0x05, 0x18, 0xb9, 0x90, 0xdc, 0xe3, 0xaa, 0x3e, 0xee, 0xe3, 0xbe, 0xb4, - 0x47, 0x2e, 0x7d, 0x5e, 0x2c, 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, + // 468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x94, 0xc1, 0x6e, 0xd3, 0x30, + 0x18, 0xc7, 0xeb, 0x0e, 0xa1, 0xc9, 0xd5, 0x04, 0x04, 0x2a, 0xca, 0x98, 0xd2, 0xaa, 0xa7, 0x0a, + 0x81, 0x8d, 0x0a, 0x07, 0xb8, 0x76, 0x0c, 0x88, 0x34, 0xc4, 0x14, 0x21, 0x0e, 0x5c, 0x90, 0xe3, + 0x7e, 0x75, 0x2c, 0x82, 0x5d, 0xd9, 0xce, 0xb4, 0x22, 0xf1, 0x02, 0x9c, 0x38, 0xf2, 0x48, 0x3b, + 0xee, 0xc0, 0x01, 0x09, 0x09, 0x50, 0xfb, 0x02, 0x3c, 0x02, 0xaa, 0x43, 0x26, 0xda, 0x86, 0x3c, + 0xc0, 0x6e, 0xce, 0xf7, 0xf7, 0xdf, 0x3f, 0xe7, 0xff, 0x7d, 0x09, 0xee, 0xea, 0xc4, 0x82, 0x39, + 0x06, 0x43, 0xb9, 0xd1, 0xd6, 0xf2, 0x94, 0x49, 0xf5, 0x76, 0x92, 0x31, 0x61, 0xc9, 0xd4, 0x68, + 0xa7, 0x83, 0xdb, 0x1f, 0xc0, 0x31, 0x5f, 0x26, 0x7e, 0xa5, 0x0d, 0x90, 0xd2, 0xb3, 0x7b, 0x43, + 0x68, 0xa1, 0xfd, 0x3e, 0xba, 0x5c, 0x15, 0x96, 0xdd, 0x50, 0x68, 0x2d, 0x32, 0xa0, 0xfe, 0x29, + 0xc9, 0x27, 0x74, 0x9c, 0x1b, 0xe6, 0xa4, 0x56, 0x85, 0xde, 0xff, 0x8d, 0x70, 0xfb, 0x19, 0xb3, + 0x47, 0x46, 0x72, 0x88, 0x14, 0x37, 0xc0, 0x2c, 0x3c, 0x5d, 0x22, 0x83, 0x1e, 0x6e, 0xc1, 0x54, + 0xf3, 0xf4, 0x10, 0x94, 0x70, 0x69, 0x07, 0xf5, 0xd0, 0x60, 0x2b, 0xfe, 0xb7, 0x14, 0x44, 0x78, + 0xc7, 0x80, 0x33, 0xb3, 0x48, 0x39, 0x30, 0xc7, 0x2c, 0xeb, 0x34, 0x7b, 0x68, 0xd0, 0x1a, 0xde, + 0x22, 0x05, 0x93, 0x94, 0x4c, 0xf2, 0xe4, 0x2f, 0x73, 0xb4, 0x7d, 0xfa, 0xa3, 0xdb, 0xf8, 0xf2, + 0xb3, 0x8b, 0xe2, 0x55, 0x67, 0xf0, 0x08, 0xdf, 0x14, 0x6b, 0xb7, 0x38, 0x02, 0xc3, 0x41, 0xb9, + 0xce, 0x56, 0x0f, 0x0d, 0x76, 0xe2, 0xff, 0xc9, 0xc1, 0x7d, 0x7c, 0x7d, 0x5d, 0x7a, 0xc1, 0x4e, + 0x3a, 0x97, 0xbc, 0xab, 0x4a, 0xea, 0x7f, 0x42, 0x78, 0x6f, 0x94, 0x69, 0xfe, 0xee, 0x39, 0xb0, + 0x31, 0x98, 0xd7, 0x60, 0xe4, 0x44, 0x72, 0x7f, 0xc1, 0xe2, 0xcd, 0x1f, 0xe2, 0xb6, 0xb4, 0x07, + 0x2e, 0x7d, 0x35, 0x9b, 0xc2, 0xfe, 0x32, 0xed, 0x03, 0xc5, 0x92, 0x0c, 0xc6, 0x3e, 0x83, 0xed, + 0xb8, 0x5a, 0x2c, 0x5c, 0x23, 0xc7, 0x37, 0x5c, 0xcd, 0xd2, 0x55, 0x21, 0xf6, 0xbf, 0x36, 0xf1, + 0x95, 0xfd, 0xf3, 0x6e, 0x17, 0xfc, 0x3b, 0xf8, 0xaa, 0xb4, 0x91, 0x4a, 0x74, 0xae, 0xc6, 0xab, + 0xe8, 0x8d, 0x7a, 0x70, 0x17, 0x5f, 0x93, 0xf6, 0x65, 0xee, 0x56, 0x36, 0x17, 0xc4, 0x4d, 0x21, + 0x48, 0x71, 0x5b, 0x54, 0x35, 0xdb, 0x87, 0xdc, 0x1a, 0x0e, 0x49, 0xcd, 0x80, 0x91, 0xca, 0x31, + 0x89, 0xab, 0x0f, 0x0c, 0x3e, 0xe2, 0xbd, 0xa4, 0x26, 0x63, 0xdf, 0x9f, 0xd6, 0xf0, 0x71, 0x2d, + 0xb0, 0xae, 0x49, 0x71, 0xed, 0xf1, 0xfd, 0xef, 0x08, 0xb7, 0x0f, 0x41, 0x30, 0x3e, 0xbb, 0x80, + 0xe1, 0x8e, 0xa2, 0xd3, 0x79, 0x88, 0xce, 0xe6, 0x21, 0xfa, 0x35, 0x0f, 0xd1, 0xe7, 0x45, 0xd8, + 0x38, 0x5b, 0x84, 0x8d, 0x6f, 0x8b, 0xb0, 0xf1, 0x86, 0x0a, 0xe9, 0xd2, 0x3c, 0x21, 0x5c, 0xbf, + 0xa7, 0x4b, 0xc8, 0x3d, 0xcf, 0xa3, 0x25, 0x8f, 0x9e, 0xd0, 0xf3, 0x7f, 0x8c, 0x9b, 0x4d, 0xc1, + 0x26, 0x97, 0xfd, 0x47, 0xfa, 0xe0, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdb, 0xb0, 0x8c, 0xc5, + 0x7c, 0x04, 0x00, 0x00, } func (m *GasPriceIncreaseFlags) Marshal() (dAtA []byte, err error) { @@ -330,6 +341,11 @@ func (m *GasPriceIncreaseFlags) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.GasPriceIncreaseMax != 0 { + i = encodeVarintCrosschainFlags(dAtA, i, uint64(m.GasPriceIncreaseMax)) + i-- + dAtA[i] = 0x20 + } if m.GasPriceIncreasePercent != 0 { i = encodeVarintCrosschainFlags(dAtA, i, uint64(m.GasPriceIncreasePercent)) i-- @@ -541,6 +557,9 @@ func (m *GasPriceIncreaseFlags) Size() (n int) { if m.GasPriceIncreasePercent != 0 { n += 1 + sovCrosschainFlags(uint64(m.GasPriceIncreasePercent)) } + if m.GasPriceIncreaseMax != 0 { + n += 1 + sovCrosschainFlags(uint64(m.GasPriceIncreaseMax)) + } return n } @@ -707,6 +726,25 @@ func (m *GasPriceIncreaseFlags) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPriceIncreaseMax", wireType) + } + m.GasPriceIncreaseMax = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCrosschainFlags + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.GasPriceIncreaseMax |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipCrosschainFlags(dAtA[iNdEx:]) From d41cf7f1af4d2cac20bec191b980d69d9d315348 Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Fri, 20 Oct 2023 17:37:25 -0500 Subject: [PATCH 07/26] fix(`zetaclient`): report failed ERC20 transfers from TSS (#1315) * report failed ERC20 transfers from TSS * adjust zetaclient minimum outbound gaslimit to be 100K * Update zetaclient/evm_client.go Co-authored-by: Lucas Bertrand --------- Co-authored-by: Lucas Bertrand --- zetaclient/evm_client.go | 20 ++++++++++++++++++++ zetaclient/evm_signer.go | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/zetaclient/evm_client.go b/zetaclient/evm_client.go index 43ecf196e2..f5cdbe1de4 100644 --- a/zetaclient/evm_client.go +++ b/zetaclient/evm_client.go @@ -497,6 +497,26 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co return true, false, nil } } + } else { + logger.Info().Msgf("Found (failed tx) sendHash %s on chain %s txhash %s", sendHash, ob.chain.String(), receipt.TxHash.Hex()) + zetaTxHash, err := ob.zetaClient.PostReceiveConfirmation( + sendHash, + receipt.TxHash.Hex(), + receipt.BlockNumber.Uint64(), + receipt.GasUsed, + transaction.GasPrice(), + transaction.Gas(), + big.NewInt(0), + common.ReceiveStatus_Failed, + ob.chain, + nonce, + common.CoinType_ERC20, + ) + if err != nil { + logger.Error().Err(err).Msgf("PostReceiveConfirmation error in WatchTxHashWithTimeout; zeta tx hash %s", zetaTxHash) + } + logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaTxHash, sendHash, nonce) + return true, true, nil } } diff --git a/zetaclient/evm_signer.go b/zetaclient/evm_signer.go index 96c6dc728e..925354f27c 100644 --- a/zetaclient/evm_signer.go +++ b/zetaclient/evm_signer.go @@ -320,8 +320,8 @@ func (signer *EVMSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out } gasLimit := send.GetCurrentOutTxParam().OutboundTxGasLimit - if gasLimit < 50_000 { - gasLimit = 50_000 + if gasLimit < 100_000 { + gasLimit = 100_000 logger.Warn().Msgf("gasLimit %d is too low; set to %d", send.GetCurrentOutTxParam().OutboundTxGasLimit, gasLimit) } if gasLimit > 1_000_000 { From a4f297807809c3dae5420ef8f60c815c04300fd3 Mon Sep 17 00:00:00 2001 From: Charlie Chen <34498985+ws4charlie@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:13:20 -0500 Subject: [PATCH 08/26] feat: Bitcoin utxo consolidation (#1326) * initiated utxo consolidation * use real world max outTx size * set consolidation rank to 10 to create a buffer (10) for small UTXOs received from Bitcoin omni-contract call * revert DustOffset to 2000 for mainnet * improved variable names and comments --------- Co-authored-by: charliec --- common/default_chains_mainnet.go | 2 +- zetaclient/bitcoin_client.go | 46 ++++++--- zetaclient/btc_signer.go | 12 +-- zetaclient/btc_signer_test.go | 172 ++++++++++++++++++++++++------- 4 files changed, 176 insertions(+), 56 deletions(-) diff --git a/common/default_chains_mainnet.go b/common/default_chains_mainnet.go index 3b80f2a89e..62b455e571 100644 --- a/common/default_chains_mainnet.go +++ b/common/default_chains_mainnet.go @@ -36,7 +36,7 @@ func BtcChainID() int64 { } func BtcDustOffset() int64 { - return 0 + return 2000 } func PolygonChain() Chain { diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index 4fc07e89bd..fd360a3453 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -815,12 +815,17 @@ func (ob *BitcoinChainClient) findNonceMarkUTXO(nonce uint64, txid string) (int, // // Parameters: // - amount: The desired minimum total value of the selected UTXOs. -// - utxoCap: The maximum number of UTXOs to be selected. +// - utxos2Spend: The maximum number of UTXOs to spend. // - nonce: The nonce of the outbound transaction. +// - consolidateRank: The rank below which UTXOs will be consolidated. // - test: true for unit test only. // -// Returns: a sublist (includes previous nonce-mark) of UTXOs or an error if the qulifying sublist cannot be found. -func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxoCap uint8, nonce uint64, test bool) ([]btcjson.ListUnspentResult, float64, error) { +// Returns: +// - a sublist (includes previous nonce-mark) of UTXOs or an error if the qualifying sublist cannot be found. +// - the total value of the selected UTXOs. +// - the number of consolidated UTXOs. +// - the total value of the consolidated UTXOs. +func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxosToSpend uint16, nonce uint64, consolidateRank uint16, test bool) ([]btcjson.ListUnspentResult, float64, uint16, float64, error) { idx := -1 if nonce == 0 { // for nonce = 0; make exception; no need to include nonce-mark utxo @@ -830,24 +835,24 @@ func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxoCap uint8, nonce u // 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 + return nil, 0, 0, 0, err } ob.Mu.Lock() defer ob.Mu.Unlock() idx, err = ob.findNonceMarkUTXO(nonce-1, preTxid) if err != nil { - return nil, 0, err + return nil, 0, 0, 0, err } } - // select utxos + // select smallest possible UTXOs to make payment total := 0.0 left, right := 0, 0 for total < amount && right < len(ob.utxos) { - if utxoCap > 0 { // expand sublist + if utxosToSpend > 0 { // expand sublist total += ob.utxos[right].Amount right++ - utxoCap-- + utxosToSpend-- } else { // pop the smallest utxo and append the current one total -= ob.utxos[left].Amount total += ob.utxos[right].Amount @@ -858,8 +863,8 @@ func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxoCap uint8, nonce u results := make([]btcjson.ListUnspentResult, right-left) copy(results, ob.utxos[left:right]) - // Note: always put nonce-mark as 1st input - if idx >= 0 { + // include nonce-mark as the 1st input + if idx >= 0 { // for nonce > 0 if idx < left || idx >= right { total += ob.utxos[idx].Amount results = append([]btcjson.ListUnspentResult{ob.utxos[idx]}, results...) @@ -870,9 +875,26 @@ func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxoCap uint8, nonce u } } if total < amount { - return nil, 0, fmt.Errorf("SelectUTXOs: not enough btc in reserve - available : %v , tx amount : %v", total, amount) + return nil, 0, 0, 0, fmt.Errorf("SelectUTXOs: not enough btc in reserve - available : %v , tx amount : %v", total, amount) + } + + // consolidate biggest possible UTXOs to maximize consolidated value + // consolidation happens only when there are more than (or equal to) consolidateRank (10) UTXOs + utxoRank, consolidatedUtxo, consolidatedValue := uint16(0), uint16(0), 0.0 + for i := len(ob.utxos) - 1; i >= 0 && utxosToSpend > 0; i-- { // iterate over UTXOs big-to-small + if i != idx && (i < left || i >= right) { // exclude nonce-mark and already selected UTXOs + utxoRank++ + if utxoRank >= consolidateRank { // consolication starts from the 10-ranked UTXO based on value + utxosToSpend-- + consolidatedUtxo++ + total += ob.utxos[i].Amount + consolidatedValue += ob.utxos[i].Amount + results = append(results, ob.utxos[i]) + } + } } - return results, total, nil + + return results, total, consolidatedUtxo, consolidatedValue, nil } // Save successfully broadcasted transaction diff --git a/zetaclient/btc_signer.go b/zetaclient/btc_signer.go index f426fee681..afe93c7d4e 100644 --- a/zetaclient/btc_signer.go +++ b/zetaclient/btc_signer.go @@ -23,8 +23,9 @@ import ( const ( maxNoOfInputsPerTx = 20 - outTxBytesMin = 400 // 500B is a conservative estimate for a 2-input, 3-output SegWit tx - outTxBytesMax = 4_000 // 4KB is a conservative estimate for a 21-input, 3-output SegWit tx + consolidationRank = 10 // the rank below (or equal to) which we consolidate UTXOs + outTxBytesMin = 400 // 500B is an estimated size for a 2-input, 3-output SegWit tx + outTxBytesMax = 3250 // 3250B is an estimated size for a 21-input, 3-output SegWit tx outTxBytesCap = 10_000 // in case of accident // for ZRC20 configuration @@ -68,9 +69,7 @@ func NewBTCSigner(cfg config.BTCConfig, tssSigner TSSSigner, logger zerolog.Logg // SignWithdrawTx receives utxos sorted by value, amount in BTC, feeRate in BTC per Kb func (signer *BTCSigner) SignWithdrawTx(to *btcutil.AddressWitnessPubKeyHash, amount float64, gasPrice *big.Int, sizeLimit uint64, btcClient *BitcoinChainClient, height uint64, nonce uint64, chain *common.Chain) (*wire.MsgTx, error) { - estimateFee := float64(gasPrice.Uint64()) * outTxBytesMax / 1e8 - nonceMark := common.NonceMarkAmount(nonce) // refresh unspent UTXOs and continue with keysign regardless of error @@ -80,7 +79,7 @@ func (signer *BTCSigner) SignWithdrawTx(to *btcutil.AddressWitnessPubKeyHash, am } // select N UTXOs to cover the total expense - prevOuts, total, err := btcClient.SelectUTXOs(amount+estimateFee+float64(nonceMark)*1e-8, maxNoOfInputsPerTx, nonce, false) + prevOuts, total, consolidatedUtxo, consolidatedValue, err := btcClient.SelectUTXOs(amount+estimateFee+float64(nonceMark)*1e-8, maxNoOfInputsPerTx, nonce, consolidationRank, false) if err != nil { return nil, err } @@ -120,7 +119,8 @@ func (signer *BTCSigner) SignWithdrawTx(to *btcutil.AddressWitnessPubKeyHash, am // fee calculation // #nosec G701 always in range (checked above) fees := new(big.Int).Mul(big.NewInt(int64(txSize)), gasPrice) - signer.logger.Info().Msgf("bitcoin outTx nonce %d gasPrice %s size %d fees %s", nonce, gasPrice.String(), txSize, fees.String()) + signer.logger.Info().Msgf("bitcoin outTx nonce %d gasPrice %s size %d fees %s consolidated %d utxos of value %v", + nonce, gasPrice.String(), txSize, fees.String(), consolidatedUtxo, consolidatedValue) // calculate remaining btc to TSS self tssAddrWPKH := signer.tssSigner.BTCAddressWitnessPubkeyHash() diff --git a/zetaclient/btc_signer_test.go b/zetaclient/btc_signer_test.go index 5f3eb9a250..38b648ebec 100644 --- a/zetaclient/btc_signer_test.go +++ b/zetaclient/btc_signer_test.go @@ -3,6 +3,7 @@ package zetaclient import ( "encoding/hex" "fmt" + "math" "sort" "sync" "testing" @@ -232,25 +233,27 @@ func mineTxNSetNonceMark(ob *BitcoinChainClient, nonce uint64, txid string, preM ob.includedTxResults[outTxID] = btcjson.GetTransactionResult{TxID: txid} // Set nonce mark - if preMarkIndex >= 0 { - tssAddress := ob.Tss.BTCAddressWitnessPubkeyHash().EncodeAddress() - nonceMark := btcjson.ListUnspentResult{TxID: txid, Address: tssAddress, Amount: float64(common.NonceMarkAmount(nonce)) * 1e-8} + tssAddress := ob.Tss.BTCAddressWitnessPubkeyHash().EncodeAddress() + nonceMark := btcjson.ListUnspentResult{TxID: txid, Address: tssAddress, Amount: float64(common.NonceMarkAmount(nonce)) * 1e-8} + if preMarkIndex >= 0 { // replace nonce-mark utxo ob.utxos[preMarkIndex] = nonceMark - sort.SliceStable(ob.utxos, func(i, j int) bool { - return ob.utxos[i].Amount < ob.utxos[j].Amount - }) + + } else { // add nonce-mark utxo directly + ob.utxos = append(ob.utxos, nonceMark) } + sort.SliceStable(ob.utxos, func(i, j int) bool { + return ob.utxos[i].Amount < ob.utxos[j].Amount + }) } func TestSelectUTXOs(t *testing.T) { ob := createTestClient(t) - tssAddress := ob.Tss.BTCAddressWitnessPubkeyHash().EncodeAddress() dummyTxID := "6e6f71d281146c1fc5c755b35908ee449f26786c84e2ae18f98b268de40b7ec4" // Case1: nonce = 0, bootstrap // input: utxoCap = 5, amount = 0.01, nonce = 0 // output: [0.01], 0.01 - result, amount, err := ob.SelectUTXOs(0.01, 5, 0, true) + result, amount, _, _, err := ob.SelectUTXOs(0.01, 5, 0, math.MaxUint16, true) require.Nil(t, err) require.Equal(t, 0.01, amount) require.Equal(t, ob.utxos[0:1], result) @@ -258,89 +261,184 @@ func TestSelectUTXOs(t *testing.T) { // Case2: nonce = 1, must FAIL and wait for previous transaction to be mined // input: utxoCap = 5, amount = 0.5, nonce = 1 // output: error - result, amount, err = ob.SelectUTXOs(0.5, 5, 1, true) + result, amount, _, _, err = ob.SelectUTXOs(0.5, 5, 1, math.MaxUint16, true) require.NotNil(t, err) require.Nil(t, result) require.Zero(t, amount) require.Equal(t, "getOutTxidByNonce: cannot find outTx txid for nonce 0", err.Error()) - mineTxNSetNonceMark(ob, 0, dummyTxID, -1) // mine a transaction for nonce 0 - - // Case3: nonce = 1, must FAIL without nonce mark utxo - // input: utxoCap = 5, amount = 0.5, nonce = 1 - // output: error - result, amount, err = ob.SelectUTXOs(0.5, 5, 1, true) - require.NotNil(t, err) - require.Nil(t, result) - require.Zero(t, amount) - require.Equal(t, "findNonceMarkUTXO: cannot find nonce-mark utxo with nonce 0", err.Error()) + mineTxNSetNonceMark(ob, 0, dummyTxID, -1) // mine a transaction and set nonce-mark utxo for nonce 0 - // add nonce-mark utxo for nonce 0 - nonceMark0 := btcjson.ListUnspentResult{TxID: dummyTxID, Address: tssAddress, Amount: float64(common.NonceMarkAmount(0)) * 1e-8} - ob.utxos = append([]btcjson.ListUnspentResult{nonceMark0}, ob.utxos...) - - // Case4: nonce = 1, should pass now + // Case3: nonce = 1, should pass now // input: utxoCap = 5, amount = 0.5, nonce = 1 // output: [0.00002, 0.01, 0.12, 0.18, 0.24], 0.55002 - result, amount, err = ob.SelectUTXOs(0.5, 5, 1, true) + result, amount, _, _, err = ob.SelectUTXOs(0.5, 5, 1, math.MaxUint16, true) require.Nil(t, err) require.Equal(t, 0.55002, amount) require.Equal(t, ob.utxos[0:5], result) mineTxNSetNonceMark(ob, 1, dummyTxID, 0) // mine a transaction and set nonce-mark utxo for nonce 1 - // Case5: + // Case4: // input: utxoCap = 5, amount = 1.0, nonce = 2 // output: [0.00002001, 0.01, 0.12, 0.18, 0.24, 0.5], 1.05002001 - result, amount, err = ob.SelectUTXOs(1.0, 5, 2, true) + result, amount, _, _, err = ob.SelectUTXOs(1.0, 5, 2, math.MaxUint16, true) require.Nil(t, err) assert.InEpsilon(t, 1.05002001, amount, 1e-8) require.Equal(t, ob.utxos[0:6], result) mineTxNSetNonceMark(ob, 2, dummyTxID, 0) // mine a transaction and set nonce-mark utxo for nonce 2 - // Case6: should include nonce-mark utxo on the LEFT + // Case5: should include nonce-mark utxo on the LEFT // input: utxoCap = 5, amount = 8.05, nonce = 3 // output: [0.00002002, 0.24, 0.5, 1.26, 2.97, 3.28], 8.25002002 - result, amount, err = ob.SelectUTXOs(8.05, 5, 3, true) + result, amount, _, _, err = ob.SelectUTXOs(8.05, 5, 3, math.MaxUint16, true) require.Nil(t, err) assert.InEpsilon(t, 8.25002002, amount, 1e-8) expected := append([]btcjson.ListUnspentResult{ob.utxos[0]}, ob.utxos[4:9]...) require.Equal(t, expected, result) mineTxNSetNonceMark(ob, 24105431, dummyTxID, 0) // mine a transaction and set nonce-mark utxo for nonce 24105431 - // Case7: should include nonce-mark utxo on the RIGHT + // Case6: should include nonce-mark utxo on the RIGHT // input: utxoCap = 5, amount = 0.503, nonce = 24105432 // output: [0.24107432, 0.01, 0.12, 0.18, 0.24], 0.55002002 - result, amount, err = ob.SelectUTXOs(0.503, 5, 24105432, true) + result, amount, _, _, err = ob.SelectUTXOs(0.503, 5, 24105432, math.MaxUint16, true) require.Nil(t, err) assert.InEpsilon(t, 0.79107431, amount, 1e-8) expected = append([]btcjson.ListUnspentResult{ob.utxos[4]}, ob.utxos[0:4]...) require.Equal(t, expected, result) mineTxNSetNonceMark(ob, 24105432, dummyTxID, 4) // mine a transaction and set nonce-mark utxo for nonce 24105432 - // Case8: should include nonce-mark utxo in the MIDDLE + // Case7: should include nonce-mark utxo in the MIDDLE // input: utxoCap = 5, amount = 1.0, nonce = 24105433 // output: [0.24107432, 0.12, 0.18, 0.24, 0.5], 1.28107432 - result, amount, err = ob.SelectUTXOs(1.0, 5, 24105433, true) + result, amount, _, _, err = ob.SelectUTXOs(1.0, 5, 24105433, math.MaxUint16, true) require.Nil(t, err) assert.InEpsilon(t, 1.28107432, amount, 1e-8) expected = append([]btcjson.ListUnspentResult{ob.utxos[4]}, ob.utxos[1:4]...) expected = append(expected, ob.utxos[5]) require.Equal(t, expected, result) - // Case9: should work with maximum amount + // Case8: should work with maximum amount // input: utxoCap = 5, amount = 16.03 // output: [0.24107432, 1.26, 2.97, 3.28, 5.16, 8.72], 21.63107432 - result, amount, err = ob.SelectUTXOs(16.03, 5, 24105433, true) + result, amount, _, _, err = ob.SelectUTXOs(16.03, 5, 24105433, math.MaxUint16, true) require.Nil(t, err) assert.InEpsilon(t, 21.63107432, amount, 1e-8) expected = append([]btcjson.ListUnspentResult{ob.utxos[4]}, ob.utxos[6:11]...) require.Equal(t, expected, result) - // Case10: must FAIL due to insufficient funds + // Case9: must FAIL due to insufficient funds // input: utxoCap = 5, amount = 21.64 // output: error - result, amount, err = ob.SelectUTXOs(21.64, 5, 24105433, true) + result, amount, _, _, err = ob.SelectUTXOs(21.64, 5, 24105433, math.MaxUint16, true) require.NotNil(t, err) require.Nil(t, result) require.Zero(t, amount) require.Equal(t, "SelectUTXOs: not enough btc in reserve - available : 21.63107432 , tx amount : 21.64", err.Error()) } + +func TestUTXOConsolidation(t *testing.T) { + dummyTxID := "6e6f71d281146c1fc5c755b35908ee449f26786c84e2ae18f98b268de40b7ec4" + + t.Run("should not consolidate", func(t *testing.T) { + ob := createTestClient(t) + mineTxNSetNonceMark(ob, 0, dummyTxID, -1) // mine a transaction and set nonce-mark utxo for nonce 0 + + // input: utxoCap = 10, amount = 0.01, nonce = 1, rank = 10 + // output: [0.00002, 0.01], 0.01002 + result, amount, clsdtUtxo, clsdtValue, err := ob.SelectUTXOs(0.01, 10, 1, 10, true) + require.Nil(t, err) + require.Equal(t, 0.01002, amount) + require.Equal(t, ob.utxos[0:2], result) + require.Equal(t, uint16(0), clsdtUtxo) + require.Equal(t, 0.0, clsdtValue) + }) + + t.Run("should consolidate 1 utxo", func(t *testing.T) { + ob := createTestClient(t) + mineTxNSetNonceMark(ob, 0, dummyTxID, -1) // mine a transaction and set nonce-mark utxo for nonce 0 + + // input: utxoCap = 9, amount = 0.01, nonce = 1, rank = 9 + // output: [0.00002, 0.01, 0.12], 0.13002 + result, amount, clsdtUtxo, clsdtValue, err := ob.SelectUTXOs(0.01, 9, 1, 9, true) + require.Nil(t, err) + require.Equal(t, 0.13002, amount) + require.Equal(t, ob.utxos[0:3], result) + require.Equal(t, uint16(1), clsdtUtxo) + require.Equal(t, 0.12, clsdtValue) + }) + + t.Run("should consolidate 3 utxos", func(t *testing.T) { + ob := createTestClient(t) + mineTxNSetNonceMark(ob, 0, dummyTxID, -1) // mine a transaction and set nonce-mark utxo for nonce 0 + + // input: utxoCap = 5, amount = 0.01, nonce = 0, rank = 5 + // output: [0.00002, 0.014, 1.26, 0.5, 0.2], 2.01002 + result, amount, clsdtUtxo, clsdtValue, err := ob.SelectUTXOs(0.01, 5, 1, 5, true) + require.Nil(t, err) + require.Equal(t, 2.01002, amount) + expected := make([]btcjson.ListUnspentResult, 2) + copy(expected, ob.utxos[0:2]) + for i := 6; i >= 4; i-- { // append consolidated utxos in descending order + expected = append(expected, ob.utxos[i]) + } + require.Equal(t, expected, result) + require.Equal(t, uint16(3), clsdtUtxo) + require.Equal(t, 2.0, clsdtValue) + }) + + t.Run("should consolidate all utxos using rank 1", func(t *testing.T) { + ob := createTestClient(t) + mineTxNSetNonceMark(ob, 0, dummyTxID, -1) // mine a transaction and set nonce-mark utxo for nonce 0 + + // input: utxoCap = 12, amount = 0.01, nonce = 0, rank = 1 + // output: [0.00002, 0.01, 8.72, 5.16, 3.28, 2.97, 1.26, 0.5, 0.24, 0.18, 0.12], 22.44002 + result, amount, clsdtUtxo, clsdtValue, err := ob.SelectUTXOs(0.01, 12, 1, 1, true) + require.Nil(t, err) + require.Equal(t, 22.44002, amount) + expected := make([]btcjson.ListUnspentResult, 2) + copy(expected, ob.utxos[0:2]) + for i := 10; i >= 2; i-- { // append consolidated utxos in descending order + expected = append(expected, ob.utxos[i]) + } + require.Equal(t, expected, result) + require.Equal(t, uint16(9), clsdtUtxo) + require.Equal(t, 22.43, clsdtValue) + }) + + t.Run("should consolidate 3 utxos sparse", func(t *testing.T) { + ob := createTestClient(t) + mineTxNSetNonceMark(ob, 24105431, dummyTxID, -1) // mine a transaction and set nonce-mark utxo for nonce 24105431 + + // input: utxoCap = 5, amount = 0.13, nonce = 24105432, rank = 5 + // output: [0.24107431, 0.01, 0.12, 1.26, 0.5, 0.24], 2.37107431 + result, amount, clsdtUtxo, clsdtValue, err := ob.SelectUTXOs(0.13, 5, 24105432, 5, true) + require.Nil(t, err) + assert.InEpsilon(t, 2.37107431, amount, 1e-8) + expected := append([]btcjson.ListUnspentResult{ob.utxos[4]}, ob.utxos[0:2]...) + expected = append(expected, ob.utxos[6]) + expected = append(expected, ob.utxos[5]) + expected = append(expected, ob.utxos[3]) + require.Equal(t, expected, result) + require.Equal(t, uint16(3), clsdtUtxo) + require.Equal(t, 2.0, clsdtValue) + }) + + t.Run("should consolidate all utxos sparse", func(t *testing.T) { + ob := createTestClient(t) + mineTxNSetNonceMark(ob, 24105431, dummyTxID, -1) // mine a transaction and set nonce-mark utxo for nonce 24105431 + + // input: utxoCap = 12, amount = 0.13, nonce = 24105432, rank = 1 + // output: [0.24107431, 0.01, 0.12, 8.72, 5.16, 3.28, 2.97, 1.26, 0.5, 0.24, 0.18], 22.68107431 + result, amount, clsdtUtxo, clsdtValue, err := ob.SelectUTXOs(0.13, 12, 24105432, 1, true) + require.Nil(t, err) + assert.InEpsilon(t, 22.68107431, amount, 1e-8) + expected := append([]btcjson.ListUnspentResult{ob.utxos[4]}, ob.utxos[0:2]...) + for i := 10; i >= 5; i-- { // append consolidated utxos in descending order + expected = append(expected, ob.utxos[i]) + } + expected = append(expected, ob.utxos[3]) + expected = append(expected, ob.utxos[2]) + require.Equal(t, expected, result) + require.Equal(t, uint16(8), clsdtUtxo) + require.Equal(t, 22.31, clsdtValue) + }) +} From fcf532f506819d480dac8e6402ca9e83f3b79a19 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Mon, 23 Oct 2023 20:02:00 -0400 Subject: [PATCH 09/26] fix: add support for bsc headers (#1334) --- common/chain.go | 8 ++ testutil/network/genesis_state.go | 7 +- testutil/sample/common.go | 20 ++++ x/observer/genesis.go | 12 ++- x/observer/genesis_test.go | 2 +- .../keeper/msg_server_add_block_header.go | 17 +++- .../msg_server_add_block_header_test.go | 96 +++++++++++++++++++ x/observer/migrations/v4/migrate_test.go | 4 +- x/observer/types/crosschain_flags.go | 16 ++-- x/observer/types/errors.go | 11 ++- x/observer/types/messages_add_block_header.go | 2 +- 11 files changed, 175 insertions(+), 20 deletions(-) create mode 100644 x/observer/keeper/msg_server_add_block_header_test.go diff --git a/common/chain.go b/common/chain.go index 63cb26b213..010e899258 100644 --- a/common/chain.go +++ b/common/chain.go @@ -102,6 +102,14 @@ func IsEVMChain(chainID int64) bool { chainID == 137 // polygon mainnet } +func IsHeaderSupportedEvmChain(chainID int64) bool { + return chainID == 5 || // Goerli + chainID == 97 || // BSC testnet + chainID == 1337 || // eth privnet + chainID == 1 || // eth mainnet + chainID == 56 // bsc mainnet +} + func (chain Chain) IsKlaytnChain() bool { return chain.ChainId == 1001 } diff --git a/testutil/network/genesis_state.go b/testutil/network/genesis_state.go index 334c258746..ff1596e88d 100644 --- a/testutil/network/genesis_state.go +++ b/testutil/network/genesis_state.go @@ -105,9 +105,12 @@ func AddObserverData(t *testing.T, genesisState map[string]json.RawMessage, code state.Params.BallotMaturityBlocks = 3 state.Keygen = &observerTypes.Keygen{BlockNumber: 10, GranteePubkeys: []string{}} crosschainFlags := &observerTypes.CrosschainFlags{ - IsInboundEnabled: true, - IsOutboundEnabled: true, + IsInboundEnabled: true, + IsOutboundEnabled: true, + GasPriceIncreaseFlags: &observerTypes.DefaultGasPriceIncreaseFlags, + BlockHeaderVerificationFlags: &observerTypes.DefaultBlockHeaderVerificationFlags, } + nullify.Fill(&crosschainFlags) state.CrosschainFlags = crosschainFlags diff --git a/testutil/sample/common.go b/testutil/sample/common.go index 77daaf09b0..a2d3c18dd7 100644 --- a/testutil/sample/common.go +++ b/testutil/sample/common.go @@ -1,7 +1,12 @@ package sample import ( + "context" + "math/big" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/ethereum/go-ethereum/rlp" "github.com/tendermint/tendermint/crypto/secp256k1" "github.com/zeta-chain/zetacore/common" ) @@ -22,3 +27,18 @@ func PubKeySet() *common.PubKeySet { } return &pubKeySet } + +func EthHeader() (headerRLP []byte, err error) { + url := "https://rpc.ankr.com/eth_goerli" + client, err := ethclient.Dial(url) + if err != nil { + return + } + bn := int64(9889649) + block, err := client.BlockByNumber(context.Background(), big.NewInt(bn)) + if err != nil { + return + } + headerRLP, _ = rlp.EncodeToBytes(block.Header()) + return +} diff --git a/x/observer/genesis.go b/x/observer/genesis.go index 8c00a1bd4b..8e9303df78 100644 --- a/x/observer/genesis.go +++ b/x/observer/genesis.go @@ -39,8 +39,18 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.SetParams(ctx, params) // Set if defined + + crosschainFlags := types.DefaultCrosschainFlags() if genState.CrosschainFlags != nil { - k.SetCrosschainFlags(ctx, *genState.CrosschainFlags) + crosschainFlags.IsOutboundEnabled = genState.CrosschainFlags.IsOutboundEnabled + crosschainFlags.IsInboundEnabled = genState.CrosschainFlags.IsInboundEnabled + if genState.CrosschainFlags.BlockHeaderVerificationFlags != nil { + crosschainFlags.BlockHeaderVerificationFlags = genState.CrosschainFlags.BlockHeaderVerificationFlags + } + if genState.CrosschainFlags.GasPriceIncreaseFlags != nil { + crosschainFlags.GasPriceIncreaseFlags = genState.CrosschainFlags.GasPriceIncreaseFlags + } + k.SetCrosschainFlags(ctx, *crosschainFlags) } else { k.SetCrosschainFlags(ctx, *types.DefaultCrosschainFlags()) } diff --git a/x/observer/genesis_test.go b/x/observer/genesis_test.go index 6919685a52..30b9260821 100644 --- a/x/observer/genesis_test.go +++ b/x/observer/genesis_test.go @@ -31,7 +31,7 @@ func TestGenesis(t *testing.T) { sample.NodeAccount(), sample.NodeAccount(), }, - CrosschainFlags: sample.CrosschainFlags(), + CrosschainFlags: types.DefaultCrosschainFlags(), Keygen: sample.Keygen(t), LastObserverCount: sample.LastObserverCount(1000), CoreParamsList: sample.CoreParamsList(), diff --git a/x/observer/keeper/msg_server_add_block_header.go b/x/observer/keeper/msg_server_add_block_header.go index cfc3e32bcd..83f8c97dc0 100644 --- a/x/observer/keeper/msg_server_add_block_header.go +++ b/x/observer/keeper/msg_server_add_block_header.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "fmt" cosmoserrors "cosmossdk.io/errors" @@ -20,6 +21,20 @@ func (k msgServer) AddBlockHeader(goCtx context.Context, msg *types.MsgAddBlockH return nil, types.ErrNotAuthorizedPolicy } + crosschainFlags, found := k.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(msg.ChainId) && !crosschainFlags.BlockHeaderVerificationFlags.IsBtcTypeChainEnabled { + return nil, cosmoserrors.Wrapf(types.ErrBlockHeaderVerficationDisabled, "proof verification not enabled for bitcoin ,chain id: %d", msg.ChainId) + } + if common.IsEVMChain(msg.ChainId) && !crosschainFlags.BlockHeaderVerificationFlags.IsEthTypeChainEnabled { + return nil, cosmoserrors.Wrapf(types.ErrBlockHeaderVerficationDisabled, "proof verification not enabled for evm ,chain id: %d", msg.ChainId) + } + // add vote to ballot ballot, _, err := k.FindBallot(ctx, msg.Digest(), chain, types.ObservationType_InBoundTx) if err != nil { @@ -37,7 +52,7 @@ func (k msgServer) AddBlockHeader(goCtx context.Context, msg *types.MsgAddBlockH /** * Vote finalized, add block header to store */ - _, found := k.GetBlockHeader(ctx, msg.BlockHash) + _, found = k.GetBlockHeader(ctx, msg.BlockHash) if found { hashString, err := common.HashToString(msg.ChainId, msg.BlockHash) if err != nil { diff --git a/x/observer/keeper/msg_server_add_block_header_test.go b/x/observer/keeper/msg_server_add_block_header_test.go new file mode 100644 index 0000000000..db77cac8ab --- /dev/null +++ b/x/observer/keeper/msg_server_add_block_header_test.go @@ -0,0 +1,96 @@ +//go:build TESTNET +// +build TESTNET + +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/common" + keepertest "github.com/zeta-chain/zetacore/testutil/keeper" + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/observer/keeper" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +func TestMsgServer_AddBlockHeader(t *testing.T) { + header, err := sample.EthHeader() + assert.NoError(t, err) + observerChain := common.GoerliChain() + observerAddress := sample.AccAddress() + // Add tests for btc headers : https://github.com/zeta-chain/node/issues/1336 + tt := []struct { + name string + msg *types.MsgAddBlockHeader + IsEthTypeChainEnabled bool + IsBtcTypeChainEnabled bool + wantErr require.ErrorAssertionFunc + }{ + { + name: "success submit eth header", + msg: &types.MsgAddBlockHeader{ + Creator: observerAddress, + ChainId: common.GoerliChain().ChainId, + BlockHash: sample.Bytes(), + Height: 1, + Header: common.NewEthereumHeader(header), + }, + IsEthTypeChainEnabled: true, + IsBtcTypeChainEnabled: true, + wantErr: require.NoError, + }, + { + name: "failure submit eth header eth disabled", + msg: &types.MsgAddBlockHeader{ + Creator: observerAddress, + ChainId: common.GoerliChain().ChainId, + BlockHash: sample.Bytes(), + Height: 1, + Header: common.NewEthereumHeader(header), + }, + IsEthTypeChainEnabled: false, + IsBtcTypeChainEnabled: true, + wantErr: func(t require.TestingT, err error, i ...interface{}) { + assert.ErrorIs(t, err, types.ErrBlockHeaderVerficationDisabled) + }, + }, + { + name: "failure submit eth header eth disabled", + msg: &types.MsgAddBlockHeader{ + Creator: sample.AccAddress(), + ChainId: common.GoerliChain().ChainId, + BlockHash: sample.Bytes(), + Height: 1, + Header: common.NewEthereumHeader(header), + }, + IsEthTypeChainEnabled: false, + IsBtcTypeChainEnabled: true, + wantErr: func(t require.TestingT, err error, i ...interface{}) { + assert.ErrorIs(t, err, types.ErrNotAuthorizedPolicy) + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + k, ctx := keepertest.ObserverKeeper(t) + srv := keeper.NewMsgServerImpl(*k) + k.SetObserverMapper(ctx, &types.ObserverMapper{ + ObserverChain: &observerChain, + ObserverList: []string{observerAddress}, + }) + k.SetCrosschainFlags(ctx, types.CrosschainFlags{ + IsInboundEnabled: true, + IsOutboundEnabled: true, + GasPriceIncreaseFlags: nil, + BlockHeaderVerificationFlags: &types.BlockHeaderVerificationFlags{ + IsEthTypeChainEnabled: tc.IsEthTypeChainEnabled, + IsBtcTypeChainEnabled: tc.IsBtcTypeChainEnabled, + }, + }) + _, err := srv.AddBlockHeader(ctx, tc.msg) + tc.wantErr(t, err) + }) + } +} diff --git a/x/observer/migrations/v4/migrate_test.go b/x/observer/migrations/v4/migrate_test.go index 98f4439403..2e420749b9 100644 --- a/x/observer/migrations/v4/migrate_test.go +++ b/x/observer/migrations/v4/migrate_test.go @@ -25,6 +25,6 @@ func TestMigrateStore(t *testing.T) { 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) + assert.True(t, flags.BlockHeaderVerificationFlags.IsBtcTypeChainEnabled) + assert.True(t, flags.BlockHeaderVerificationFlags.IsEthTypeChainEnabled) } diff --git a/x/observer/types/crosschain_flags.go b/x/observer/types/crosschain_flags.go index 4dccfbc8c4..bc3db1e8f8 100644 --- a/x/observer/types/crosschain_flags.go +++ b/x/observer/types/crosschain_flags.go @@ -18,15 +18,17 @@ var DefaultGasPriceIncreaseFlags = GasPriceIncreaseFlags{ GasPriceIncreaseMax: 500, } +var DefaultBlockHeaderVerificationFlags = BlockHeaderVerificationFlags{ + IsEthTypeChainEnabled: true, + IsBtcTypeChainEnabled: true, +} + // DefaultCrosschainFlags returns the default crosschain flags used when not defined func DefaultCrosschainFlags() *CrosschainFlags { return &CrosschainFlags{ - IsInboundEnabled: true, - IsOutboundEnabled: true, - GasPriceIncreaseFlags: &DefaultGasPriceIncreaseFlags, - BlockHeaderVerificationFlags: &BlockHeaderVerificationFlags{ - IsEthTypeChainEnabled: false, - IsBtcTypeChainEnabled: false, - }, + IsInboundEnabled: true, + IsOutboundEnabled: true, + GasPriceIncreaseFlags: &DefaultGasPriceIncreaseFlags, + BlockHeaderVerificationFlags: &DefaultBlockHeaderVerificationFlags, } } diff --git a/x/observer/types/errors.go b/x/observer/types/errors.go index 3767712e34..c4659faa33 100644 --- a/x/observer/types/errors.go +++ b/x/observer/types/errors.go @@ -25,9 +25,10 @@ var ( ErrKeygenCompleted = errorsmod.Register(ModuleName, 1115, "keygen already completed") ErrNotAuthorized = errorsmod.Register(ModuleName, 1116, "not authorized") - ErrBlockHeaderNotFound = errorsmod.Register(ModuleName, 1117, "block header not found") - ErrUnrecognizedBlockHeader = errorsmod.Register(ModuleName, 1118, "unrecognized block header") - ErrBlockAlreadyExist = errorsmod.Register(ModuleName, 1119, "block already exists") - ErrNoParentHash = errorsmod.Register(ModuleName, 1120, "no parent hash") - ErrInvalidTimestamp = errorsmod.Register(ModuleName, 1121, "invalid timestamp") + ErrBlockHeaderNotFound = errorsmod.Register(ModuleName, 1117, "block header not found") + ErrUnrecognizedBlockHeader = errorsmod.Register(ModuleName, 1118, "unrecognized block header") + ErrBlockAlreadyExist = errorsmod.Register(ModuleName, 1119, "block already exists") + ErrNoParentHash = errorsmod.Register(ModuleName, 1120, "no parent hash") + ErrInvalidTimestamp = errorsmod.Register(ModuleName, 1121, "invalid timestamp") + ErrBlockHeaderVerficationDisabled = errorsmod.Register(ModuleName, 1122, "block header verification is disabled") ) diff --git a/x/observer/types/messages_add_block_header.go b/x/observer/types/messages_add_block_header.go index cfa2867128..f7094a002c 100644 --- a/x/observer/types/messages_add_block_header.go +++ b/x/observer/types/messages_add_block_header.go @@ -52,7 +52,7 @@ func (msg *MsgAddBlockHeader) ValidateBasic() error { return cosmoserrors.Wrapf(sdkerrors.ErrInvalidAddress, err.Error()) } - if common.IsEthereumChain(msg.ChainId) || common.IsBitcoinChain(msg.ChainId) { + if common.IsHeaderSupportedEvmChain(msg.ChainId) || common.IsBitcoinChain(msg.ChainId) { if len(msg.BlockHash) != 32 { return cosmoserrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid block hash length (%d)", len(msg.BlockHash)) } From 9997c93f174a5ecaefc1f444f62a9cb777dc25d6 Mon Sep 17 00:00:00 2001 From: Chinmay Mehta Date: Tue, 24 Oct 2023 07:54:49 +0530 Subject: [PATCH 10/26] fix: Error Context in gas_price (#1224) * fix: Error Context in gas_price * resolved comments & updated error message for setGasCoin, SetGasZetaPool Signed-off-by: chinmaym07 --------- Signed-off-by: chinmaym07 Co-authored-by: Chinmay Mehta Co-authored-by: chinmaym07 Co-authored-by: Lucas Bertrand Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com> --- x/fungible/keeper/gas_price.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/x/fungible/keeper/gas_price.go b/x/fungible/keeper/gas_price.go index f492ddb2ec..3f2ee63d28 100644 --- a/x/fungible/keeper/gas_price.go +++ b/x/fungible/keeper/gas_price.go @@ -25,8 +25,11 @@ func (k Keeper) SetGasPrice(ctx sdk.Context, chainid *big.Int, gasPrice *big.Int return 0, sdkerrors.Wrapf(types.ErrABIGet, "SystemContractMetaData") } res, err := k.CallEVM(ctx, *abi, types.ModuleAddressEVM, oracle, BigIntZero, big.NewInt(50_000), true, false, "setGasPrice", chainid, gasPrice) - if err != nil || res.Failed() { - return res.GasUsed, sdkerrors.Wrapf(types.ErrContractCall, "setGasPrice") + if err != nil { + return 0, sdkerrors.Wrapf(types.ErrContractCall, err.Error()) + } + if res.Failed() { + return res.GasUsed, sdkerrors.Wrapf(types.ErrContractCall, "setGasPrice tx failed") } return res.GasUsed, nil @@ -46,8 +49,11 @@ func (k Keeper) SetGasCoin(ctx sdk.Context, chainid *big.Int, address common.Add return sdkerrors.Wrapf(types.ErrABIGet, "SystemContractMetaData") } res, err := k.CallEVM(ctx, *abi, types.ModuleAddressEVM, oracle, BigIntZero, nil, true, false, "setGasCoinZRC20", chainid, address) - if err != nil || res.Failed() { - return sdkerrors.Wrapf(types.ErrContractCall, "setGasCoinZRC20") + if err != nil { + return sdkerrors.Wrapf(types.ErrContractCall, err.Error()) + } + if res.Failed() { + return sdkerrors.Wrapf(types.ErrContractCall, "setGasCoinZRC20 tx failed") } return nil @@ -67,8 +73,11 @@ func (k Keeper) SetGasZetaPool(ctx sdk.Context, chainid *big.Int, pool common.Ad return sdkerrors.Wrapf(types.ErrABIGet, "SystemContractMetaData") } res, err := k.CallEVM(ctx, *abi, types.ModuleAddressEVM, oracle, BigIntZero, nil, true, false, "setGasZetaPool", chainid, pool) - if err != nil || res.Failed() { - return sdkerrors.Wrapf(types.ErrContractCall, "setGasZetaPool") + if err != nil { + return sdkerrors.Wrapf(types.ErrContractCall, err.Error()) + } + if res.Failed() { + return sdkerrors.Wrapf(types.ErrContractCall, "setGasZetaPool tx failed") } return nil From 0ab8ed08bd41dc7cd94ea806c073b8cce9b15df1 Mon Sep 17 00:00:00 2001 From: Luke Ma <867273263@qq.com> Date: Tue, 24 Oct 2023 11:30:38 +0800 Subject: [PATCH 11/26] refactor: remove redundant conditional judgment code (#1309) Co-authored-by: Charlie Chen <34498985+ws4charlie@users.noreply.github.com> Co-authored-by: Lucas Bertrand --- x/crosschain/genesis.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/x/crosschain/genesis.go b/x/crosschain/genesis.go index e1d77b1c02..9c0f52bb29 100644 --- a/x/crosschain/genesis.go +++ b/x/crosschain/genesis.go @@ -57,9 +57,7 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) } if genState.Tss != nil { - if genState.Tss != nil { - k.SetTSS(ctx, *genState.Tss) - } + k.SetTSS(ctx, *genState.Tss) for _, chain := range common.DefaultChainsList() { k.SetPendingNonces(ctx, types.PendingNonces{ NonceLow: 0, From 3bec1b56918ef68b17bd177a9a5247e4001c7096 Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Tue, 24 Oct 2023 14:43:06 -0700 Subject: [PATCH 12/26] refactor(`zetaclient`): use interfaces for used attributes (#1191) * refactor chain client and signer * define zetacore bridger * use interface for bitcoin client * interface for evm client * use interface for tss * lint issue * fix logger * fixes from conflicts * improve imports --- cmd/zetaclientd/aux.go | 17 +- cmd/zetaclientd/start.go | 2 +- zetaclient/bitcoin_client.go | 69 ++-- zetaclient/block_height.go | 20 - zetaclient/btc_signer.go | 42 ++- zetaclient/btc_test.go | 11 +- zetaclient/chain_signer.go | 9 - zetaclient/chainclient.go | 26 -- zetaclient/errors.go | 5 +- zetaclient/evm_client.go | 73 ++-- zetaclient/evm_signer.go | 98 ++++- zetaclient/interfaces.go | 122 ++++++ zetaclient/query.go | 91 ++--- zetaclient/signer.go | 4 +- zetaclient/telemetry.go | 3 +- zetaclient/tss_signer.go | 347 +++++++++--------- zetaclient/tx.go | 1 - zetaclient/utils.go | 6 +- .../{zetabridge.go => zetacore_bridge.go} | 73 ++-- zetaclient/zetacore_observer.go | 22 +- 20 files changed, 599 insertions(+), 442 deletions(-) delete mode 100644 zetaclient/chain_signer.go delete mode 100644 zetaclient/chainclient.go create mode 100644 zetaclient/interfaces.go rename zetaclient/{zetabridge.go => zetacore_bridge.go} (88%) diff --git a/cmd/zetaclientd/aux.go b/cmd/zetaclientd/aux.go index 8f9ef2041b..44f3d6a9bc 100644 --- a/cmd/zetaclientd/aux.go +++ b/cmd/zetaclientd/aux.go @@ -33,7 +33,12 @@ func CreateZetaBridge(cfg *config.Config) (*zetaclient.ZetaCoreBridge, error) { return bridge, nil } -func CreateSignerMap(tss zetaclient.TSSSigner, logger zerolog.Logger, cfg *config.Config, ts *zetaclient.TelemetryServer) (map[common.Chain]zetaclient.ChainSigner, error) { +func CreateSignerMap( + tss zetaclient.TSSSigner, + logger zerolog.Logger, + cfg *config.Config, + ts *zetaclient.TelemetryServer, +) (map[common.Chain]zetaclient.ChainSigner, error) { signerMap := make(map[common.Chain]zetaclient.ChainSigner) // EVM signers for _, evmConfig := range cfg.GetAllEVMConfigs() { @@ -63,7 +68,15 @@ func CreateSignerMap(tss zetaclient.TSSSigner, logger zerolog.Logger, cfg *confi return signerMap, nil } -func CreateChainClientMap(bridge *zetaclient.ZetaCoreBridge, tss zetaclient.TSSSigner, dbpath string, metrics *metrics.Metrics, logger zerolog.Logger, cfg *config.Config, ts *zetaclient.TelemetryServer) (map[common.Chain]zetaclient.ChainClient, error) { +func CreateChainClientMap( + bridge *zetaclient.ZetaCoreBridge, + tss zetaclient.TSSSigner, + dbpath string, + metrics *metrics.Metrics, + logger zerolog.Logger, + cfg *config.Config, + ts *zetaclient.TelemetryServer, +) (map[common.Chain]zetaclient.ChainClient, error) { clientMap := make(map[common.Chain]zetaclient.ChainClient) // EVM clients for _, evmConfig := range cfg.GetAllEVMConfigs() { diff --git a/cmd/zetaclientd/start.go b/cmd/zetaclientd/start.go index 0e770b951f..7bfbb91f54 100644 --- a/cmd/zetaclientd/start.go +++ b/cmd/zetaclientd/start.go @@ -237,7 +237,7 @@ func start(_ *cobra.Command, _ []string) error { } // CreateCoreObserver : Core observer wraps the zetacore bridge and adds the client and signer maps to it . This is the high level object used for CCTX interactions - mo1 := mc.NewCoreObserver(zetaBridge, signerMap, chainClientMap, metrics, tss, masterLogger, cfg, telemetryServer) + mo1 := mc.NewCoreObserver(zetaBridge, signerMap, chainClientMap, metrics, masterLogger, cfg, telemetryServer) mo1.MonitorCore() startLogger.Info().Msgf("awaiting the os.Interrupt, syscall.SIGTERM signals...") diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index fd360a3453..3584382021 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -4,16 +4,7 @@ import ( "bytes" "encoding/hex" "fmt" - - "cosmossdk.io/math" - "github.com/btcsuite/btcd/chaincfg/chainhash" - "github.com/btcsuite/btcd/wire" - "github.com/pkg/errors" - "gorm.io/driver/sqlite" - "gorm.io/gorm" - "gorm.io/gorm/logger" - - math2 "math" + "math" "math/big" "os" "sort" @@ -21,10 +12,14 @@ import ( "sync" "sync/atomic" + cosmosmath "cosmossdk.io/math" "github.com/btcsuite/btcd/btcjson" + "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/rpcclient" + "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" lru "github.com/hashicorp/golang-lru" + "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" @@ -32,6 +27,9 @@ import ( "github.com/zeta-chain/zetacore/zetaclient/config" metricsPkg "github.com/zeta-chain/zetacore/zetaclient/metrics" clienttypes "github.com/zeta-chain/zetacore/zetaclient/types" + "gorm.io/driver/sqlite" + "gorm.io/gorm" + "gorm.io/gorm/logger" ) var _ ChainClient = &BitcoinChainClient{} @@ -44,14 +42,14 @@ type BTCLog struct { WatchGasPrice zerolog.Logger } -// Chain configuration struct +// BitcoinChainClient represents a chain configuration for Bitcoin // Filled with above constants depending on chain type BitcoinChainClient struct { *ChainMetrics chain common.Chain - rpcClient *rpcclient.Client - zetaClient *ZetaCoreBridge + rpcClient BTCRPCClient + zetaClient ZetaCoreBridger Tss TSSSigner lastBlock int64 lastBlockScanned int64 @@ -121,8 +119,17 @@ func (ob *BitcoinChainClient) GetCoreParams() observertypes.CoreParams { return ob.params } -// Return configuration based on supplied target chain -func NewBitcoinClient(chain common.Chain, bridge *ZetaCoreBridge, tss TSSSigner, dbpath string, metrics *metricsPkg.Metrics, logger zerolog.Logger, btcCfg config.BTCConfig, ts *TelemetryServer) (*BitcoinChainClient, error) { +// NewBitcoinClient returns a new configuration based on supplied target chain +func NewBitcoinClient( + chain common.Chain, + bridge ZetaCoreBridger, + tss TSSSigner, + dbpath string, + metrics *metricsPkg.Metrics, + logger zerolog.Logger, + btcCfg config.BTCConfig, + ts *TelemetryServer, +) (*BitcoinChainClient, error) { ob := BitcoinChainClient{ ChainMetrics: NewChainMetrics(chain.ChainName.String(), metrics), ts: ts, @@ -205,7 +212,7 @@ func (ob *BitcoinChainClient) SetLastBlockHeight(block int64) { if block < 0 { panic("lastBlock is negative") } - if block >= math2.MaxInt64 { + if block >= math.MaxInt64 { panic("lastBlock is too large") } atomic.StoreInt64(&ob.lastBlock, block) @@ -216,7 +223,7 @@ func (ob *BitcoinChainClient) GetLastBlockHeight() int64 { if height < 0 { panic("lastBlock is negative") } - if height >= math2.MaxInt64 { + if height >= math.MaxInt64 { panic("lastBlock is too large") } return height @@ -226,7 +233,7 @@ func (ob *BitcoinChainClient) SetLastBlockHeightScanned(block int64) { if block < 0 { panic("lastBlockScanned is negative") } - if block >= math2.MaxInt64 { + if block >= math.MaxInt64 { panic("lastBlockScanned is too large") } atomic.StoreInt64(&ob.lastBlockScanned, block) @@ -238,7 +245,7 @@ func (ob *BitcoinChainClient) GetLastBlockHeightScanned() int64 { if height < 0 { panic("lastBlockScanned is negative") } - if height >= math2.MaxInt64 { + if height >= math.MaxInt64 { panic("lastBlockScanned is too large") } return height @@ -281,14 +288,14 @@ func (ob *BitcoinChainClient) observeInTx() error { if err != nil { return fmt.Errorf("error getting block count: %s", err) } - if cnt < 0 || cnt >= math2.MaxInt64 { + if cnt < 0 || cnt >= math.MaxInt64 { return fmt.Errorf("block count is out of range: %d", cnt) } // "confirmed" current block number // #nosec G701 always in range confirmedBlockNum := cnt - int64(ob.GetCoreParams().ConfirmationCount) - if confirmedBlockNum < 0 || confirmedBlockNum > math2.MaxInt64 { + if confirmedBlockNum < 0 || confirmedBlockNum > math.MaxInt64 { return fmt.Errorf("skipping observer , confirmedBlockNum is negative or too large ") } ob.SetLastBlockHeight(confirmedBlockNum) @@ -365,7 +372,7 @@ func (ob *BitcoinChainClient) observeInTx() error { return nil } -// Returns number of required Bitcoin confirmations depending on sent BTC amount. +// ConfirmationsThreshold returns number of required Bitcoin confirmations depending on sent BTC amount. func (ob *BitcoinChainClient) ConfirmationsThreshold(amount *big.Int) int64 { if amount.Cmp(big.NewInt(200000000)) >= 0 { return 6 @@ -373,7 +380,7 @@ func (ob *BitcoinChainClient) ConfirmationsThreshold(amount *big.Int) int64 { return 2 } -// returns isIncluded(or inMempool), isConfirmed, Error +// IsSendOutTxProcessed returns isIncluded(or inMempool), isConfirmed, Error func (ob *BitcoinChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, _ common.CoinType, logger zerolog.Logger) (bool, bool, error) { outTxID := ob.GetTxID(nonce) logger.Info().Msgf("IsSendOutTxProcessed %s", outTxID) @@ -509,7 +516,7 @@ func (ob *BitcoinChainClient) PostGasPrice() error { if feeResult.Errors != nil || feeResult.FeeRate == nil { return fmt.Errorf("error getting gas price: %s", feeResult.Errors) } - if *feeResult.FeeRate > math2.MaxInt64 { + if *feeResult.FeeRate > math.MaxInt64 { return fmt.Errorf("gas price is too large: %f", *feeResult.FeeRate) } // #nosec G701 always in range @@ -538,7 +545,7 @@ type BTCInTxEvnet struct { TxHash string } -// given txs list returned by the "getblock 2" RPC command, return the txs that are relevant to us +// FilterAndParseIncomingTx given txs list returned by the "getblock 2" RPC command, return the txs that are relevant to us // relevant tx must have the following vouts as the first two vouts: // vout0: p2wpkh to the TSS address (targetAddress) // vout1: OP_RETURN memo, base64 encoded @@ -572,14 +579,14 @@ func (ob *BitcoinChainClient) GetInboundVoteMessageFromBtcEvent(inTx *BTCInTxEvn inTx.FromAddress, inTx.FromAddress, common.ZetaChain().ChainId, - math.NewUintFromBigInt(amountInt), + cosmosmath.NewUintFromBigInt(amountInt), message, inTx.TxHash, inTx.BlockNumber, 0, common.CoinType_Gas, "", - ob.zetaClient.keys.GetOperatorAddress().String(), + ob.zetaClient.GetKeys().GetOperatorAddress().String(), ) } @@ -811,7 +818,7 @@ func (ob *BitcoinChainClient) findNonceMarkUTXO(nonce uint64, txid string) (int, return -1, fmt.Errorf("findNonceMarkUTXO: cannot find nonce-mark utxo with nonce %d", nonce) } -// Selects a sublist of utxos to be used as inputs. +// SelectUTXOs selects a sublist of utxos to be used as inputs. // // Parameters: // - amount: The desired minimum total value of the selected UTXOs. @@ -897,7 +904,7 @@ func (ob *BitcoinChainClient) SelectUTXOs(amount float64, utxosToSpend uint16, n return results, total, consolidatedUtxo, consolidatedValue, nil } -// Save successfully broadcasted transaction +// SaveBroadcastedTx saves successfully broadcasted transaction func (ob *BitcoinChainClient) SaveBroadcastedTx(txHash string, nonce uint64) { outTxID := ob.GetTxID(nonce) ob.Mu.Lock() @@ -1072,7 +1079,7 @@ func (ob *BitcoinChainClient) getRawTxResult(hash *chainhash.Hash, res *btcjson. } } -// Vin is valid if: +// checkTSSVin checks vin is valid if: // - The first input is the nonce-mark // - All inputs are from TSS address func (ob *BitcoinChainClient) checkTSSVin(vins []btcjson.Vin, nonce uint64) error { @@ -1104,7 +1111,7 @@ func (ob *BitcoinChainClient) checkTSSVin(vins []btcjson.Vin, nonce uint64) erro return nil } -// Vout is valid if: +// checkTSSVout vout is valid if: // - The first output is the nonce-mark // - The second output is the correct payment to recipient // - The third output is the change to TSS (optional) diff --git a/zetaclient/block_height.go b/zetaclient/block_height.go index 7c2d19ee0b..587fd8b8f4 100644 --- a/zetaclient/block_height.go +++ b/zetaclient/block_height.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - //"github.com/Meta-Protocol/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" ) @@ -23,22 +22,3 @@ func (b *ZetaCoreBridge) GetBlockHeight() (int64, error) { fmt.Printf("block height: %d\n", height.Height) return height.Height, nil } - -//func (b *ZetaCoreBridge) GetLastBlockObserved(chain common.Chain) (uint64, error) { -// Client := types.NewQueryClient(b.grpcConn) -// last_obs, err := Client.LastBlockObserved( -// context.Background(), -// &types.QueryGetLastBlockObservedRequest{ -// Index: chain.String(), -// }, -// ) -// if err != nil { -// return 0, err -// } -// -// observed := last_obs.LastBlockObserved -// fmt.Printf("last observed block height on chain %s: %d\n", -// observed.Chain, -// observed.Height) -// return observed.Height, nil -//} diff --git a/zetaclient/btc_signer.go b/zetaclient/btc_signer.go index afe93c7d4e..99385842d7 100644 --- a/zetaclient/btc_signer.go +++ b/zetaclient/btc_signer.go @@ -17,7 +17,7 @@ import ( "github.com/rs/zerolog" "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" - zetaObserverModuleTypes "github.com/zeta-chain/zetacore/x/observer/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" "github.com/zeta-chain/zetacore/zetaclient/config" ) @@ -35,7 +35,7 @@ const ( type BTCSigner struct { tssSigner TSSSigner - rpcClient *rpcclient.Client + rpcClient BTCRPCClient logger zerolog.Logger ts *TelemetryServer } @@ -67,8 +67,16 @@ func NewBTCSigner(cfg config.BTCConfig, tssSigner TSSSigner, logger zerolog.Logg } // SignWithdrawTx receives utxos sorted by value, amount in BTC, feeRate in BTC per Kb -func (signer *BTCSigner) SignWithdrawTx(to *btcutil.AddressWitnessPubKeyHash, amount float64, gasPrice *big.Int, sizeLimit uint64, - btcClient *BitcoinChainClient, height uint64, nonce uint64, chain *common.Chain) (*wire.MsgTx, error) { +func (signer *BTCSigner) SignWithdrawTx( + to *btcutil.AddressWitnessPubKeyHash, + amount float64, + gasPrice *big.Int, + sizeLimit uint64, + btcClient *BitcoinChainClient, + height uint64, + nonce uint64, + chain *common.Chain, +) (*wire.MsgTx, error) { estimateFee := float64(gasPrice.Uint64()) * outTxBytesMax / 1e8 nonceMark := common.NonceMarkAmount(nonce) @@ -224,7 +232,14 @@ func (signer *BTCSigner) Broadcast(signedTx *wire.MsgTx) error { return nil } -func (signer *BTCSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *OutTxProcessorManager, outTxID string, chainclient ChainClient, zetaBridge *ZetaCoreBridge, height uint64) { +func (signer *BTCSigner) TryProcessOutTx( + send *types.CrossChainTx, + outTxMan *OutTxProcessorManager, + outTxID string, + chainclient ChainClient, + zetaBridge ZetaCoreBridger, + height uint64, +) { defer func() { outTxMan.EndTryProcess(outTxID) if err := recover(); err != nil { @@ -258,7 +273,7 @@ func (signer *BTCSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out logger.Info().Msgf("outbound is disabled") return } - myid := zetaBridge.keys.GetAddress() + myid := zetaBridge.GetKeys().GetAddress() // Early return if the send is already processed // FIXME: handle revert case outboundTxTssNonce := params.OutboundTxTssNonce @@ -293,8 +308,17 @@ func (signer *BTCSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out logger.Info().Msgf("SignWithdrawTx: to %s, value %d sats", addr.EncodeAddress(), params.Amount.Uint64()) logger.Info().Msgf("using utxos: %v", btcClient.utxos) - tx, err := signer.SignWithdrawTx(to, float64(params.Amount.Uint64())/1e8, gasprice, sizelimit, btcClient, height, - outboundTxTssNonce, &btcClient.chain) + + tx, err := signer.SignWithdrawTx( + to, + float64(params.Amount.Uint64())/1e8, + gasprice, + sizelimit, + btcClient, + height, + outboundTxTssNonce, + &btcClient.chain, + ) if err != nil { logger.Warn().Err(err).Msgf("SignOutboundTx error: nonce %d chain %d", outboundTxTssNonce, params.ReceiverChainId) return @@ -303,7 +327,7 @@ func (signer *BTCSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out // FIXME: add prometheus metrics _, err = zetaBridge.GetObserverList(btcClient.chain) if err != nil { - logger.Warn().Err(err).Msgf("unable to get observer list: chain %d observation %s", outboundTxTssNonce, zetaObserverModuleTypes.ObservationType_OutBoundTx.String()) + logger.Warn().Err(err).Msgf("unable to get observer list: chain %d observation %s", outboundTxTssNonce, observertypes.ObservationType_OutBoundTx.String()) } if tx != nil { outTxHash := tx.TxHash().String() diff --git a/zetaclient/btc_test.go b/zetaclient/btc_test.go index 3144ffa927..16f60c25db 100644 --- a/zetaclient/btc_test.go +++ b/zetaclient/btc_test.go @@ -7,19 +7,16 @@ import ( "math/big" "testing" - "github.com/zeta-chain/zetacore/common" - - "gorm.io/driver/sqlite" - "gorm.io/gorm" - - "github.com/stretchr/testify/suite" - "github.com/btcsuite/btcd/btcec" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/txscript" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" + "github.com/stretchr/testify/suite" + "github.com/zeta-chain/zetacore/common" + "gorm.io/driver/sqlite" + "gorm.io/gorm" ) type BTCSignTestSuite struct { diff --git a/zetaclient/chain_signer.go b/zetaclient/chain_signer.go deleted file mode 100644 index 7fe2115f4e..0000000000 --- a/zetaclient/chain_signer.go +++ /dev/null @@ -1,9 +0,0 @@ -package zetaclient - -import ( - "github.com/zeta-chain/zetacore/x/crosschain/types" -) - -type ChainSigner interface { - TryProcessOutTx(send *types.CrossChainTx, outTxMan *OutTxProcessorManager, outTxID string, evmClient ChainClient, zetaBridge *ZetaCoreBridge, height uint64) -} diff --git a/zetaclient/chainclient.go b/zetaclient/chainclient.go deleted file mode 100644 index c92f29a77e..0000000000 --- a/zetaclient/chainclient.go +++ /dev/null @@ -1,26 +0,0 @@ -package zetaclient - -import ( - "github.com/prometheus/client_golang/prometheus" - "github.com/rs/zerolog" - "github.com/zeta-chain/zetacore/common" - observertypes "github.com/zeta-chain/zetacore/x/observer/types" -) - -// general chain client - -type ChainClient interface { - //GetLastBlockHeight() int64 // 0 means error - //SetLastBlockHeight(int64) - Start() - Stop() - //GetBaseGasPrice() *big.Int - IsSendOutTxProcessed(sendHash string, nonce uint64, cointype common.CoinType, logger zerolog.Logger) (bool, bool, error) - //PostNonceIfNotRecorded(logger zerolog.Logger) error - SetCoreParams(observertypes.CoreParams) - GetCoreParams() observertypes.CoreParams - GetPromGauge(name string) (prometheus.Gauge, error) - GetPromCounter(name string) (prometheus.Counter, error) - GetTxID(nonce uint64) string - ExternalChainWatcherForNewInboundTrackerSuggestions() -} diff --git a/zetaclient/errors.go b/zetaclient/errors.go index 3213ef222f..3c8b579301 100644 --- a/zetaclient/errors.go +++ b/zetaclient/errors.go @@ -5,7 +5,6 @@ import ( ) var ( - ErrBech32ifyPubKey = errors.New("Bech32ifyPubKey fail in main") - ErrNewPubKey = errors.New("NewPubKey error from string") - ErrKeySignStatusFail = errors.New("keysign failed with blame data") + ErrBech32ifyPubKey = errors.New("Bech32ifyPubKey fail in main") + ErrNewPubKey = errors.New("NewPubKey error from string") ) diff --git a/zetaclient/evm_client.go b/zetaclient/evm_client.go index f5cdbe1de4..3a9dc30411 100644 --- a/zetaclient/evm_client.go +++ b/zetaclient/evm_client.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "fmt" - math2 "math" + "math" "math/big" "os" "sort" @@ -13,30 +13,26 @@ import ( "sync/atomic" "time" - "gorm.io/driver/sqlite" - "gorm.io/gorm" - + "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" + ethcommon "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" "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" - metricsPkg "github.com/zeta-chain/zetacore/zetaclient/metrics" - - "github.com/ethereum/go-ethereum" - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/ethclient" "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "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/zetaclient/config" - "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" + "github.com/zeta-chain/zetacore/zetaclient/config" + metricsPkg "github.com/zeta-chain/zetacore/zetaclient/metrics" clienttypes "github.com/zeta-chain/zetacore/zetaclient/types" + "gorm.io/driver/sqlite" + "gorm.io/gorm" ) type TxHashEnvelope struct { @@ -61,14 +57,14 @@ const ( DonationMessage = "I am rich!" ) -// Chain configuration struct +// EVMChainClient represents the chain configuration for an EVM chain // Filled with above constants depending on chain type EVMChainClient struct { *ChainMetrics chain common.Chain - evmClient *ethclient.Client - KlaytnClient *KlaytnClient - zetaClient *ZetaCoreBridge + evmClient EVMRPCClient + KlaytnClient KlaytnRPCClient + zetaClient ZetaCoreBridger Tss TSSSigner lastBlockScanned int64 lastBlock int64 @@ -93,8 +89,17 @@ type EVMChainClient struct { var _ ChainClient = (*EVMChainClient)(nil) -// Return configuration based on supplied target chain -func NewEVMChainClient(bridge *ZetaCoreBridge, tss TSSSigner, dbpath string, metrics *metricsPkg.Metrics, logger zerolog.Logger, cfg *config.Config, evmCfg config.EVMConfig, ts *TelemetryServer) (*EVMChainClient, error) { +// NewEVMChainClient returns a new configuration based on supplied target chain +func NewEVMChainClient( + bridge ZetaCoreBridger, + tss TSSSigner, + dbpath string, + metrics *metricsPkg.Metrics, + logger zerolog.Logger, + cfg *config.Config, + evmCfg config.EVMConfig, + ts *TelemetryServer, +) (*EVMChainClient, error) { ob := EVMChainClient{ ChainMetrics: NewChainMetrics(evmCfg.Chain.ChainName.String(), metrics), ts: ts, @@ -140,12 +145,12 @@ func NewEVMChainClient(bridge *ZetaCoreBridge, tss TSSSigner, dbpath string, met } if ob.chain.IsKlaytnChain() { - kclient, err := Dial(evmCfg.Endpoint) + client, err := Dial(evmCfg.Endpoint) if err != nil { ob.logger.ChainLogger.Err(err).Msg("klaytn Client Dial") return nil, err } - ob.KlaytnClient = kclient + ob.KlaytnClient = client } // create metric counters @@ -228,7 +233,7 @@ func (ob *EVMChainClient) GetConnectorContract() (*zetaconnector.ZetaConnectorNo return FetchConnectorContract(addr, ob.evmClient) } -func FetchConnectorContract(addr ethcommon.Address, client *ethclient.Client) (*zetaconnector.ZetaConnectorNonEth, error) { +func FetchConnectorContract(addr ethcommon.Address, client EVMRPCClient) (*zetaconnector.ZetaConnectorNonEth, error) { return zetaconnector.NewZetaConnectorNonEth(addr, client) } func (ob *EVMChainClient) GetERC20CustodyContract() (*erc20custody.ERC20Custody, error) { @@ -236,7 +241,7 @@ func (ob *EVMChainClient) GetERC20CustodyContract() (*erc20custody.ERC20Custody, return FetchERC20CustodyContract(addr, ob.evmClient) } -func FetchERC20CustodyContract(addr ethcommon.Address, client *ethclient.Client) (*erc20custody.ERC20Custody, error) { +func FetchERC20CustodyContract(addr ethcommon.Address, client EVMRPCClient) (*erc20custody.ERC20Custody, error) { return erc20custody.NewERC20Custody(addr, client) } @@ -349,7 +354,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co logs := receipt.Logs for _, vLog := range logs { confHeight := vLog.BlockNumber + params.ConfirmationCount - if confHeight < 0 || confHeight >= math2.MaxInt64 { + if confHeight < 0 || confHeight >= math.MaxInt64 { return false, false, fmt.Errorf("confHeight is out of range") } // TODO rewrite this to return early if not confirmed @@ -463,7 +468,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co for _, vLog := range logs { event, err := ERC20Custody.ParseWithdrawn(*vLog) confHeight := vLog.BlockNumber + params.ConfirmationCount - if confHeight < 0 || confHeight >= math2.MaxInt64 { + if confHeight < 0 || confHeight >= math.MaxInt64 { return false, false, fmt.Errorf("confHeight is out of range") } if err == nil { @@ -631,7 +636,7 @@ func (ob *EVMChainClient) queryTxByHash(txHash string, nonce uint64) (*ethtypes. return nil, nil, fmt.Errorf("queryTxByHash: txHash %s nonce mismatch: wanted %d, got tx nonce %d", txHash, nonce, transaction.Nonce()) } confHeight := receipt.BlockNumber.Uint64() + ob.GetCoreParams().ConfirmationCount - if confHeight < 0 || confHeight >= math2.MaxInt64 { + if confHeight < 0 || confHeight >= math.MaxInt64 { return nil, nil, fmt.Errorf("confHeight is out of range") } @@ -648,7 +653,7 @@ func (ob *EVMChainClient) SetLastBlockHeightScanned(block int64) { if block < 0 { panic("lastBlockScanned is negative") } - if block >= math2.MaxInt64 { + if block >= math.MaxInt64 { panic("lastBlockScanned is too large") } atomic.StoreInt64(&ob.lastBlockScanned, block) @@ -661,7 +666,7 @@ func (ob *EVMChainClient) GetLastBlockHeightScanned() int64 { if height < 0 { panic("lastBlockScanned is negative") } - if height >= math2.MaxInt64 { + if height >= math.MaxInt64 { panic("lastBlockScanned is too large") } return height @@ -672,7 +677,7 @@ func (ob *EVMChainClient) SetLastBlockHeight(block int64) { if block < 0 { panic("lastBlock is negative") } - if block >= math2.MaxInt64 { + if block >= math.MaxInt64 { panic("lastBlock is too large") } atomic.StoreInt64(&ob.lastBlock, block) @@ -684,7 +689,7 @@ func (ob *EVMChainClient) GetLastBlockHeight() int64 { if height < 0 { panic("lastBlock is negative") } - if height >= math2.MaxInt64 { + if height >= math.MaxInt64 { panic("lastBlock is too large") } return height @@ -735,7 +740,7 @@ func (ob *EVMChainClient) observeInTX() error { // skip if no new block is produced. sampledLogger := ob.logger.ExternalChainWatcher.Sample(&zerolog.BasicSampler{N: 10}) - if confirmedBlockNum < 0 || confirmedBlockNum > math2.MaxUint64 { + if confirmedBlockNum < 0 || confirmedBlockNum > math.MaxUint64 { sampledLogger.Error().Msg("Skipping observer , confirmedBlockNum is negative or too large ") return nil } @@ -752,10 +757,10 @@ func (ob *EVMChainClient) observeInTX() error { // #nosec G701 checked in range toBlock = int64(confirmedBlockNum) } - if startBlock < 0 || startBlock >= math2.MaxInt64 { + if startBlock < 0 || startBlock >= math.MaxInt64 { return fmt.Errorf("startBlock is negative or too large") } - if toBlock < 0 || toBlock >= math2.MaxInt64 { + if toBlock < 0 || toBlock >= math.MaxInt64 { return fmt.Errorf("toBlock is negative or too large") } ob.logger.ExternalChainWatcher.Info().Msgf("Checking for all inTX : startBlock %d, toBlock %d", startBlock, toBlock) diff --git a/zetaclient/evm_signer.go b/zetaclient/evm_signer.go index 925354f27c..e00741fb10 100644 --- a/zetaclient/evm_signer.go +++ b/zetaclient/evm_signer.go @@ -25,7 +25,7 @@ import ( ) type EVMSigner struct { - client *ethclient.Client + client EVMRPCClient chain *common.Chain chainID *big.Int tssSigner TSSSigner @@ -40,7 +40,17 @@ type EVMSigner struct { var _ ChainSigner = &EVMSigner{} -func NewEVMSigner(chain common.Chain, endpoint string, tssSigner TSSSigner, abiString string, erc20CustodyABIString string, metaContract ethcommon.Address, erc20CustodyContract ethcommon.Address, logger zerolog.Logger, ts *TelemetryServer) (*EVMSigner, error) { +func NewEVMSigner( + chain common.Chain, + endpoint string, + tssSigner TSSSigner, + abiString string, + erc20CustodyABIString string, + metaContract ethcommon.Address, + erc20CustodyContract ethcommon.Address, + logger zerolog.Logger, + ts *TelemetryServer, +) (*EVMSigner, error) { client, err := ethclient.Dial(endpoint) if err != nil { return nil, err @@ -77,9 +87,16 @@ func NewEVMSigner(chain common.Chain, endpoint string, tssSigner TSSSigner, abiS }, nil } -// given data, and metadata (gas, nonce, etc) +// Sign given data, and metadata (gas, nonce, etc) // returns a signed transaction, sig bytes, hash bytes, and error -func (signer *EVMSigner) Sign(data []byte, to ethcommon.Address, gasLimit uint64, gasPrice *big.Int, nonce uint64, height uint64) (*ethtypes.Transaction, []byte, []byte, error) { +func (signer *EVMSigner) Sign( + data []byte, + to ethcommon.Address, + gasLimit uint64, + gasPrice *big.Int, + nonce uint64, + height uint64, +) (*ethtypes.Transaction, []byte, []byte, error) { log.Debug().Msgf("TSS SIGNER: %s", signer.tssSigner.Pubkey()) tx := ethtypes.NewTransaction(nonce, to, big.NewInt(0), gasLimit, gasPrice, data) hashBytes := signer.ethSigner.Hash(tx).Bytes() @@ -102,13 +119,14 @@ func (signer *EVMSigner) Sign(data []byte, to ethcommon.Address, gasLimit uint64 return signedTX, sig[:], hashBytes[:], nil } -// takes in signed tx, broadcast to external chain node +// Broadcast takes in signed tx, broadcast to external chain node func (signer *EVMSigner) Broadcast(tx *ethtypes.Transaction) error { ctxt, cancel := context.WithTimeout(context.Background(), 1*time.Second) defer cancel() return signer.client.SendTransaction(ctxt, tx) } +// SignOutboundTx // function onReceive( // // bytes calldata originSenderAddress, @@ -149,6 +167,7 @@ func (signer *EVMSigner) SignOutboundTx(sender ethcommon.Address, return tx, nil } +// SignRevertTx // function onRevert( // address originSenderAddress, // uint256 originChainId, @@ -158,7 +177,19 @@ func (signer *EVMSigner) SignOutboundTx(sender ethcommon.Address, // bytes calldata message, // bytes32 internalSendHash // ) external override whenNotPaused onlyTssAddress -func (signer *EVMSigner) SignRevertTx(sender ethcommon.Address, srcChainID *big.Int, to []byte, toChainID *big.Int, amount *big.Int, gasLimit uint64, message []byte, sendHash [32]byte, nonce uint64, gasPrice *big.Int, height uint64) (*ethtypes.Transaction, error) { +func (signer *EVMSigner) SignRevertTx( + sender ethcommon.Address, + srcChainID *big.Int, + to []byte, + toChainID *big.Int, + amount *big.Int, + gasLimit uint64, + message []byte, + sendHash [32]byte, + nonce uint64, + gasPrice *big.Int, + height uint64, +) (*ethtypes.Transaction, error) { var data []byte var err error @@ -196,7 +227,13 @@ func (signer *EVMSigner) SignCancelTx(nonce uint64, gasPrice *big.Int, height ui return signedTX, nil } -func (signer *EVMSigner) SignWithdrawTx(to ethcommon.Address, amount *big.Int, nonce uint64, gasPrice *big.Int, height uint64) (*ethtypes.Transaction, error) { +func (signer *EVMSigner) SignWithdrawTx( + to ethcommon.Address, + amount *big.Int, + nonce uint64, + gasPrice *big.Int, + height uint64, +) (*ethtypes.Transaction, error) { tx := ethtypes.NewTransaction(nonce, to, amount, 21000, gasPrice, nil) hashBytes := signer.ethSigner.Hash(tx).Bytes() sig, err := signer.tssSigner.Sign(hashBytes, height, nonce, signer.chain, "") @@ -217,7 +254,15 @@ func (signer *EVMSigner) SignWithdrawTx(to ethcommon.Address, amount *big.Int, n return signedTX, nil } -func (signer *EVMSigner) SignCommandTx(cmd string, params string, to ethcommon.Address, outboundParams *types.OutboundTxParams, gasLimit uint64, gasPrice *big.Int, height uint64) (*ethtypes.Transaction, error) { +func (signer *EVMSigner) SignCommandTx( + cmd string, + params string, + to ethcommon.Address, + outboundParams *types.OutboundTxParams, + gasLimit uint64, + gasPrice *big.Int, + height uint64, +) (*ethtypes.Transaction, error) { if cmd == common.CmdWhitelistERC20 { erc20 := ethcommon.HexToAddress(params) if erc20 == (ethcommon.Address{}) { @@ -261,7 +306,14 @@ func (signer *EVMSigner) SignCommandTx(cmd string, params string, to ethcommon.A return nil, fmt.Errorf("SignCommandTx: unknown command %s", cmd) } -func (signer *EVMSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *OutTxProcessorManager, outTxID string, evmClient ChainClient, zetaBridge *ZetaCoreBridge, height uint64) { +func (signer *EVMSigner) TryProcessOutTx( + send *types.CrossChainTx, + outTxMan *OutTxProcessorManager, + outTxID string, + evmClient ChainClient, + zetaBridge ZetaCoreBridger, + height uint64, +) { logger := signer.logger.With(). Str("outTxID", outTxID). Str("SendHash", send.Index). @@ -272,7 +324,7 @@ func (signer *EVMSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out defer func() { outTxMan.EndTryProcess(outTxID) }() - myid := zetaBridge.keys.GetOperatorAddress() + myID := zetaBridge.GetKeys().GetOperatorAddress() var to ethcommon.Address var err error @@ -504,7 +556,7 @@ func (signer *EVMSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out } if tx != nil { outTxHash := tx.Hash().Hex() - logger.Info().Msgf("on chain %s nonce %d, outTxHash %s signer %s", signer.chain, send.GetCurrentOutTxParam().OutboundTxTssNonce, outTxHash, myid) + logger.Info().Msgf("on chain %s nonce %d, outTxHash %s signer %s", signer.chain, send.GetCurrentOutTxParam().OutboundTxTssNonce, outTxHash, myID) //if len(signers) == 0 || myid == signers[send.OutboundTxParams.Broadcaster] || myid == signers[int(send.OutboundTxParams.Broadcaster+1)%len(signers)] { backOff := 1000 * time.Millisecond // retry loop: 1s, 2s, 4s, 8s, 16s in case of RPC error @@ -539,16 +591,23 @@ func (signer *EVMSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out } } - //} - } +// SignERC20WithdrawTx // function withdraw( // address recipient, // address asset, // uint256 amount, // ) external onlyTssAddress -func (signer *EVMSigner) SignERC20WithdrawTx(recipient ethcommon.Address, asset ethcommon.Address, amount *big.Int, gasLimit uint64, nonce uint64, gasPrice *big.Int, height uint64) (*ethtypes.Transaction, error) { +func (signer *EVMSigner) SignERC20WithdrawTx( + recipient ethcommon.Address, + asset ethcommon.Address, + amount *big.Int, + gasLimit uint64, + nonce uint64, + gasPrice *big.Int, + height uint64, +) (*ethtypes.Transaction, error) { var data []byte var err error data, err = signer.erc20CustodyABI.Pack("withdraw", recipient, asset, amount) @@ -564,13 +623,22 @@ func (signer *EVMSigner) SignERC20WithdrawTx(recipient ethcommon.Address, asset return tx, nil } +// SignWhitelistTx // function whitelist( // address asset, // ) external onlyTssAddress // function unwhitelist( // address asset, // ) external onlyTssAddress -func (signer *EVMSigner) SignWhitelistTx(action string, _ ethcommon.Address, asset ethcommon.Address, gasLimit uint64, nonce uint64, gasPrice *big.Int, height uint64) (*ethtypes.Transaction, error) { +func (signer *EVMSigner) SignWhitelistTx( + action string, + _ ethcommon.Address, + asset ethcommon.Address, + gasLimit uint64, + nonce uint64, + gasPrice *big.Int, + height uint64, +) (*ethtypes.Transaction, error) { var data []byte var err error diff --git a/zetaclient/interfaces.go b/zetaclient/interfaces.go new file mode 100644 index 0000000000..8abe50eb86 --- /dev/null +++ b/zetaclient/interfaces.go @@ -0,0 +1,122 @@ +package zetaclient + +import ( + "context" + "math/big" + + "github.com/btcsuite/btcd/btcjson" + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/btcsuite/btcd/wire" + "github.com/btcsuite/btcutil" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + ethcommon "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/prometheus/client_golang/prometheus" + "github.com/rs/zerolog" + "github.com/zeta-chain/zetacore/common" + crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" + "gitlab.com/thorchain/tss/go-tss/blame" +) + +// ChainClient is the interface for chain clients +type ChainClient interface { + Start() + Stop() + IsSendOutTxProcessed(sendHash string, nonce uint64, cointype common.CoinType, logger zerolog.Logger) (bool, bool, error) + SetCoreParams(observertypes.CoreParams) + GetCoreParams() observertypes.CoreParams + GetPromGauge(name string) (prometheus.Gauge, error) + GetPromCounter(name string) (prometheus.Counter, error) + GetTxID(nonce uint64) string + ExternalChainWatcherForNewInboundTrackerSuggestions() +} + +// ChainSigner is the interface to sign transactions for a chain +type ChainSigner interface { + TryProcessOutTx( + send *crosschaintypes.CrossChainTx, + outTxMan *OutTxProcessorManager, + outTxID string, + evmClient ChainClient, + zetaBridge ZetaCoreBridger, + height uint64, + ) +} + +// ZetaCoreBridger is the interface to interact with ZetaCore +type ZetaCoreBridger interface { + PostSend(zetaGasLimit uint64, msg *crosschaintypes.MsgVoteOnObservedInboundTx) (string, error) + PostReceiveConfirmation( + sendHash string, + outTxHash string, + outBlockHeight uint64, + outTxGasUsed uint64, + outTxEffectiveGasPrice *big.Int, + outTxEffectiveGasLimit uint64, + amount *big.Int, + status common.ReceiveStatus, + chain common.Chain, + nonce uint64, + coinType common.CoinType, + ) (string, error) + PostGasPrice(chain common.Chain, gasPrice uint64, supply string, blockNum uint64) (string, error) + PostAddBlockHeader(chainID int64, txhash []byte, height int64, header common.HeaderData) (string, error) + PostBlameData(blame *blame.Blame, chainID int64, index string) (string, error) + AddTxHashToOutTxTracker( + chainID int64, + nonce uint64, + txHash string, + proof *common.Proof, + blockHash string, + txIndex int64, + ) (string, error) + GetKeys() *Keys + GetBlockHeight() (int64, error) + GetZetaBlockHeight() (int64, error) + GetLastBlockHeightByChain(chain common.Chain) (*crosschaintypes.LastBlockHeight, error) + GetAllPendingCctx(chainID int64) ([]*crosschaintypes.CrossChainTx, error) + GetPendingNoncesByChain(chainID int64) (crosschaintypes.PendingNonces, error) + GetCctxByNonce(chainID int64, nonce uint64) (*crosschaintypes.CrossChainTx, error) + GetAllOutTxTrackerByChain(chain common.Chain, order Order) ([]crosschaintypes.OutTxTracker, error) + GetCrosschainFlags() (observertypes.CrosschainFlags, error) + GetObserverList(chain common.Chain) ([]string, error) + GetKeyGen() (*observertypes.Keygen, error) + GetBtcTssAddress() (string, error) + GetInboundTrackersForChain(chainID int64) ([]crosschaintypes.InTxTracker, error) + GetLogger() *zerolog.Logger + Pause() + Unpause() +} + +// BTCRPCClient is the interface for BTC RPC client +type BTCRPCClient interface { + SendRawTransaction(tx *wire.MsgTx, allowHighFees bool) (*chainhash.Hash, error) + ListUnspentMinMaxAddresses(minConf int, maxConf int, addrs []btcutil.Address) ([]btcjson.ListUnspentResult, error) + EstimateSmartFee(confTarget int64, mode *btcjson.EstimateSmartFeeMode) (*btcjson.EstimateSmartFeeResult, error) + GetTransaction(txHash *chainhash.Hash) (*btcjson.GetTransactionResult, error) + GetRawTransactionVerbose(txHash *chainhash.Hash) (*btcjson.TxRawResult, error) + GetBlockCount() (int64, error) + GetBlockHash(blockHeight int64) (*chainhash.Hash, error) + GetBlockVerbose(blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseResult, error) + GetBlockVerboseTx(blockHash *chainhash.Hash) (*btcjson.GetBlockVerboseTxResult, error) + GetBlockHeader(blockHash *chainhash.Hash) (*wire.BlockHeader, error) +} + +// EVMRPCClient is the interface for EVM RPC client +type EVMRPCClient interface { + bind.ContractBackend + SendTransaction(ctx context.Context, tx *ethtypes.Transaction) error + SuggestGasPrice(ctx context.Context) (*big.Int, error) + BlockNumber(ctx context.Context) (uint64, error) + BlockByNumber(ctx context.Context, number *big.Int) (*ethtypes.Block, error) + HeaderByNumber(ctx context.Context, number *big.Int) (*ethtypes.Header, error) + TransactionByHash(ctx context.Context, hash ethcommon.Hash) (tx *ethtypes.Transaction, isPending bool, err error) + TransactionReceipt(ctx context.Context, txHash ethcommon.Hash) (*ethtypes.Receipt, error) + TransactionSender(ctx context.Context, tx *ethtypes.Transaction, block ethcommon.Hash, index uint) (ethcommon.Address, error) +} + +// KlaytnRPCClient is the interface for Klaytn RPC client +type KlaytnRPCClient interface { + BlockByNumber(ctx context.Context, number *big.Int) (*RPCBlock, error) +} diff --git a/zetaclient/query.go b/zetaclient/query.go index d84d335e0c..b773bc3a02 100644 --- a/zetaclient/query.go +++ b/zetaclient/query.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "sort" - "time" "github.com/cosmos/cosmos-sdk/client/grpc/tmservice" @@ -13,7 +12,7 @@ import ( tmtypes "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" - zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" "google.golang.org/grpc" ) @@ -25,30 +24,31 @@ const ( Descending Order = "DESC" ) -func (b *ZetaCoreBridge) GetCrosschainFlags() (zetaObserverTypes.CrosschainFlags, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) - resp, err := client.CrosschainFlags(context.Background(), &zetaObserverTypes.QueryGetCrosschainFlagsRequest{}) +func (b *ZetaCoreBridge) GetCrosschainFlags() (observertypes.CrosschainFlags, error) { + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.CrosschainFlags(context.Background(), &observertypes.QueryGetCrosschainFlagsRequest{}) if err != nil { - return zetaObserverTypes.CrosschainFlags{}, err + return observertypes.CrosschainFlags{}, err } return resp.CrosschainFlags, nil } -func (b *ZetaCoreBridge) GetCoreParamsForChainID(externalChainID int64) (*zetaObserverTypes.CoreParams, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) - resp, err := client.GetCoreParamsForChain(context.Background(), &zetaObserverTypes.QueryGetCoreParamsForChainRequest{ChainId: externalChainID}) +func (b *ZetaCoreBridge) GetCoreParamsForChainID(externalChainID int64) (*observertypes.CoreParams, error) { + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.GetCoreParamsForChain(context.Background(), &observertypes.QueryGetCoreParamsForChainRequest{ChainId: externalChainID}) if err != nil { - return &zetaObserverTypes.CoreParams{}, err + return &observertypes.CoreParams{}, err } return resp.CoreParams, nil } -func (b *ZetaCoreBridge) GetCoreParams() ([]*zetaObserverTypes.CoreParams, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) +func (b *ZetaCoreBridge) GetCoreParams() ([]*observertypes.CoreParams, error) { + client := observertypes.NewQueryClient(b.grpcConn) var err error - resp := &zetaObserverTypes.QueryGetCoreParamsResponse{} + + resp := &observertypes.QueryGetCoreParamsResponse{} for i := 0; i <= DefaultRetryCount; i++ { - resp, err = client.GetCoreParams(context.Background(), &zetaObserverTypes.QueryGetCoreParamsRequest{}) + resp, err = client.GetCoreParams(context.Background(), &observertypes.QueryGetCoreParamsRequest{}) if err == nil { return resp.CoreParams.CoreParams, nil } @@ -57,11 +57,11 @@ func (b *ZetaCoreBridge) GetCoreParams() ([]*zetaObserverTypes.CoreParams, error return nil, fmt.Errorf("failed to get core params | err %s", err.Error()) } -func (b *ZetaCoreBridge) GetObserverParams() (zetaObserverTypes.Params, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) - resp, err := client.Params(context.Background(), &zetaObserverTypes.QueryParamsRequest{}) +func (b *ZetaCoreBridge) GetObserverParams() (observertypes.Params, error) { + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.Params(context.Background(), &observertypes.QueryParamsRequest{}) if err != nil { - return zetaObserverTypes.Params{}, err + return observertypes.Params{}, err } return resp.Params, nil } @@ -76,21 +76,6 @@ func (b *ZetaCoreBridge) GetUpgradePlan() (*upgradetypes.Plan, error) { return resp.Plan, nil } -//func (b *ZetaCoreBridge) GetAccountDetails(address string) (string, error) { -// client := authtypes.NewQueryClient(b.grpcConn) -// resp, err := client.Account(context.Background(), &authtypes.QueryAccountRequest{ -// Address: address, -// }) -// if err != nil { -// b.logger.Error().Err(err).Msg("Query account failed") -// return "", err -// } -// -// err := resp.UnpackInterfaces -// return resp.Account.GetTypeUrl(), nil -// -//} - func (b *ZetaCoreBridge) GetAllCctx() ([]*types.CrossChainTx, error) { client := types.NewQueryClient(b.grpcConn) resp, err := client.CctxAll(context.Background(), &types.QueryAllCctxRequest{}) @@ -123,10 +108,10 @@ func (b *ZetaCoreBridge) GetCctxByNonce(chainID int64, nonce uint64) (*types.Cro func (b *ZetaCoreBridge) GetObserverList(chain common.Chain) ([]string, error) { var err error + client := observertypes.NewQueryClient(b.grpcConn) - client := zetaObserverTypes.NewQueryClient(b.grpcConn) for i := 0; i <= DefaultRetryCount; i++ { - resp, err := client.ObserversByChain(context.Background(), &zetaObserverTypes.QueryObserversByChainRequest{ObservationChain: chain.ChainName.String()}) + resp, err := client.ObserversByChain(context.Background(), &observertypes.QueryObserversByChainRequest{ObservationChain: chain.ChainName.String()}) if err == nil { return resp.Observers, nil } @@ -205,9 +190,9 @@ func (b *ZetaCoreBridge) GetNonceByChain(chain common.Chain) (*types.ChainNonces return resp.ChainNonces, nil } -func (b *ZetaCoreBridge) GetAllNodeAccounts() ([]*zetaObserverTypes.NodeAccount, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) - resp, err := client.NodeAccountAll(context.Background(), &zetaObserverTypes.QueryAllNodeAccountRequest{}) +func (b *ZetaCoreBridge) GetAllNodeAccounts() ([]*observertypes.NodeAccount, error) { + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.NodeAccountAll(context.Background(), &observertypes.QueryAllNodeAccountRequest{}) if err != nil { return nil, err } @@ -215,12 +200,12 @@ func (b *ZetaCoreBridge) GetAllNodeAccounts() ([]*zetaObserverTypes.NodeAccount, return resp.NodeAccount, nil } -func (b *ZetaCoreBridge) GetKeyGen() (*zetaObserverTypes.Keygen, error) { +func (b *ZetaCoreBridge) GetKeyGen() (*observertypes.Keygen, error) { var err error + client := observertypes.NewQueryClient(b.grpcConn) - client := zetaObserverTypes.NewQueryClient(b.grpcConn) for i := 0; i <= ExtendedRetryCount; i++ { - resp, err := client.Keygen(context.Background(), &zetaObserverTypes.QueryGetKeygenRequest{}) + resp, err := client.Keygen(context.Background(), &observertypes.QueryGetKeygenRequest{}) if err == nil { return resp.Keygen, nil } @@ -230,9 +215,11 @@ 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}) +func (b *ZetaCoreBridge) GetBallot(ballotIdentifier string) (*observertypes.QueryBallotByIdentifierResponse, error) { + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.BallotByIdentifier(context.Background(), &observertypes.QueryBallotByIdentifierRequest{ + BallotIdentifier: ballotIdentifier, + }) if err != nil { return nil, err } @@ -324,11 +311,11 @@ func (b *ZetaCoreBridge) GetAllOutTxTrackerByChain(chain common.Chain, order Ord return resp.OutTxTracker, nil } -func (b *ZetaCoreBridge) GetClientParams(chainID int64) (zetaObserverTypes.QueryGetCoreParamsForChainResponse, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) - resp, err := client.GetCoreParamsForChain(context.Background(), &zetaObserverTypes.QueryGetCoreParamsForChainRequest{ChainId: chainID}) +func (b *ZetaCoreBridge) GetClientParams(chainID int64) (observertypes.QueryGetCoreParamsForChainResponse, error) { + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.GetCoreParamsForChain(context.Background(), &observertypes.QueryGetCoreParamsForChainRequest{ChainId: chainID}) if err != nil { - return zetaObserverTypes.QueryGetCoreParamsForChainResponse{}, err + return observertypes.QueryGetCoreParamsForChainResponse{}, err } return *resp, nil } @@ -343,8 +330,8 @@ func (b *ZetaCoreBridge) GetPendingNoncesByChain(chainID int64) (types.PendingNo } func (b *ZetaCoreBridge) GetSupportedChains() ([]*common.Chain, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) - resp, err := client.SupportedChains(context.Background(), &zetaObserverTypes.QuerySupportedChains{}) + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.SupportedChains(context.Background(), &observertypes.QuerySupportedChains{}) if err != nil { return nil, err } @@ -361,8 +348,8 @@ func (b *ZetaCoreBridge) GetPendingNonces() (*types.QueryAllPendingNoncesRespons } func (b *ZetaCoreBridge) Prove(blockHash string, txHash string, txIndex int64, proof *common.Proof, chainID int64) (bool, error) { - client := zetaObserverTypes.NewQueryClient(b.grpcConn) - resp, err := client.Prove(context.Background(), &zetaObserverTypes.QueryProveRequest{ + client := observertypes.NewQueryClient(b.grpcConn) + resp, err := client.Prove(context.Background(), &observertypes.QueryProveRequest{ BlockHash: blockHash, TxIndex: txIndex, Proof: proof, diff --git a/zetaclient/signer.go b/zetaclient/signer.go index 5690a4693a..6410af38ed 100644 --- a/zetaclient/signer.go +++ b/zetaclient/signer.go @@ -26,7 +26,7 @@ type TSSSigner interface { var _ TSSSigner = (*TestSigner)(nil) -// a fake signer for testing +// TestSigner is a fake signer for testing type TestSigner struct { PrivKey *ecdsa.PrivateKey } @@ -46,7 +46,7 @@ func (s TestSigner) Pubkey() []byte { return publicKeyBytes } -// return 33B compressed pubkey +// PubKeyCompressedBytes returns 33B compressed pubkey func (s TestSigner) PubKeyCompressedBytes() []byte { pkBytes := crypto.FromECDSAPub(&s.PrivKey.PublicKey) pk, err := btcec.ParsePubKey(pkBytes) diff --git a/zetaclient/telemetry.go b/zetaclient/telemetry.go index 7bd124dbc0..695459d597 100644 --- a/zetaclient/telemetry.go +++ b/zetaclient/telemetry.go @@ -9,11 +9,10 @@ import ( "sync" "time" - "github.com/zeta-chain/zetacore/common" - "github.com/gorilla/mux" "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/zetaclient/types" ) diff --git a/zetaclient/tss_signer.go b/zetaclient/tss_signer.go index 2302ad14e5..e98854b8cf 100644 --- a/zetaclient/tss_signer.go +++ b/zetaclient/tss_signer.go @@ -5,54 +5,34 @@ import ( "encoding/base64" "encoding/hex" "fmt" + "os" "path" "path/filepath" "sort" "strings" - - observertypes "github.com/zeta-chain/zetacore/x/observer/types" - - "github.com/zeta-chain/zetacore/zetaclient/metrics" - - "github.com/btcsuite/btcd/chaincfg/chainhash" - peer2 "github.com/libp2p/go-libp2p/core/peer" - "github.com/zeta-chain/zetacore/common" - "github.com/zeta-chain/zetacore/x/crosschain/types" - "github.com/zeta-chain/zetacore/zetaclient/config" - "gitlab.com/thorchain/tss/go-tss/p2p" + "time" "github.com/binance-chain/tss-lib/ecdsa/keygen" + "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcutil" ethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + gopeer "github.com/libp2p/go-libp2p/core/peer" "github.com/rs/zerolog" + "github.com/rs/zerolog/log" + tmcrypto "github.com/tendermint/tendermint/crypto" + "github.com/zeta-chain/zetacore/common" zcommon "github.com/zeta-chain/zetacore/common/cosmos" + "github.com/zeta-chain/zetacore/x/crosschain/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" + "github.com/zeta-chain/zetacore/zetaclient/config" + "github.com/zeta-chain/zetacore/zetaclient/metrics" thorcommon "gitlab.com/thorchain/tss/go-tss/common" - - "os" - "time" - - "github.com/ethereum/go-ethereum/crypto" - "github.com/rs/zerolog/log" "gitlab.com/thorchain/tss/go-tss/keysign" + "gitlab.com/thorchain/tss/go-tss/p2p" "gitlab.com/thorchain/tss/go-tss/tss" - - tmcrypto "github.com/tendermint/tendermint/crypto" ) -//var testPubKeys = []string{ -// "zetapub1addwnpepqtdklw8tf3anjz7nn5fly3uvq2e67w2apn560s4smmrt9e3x52nt2m5cmyy", -// "zetapub1addwnpepqtspqyy6gk22u37ztra4hq3hdakc0w0k60sfy849mlml2vrpfr0wvszlzhs", -// "zetapub1addwnpepq2ryyje5zr09lq7gqptjwnxqsy2vcdngvwd6z7yt5yjcnyj8c8cn5la9ezs", -// "zetapub1addwnpepqfjcw5l4ay5t00c32mmlky7qrppepxzdlkcwfs2fd5u73qrwna0vzksjyd8", -//} -// -//var testPrivKeys = []string{ -// "MjQ1MDc2MmM4MjU5YjRhZjhhNmFjMmI0ZDBkNzBkOGE1ZTBmNDQ5NGI4NzM4OTYyM2E3MmI0OWMzNmE1ODZhNw==", -// "YmNiMzA2ODU1NWNjMzk3NDE1OWMwMTM3MDU0NTNjN2YwMzYzZmVhZDE5NmU3NzRhOTMwOWIxN2QyZTQ0MzdkNg==", -// "ZThiMDAxOTk2MDc4ODk3YWE0YThlMjdkMWY0NjA1MTAwZDgyNDkyYzdhNmMwZWQ3MDBhMWIyMjNmNGMzYjVhYg==", -// "ZTc2ZjI5OTIwOGVlMDk2N2M3Yzc1MjYyODQ0OGUyMjE3NGJiOGRmNGQyZmVmODg0NzQwNmUzYTk1YmQyODlmNA==", -//} - type TSSKey struct { PubkeyInBytes []byte // FIXME: compressed pubkey? PubkeyInBech32 string // FIXME: same above @@ -77,17 +57,118 @@ func NewTSSKey(pk string) (*TSSKey, error) { return TSSKey, nil } +var _ TSSSigner = (*TSS)(nil) + +// TSS is a struct that holds the server and the keys for TSS type TSS struct { Server *tss.TssServer Keys map[string]*TSSKey // PubkeyInBech32 => TSSKey CurrentPubkey string logger zerolog.Logger Signers []string - CoreBridge *ZetaCoreBridge + CoreBridge ZetaCoreBridger Metrics *ChainMetrics } -var _ TSSSigner = (*TSS)(nil) +// NewTSS creates a new TSS instance +func NewTSS( + peer p2p.AddrList, + privkey tmcrypto.PrivKey, + preParams *keygen.LocalPreParams, + cfg *config.Config, + bridge ZetaCoreBridger, + tssHistoricalList []types.TSS, + metrics *metrics.Metrics, +) (*TSS, error) { + server, err := SetupTSSServer(peer, privkey, preParams, cfg) + if err != nil { + return nil, fmt.Errorf("SetupTSSServer error: %w", err) + } + newTss := TSS{ + Server: server, + Keys: make(map[string]*TSSKey), + CurrentPubkey: cfg.CurrentTssPubkey, + logger: log.With().Str("module", "tss_signer").Logger(), + CoreBridge: bridge, + } + + err = newTss.LoadTssFilesFromDirectory(cfg.TssPath) + if err != nil { + return nil, err + } + _, pubkeyInBech32, err := GetKeyringKeybase(cfg) + if err != nil { + return nil, err + } + err = newTss.VerifyKeysharesForPubkeys(tssHistoricalList, pubkeyInBech32) + if err != nil { + bridge.GetLogger().Error().Err(err).Msg("VerifyKeysharesForPubkeys fail") + } + err = newTss.RegisterMetrics(metrics) + if err != nil { + bridge.GetLogger().Err(err).Msg("tss.RegisterMetrics") + return nil, err + } + + return &newTss, nil +} + +func SetupTSSServer(peer p2p.AddrList, privkey tmcrypto.PrivKey, preParams *keygen.LocalPreParams, cfg *config.Config) (*tss.TssServer, error) { + bootstrapPeers := peer + log.Info().Msgf("Peers AddrList %v", bootstrapPeers) + + tsspath := cfg.TssPath + if len(tsspath) == 0 { + log.Error().Msg("empty env TSSPATH") + homedir, err := os.UserHomeDir() + if err != nil { + log.Error().Err(err).Msgf("cannot get UserHomeDir") + return nil, err + } + tsspath = path.Join(homedir, ".Tss") + log.Info().Msgf("create temporary TSSPATH: %s", tsspath) + } + IP := cfg.PublicIP + if len(IP) == 0 { + log.Info().Msg("empty public IP in config") + } + tssServer, err := tss.NewTss( + bootstrapPeers, + 6668, + privkey, + "MetaMetaOpenTheDoor", + tsspath, + thorcommon.TssConfig{ + EnableMonitor: true, + KeyGenTimeout: 300 * time.Second, // must be shorter than constants.JailTimeKeygen + KeySignTimeout: 30 * time.Second, // must be shorter than constants.JailTimeKeysign + PartyTimeout: 30 * time.Second, + PreParamTimeout: 5 * time.Minute, + }, + preParams, // use pre-generated pre-params if non-nil + IP, // for docker test + ) + if err != nil { + log.Error().Err(err).Msg("NewTSS error") + return nil, fmt.Errorf("NewTSS error: %w", err) + } + + err = tssServer.Start() + if err != nil { + log.Error().Err(err).Msg("tss server start error") + } + + log.Info().Msgf("LocalID: %v", tssServer.GetLocalPeerID()) + if tssServer.GetLocalPeerID() == "" || + tssServer.GetLocalPeerID() == "0" || + tssServer.GetLocalPeerID() == "000000000000000000000000000000" || + tssServer.GetLocalPeerID() == gopeer.ID("").String() { + log.Error().Msg("tss server start error") + return nil, fmt.Errorf("tss server start error") + } + + return tssServer, nil +} // FIXME: does it return pubkey in compressed form or uncompressed? func (tss *TSS) Pubkey() []byte { @@ -168,7 +249,8 @@ func (tss *TSS) Sign(digest []byte, height uint64, nonce uint64, chain *common.C return sigbyte, nil } -// digest should be batch of Hashes of some data +// SignBatch is hash of some data +// digest should be batch of hashes of some data func (tss *TSS) SignBatch(digests [][]byte, height uint64, nonce uint64, chain *common.Chain) ([][65]byte, error) { tssPubkey := tss.CurrentPubkey digestBase64 := make([]string, len(digests)) @@ -288,7 +370,7 @@ func (tss *TSS) EVMAddress() ethcommon.Address { return addr } -// generate a bech32 p2wpkh address from pubkey +// BTCAddress generates a bech32 p2wpkh address from pubkey func (tss *TSS) BTCAddress() string { addr, err := GetTssAddrBTC(tss.CurrentPubkey) if err != nil { @@ -316,7 +398,7 @@ func (tss *TSS) PubKeyCompressedBytes() []byte { return pubk.Bytes() } -// adds a new key to the TSS keys map +// InsertPubKey adds a new key to the TSS keys map func (tss *TSS) InsertPubKey(pk string) error { TSSKey, err := NewTSSKey(pk) if err != nil { @@ -326,86 +408,24 @@ func (tss *TSS) InsertPubKey(pk string) error { return nil } -func GetTssAddrEVM(tssPubkey string) (ethcommon.Address, error) { - var keyAddr ethcommon.Address - pubk, err := zcommon.GetPubKeyFromBech32(zcommon.Bech32PubKeyTypeAccPub, tssPubkey) - if err != nil { - log.Fatal().Err(err) - return keyAddr, err - } - //keyAddrBytes := pubk.EVMAddress().Bytes() - pubk.Bytes() - decompresspubkey, err := crypto.DecompressPubkey(pubk.Bytes()) - if err != nil { - log.Fatal().Err(err).Msg("decompress err") - return keyAddr, err - } - - keyAddr = crypto.PubkeyToAddress(*decompresspubkey) - - return keyAddr, nil -} - -// FIXME: mainnet/testnet -func GetTssAddrBTC(tssPubkey string) (string, error) { - addrWPKH, err := getKeyAddrBTCWitnessPubkeyHash(tssPubkey) - if err != nil { - log.Fatal().Err(err) - return "", err - } - - return addrWPKH.EncodeAddress(), nil -} - -func getKeyAddrBTCWitnessPubkeyHash(tssPubkey string) (*btcutil.AddressWitnessPubKeyHash, error) { - pubk, err := zcommon.GetPubKeyFromBech32(zcommon.Bech32PubKeyTypeAccPub, tssPubkey) - if err != nil { - return nil, err - } - addr, err := btcutil.NewAddressWitnessPubKeyHash(btcutil.Hash160(pubk.Bytes()), config.BitconNetParams) - if err != nil { - return nil, err - } - return addr, nil -} - -func NewTSS(peer p2p.AddrList, privkey tmcrypto.PrivKey, preParams *keygen.LocalPreParams, cfg *config.Config, bridge *ZetaCoreBridge, tssHistoricalList []types.TSS, metrics *metrics.Metrics) (*TSS, error) { - server, err := SetupTSSServer(peer, privkey, preParams, cfg) - if err != nil { - return nil, fmt.Errorf("SetupTSSServer error: %w", err) - } - newTss := TSS{ - Server: server, - Keys: make(map[string]*TSSKey), - CurrentPubkey: cfg.CurrentTssPubkey, - logger: log.With().Str("module", "tss_signer").Logger(), - CoreBridge: bridge, - } - - err = newTss.LoadTssFilesFromDirectory(cfg.TssPath) - if err != nil { - return nil, err - } - _, pubkeyInBech32, err := GetKeyringKeybase(cfg) - if err != nil { - return nil, err - } - err = newTss.VerifyKeysharesForPubkeys(tssHistoricalList, pubkeyInBech32) +func (tss *TSS) RegisterMetrics(metrics *metrics.Metrics) error { + tss.Metrics = NewChainMetrics("tss", metrics) + keygenRes, err := tss.CoreBridge.GetKeyGen() if err != nil { - bridge.logger.Error().Err(err).Msg("VerifyKeysharesForPubkeys fail") + return err } - err = newTss.RegisterMetrics(metrics) - if err != nil { - bridge.logger.Err(err).Msg("tss.RegisterMetrics") - return nil, err + for _, key := range keygenRes.GranteePubkeys { + err := tss.Metrics.RegisterPromCounter(key, "tss node blame counter") + if err != nil { + return err + } } - - return &newTss, nil + return nil } func (tss *TSS) VerifyKeysharesForPubkeys(tssList []types.TSS, granteePubKey32 string) error { for _, t := range tssList { - if WasNodePartOfTss(granteePubKey32, t.TssParticipantList) { + if wasNodePartOfTss(granteePubKey32, t.TssParticipantList) { if _, ok := tss.Keys[t.TssPubkey]; !ok { return fmt.Errorf("pubkey %s not found in keyshare", t.TssPubkey) } @@ -413,15 +433,6 @@ func (tss *TSS) VerifyKeysharesForPubkeys(tssList []types.TSS, granteePubKey32 s } return nil } - -func WasNodePartOfTss(granteePubKey32 string, granteeList []string) bool { - for _, grantee := range granteeList { - if granteePubKey32 == grantee { - return true - } - } - return false -} func (tss *TSS) LoadTssFilesFromDirectory(tssPath string) error { files, err := os.ReadDir(tssPath) if err != nil { @@ -470,61 +481,35 @@ func (tss *TSS) LoadTssFilesFromDirectory(tssPath string) error { return nil } -func SetupTSSServer(peer p2p.AddrList, privkey tmcrypto.PrivKey, preParams *keygen.LocalPreParams, cfg *config.Config) (*tss.TssServer, error) { - bootstrapPeers := peer - log.Info().Msgf("Peers AddrList %v", bootstrapPeers) - - tsspath := cfg.TssPath - if len(tsspath) == 0 { - log.Error().Msg("empty env TSSPATH") - homedir, err := os.UserHomeDir() - if err != nil { - log.Error().Err(err).Msgf("cannot get UserHomeDir") - return nil, err - } - tsspath = path.Join(homedir, ".Tss") - log.Info().Msgf("create temporary TSSPATH: %s", tsspath) - } - IP := cfg.PublicIP - if len(IP) == 0 { - log.Info().Msg("empty public IP in config") - } - tssServer, err := tss.NewTss( - bootstrapPeers, - 6668, - privkey, - "MetaMetaOpenTheDoor", - tsspath, - thorcommon.TssConfig{ - EnableMonitor: true, - KeyGenTimeout: 300 * time.Second, // must be shorter than constants.JailTimeKeygen - KeySignTimeout: 30 * time.Second, // must be shorter than constants.JailTimeKeysign - PartyTimeout: 30 * time.Second, - PreParamTimeout: 5 * time.Minute, - }, - preParams, // use pre-generated pre-params if non-nil - IP, // for docker test - ) +// FIXME: mainnet/testnet +func GetTssAddrBTC(tssPubkey string) (string, error) { + addrWPKH, err := getKeyAddrBTCWitnessPubkeyHash(tssPubkey) if err != nil { - log.Error().Err(err).Msg("NewTSS error") - return nil, fmt.Errorf("NewTSS error: %w", err) + log.Fatal().Err(err) + return "", err } - err = tssServer.Start() + return addrWPKH.EncodeAddress(), nil +} + +func GetTssAddrEVM(tssPubkey string) (ethcommon.Address, error) { + var keyAddr ethcommon.Address + pubk, err := zcommon.GetPubKeyFromBech32(zcommon.Bech32PubKeyTypeAccPub, tssPubkey) if err != nil { - log.Error().Err(err).Msg("tss server start error") + log.Fatal().Err(err) + return keyAddr, err } - - log.Info().Msgf("LocalID: %v", tssServer.GetLocalPeerID()) - if tssServer.GetLocalPeerID() == "" || - tssServer.GetLocalPeerID() == "0" || - tssServer.GetLocalPeerID() == "000000000000000000000000000000" || - tssServer.GetLocalPeerID() == peer2.ID("").String() { - log.Error().Msg("tss server start error") - return nil, fmt.Errorf("tss server start error") + //keyAddrBytes := pubk.EVMAddress().Bytes() + pubk.Bytes() + decompresspubkey, err := crypto.DecompressPubkey(pubk.Bytes()) + if err != nil { + log.Fatal().Err(err).Msg("decompress err") + return keyAddr, err } - return tssServer, nil + keyAddr = crypto.PubkeyToAddress(*decompresspubkey) + + return keyAddr, nil } func TestKeysign(tssPubkey string, tssServer *tss.TssServer) error { @@ -596,17 +581,23 @@ func combineDigests(digestList []string) []byte { return digestBytes.CloneBytes() } -func (tss *TSS) RegisterMetrics(metrics *metrics.Metrics) error { - tss.Metrics = NewChainMetrics("tss", metrics) - keygenRes, err := tss.CoreBridge.GetKeyGen() +func wasNodePartOfTss(granteePubKey32 string, granteeList []string) bool { + for _, grantee := range granteeList { + if granteePubKey32 == grantee { + return true + } + } + return false +} + +func getKeyAddrBTCWitnessPubkeyHash(tssPubkey string) (*btcutil.AddressWitnessPubKeyHash, error) { + pubk, err := zcommon.GetPubKeyFromBech32(zcommon.Bech32PubKeyTypeAccPub, tssPubkey) if err != nil { - return err + return nil, err } - for _, key := range keygenRes.GranteePubkeys { - err := tss.Metrics.RegisterPromCounter(key, "tss node blame counter") - if err != nil { - return err - } + addr, err := btcutil.NewAddressWitnessPubKeyHash(btcutil.Hash160(pubk.Bytes()), config.BitconNetParams) + if err != nil { + return nil, err } - return nil + return addr, nil } diff --git a/zetaclient/tx.go b/zetaclient/tx.go index 5d478317c8..daaf7fd412 100644 --- a/zetaclient/tx.go +++ b/zetaclient/tx.go @@ -8,7 +8,6 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" - "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" observerTypes "github.com/zeta-chain/zetacore/x/observer/types" diff --git a/zetaclient/utils.go b/zetaclient/utils.go index 1983396152..389732f684 100644 --- a/zetaclient/utils.go +++ b/zetaclient/utils.go @@ -124,7 +124,7 @@ func (ob *EVMChainClient) GetInboundVoteMsgForDepositedEvent(event *erc20custody 1_500_000, common.CoinType_ERC20, event.Asset.String(), - ob.zetaClient.keys.GetOperatorAddress().String(), + ob.zetaClient.GetKeys().GetOperatorAddress().String(), ), nil } @@ -159,7 +159,7 @@ func (ob *EVMChainClient) GetInboundVoteMsgForZetaSentEvent(event *zetaconnector event.DestinationGasLimit.Uint64(), common.CoinType_Zeta, "", - ob.zetaClient.keys.GetOperatorAddress().String(), + ob.zetaClient.GetKeys().GetOperatorAddress().String(), ), nil } @@ -184,6 +184,6 @@ func (ob *EVMChainClient) GetInboundVoteMsgForTokenSentToTSS(txhash ethcommon.Ha 90_000, common.CoinType_Gas, "", - ob.zetaClient.keys.GetOperatorAddress().String(), + ob.zetaClient.GetKeys().GetOperatorAddress().String(), ) } diff --git a/zetaclient/zetabridge.go b/zetaclient/zetacore_bridge.go similarity index 88% rename from zetaclient/zetabridge.go rename to zetaclient/zetacore_bridge.go index 4e29e0d9cf..a5af9285c1 100644 --- a/zetaclient/zetabridge.go +++ b/zetaclient/zetacore_bridge.go @@ -2,62 +2,43 @@ package zetaclient import ( "fmt" - "time" - - "github.com/cosmos/cosmos-sdk/simapp/params" - - "github.com/zeta-chain/zetacore/common" - "sync" + "time" - "github.com/hashicorp/go-retryablehttp" - "google.golang.org/grpc" - - //"fmt" - "github.com/zeta-chain/zetacore/common/cosmos" - //"github.com/armon/go-metrics" - //"github.com/cosmos/cosmos-sdk/Client" "github.com/cosmos/cosmos-sdk/codec" - - //"github.com/cosmos/cosmos-sdk/std" + "github.com/cosmos/cosmos-sdk/simapp/params" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - - //"github.com/hashicorp/go-retryablehttp" + "github.com/hashicorp/go-retryablehttp" "github.com/rs/zerolog" "github.com/rs/zerolog/log" - - //"golang.org/x/tools/go/cfg" - //"io/ioutil" - //"net/http" - //"net/url" - //"strconv" - //"strings" - "github.com/zeta-chain/zetacore/app" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/common/cosmos" crosschaintypes "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" ) +var _ ZetaCoreBridger = &ZetaCoreBridge{} + // ZetaCoreBridge will be used to send tx to ZetaCore. type ZetaCoreBridge struct { - logger zerolog.Logger - blockHeight int64 - accountNumber map[common.KeyType]uint64 - seqNumber map[common.KeyType]uint64 - grpcConn *grpc.ClientConn - httpClient *retryablehttp.Client - cfg config.ClientConfiguration - encodingCfg params.EncodingConfig - keys *Keys - broadcastLock *sync.RWMutex - zetaChainID string - //ChainNonces map[string]uint64 // FIXME: Remove this? + logger zerolog.Logger + blockHeight int64 + accountNumber map[common.KeyType]uint64 + seqNumber map[common.KeyType]uint64 + grpcConn *grpc.ClientConn + httpClient *retryablehttp.Client + cfg config.ClientConfiguration + encodingCfg params.EncodingConfig + keys *Keys + broadcastLock *sync.RWMutex + zetaChainID string lastOutTxReportTime map[string]time.Time stop chan struct{} - - pause chan struct{} + pause chan struct{} } // NewZetaCoreBridge create a new instance of ZetaCoreBridge @@ -79,7 +60,7 @@ func NewZetaCoreBridge(k *Keys, chainIP string, signerName string, chainID strin grpc.WithInsecure(), ) if err != nil { - log.Error().Err(err).Msg("grpc dial fail") + logger.Error().Err(err).Msg("grpc dial fail") return nil, err } accountsMap := make(map[common.KeyType]uint64) @@ -116,6 +97,10 @@ func MakeLegacyCodec() *codec.LegacyAmino { return cdc } +func (b *ZetaCoreBridge) GetLogger() *zerolog.Logger { + return &b.logger +} + func (b *ZetaCoreBridge) UpdateChainID(chainID string) { if b.zetaChainID != chainID { b.zetaChainID = chainID @@ -225,3 +210,11 @@ func (b *ZetaCoreBridge) UpdateConfigFromCore(cfg *config.Config, init bool) err } return nil } + +func (b *ZetaCoreBridge) Pause() { + <-b.pause +} + +func (b *ZetaCoreBridge) Unpause() { + b.pause <- struct{}{} +} diff --git a/zetaclient/zetacore_observer.go b/zetaclient/zetacore_observer.go index 1b6ecaec26..9e722ebff5 100644 --- a/zetaclient/zetacore_observer.go +++ b/zetaclient/zetacore_observer.go @@ -24,19 +24,28 @@ type ZetaCoreLog struct { ZetaChainWatcher zerolog.Logger } +// CoreObserver wraps the zetacore bridge and adds the client and signer maps to it . This is the high level object used for CCTX interactions type CoreObserver struct { - bridge *ZetaCoreBridge + bridge ZetaCoreBridger signerMap map[common.Chain]ChainSigner clientMap map[common.Chain]ChainClient metrics *metrics.Metrics - tss *TSS logger ZetaCoreLog cfg *config.Config ts *TelemetryServer stop chan struct{} } -func NewCoreObserver(bridge *ZetaCoreBridge, signerMap map[common.Chain]ChainSigner, clientMap map[common.Chain]ChainClient, metrics *metrics.Metrics, tss *TSS, logger zerolog.Logger, cfg *config.Config, ts *TelemetryServer) *CoreObserver { +// NewCoreObserver creates a new CoreObserver +func NewCoreObserver( + bridge ZetaCoreBridger, + signerMap map[common.Chain]ChainSigner, + clientMap map[common.Chain]ChainClient, + metrics *metrics.Metrics, + logger zerolog.Logger, + cfg *config.Config, + ts *TelemetryServer, +) *CoreObserver { co := CoreObserver{ ts: ts, stop: make(chan struct{}), @@ -50,7 +59,6 @@ func NewCoreObserver(bridge *ZetaCoreBridge, signerMap map[common.Chain]ChainSig ZetaChainWatcher: chainLogger.With().Str("module", "ZetaChainWatcher").Logger(), } - co.tss = tss co.bridge = bridge co.signerMap = signerMap @@ -74,13 +82,13 @@ func (co *CoreObserver) GetPromCounter(name string) (prom.Counter, error) { } func (co *CoreObserver) MonitorCore() { - myid := co.bridge.keys.GetAddress() + myid := co.bridge.GetKeys().GetAddress() co.logger.ZetaChainWatcher.Info().Msgf("Starting Send Scheduler for %s", myid) go co.startSendScheduler() go func() { // bridge queries UpgradePlan from zetacore and send to its pause channel if upgrade height is reached - <-co.bridge.pause + co.bridge.Pause() // now stop everything close(co.stop) // this stops the startSendScheduler() loop for _, c := range co.clientMap { @@ -314,7 +322,7 @@ func (co *CoreObserver) getTargetChainOb(chainID int64) (ChainClient, error) { return chainOb, nil } -// returns whether to retry in a few seconds, and whether to report via AddTxHashToOutTxTracker +// HandleBroadcastError returns whether to retry in a few seconds, and whether to report via AddTxHashToOutTxTracker func HandleBroadcastError(err error, nonce, toChain, outTxHash string) (bool, bool) { if strings.Contains(err.Error(), "nonce too low") { log.Warn().Err(err).Msgf("nonce too low! this might be a unnecessary key-sign. increase re-try interval and awaits outTx confirmation") From 9028fe3e5ba17d01d7cb58e23594d7e559718278 Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:16:28 -0500 Subject: [PATCH 13/26] fix(`rpc`): remove zetacore from some RPC REST path (#1282) Co-authored-by: lumtis --- docs/openapi/openapi.swagger.yaml | 420 +++++++++++++++--------------- proto/emissions/query.proto | 8 +- proto/fungible/query.proto | 12 +- x/emissions/types/query.pb.go | 85 +++--- x/emissions/types/query.pb.gw.go | 8 +- x/fungible/types/query.pb.go | 108 ++++---- x/fungible/types/query.pb.gw.go | 12 +- 7 files changed, 326 insertions(+), 327 deletions(-) diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 5bc7f67767..440c31d739 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -27343,6 +27343,216 @@ paths: $ref: '#/definitions/googlerpcStatus' tags: - Query + /zeta-chain/emissions/get_emissions_factors: + get: + summary: Queries a list of GetEmmisonsFactors items. + operationId: Query_GetEmissionsFactors + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/emissionsQueryGetEmissionsFactorsResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query + /zeta-chain/emissions/list_addresses: + get: + summary: Queries a list of ListBalances items. + operationId: Query_ListPoolAddresses + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/emissionsQueryListPoolAddressesResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query + /zeta-chain/emissions/params: + get: + summary: Parameters queries the parameters of the module. + operationId: Query_Params + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/zetacoreemissionsQueryParamsResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query + /zeta-chain/emissions/show_available_emissions/{address}: + get: + summary: Queries a list of ShowAvailableEmissions items. + operationId: Query_ShowAvailableEmissions + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/emissionsQueryShowAvailableEmissionsResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: address + in: path + required: true + type: string + tags: + - Query + /zeta-chain/fungible/foreign_coins: + get: + summary: Queries a list of ForeignCoins items. + operationId: Query_ForeignCoinsAll + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/fungibleQueryAllForeignCoinsResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - 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/fungible/foreign_coins/{index}: + get: + summary: Queries a ForeignCoins by index. + operationId: Query_ForeignCoins + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/fungibleQueryGetForeignCoinsResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: index + in: path + required: true + type: string + tags: + - Query + /zeta-chain/fungible/gas_stability_pool_address: + get: + summary: Queries the address of a gas stability pool on a given chain. + operationId: Query_GasStabilityPoolAddress + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/fungibleQueryGetGasStabilityPoolAddressResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query + /zeta-chain/fungible/gas_stability_pool_balance/{chain_id}: + get: + summary: Queries the balance of a gas stability pool on a given chain. + operationId: Query_GasStabilityPoolBalance + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/fungibleQueryGetGasStabilityPoolBalanceResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: chain_id + in: path + required: true + type: string + format: int64 + tags: + - Query + /zeta-chain/fungible/params: + get: + summary: Parameters queries the parameters of the module. + operationId: Query_Params + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/zetacorefungibleQueryParamsResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query + /zeta-chain/fungible/system_contract: + get: + summary: Queries SystemContract + operationId: Query_SystemContract + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/fungibleQueryGetSystemContractResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - Query /zeta-chain/observer/all_observer_mappers: get: operationId: Query_AllObserverMappers @@ -27774,165 +27984,6 @@ paths: $ref: '#/definitions/googlerpcStatus' tags: - Query - /zeta-chain/zetacore/emissions/get_emissions_factors: - get: - summary: Queries a list of GetEmmisonsFactors items. - operationId: Query_GetEmissionsFactors - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/emissionsQueryGetEmissionsFactorsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - Query - /zeta-chain/zetacore/emissions/list_addresses: - get: - summary: Queries a list of ListBalances items. - operationId: Query_ListPoolAddresses - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/emissionsQueryListPoolAddressesResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - Query - /zeta-chain/zetacore/emissions/params: - get: - summary: Parameters queries the parameters of the module. - operationId: Query_Params - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/zetacoreemissionsQueryParamsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - Query - /zeta-chain/zetacore/emissions/show_available_emissions/{address}: - get: - summary: Queries a list of ShowAvailableEmissions items. - operationId: Query_ShowAvailableEmissions - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/emissionsQueryShowAvailableEmissionsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: address - in: path - required: true - type: string - tags: - - Query - /zeta-chain/zetacore/fungible/foreign_coins: - get: - summary: Queries a list of ForeignCoins items. - operationId: Query_ForeignCoinsAll - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/fungibleQueryAllForeignCoinsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - 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/zetacore/fungible/foreign_coins/{index}: - get: - summary: Queries a ForeignCoins by index. - operationId: Query_ForeignCoins - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/fungibleQueryGetForeignCoinsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: index - in: path - required: true - type: string - tags: - - Query - /zeta-chain/zetacore/fungible/gas_stability_pool_address: - get: - summary: Queries the address of a gas stability pool on a given chain. - operationId: Query_GasStabilityPoolAddress - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/fungibleQueryGetGasStabilityPoolAddressResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - Query /zeta-chain/zetacore/fungible/gas_stability_pool_balance: get: summary: Queries all gas stability pool balances. @@ -27948,57 +27999,6 @@ paths: $ref: '#/definitions/googlerpcStatus' tags: - Query - /zeta-chain/zetacore/fungible/gas_stability_pool_balance/{chain_id}: - get: - summary: Queries the balance of a gas stability pool on a given chain. - operationId: Query_GasStabilityPoolBalance - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/fungibleQueryGetGasStabilityPoolBalanceResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: chain_id - in: path - required: true - type: string - format: int64 - tags: - - Query - /zeta-chain/zetacore/fungible/params: - get: - summary: Parameters queries the parameters of the module. - operationId: Query_Params - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/zetacorefungibleQueryParamsResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - Query - /zeta-chain/zetacore/fungible/system_contract: - get: - summary: Queries SystemContract - operationId: Query_SystemContract - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/fungibleQueryGetSystemContractResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - Query /zeta-chain/zetacore/observer/show_observer_count: get: summary: Queries a list of ShowObserverCount items. diff --git a/proto/emissions/query.proto b/proto/emissions/query.proto index fcfa34fb76..0b89ffc1f5 100644 --- a/proto/emissions/query.proto +++ b/proto/emissions/query.proto @@ -12,21 +12,21 @@ option go_package = "github.com/zeta-chain/zetacore/x/emissions/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/emissions/params"; + option (google.api.http).get = "/zeta-chain/emissions/params"; } // Queries a list of ListBalances items. rpc ListPoolAddresses(QueryListPoolAddressesRequest) returns (QueryListPoolAddressesResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/emissions/list_addresses"; + option (google.api.http).get = "/zeta-chain/emissions/list_addresses"; } // Queries a list of GetEmmisonsFactors items. rpc GetEmissionsFactors(QueryGetEmissionsFactorsRequest) returns (QueryGetEmissionsFactorsResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/emissions/get_emissions_factors"; + option (google.api.http).get = "/zeta-chain/emissions/get_emissions_factors"; } // Queries a list of ShowAvailableEmissions items. rpc ShowAvailableEmissions(QueryShowAvailableEmissionsRequest) returns (QueryShowAvailableEmissionsResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/emissions/show_available_emissions/{address}"; + option (google.api.http).get = "/zeta-chain/emissions/show_available_emissions/{address}"; } // this line is used by starport scaffolding # 2 diff --git a/proto/fungible/query.proto b/proto/fungible/query.proto index a54730ba76..50e573ea32 100644 --- a/proto/fungible/query.proto +++ b/proto/fungible/query.proto @@ -14,31 +14,31 @@ option go_package = "github.com/zeta-chain/zetacore/x/fungible/types"; service Query { // Parameters queries the parameters of the module. rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/fungible/params"; + option (google.api.http).get = "/zeta-chain/fungible/params"; } // Queries a ForeignCoins by index. rpc ForeignCoins(QueryGetForeignCoinsRequest) returns (QueryGetForeignCoinsResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/fungible/foreign_coins/{index}"; + option (google.api.http).get = "/zeta-chain/fungible/foreign_coins/{index}"; } // Queries a list of ForeignCoins items. rpc ForeignCoinsAll(QueryAllForeignCoinsRequest) returns (QueryAllForeignCoinsResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/fungible/foreign_coins"; + option (google.api.http).get = "/zeta-chain/fungible/foreign_coins"; } // Queries SystemContract rpc SystemContract(QueryGetSystemContractRequest) returns (QueryGetSystemContractResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/fungible/system_contract"; + option (google.api.http).get = "/zeta-chain/fungible/system_contract"; } // Queries the address of a gas stability pool on a given chain. rpc GasStabilityPoolAddress(QueryGetGasStabilityPoolAddress) returns (QueryGetGasStabilityPoolAddressResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/fungible/gas_stability_pool_address"; + option (google.api.http).get = "/zeta-chain/fungible/gas_stability_pool_address"; } // Queries the balance of a gas stability pool on a given chain. rpc GasStabilityPoolBalance(QueryGetGasStabilityPoolBalance) returns (QueryGetGasStabilityPoolBalanceResponse) { - option (google.api.http).get = "/zeta-chain/zetacore/fungible/gas_stability_pool_balance/{chain_id}"; + option (google.api.http).get = "/zeta-chain/fungible/gas_stability_pool_balance/{chain_id}"; } // Queries all gas stability pool balances. diff --git a/x/emissions/types/query.pb.go b/x/emissions/types/query.pb.go index b68ff65280..1202f7753b 100644 --- a/x/emissions/types/query.pb.go +++ b/x/emissions/types/query.pb.go @@ -408,49 +408,48 @@ func init() { func init() { proto.RegisterFile("emissions/query.proto", fileDescriptor_6e578782beb6ef82) } var fileDescriptor_6e578782beb6ef82 = []byte{ - // 660 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4f, 0x4f, 0xd4, 0x4e, - 0x18, 0xde, 0xf2, 0xfb, 0xb9, 0xc6, 0x31, 0x31, 0x71, 0x40, 0x24, 0x0d, 0x76, 0xb1, 0xa2, 0x18, - 0x13, 0x3a, 0x80, 0xca, 0x45, 0x20, 0xee, 0x1a, 0x35, 0xfe, 0x8b, 0x88, 0x7a, 0xd0, 0x4b, 0x33, - 0xdd, 0x8e, 0xdd, 0x49, 0xda, 0x4e, 0xe9, 0x3b, 0x05, 0xd1, 0x78, 0xf1, 0x13, 0x18, 0xbd, 0xfa, - 0x19, 0xfc, 0x16, 0x26, 0x1c, 0x89, 0x5e, 0x3c, 0x19, 0x03, 0x1e, 0xfc, 0x10, 0x1e, 0xcc, 0x4e, - 0xa7, 0x85, 0x5d, 0xd8, 0x05, 0xf1, 0x36, 0xf3, 0xf6, 0x7d, 0x9e, 0xf7, 0x79, 0xde, 0x3e, 0x4d, - 0xd1, 0x29, 0x16, 0x71, 0x00, 0x2e, 0x62, 0x20, 0xcb, 0x19, 0x4b, 0xd7, 0x9c, 0x24, 0x15, 0x52, - 0xe0, 0xd1, 0x57, 0x4c, 0xd2, 0x66, 0x8b, 0xf2, 0xd8, 0x51, 0x27, 0x91, 0x32, 0xa7, 0xec, 0x34, - 0x2f, 0x35, 0x05, 0x44, 0x02, 0x88, 0x47, 0x81, 0xe5, 0x30, 0xb2, 0x32, 0xed, 0x31, 0x49, 0xa7, - 0x49, 0x42, 0x03, 0x1e, 0x53, 0xc9, 0x45, 0x9c, 0x33, 0x99, 0xc3, 0xdb, 0x03, 0x12, 0x9a, 0xd2, - 0x08, 0x74, 0x7d, 0x28, 0x10, 0x81, 0x50, 0x47, 0xd2, 0x3e, 0xe9, 0xea, 0x68, 0x20, 0x44, 0x10, - 0x32, 0x42, 0x13, 0x4e, 0x68, 0x1c, 0x0b, 0xa9, 0xa8, 0x34, 0xc6, 0x1e, 0x42, 0xf8, 0x51, 0x7b, - 0xda, 0xa2, 0x22, 0x5a, 0x62, 0xcb, 0x19, 0x03, 0x69, 0x3f, 0x43, 0x83, 0x1d, 0x55, 0x48, 0x44, - 0x0c, 0x0c, 0x37, 0x50, 0x35, 0x1f, 0x38, 0x62, 0x8c, 0x19, 0x17, 0x8f, 0xcf, 0x8c, 0x3b, 0xfd, - 0x3c, 0x39, 0x39, 0xba, 0xf1, 0xff, 0xfa, 0xf7, 0x5a, 0x65, 0x49, 0x23, 0xed, 0x1a, 0x3a, 0xa3, - 0xa8, 0xef, 0x73, 0x90, 0x8b, 0x42, 0x84, 0x75, 0xdf, 0x4f, 0x19, 0x00, 0x2b, 0x67, 0xff, 0x36, - 0x90, 0xd5, 0xab, 0x43, 0xeb, 0x78, 0x8a, 0x26, 0xb2, 0xd8, 0xe7, 0x20, 0x53, 0xee, 0x65, 0x92, - 0xf9, 0xae, 0xf0, 0x80, 0xa5, 0x2b, 0x2c, 0x75, 0x3d, 0x1a, 0xd2, 0xb8, 0xc9, 0xc0, 0xa5, 0x39, - 0x48, 0x09, 0x3d, 0xb6, 0x34, 0xde, 0xd1, 0xfe, 0x50, 0x77, 0x37, 0x74, 0xb3, 0x1e, 0x80, 0xef, - 0x21, 0xbb, 0x93, 0x56, 0x02, 0xec, 0x66, 0x1c, 0x50, 0x8c, 0xb5, 0x8e, 0xce, 0x27, 0x00, 0xdd, - 0x64, 0xb3, 0xe8, 0x74, 0xb1, 0x09, 0x37, 0x12, 0x7e, 0x16, 0xb2, 0x92, 0xe1, 0x3f, 0xc5, 0x50, - 0xc6, 0xe4, 0x81, 0x7a, 0xaa, 0x71, 0xf6, 0x59, 0x54, 0x53, 0xee, 0x6f, 0x33, 0x79, 0xb3, 0xd8, - 0xe4, 0x2d, 0xda, 0x94, 0x22, 0x2d, 0x37, 0xf4, 0xde, 0x40, 0x63, 0xbd, 0x7b, 0xf4, 0x8e, 0x2e, - 0xa0, 0x13, 0x29, 0x53, 0x3e, 0xf5, 0x23, 0xbd, 0x8a, 0xae, 0x2a, 0xb6, 0x10, 0xf2, 0x44, 0xec, - 0xeb, 0x9e, 0xdc, 0xdc, 0x8e, 0x4a, 0x9b, 0xc7, 0xcf, 0x52, 0x95, 0x19, 0xdd, 0x93, 0xcb, 0xef, - 0xaa, 0xda, 0x0b, 0xc8, 0x56, 0x9a, 0x1e, 0xb7, 0xc4, 0x6a, 0x7d, 0x85, 0xf2, 0x90, 0x7a, 0x21, - 0x2b, 0xd5, 0x69, 0xe9, 0x78, 0x04, 0x1d, 0xed, 0x7c, 0x33, 0xc5, 0xd5, 0x9e, 0x47, 0xe7, 0xfa, - 0xe2, 0xb5, 0xad, 0x61, 0x54, 0xa5, 0x91, 0xc8, 0x62, 0xa9, 0xf1, 0xfa, 0x36, 0xf3, 0xa9, 0x8a, - 0x8e, 0x28, 0x3c, 0xfe, 0x68, 0xa0, 0x6a, 0x9e, 0x3c, 0x3c, 0xd5, 0x3f, 0x9f, 0xbb, 0x83, 0x6f, - 0x4e, 0xff, 0x05, 0x22, 0x57, 0x64, 0x4f, 0xbe, 0xfd, 0xfa, 0xf3, 0xc3, 0xc0, 0x04, 0x3e, 0x4f, - 0xda, 0x80, 0x49, 0x85, 0x25, 0x05, 0x96, 0x74, 0x7f, 0xaa, 0xf8, 0xb3, 0x81, 0x4e, 0xee, 0x4a, - 0x36, 0xbe, 0x76, 0x80, 0xb9, 0xbd, 0xbe, 0x18, 0x73, 0xee, 0x70, 0x60, 0xad, 0xff, 0xaa, 0xd2, - 0x4f, 0xf0, 0xe4, 0x3e, 0xfa, 0x43, 0x0e, 0xb2, 0x88, 0x30, 0x03, 0xfc, 0xc5, 0x40, 0x83, 0x7b, - 0xe4, 0x0f, 0xcf, 0x1f, 0x40, 0x4c, 0xef, 0x6c, 0x9b, 0x0b, 0x87, 0x85, 0x6b, 0x37, 0x73, 0xca, - 0xcd, 0x2c, 0xbe, 0xb2, 0x8f, 0x9b, 0x80, 0x49, 0xb7, 0xbc, 0xb9, 0x2f, 0xb4, 0xf8, 0x5f, 0x06, - 0x1a, 0xde, 0x3b, 0x80, 0xf8, 0xfa, 0x01, 0x84, 0xf5, 0xcd, 0xbe, 0x59, 0xff, 0x07, 0x06, 0xed, - 0xee, 0x8e, 0x72, 0x77, 0x03, 0xd7, 0xf7, 0x71, 0x07, 0x2d, 0xb1, 0xea, 0xd2, 0x82, 0x67, 0xdb, - 0x28, 0x79, 0xad, 0x5f, 0xe0, 0x9b, 0xc6, 0xdd, 0xf5, 0x4d, 0xcb, 0xd8, 0xd8, 0xb4, 0x8c, 0x1f, - 0x9b, 0x96, 0xf1, 0x6e, 0xcb, 0xaa, 0x6c, 0x6c, 0x59, 0x95, 0x6f, 0x5b, 0x56, 0xe5, 0xf9, 0x54, - 0xc0, 0x65, 0x2b, 0xf3, 0x9c, 0xa6, 0x88, 0xf6, 0x1c, 0xf3, 0x72, 0xc7, 0x20, 0xb9, 0x96, 0x30, - 0xf0, 0xaa, 0xea, 0x5f, 0x72, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x52, 0x66, 0xde, 0xc2, - 0xfa, 0x06, 0x00, 0x00, + // 654 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x6b, 0xd4, 0x40, + 0x18, 0xde, 0x54, 0x5d, 0x71, 0x04, 0xc1, 0x69, 0xad, 0x25, 0xd4, 0x6c, 0x8d, 0x4b, 0x15, 0xb5, + 0x49, 0x3f, 0x40, 0x44, 0x6d, 0x69, 0x17, 0x54, 0xf0, 0x03, 0x6b, 0xd5, 0x83, 0x5e, 0xc2, 0x64, + 0x33, 0x66, 0x07, 0x92, 0x4c, 0x9a, 0x77, 0xd2, 0x5a, 0xc5, 0x8b, 0x47, 0x4f, 0x62, 0xff, 0x8e, + 0x3f, 0xa0, 0xde, 0x0a, 0x5e, 0x3c, 0xa9, 0x74, 0xfd, 0x19, 0x1e, 0x64, 0x27, 0x93, 0x74, 0xbf, + 0x59, 0xeb, 0x6d, 0xe6, 0xcd, 0xfb, 0x3c, 0xef, 0xf3, 0xbc, 0x79, 0x42, 0xd0, 0x39, 0x1a, 0x32, + 0x00, 0xc6, 0x23, 0xb0, 0x37, 0x53, 0x9a, 0xec, 0x58, 0x71, 0xc2, 0x05, 0xc7, 0xd3, 0x6f, 0xa9, + 0x20, 0xf5, 0x06, 0x61, 0x91, 0x25, 0x4f, 0x3c, 0xa1, 0x56, 0xd1, 0xa9, 0x5f, 0xad, 0x73, 0x08, + 0x39, 0xd8, 0x2e, 0x01, 0x9a, 0xc1, 0xec, 0xad, 0x05, 0x97, 0x0a, 0xb2, 0x60, 0xc7, 0xc4, 0x67, + 0x11, 0x11, 0x8c, 0x47, 0x19, 0x93, 0x3e, 0x79, 0x38, 0x20, 0x26, 0x09, 0x09, 0x41, 0xd5, 0x27, + 0x7c, 0xee, 0x73, 0x79, 0xb4, 0x5b, 0x27, 0x55, 0x9d, 0xf6, 0x39, 0xf7, 0x03, 0x6a, 0x93, 0x98, + 0xd9, 0x24, 0x8a, 0xb8, 0x90, 0x54, 0x0a, 0x63, 0x4e, 0x20, 0xfc, 0xb4, 0x35, 0x6d, 0x5d, 0x12, + 0x6d, 0xd0, 0xcd, 0x94, 0x82, 0x30, 0x5f, 0xa2, 0xf1, 0x8e, 0x2a, 0xc4, 0x3c, 0x02, 0x8a, 0x6b, + 0xa8, 0x9c, 0x0d, 0x9c, 0xd2, 0x66, 0xb4, 0x2b, 0xa7, 0x17, 0xab, 0xd6, 0x30, 0x4f, 0x56, 0x86, + 0xae, 0x1d, 0xdf, 0xfb, 0x51, 0x29, 0x6d, 0x28, 0xa4, 0x59, 0x41, 0x17, 0x24, 0xf5, 0x23, 0x06, + 0x62, 0x9d, 0xf3, 0x60, 0xcd, 0xf3, 0x12, 0x0a, 0x40, 0x8b, 0xd9, 0x7f, 0x34, 0x64, 0x0c, 0xea, + 0x50, 0x3a, 0x5e, 0xa0, 0xcb, 0x69, 0xe4, 0x31, 0x10, 0x09, 0x73, 0x53, 0x41, 0x3d, 0x87, 0xbb, + 0x40, 0x93, 0x2d, 0x9a, 0x38, 0x2e, 0x09, 0x48, 0x54, 0xa7, 0xe0, 0x90, 0x0c, 0x24, 0x85, 0x9e, + 0xda, 0xa8, 0x76, 0xb4, 0x3f, 0x51, 0xdd, 0x35, 0xd5, 0xac, 0x06, 0xe0, 0x87, 0xc8, 0xec, 0xa4, + 0x15, 0x00, 0xbd, 0x8c, 0x63, 0x92, 0xb1, 0xd2, 0xd1, 0xf9, 0x1c, 0xa0, 0x9b, 0xec, 0x06, 0x3a, + 0x9f, 0x6f, 0xc2, 0x09, 0xb9, 0x97, 0x06, 0xb4, 0x60, 0x38, 0x26, 0x19, 0x8a, 0x98, 0x3c, 0x96, + 0x4f, 0x15, 0xce, 0xbc, 0x88, 0x2a, 0xd2, 0xfd, 0x7d, 0x2a, 0xee, 0xe6, 0x9b, 0xbc, 0x47, 0xea, + 0x82, 0x27, 0xc5, 0x86, 0x3e, 0x6b, 0x68, 0x66, 0x70, 0x8f, 0xda, 0xd1, 0x2c, 0x3a, 0x93, 0x50, + 0xe9, 0x53, 0x3d, 0x52, 0xab, 0xe8, 0xaa, 0x62, 0x03, 0x21, 0x97, 0x47, 0x9e, 0xea, 0xc9, 0xcc, + 0xb5, 0x55, 0x5a, 0x3c, 0x5e, 0x9a, 0xc8, 0xcc, 0xa8, 0x9e, 0x4c, 0x7e, 0x57, 0xd5, 0x5c, 0x41, + 0xa6, 0xd4, 0xf4, 0xac, 0xc1, 0xb7, 0xd7, 0xb6, 0x08, 0x0b, 0x88, 0x1b, 0xd0, 0x42, 0x9d, 0x92, + 0x8e, 0xa7, 0xd0, 0xc9, 0xce, 0x37, 0x93, 0x5f, 0xcd, 0x65, 0x74, 0x69, 0x28, 0x5e, 0xd9, 0x9a, + 0x44, 0x65, 0x12, 0xf2, 0x34, 0x12, 0x0a, 0xaf, 0x6e, 0x8b, 0x1f, 0xcb, 0xe8, 0x84, 0xc4, 0xe3, + 0x5d, 0x0d, 0x95, 0xb3, 0xe4, 0xe1, 0xf9, 0xe1, 0xf9, 0xec, 0x0d, 0xbe, 0xbe, 0xf0, 0x0f, 0x88, + 0x4c, 0x91, 0x59, 0xfd, 0xf0, 0xed, 0xf7, 0xee, 0x98, 0x81, 0xa7, 0xed, 0x16, 0x60, 0x4e, 0x62, + 0xed, 0xee, 0x2f, 0x14, 0x7f, 0xd1, 0xd0, 0xd9, 0x9e, 0x40, 0xe3, 0xdb, 0x23, 0x8c, 0x1b, 0xf4, + 0xa1, 0xe8, 0x77, 0x8e, 0x06, 0x56, 0xb2, 0xaf, 0x4b, 0xd9, 0xb3, 0xb8, 0xda, 0x5f, 0x76, 0xc0, + 0x40, 0xe4, 0x81, 0xa5, 0x80, 0xbf, 0x6a, 0x68, 0xbc, 0x4f, 0xda, 0xf0, 0xf2, 0x08, 0x1a, 0x06, + 0x27, 0x59, 0x5f, 0x39, 0x2a, 0x5c, 0x99, 0x58, 0x92, 0x26, 0xe6, 0xf0, 0xb5, 0xfe, 0x26, 0x7c, + 0x2a, 0x9c, 0xe2, 0xe6, 0xbc, 0x56, 0x9a, 0x7f, 0x6a, 0x68, 0xb2, 0x7f, 0xca, 0xf0, 0xea, 0x08, + 0x7a, 0x86, 0x06, 0x5c, 0x5f, 0xfb, 0x0f, 0x06, 0x65, 0x6a, 0x55, 0x9a, 0xba, 0x85, 0x6f, 0xf6, + 0x37, 0x05, 0x0d, 0xbe, 0xed, 0x90, 0x1c, 0x7e, 0xe8, 0xcf, 0x7e, 0xa7, 0x5e, 0xd7, 0xfb, 0xda, + 0x83, 0xbd, 0x03, 0x43, 0xdb, 0x3f, 0x30, 0xb4, 0x5f, 0x07, 0x86, 0xf6, 0xa9, 0x69, 0x94, 0xf6, + 0x9b, 0x46, 0xe9, 0x7b, 0xd3, 0x28, 0xbd, 0x9a, 0xf7, 0x99, 0x68, 0xa4, 0xae, 0x55, 0xe7, 0x61, + 0x3b, 0x7b, 0xae, 0xd4, 0x7e, 0xd3, 0x36, 0x48, 0xec, 0xc4, 0x14, 0xdc, 0xb2, 0xfc, 0x4f, 0x2c, + 0xfd, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x6f, 0x3f, 0x0c, 0xd6, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/emissions/types/query.pb.gw.go b/x/emissions/types/query.pb.gw.go index 36f6e4d9b9..c4303810a5 100644 --- a/x/emissions/types/query.pb.gw.go +++ b/x/emissions/types/query.pb.gw.go @@ -364,13 +364,13 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "emissions", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "emissions", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ListPoolAddresses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "emissions", "list_addresses"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ListPoolAddresses_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "emissions", "list_addresses"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GetEmissionsFactors_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "emissions", "get_emissions_factors"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GetEmissionsFactors_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "emissions", "get_emissions_factors"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ShowAvailableEmissions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"zeta-chain", "zetacore", "emissions", "show_available_emissions", "address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ShowAvailableEmissions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "emissions", "show_available_emissions", "address"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( diff --git a/x/fungible/types/query.pb.go b/x/fungible/types/query.pb.go index 0b2b3c1bc5..c8db6b9a46 100644 --- a/x/fungible/types/query.pb.go +++ b/x/fungible/types/query.pb.go @@ -717,60 +717,60 @@ func init() { func init() { proto.RegisterFile("fungible/query.proto", fileDescriptor_d671b6e9298b37cd) } var fileDescriptor_d671b6e9298b37cd = []byte{ - // 843 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x4f, 0x13, 0x4d, - 0x18, 0xee, 0xc2, 0xc7, 0x8f, 0x6f, 0xe0, 0xe3, 0x4b, 0xe6, 0xeb, 0x17, 0x71, 0xc1, 0xad, 0xae, - 0x0a, 0x2a, 0xb2, 0x23, 0x34, 0x24, 0x08, 0xc4, 0x58, 0xaa, 0x10, 0xa2, 0x07, 0x2c, 0x17, 0xf5, - 0xd2, 0x4c, 0xdb, 0x61, 0xd9, 0x64, 0xbb, 0x53, 0x3a, 0x5b, 0x42, 0x25, 0x5c, 0xfc, 0x0b, 0x4c, - 0x3c, 0x19, 0xff, 0x14, 0x3d, 0x78, 0xe4, 0x48, 0xe2, 0x45, 0x2f, 0x6a, 0x8a, 0x27, 0xff, 0x0a, - 0xd3, 0xd9, 0x77, 0x97, 0x6e, 0xed, 0xb6, 0xa5, 0xbd, 0xed, 0xce, 0xbc, 0xcf, 0xfb, 0x3c, 0xcf, - 0xcc, 0xdb, 0xa7, 0x8b, 0xe2, 0xbb, 0x15, 0xc7, 0xb4, 0x72, 0x36, 0x23, 0xfb, 0x15, 0x56, 0xae, - 0x1a, 0xa5, 0x32, 0x77, 0x39, 0x9e, 0x7a, 0xc5, 0x5c, 0x9a, 0xdf, 0xa3, 0x96, 0x63, 0xc8, 0x27, - 0x5e, 0x66, 0x86, 0x5f, 0xa8, 0xde, 0xc9, 0x73, 0x51, 0xe4, 0x82, 0xe4, 0xa8, 0x00, 0x14, 0x39, - 0x58, 0xc8, 0x31, 0x97, 0x2e, 0x90, 0x12, 0x35, 0x2d, 0x87, 0xba, 0x16, 0x77, 0xbc, 0x46, 0xea, - 0x74, 0xd0, 0x7e, 0x97, 0x97, 0x99, 0x65, 0x3a, 0xd9, 0x3c, 0xb7, 0x1c, 0x01, 0xbb, 0xff, 0x07, - 0xbb, 0x25, 0x5a, 0xa6, 0x45, 0x7f, 0x59, 0x0b, 0x96, 0x45, 0x55, 0xb8, 0xac, 0x98, 0xcd, 0x73, - 0xc7, 0x2d, 0xd3, 0xbc, 0x0b, 0xfb, 0x71, 0x93, 0x9b, 0x5c, 0x3e, 0x92, 0xfa, 0x93, 0x4f, 0x65, - 0x72, 0x6e, 0xda, 0x8c, 0xd0, 0x92, 0x45, 0xa8, 0xe3, 0x70, 0x57, 0xea, 0x80, 0x9e, 0x7a, 0x1c, - 0xe1, 0x67, 0x75, 0xa9, 0xdb, 0x92, 0x28, 0xc3, 0xf6, 0x2b, 0x4c, 0xb8, 0xfa, 0x73, 0xf4, 0x5f, - 0x68, 0x55, 0x94, 0xb8, 0x23, 0x18, 0x4e, 0xa1, 0x61, 0x4f, 0xd0, 0xa4, 0x72, 0x55, 0xb9, 0x35, - 0xb6, 0x78, 0xdd, 0x68, 0x73, 0x1e, 0x86, 0x07, 0x5e, 0xff, 0xeb, 0xe4, 0x5b, 0x22, 0x96, 0x01, - 0xa0, 0x9e, 0x44, 0x53, 0xb2, 0xf3, 0x26, 0x73, 0x37, 0x3c, 0xe7, 0xe9, 0xba, 0x71, 0x20, 0xc6, - 0x71, 0x34, 0x64, 0x39, 0x05, 0x76, 0x28, 0x09, 0xfe, 0xce, 0x78, 0x2f, 0xba, 0x40, 0xd3, 0xad, - 0x41, 0xa0, 0x6b, 0x07, 0x8d, 0xef, 0x36, 0xac, 0x83, 0xba, 0xdb, 0x6d, 0xd5, 0x35, 0x36, 0x02, - 0x8d, 0xa1, 0x26, 0x3a, 0x03, 0xa5, 0x29, 0xdb, 0x6e, 0xa5, 0x74, 0x03, 0xa1, 0xf3, 0x5b, 0x05, - 0xc6, 0x19, 0xc3, 0x1b, 0x01, 0xa3, 0x3e, 0x02, 0x86, 0x37, 0x38, 0x30, 0x02, 0xc6, 0x36, 0x35, - 0x19, 0x60, 0x33, 0x0d, 0x48, 0xfd, 0xa3, 0x02, 0xe6, 0xfe, 0xe0, 0x89, 0x34, 0x37, 0xd8, 0xb7, - 0x39, 0xbc, 0x19, 0x52, 0x3f, 0x20, 0xd5, 0xcf, 0x76, 0x54, 0xef, 0x29, 0x0a, 0xc9, 0x4f, 0xa0, - 0x2b, 0xfe, 0xd5, 0xec, 0xc8, 0xa1, 0x4c, 0xc3, 0x4c, 0xfa, 0xa3, 0x74, 0x84, 0xb4, 0xa8, 0x02, - 0x30, 0xf8, 0x02, 0x4d, 0x84, 0x77, 0xe0, 0x34, 0xe7, 0xda, 0x5a, 0x0c, 0x43, 0xc0, 0x64, 0x53, - 0x23, 0xfd, 0x1a, 0x4a, 0xf8, 0xe4, 0x9b, 0x54, 0xec, 0xb8, 0x34, 0x67, 0xd9, 0x96, 0x5b, 0xdd, - 0xe6, 0xdc, 0x4e, 0x15, 0x0a, 0x65, 0x26, 0x84, 0xbe, 0x8f, 0x66, 0x3b, 0x94, 0x04, 0x42, 0x6f, - 0xa2, 0x09, 0xef, 0x84, 0xb2, 0xd4, 0xdb, 0x81, 0x29, 0xfd, 0xc7, 0x5b, 0x85, 0x72, 0x9c, 0x40, - 0x63, 0xec, 0xa0, 0x18, 0xd4, 0x0c, 0xc8, 0x1a, 0xc4, 0x0e, 0x8a, 0x3e, 0xe5, 0x5a, 0xb4, 0xaa, - 0x75, 0x6a, 0x53, 0x27, 0xcf, 0xf0, 0x65, 0x34, 0x2a, 0x8d, 0x67, 0xad, 0x82, 0x24, 0x19, 0xcc, - 0x8c, 0xc8, 0xf7, 0xad, 0x82, 0x9e, 0x8e, 0x16, 0x0c, 0xe8, 0x40, 0xf0, 0x24, 0x1a, 0xc9, 0x79, - 0x4b, 0xa0, 0xc2, 0x7f, 0x0d, 0x0e, 0x26, 0x65, 0xdb, 0x11, 0x4d, 0xf4, 0xaf, 0x0a, 0x10, 0x45, - 0xd7, 0x04, 0x44, 0x0e, 0x1a, 0x85, 0xce, 0xfe, 0x7c, 0x3e, 0x6d, 0x7b, 0x79, 0x5d, 0xf6, 0x35, - 0xe0, 0x1d, 0x6e, 0x37, 0xe0, 0x50, 0x1f, 0xa0, 0x91, 0xce, 0x27, 0x15, 0x6d, 0x7f, 0xf1, 0xfd, - 0x18, 0x1a, 0x92, 0x1a, 0xf0, 0x3b, 0x05, 0x0d, 0x7b, 0x41, 0x85, 0x49, 0x67, 0xc9, 0xa1, 0x94, - 0x54, 0xef, 0x75, 0x0f, 0xf0, 0xfc, 0xe8, 0x77, 0x5f, 0x7f, 0xfe, 0xf9, 0x76, 0x60, 0x06, 0xdf, - 0x20, 0xf5, 0xfa, 0x79, 0x09, 0x25, 0x3e, 0x94, 0x34, 0xa5, 0x3e, 0xfe, 0xa4, 0xa0, 0xf1, 0xc6, - 0x5f, 0x32, 0x5e, 0xee, 0x4c, 0xd8, 0x3a, 0x57, 0xd5, 0xfb, 0x3d, 0x20, 0x41, 0xf3, 0xaa, 0xd4, - 0xbc, 0x84, 0x93, 0xed, 0x35, 0x87, 0xfe, 0xc7, 0xc8, 0x91, 0x0c, 0xee, 0x63, 0xfc, 0x41, 0x41, - 0xff, 0x36, 0x76, 0x4d, 0xd9, 0x76, 0x37, 0x2e, 0x5a, 0x67, 0x6e, 0x37, 0x2e, 0x22, 0x52, 0x54, - 0x4f, 0x4a, 0x17, 0xf3, 0x78, 0xee, 0x02, 0x2e, 0xea, 0x17, 0xd0, 0x94, 0x28, 0x78, 0xa5, 0xab, - 0x83, 0x6c, 0x19, 0x85, 0xea, 0x6a, 0x4f, 0x58, 0x30, 0xb0, 0x24, 0x0d, 0x10, 0x3c, 0xdf, 0xde, - 0x40, 0xd3, 0x97, 0x01, 0xfe, 0xae, 0xa0, 0x4b, 0x11, 0xb9, 0x86, 0xd7, 0xba, 0xd2, 0x13, 0x81, - 0x56, 0x1f, 0xf5, 0x83, 0x0e, 0x6c, 0x3d, 0x94, 0xb6, 0x56, 0xf0, 0x72, 0x7b, 0x5b, 0x26, 0x15, - 0x59, 0xe1, 0xf7, 0xc9, 0x96, 0x38, 0xb7, 0xfd, 0x7c, 0xc5, 0xbf, 0x5a, 0x38, 0xf4, 0xc3, 0xa1, - 0x37, 0x87, 0x80, 0xee, 0xd1, 0x61, 0x53, 0x86, 0xe9, 0x4f, 0xa4, 0xc3, 0xc7, 0x38, 0x7d, 0x61, - 0x87, 0x90, 0x56, 0xe4, 0xc8, 0x0f, 0xb8, 0x63, 0x5c, 0x53, 0x90, 0x1a, 0x41, 0x58, 0xff, 0x69, - 0xad, 0xf5, 0x93, 0xba, 0xdd, 0xf8, 0xed, 0x9c, 0xd9, 0x7d, 0xdc, 0x28, 0xf8, 0x5d, 0xdf, 0x3a, - 0xa9, 0x69, 0xca, 0x69, 0x4d, 0x53, 0x7e, 0xd4, 0x34, 0xe5, 0xcd, 0x99, 0x16, 0x3b, 0x3d, 0xd3, - 0x62, 0x5f, 0xce, 0xb4, 0xd8, 0x4b, 0x62, 0x5a, 0xee, 0x5e, 0x25, 0x67, 0xe4, 0x79, 0xb1, 0x65, - 0xf7, 0xc3, 0xf3, 0xfe, 0x6e, 0xb5, 0xc4, 0x44, 0x6e, 0x58, 0x7e, 0xe5, 0x26, 0x7f, 0x07, 0x00, - 0x00, 0xff, 0xff, 0x70, 0xd2, 0xfa, 0xa6, 0xcf, 0x0b, 0x00, 0x00, + // 846 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0x4d, 0x4f, 0xdb, 0x48, + 0x18, 0xc7, 0x63, 0x58, 0x5e, 0x76, 0x60, 0x59, 0x69, 0x36, 0xab, 0x65, 0x0d, 0x38, 0xbb, 0x03, + 0x0b, 0x5b, 0x4a, 0xed, 0x02, 0x87, 0x52, 0x1a, 0x55, 0x4d, 0xa8, 0x40, 0x48, 0x3d, 0xd0, 0x70, + 0x69, 0x7b, 0x89, 0x26, 0xc9, 0x60, 0x2c, 0x39, 0x9e, 0x90, 0x71, 0x10, 0x29, 0xe2, 0xd2, 0x4f, + 0x80, 0xd4, 0x6f, 0xd2, 0x4b, 0x2f, 0xfd, 0x00, 0x1c, 0x91, 0x2a, 0x55, 0xed, 0xa5, 0x6a, 0x43, + 0xfb, 0x3d, 0xaa, 0x8c, 0x1f, 0x9b, 0x38, 0xb5, 0x13, 0x2b, 0xdc, 0xec, 0x99, 0xe7, 0xe5, 0xf7, + 0x9f, 0x79, 0xfc, 0x4f, 0x50, 0xfa, 0xa0, 0xe1, 0x98, 0x56, 0xc9, 0x66, 0xc6, 0x51, 0x83, 0xd5, + 0x9b, 0x7a, 0xad, 0xce, 0x5d, 0x8e, 0x67, 0x5e, 0x32, 0x97, 0x96, 0x0f, 0xa9, 0xe5, 0xe8, 0xf2, + 0x89, 0xd7, 0x99, 0xee, 0x07, 0xaa, 0xcb, 0x65, 0x2e, 0xaa, 0x5c, 0x18, 0x25, 0x2a, 0x20, 0xcb, + 0x38, 0x5e, 0x2d, 0x31, 0x97, 0xae, 0x1a, 0x35, 0x6a, 0x5a, 0x0e, 0x75, 0x2d, 0xee, 0x78, 0x85, + 0xd4, 0xd9, 0xa0, 0xfc, 0x01, 0xaf, 0x33, 0xcb, 0x74, 0x8a, 0x65, 0x6e, 0x39, 0x02, 0x76, 0xff, + 0x0c, 0x76, 0x6b, 0xb4, 0x4e, 0xab, 0xfe, 0xb2, 0x16, 0x2c, 0x8b, 0xa6, 0x70, 0x59, 0xb5, 0x58, + 0xe6, 0x8e, 0x5b, 0xa7, 0x65, 0x17, 0xf6, 0xd3, 0x26, 0x37, 0xb9, 0x7c, 0x34, 0xda, 0x4f, 0x7e, + 0x2b, 0x93, 0x73, 0xd3, 0x66, 0x06, 0xad, 0x59, 0x06, 0x75, 0x1c, 0xee, 0x4a, 0x0e, 0xa8, 0x49, + 0xd2, 0x08, 0x3f, 0x6d, 0xa3, 0xee, 0xc9, 0x46, 0x05, 0x76, 0xd4, 0x60, 0xc2, 0x25, 0xcf, 0xd0, + 0x1f, 0xa1, 0x55, 0x51, 0xe3, 0x8e, 0x60, 0x38, 0x87, 0x46, 0x3d, 0xa0, 0x69, 0xe5, 0x1f, 0xe5, + 0xff, 0x89, 0xb5, 0x79, 0xbd, 0xc7, 0x79, 0xe8, 0x5e, 0x72, 0xfe, 0x97, 0x8b, 0xcf, 0x99, 0x54, + 0x01, 0x12, 0xc9, 0x3a, 0x9a, 0x91, 0x95, 0x77, 0x98, 0xbb, 0xed, 0x29, 0xdf, 0x6a, 0x0b, 0x87, + 0xc6, 0x38, 0x8d, 0x46, 0x2c, 0xa7, 0xc2, 0x4e, 0x64, 0x83, 0x5f, 0x0b, 0xde, 0x0b, 0x11, 0x68, + 0x36, 0x3a, 0x09, 0xb8, 0xf6, 0xd1, 0xe4, 0x41, 0xc7, 0x3a, 0xd0, 0xdd, 0xea, 0x49, 0xd7, 0x59, + 0x08, 0x18, 0x43, 0x45, 0x08, 0x03, 0xd2, 0x9c, 0x6d, 0x47, 0x91, 0x6e, 0x23, 0x74, 0x7d, 0xab, + 0xd0, 0x71, 0x51, 0xf7, 0x46, 0x40, 0x6f, 0x8f, 0x80, 0xee, 0x0d, 0x0e, 0x8c, 0x80, 0xbe, 0x47, + 0x4d, 0x06, 0xb9, 0x85, 0x8e, 0x4c, 0xf2, 0x4e, 0x01, 0x71, 0x3f, 0xf5, 0x89, 0x15, 0x37, 0x7c, + 0x63, 0x71, 0x78, 0x27, 0x44, 0x3f, 0x24, 0xe9, 0x97, 0xfa, 0xd2, 0x7b, 0x44, 0x21, 0xfc, 0x0c, + 0x9a, 0xf3, 0xaf, 0x66, 0x5f, 0x0e, 0xe5, 0x16, 0xcc, 0xa4, 0x3f, 0x4a, 0xa7, 0x48, 0x8b, 0x0b, + 0x00, 0x81, 0xcf, 0xd1, 0x54, 0x78, 0x07, 0x4e, 0xf3, 0x76, 0x4f, 0x89, 0xe1, 0x14, 0x10, 0xd9, + 0x55, 0x88, 0xfc, 0x8b, 0x32, 0x7e, 0xf3, 0x1d, 0x2a, 0xf6, 0x5d, 0x5a, 0xb2, 0x6c, 0xcb, 0x6d, + 0xee, 0x71, 0x6e, 0xe7, 0x2a, 0x95, 0x3a, 0x13, 0x82, 0x1c, 0xa1, 0xa5, 0x3e, 0x21, 0x01, 0xe8, + 0x7f, 0x68, 0xca, 0x3b, 0xa1, 0x22, 0xf5, 0x76, 0x60, 0x4a, 0x7f, 0xf3, 0x56, 0x21, 0x1c, 0x67, + 0xd0, 0x04, 0x3b, 0xae, 0x06, 0x31, 0x43, 0x32, 0x06, 0xb1, 0xe3, 0xaa, 0xdf, 0x32, 0x1b, 0x4f, + 0x95, 0xa7, 0x36, 0x75, 0xca, 0x0c, 0xff, 0x8d, 0xc6, 0xa5, 0xf0, 0xa2, 0x55, 0x91, 0x4d, 0x86, + 0x0b, 0x63, 0xf2, 0x7d, 0xb7, 0x42, 0xb6, 0xe2, 0x81, 0x21, 0x3b, 0x00, 0x9e, 0x46, 0x63, 0x25, + 0x6f, 0x09, 0x28, 0xfc, 0xd7, 0xe0, 0x60, 0x72, 0xb6, 0x1d, 0x53, 0x84, 0x7c, 0x52, 0xa0, 0x51, + 0x7c, 0x4c, 0xd0, 0xc8, 0x41, 0xe3, 0x50, 0xd9, 0x9f, 0xcf, 0x27, 0x3d, 0x2f, 0x2f, 0x61, 0x5d, + 0x1d, 0xde, 0xe1, 0x76, 0x83, 0x1e, 0xea, 0x43, 0x34, 0xd6, 0xff, 0xa4, 0xe2, 0xe5, 0xaf, 0x7d, + 0x47, 0x68, 0x44, 0x32, 0xe0, 0x73, 0x05, 0x8d, 0x7a, 0x46, 0x85, 0x8d, 0xfe, 0xc8, 0x21, 0x97, + 0x54, 0xef, 0x26, 0x4f, 0xf0, 0xf4, 0x90, 0xf9, 0x57, 0xef, 0xbf, 0xbd, 0x1e, 0x9a, 0xc3, 0x33, + 0x46, 0x3b, 0xfe, 0x8e, 0x4c, 0x35, 0xba, 0xcc, 0x1e, 0xbf, 0x55, 0xd0, 0x64, 0xe7, 0x07, 0x8c, + 0x37, 0xfa, 0xf7, 0x89, 0xb6, 0x53, 0xf5, 0xfe, 0x00, 0x99, 0x80, 0xba, 0x26, 0x51, 0x57, 0xf0, + 0x72, 0x24, 0x6a, 0xe8, 0x57, 0xcb, 0x38, 0x95, 0x36, 0x7d, 0x86, 0xdf, 0x28, 0xe8, 0xf7, 0xce, + 0x62, 0x39, 0xdb, 0x4e, 0x02, 0x1f, 0xed, 0xb0, 0x49, 0xe0, 0x63, 0x3c, 0x93, 0x2c, 0x4b, 0xf8, + 0x05, 0x4c, 0xfa, 0xc3, 0xb7, 0x8f, 0xbb, 0xcb, 0x36, 0xf0, 0x66, 0xa2, 0x63, 0x8b, 0xf4, 0x3b, + 0xf5, 0xc1, 0x40, 0xb9, 0xc0, 0xbd, 0x22, 0xb9, 0x17, 0xf1, 0x42, 0x24, 0x77, 0xd7, 0xaf, 0x3e, + 0xfe, 0xa0, 0xa0, 0xbf, 0x62, 0x3c, 0x0b, 0x67, 0x13, 0x61, 0xc4, 0x64, 0xab, 0x8f, 0x6f, 0x92, + 0x1d, 0xa8, 0xb9, 0x27, 0xd5, 0xac, 0x62, 0x23, 0x52, 0x8d, 0x49, 0x45, 0x51, 0xf8, 0xe9, 0xc5, + 0x1a, 0xe7, 0xb6, 0x6f, 0x99, 0xf8, 0x6b, 0x84, 0x30, 0xff, 0x7b, 0x1f, 0x4c, 0x18, 0x64, 0x0f, + 0x28, 0xac, 0xcb, 0x96, 0x48, 0x5e, 0x0a, 0xcb, 0xe2, 0xcd, 0xa4, 0xc2, 0xc0, 0x77, 0x8c, 0x53, + 0xdf, 0xaa, 0xce, 0x70, 0x4b, 0x41, 0x6a, 0x4c, 0x9f, 0xf6, 0x67, 0x93, 0xbd, 0x89, 0x7f, 0x26, + 0x91, 0xd9, 0xdf, 0x7d, 0xc9, 0x23, 0x29, 0x73, 0x13, 0x6f, 0x74, 0xca, 0xf4, 0xcb, 0x25, 0xd1, + 0x9b, 0xdf, 0xbd, 0x68, 0x69, 0xca, 0x65, 0x4b, 0x53, 0xbe, 0xb4, 0x34, 0xe5, 0xfc, 0x4a, 0x4b, + 0x5d, 0x5e, 0x69, 0xa9, 0x8f, 0x57, 0x5a, 0xea, 0x85, 0x61, 0x5a, 0xee, 0x61, 0xa3, 0xa4, 0x97, + 0x79, 0x35, 0xb2, 0xfa, 0xc9, 0x75, 0x7d, 0xb7, 0x59, 0x63, 0xa2, 0x34, 0x2a, 0xff, 0xaf, 0xae, + 0xff, 0x08, 0x00, 0x00, 0xff, 0xff, 0x88, 0x06, 0xca, 0xa7, 0x99, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/fungible/types/query.pb.gw.go b/x/fungible/types/query.pb.gw.go index 509f8a452a..5338914d3f 100644 --- a/x/fungible/types/query.pb.gw.go +++ b/x/fungible/types/query.pb.gw.go @@ -601,17 +601,17 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "fungible", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "fungible", "params"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ForeignCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"zeta-chain", "zetacore", "fungible", "foreign_coins", "index"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ForeignCoins_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "fungible", "foreign_coins", "index"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_ForeignCoinsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "fungible", "foreign_coins"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ForeignCoinsAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "fungible", "foreign_coins"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_SystemContract_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "fungible", "system_contract"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_SystemContract_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "fungible", "system_contract"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GasStabilityPoolAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "fungible", "gas_stability_pool_address"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GasStabilityPoolAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"zeta-chain", "fungible", "gas_stability_pool_address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_GasStabilityPoolBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"zeta-chain", "zetacore", "fungible", "gas_stability_pool_balance", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_GasStabilityPoolBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"zeta-chain", "fungible", "gas_stability_pool_balance", "chain_id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_GasStabilityPoolBalanceAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"zeta-chain", "zetacore", "fungible", "gas_stability_pool_balance"}, "", runtime.AssumeColonVerbOpt(false))) ) From 0c3d90f3a803d940bd259f7f255cb440c13d0350 Mon Sep 17 00:00:00 2001 From: Tanmay Date: Wed, 25 Oct 2023 16:54:07 -0400 Subject: [PATCH 14/26] test: trackers (#1320) --- testutil/keeper/config.go | 25 +++ testutil/keeper/crosschain.go | 1 + testutil/sample/common.go | 32 ++++ .../keeper_cross_chain_tx_vote_inbound_tx.go | 1 + .../keeper/msg_server_add_to_intx_tracker.go | 70 +------ .../msg_server_add_to_intx_tracker_test.go | 176 ++++++++++++++++++ .../msg_server_add_to_outtx_tracker_test.go | 158 ++++++++++++++++ x/crosschain/keeper/verify_block_header.go | 53 ------ x/crosschain/keeper/verify_proof.go | 104 +++++++++++ x/crosschain/types/errors.go | 14 +- .../types/message_add_to_in_tx_tracker.go | 4 +- 11 files changed, 515 insertions(+), 123 deletions(-) create mode 100644 testutil/keeper/config.go create mode 100644 x/crosschain/keeper/msg_server_add_to_intx_tracker_test.go create mode 100644 x/crosschain/keeper/msg_server_add_to_outtx_tracker_test.go delete mode 100644 x/crosschain/keeper/verify_block_header.go create mode 100644 x/crosschain/keeper/verify_proof.go diff --git a/testutil/keeper/config.go b/testutil/keeper/config.go new file mode 100644 index 0000000000..9c2c63cf27 --- /dev/null +++ b/testutil/keeper/config.go @@ -0,0 +1,25 @@ +package keeper + +import sdk "github.com/cosmos/cosmos-sdk/types" + +const ( + AccountAddressPrefix = "zeta" +) + +var ( + AccountPubKeyPrefix = AccountAddressPrefix + "pub" + ValidatorAddressPrefix = AccountAddressPrefix + "valoper" + ValidatorPubKeyPrefix = AccountAddressPrefix + "valoperpub" + ConsNodeAddressPrefix = AccountAddressPrefix + "valcons" + ConsNodePubKeyPrefix = AccountAddressPrefix + "valconspub" +) + +func SetConfig(seal bool) { + config := sdk.GetConfig() + config.SetBech32PrefixForAccount(AccountAddressPrefix, AccountPubKeyPrefix) + config.SetBech32PrefixForValidator(ValidatorAddressPrefix, ValidatorPubKeyPrefix) + config.SetBech32PrefixForConsensusNode(ConsNodeAddressPrefix, ConsNodePubKeyPrefix) + if seal { + config.Seal() + } +} diff --git a/testutil/keeper/crosschain.go b/testutil/keeper/crosschain.go index f96dc7e87c..0cb2a31bb2 100644 --- a/testutil/keeper/crosschain.go +++ b/testutil/keeper/crosschain.go @@ -37,6 +37,7 @@ func CrosschainKeeperWithMocks( t testing.TB, mockOptions CrosschainMockOptions, ) (*keeper.Keeper, sdk.Context, SDKKeepers, ZetaKeepers) { + SetConfig(false) storeKey := sdk.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) diff --git a/testutil/sample/common.go b/testutil/sample/common.go index a2d3c18dd7..4b1a65bd15 100644 --- a/testutil/sample/common.go +++ b/testutil/sample/common.go @@ -5,10 +5,12 @@ import ( "math/big" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rlp" "github.com/tendermint/tendermint/crypto/secp256k1" "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/common/ethereum" ) func Chain(chainID int64) *common.Chain { @@ -42,3 +44,33 @@ func EthHeader() (headerRLP []byte, err error) { headerRLP, _ = rlp.EncodeToBytes(block.Header()) return } + +func Proof() (txIndex int64, block *ethtypes.Block, header ethtypes.Header, headerRLP []byte, proof *common.Proof, tx *ethtypes.Transaction, err error) { + txIndex = int64(9) + url := "https://rpc.ankr.com/eth_goerli" + client, err := ethclient.Dial(url) + if err != nil { + return + } + bn := int64(9889649) + block, err = client.BlockByNumber(context.Background(), big.NewInt(bn)) + if err != nil { + return + } + headerRLP, _ = rlp.EncodeToBytes(block.Header()) + err = rlp.DecodeBytes(headerRLP, &header) + if err != nil { + return + } + tr := ethereum.NewTrie(block.Transactions()) + var b []byte + ib := rlp.AppendUint64(b, uint64(txIndex)) + p := ethereum.NewProof() + err = tr.Prove(ib, 0, p) + if err != nil { + return + } + proof = common.NewEthereumProof(p) + tx = block.Transactions()[txIndex] + return +} 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 8e36f2983b..d4454ba42f 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 @@ -238,6 +238,7 @@ func (k msgServer) VoteOnObservedInboundTx(goCtx context.Context, msg *types.Msg } commit() cctx.CctxStatus.ChangeStatus(types.CctxStatus_PendingOutbound, "") + k.RemoveInTxTrackerIfExists(ctx, cctx.InboundTxParams.SenderChainId, cctx.InboundTxParams.InboundTxObservedHash) return &types.MsgVoteOnObservedInboundTxResponse{}, nil } } diff --git a/x/crosschain/keeper/msg_server_add_to_intx_tracker.go b/x/crosschain/keeper/msg_server_add_to_intx_tracker.go index cb9510e9fd..3aa8644423 100644 --- a/x/crosschain/keeper/msg_server_add_to_intx_tracker.go +++ b/x/crosschain/keeper/msg_server_add_to_intx_tracker.go @@ -6,8 +6,6 @@ import ( 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" @@ -29,11 +27,16 @@ func (k msgServer) AddToInTxTracker(goCtx context.Context, msg *types.MsgAddToIn 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()) + return nil, types.ErrProofVerificationFail.Wrapf(err.Error()) } - err = k.VerifyInTxBody(ctx, msg, txBytes) - if err != nil { - return nil, types.ErrCannotVerifyProof.Wrapf(err.Error()) + + if common.IsEVMChain(msg.ChainId) { + err = k.VerifyEVMInTxBody(ctx, msg, txBytes) + if err != nil { + return nil, types.ErrTxBodyVerificationFail.Wrapf(err.Error()) + } + } else { + return nil, types.ErrTxBodyVerificationFail.Wrapf(fmt.Sprintf("cannot verify inTx body for chain %d", msg.ChainId)) } isProven = true } @@ -43,63 +46,10 @@ func (k msgServer) AddToInTxTracker(goCtx context.Context, msg *types.MsgAddToIn return nil, errorsmod.Wrap(observertypes.ErrNotAuthorized, fmt.Sprintf("Creator %s", msg.Creator)) } - k.Keeper.SetInTxTracker(ctx, types.InTxTracker{ + k.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_intx_tracker_test.go b/x/crosschain/keeper/msg_server_add_to_intx_tracker_test.go new file mode 100644 index 0000000000..715635e9fe --- /dev/null +++ b/x/crosschain/keeper/msg_server_add_to_intx_tracker_test.go @@ -0,0 +1,176 @@ +//go:build TESTNET +// +build TESTNET + +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/common" + keepertest "github.com/zeta-chain/zetacore/testutil/keeper" + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/crosschain/keeper" + "github.com/zeta-chain/zetacore/x/crosschain/types" + observerTypes "github.com/zeta-chain/zetacore/x/observer/types" +) + +func TestMsgServer_AddToInTxTracker(t *testing.T) { + t.Run("add proof based tracker with correct proof", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, proof, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToInTxTracker(ctx, &types.MsgAddToInTxTracker{ + Creator: sample.AccAddress(), + ChainId: chainID, + TxHash: tx.Hash().Hex(), + CoinType: common.CoinType_Zeta, + Proof: proof, + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + }) + require.NoError(t, err) + _, found := k.GetInTxTracker(ctx, chainID, tx.Hash().Hex()) + require.True(t, found) + }) + + t.Run("fail to add proof based tracker with wrong tx hash", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, proof, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToInTxTracker(ctx, &types.MsgAddToInTxTracker{ + Creator: sample.AccAddress(), + ChainId: chainID, + TxHash: "fake_hash", + CoinType: common.CoinType_Zeta, + Proof: proof, + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + }) + require.ErrorIs(t, types.ErrTxBodyVerificationFail, err) + _, found := k.GetInTxTracker(ctx, chainID, tx.Hash().Hex()) + require.False(t, found) + }) + + t.Run("fail to add proof based tracker with wrong chain id", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, proof, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToInTxTracker(ctx, &types.MsgAddToInTxTracker{ + Creator: sample.AccAddress(), + ChainId: 97, + TxHash: tx.Hash().Hex(), + CoinType: common.CoinType_Zeta, + Proof: proof, + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + }) + require.ErrorIs(t, types.ErrTxBodyVerificationFail, err) + _, found := k.GetInTxTracker(ctx, chainID, tx.Hash().Hex()) + require.False(t, found) + }) + t.Run("fail normal user submit without proof", func(t *testing.T) { + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + tx_hash := "string" + chainID := int64(5) + msgServer := keeper.NewMsgServerImpl(*k) + _, err := msgServer.AddToInTxTracker(ctx, &types.MsgAddToInTxTracker{ + Creator: sample.AccAddress(), + ChainId: chainID, + TxHash: tx_hash, + CoinType: common.CoinType_Zeta, + Proof: nil, + BlockHash: "", + TxIndex: 0, + }) + require.ErrorIs(t, observerTypes.ErrNotAuthorized, err) + _, found := k.GetInTxTracker(ctx, chainID, tx_hash) + require.False(t, found) + }) + t.Run("admin add tx tracker", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + admin := sample.AccAddress() + setAdminPolicies(ctx, zk, admin) + tx_hash := "string" + chainID := int64(5) + msgServer := keeper.NewMsgServerImpl(*k) + _, err := msgServer.AddToInTxTracker(ctx, &types.MsgAddToInTxTracker{ + Creator: admin, + ChainId: chainID, + TxHash: tx_hash, + CoinType: common.CoinType_Zeta, + Proof: nil, + BlockHash: "", + TxIndex: 0, + }) + require.NoError(t, err) + _, found := k.GetInTxTracker(ctx, chainID, tx_hash) + require.True(t, found) + }) + t.Run("admin submit fake tracker", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + admin := sample.AccAddress() + setAdminPolicies(ctx, zk, admin) + tx_hash := "string" + chainID := int64(5) + msgServer := keeper.NewMsgServerImpl(*k) + _, err := msgServer.AddToInTxTracker(ctx, &types.MsgAddToInTxTracker{ + Creator: admin, + ChainId: chainID, + TxHash: "Malicious TX HASH", + CoinType: common.CoinType_Zeta, + Proof: nil, + BlockHash: "", + TxIndex: 0, + }) + require.NoError(t, err) + _, found := k.GetInTxTracker(ctx, chainID, "Malicious TX HASH") + require.True(t, found) + _, found = k.GetInTxTracker(ctx, chainID, tx_hash) + require.False(t, found) + }) +} + +func setupVerificationParams(zk keepertest.ZetaKeepers, ctx sdk.Context, tx_index int64, chainID int64, header ethtypes.Header, headerRLP []byte, block *ethtypes.Block) { + params := zk.ObserverKeeper.GetParams(ctx) + params.ObserverParams = append(params.ObserverParams, &observerTypes.ObserverParams{ + Chain: &common.Chain{ + ChainId: chainID, + ChainName: common.ChainName_goerli_testnet, + }, + BallotThreshold: sdk.OneDec(), + MinObserverDelegation: sdk.OneDec(), + IsSupported: true, + }) + zk.ObserverKeeper.SetParams(ctx, params) + zk.ObserverKeeper.SetBlockHeader(ctx, common.BlockHeader{ + Height: block.Number().Int64(), + Hash: block.Hash().Bytes(), + ParentHash: header.ParentHash.Bytes(), + ChainId: chainID, + Header: common.NewEthereumHeader(headerRLP), + }) + zk.ObserverKeeper.SetCoreParams(ctx, observerTypes.CoreParamsList{CoreParams: []*observerTypes.CoreParams{ + { + ChainId: chainID, + ConnectorContractAddress: block.Transactions()[tx_index].To().Hex(), + }, + }}) + zk.ObserverKeeper.SetCrosschainFlags(ctx, observerTypes.CrosschainFlags{ + BlockHeaderVerificationFlags: &observerTypes.BlockHeaderVerificationFlags{ + IsEthTypeChainEnabled: true, + IsBtcTypeChainEnabled: false, + }, + }) +} diff --git a/x/crosschain/keeper/msg_server_add_to_outtx_tracker_test.go b/x/crosschain/keeper/msg_server_add_to_outtx_tracker_test.go new file mode 100644 index 0000000000..c43bd45ce8 --- /dev/null +++ b/x/crosschain/keeper/msg_server_add_to_outtx_tracker_test.go @@ -0,0 +1,158 @@ +//go:build TESTNET +// +build TESTNET + +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/common" + "github.com/zeta-chain/zetacore/common/ethereum" + keepertest "github.com/zeta-chain/zetacore/testutil/keeper" + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/crosschain/keeper" + "github.com/zeta-chain/zetacore/x/crosschain/types" +) + +func TestMsgServer_AddToOutTxTracker(t *testing.T) { + t.Run("add tracker admin", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + admin := sample.AccAddress() + setAdminPolicies(ctx, zk, admin) + chainID := int64(5) + txIndex, block, header, headerRLP, _, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + setupTss(k, ctx) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{ + Creator: admin, + ChainId: chainID, + TxHash: tx.Hash().Hex(), + Proof: nil, + BlockHash: "", + TxIndex: 0, + Nonce: 0, + }) + require.NoError(t, err) + _, found := k.GetOutTxTracker(ctx, chainID, 0) + require.True(t, found) + }) + + t.Run("fail add proof based tracker with wrong chainID", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, proof, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + setupTss(k, ctx) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{ + Creator: sample.AccAddress(), + ChainId: 97, + TxHash: tx.Hash().Hex(), + Proof: proof, + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + Nonce: tx.Nonce(), + }) + require.ErrorIs(t, types.ErrTxBodyVerificationFail, err) + _, found := k.GetOutTxTracker(ctx, chainID, tx.Nonce()) + require.False(t, found) + }) + + t.Run("fail add proof based tracker with wrong nonce", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, proof, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + setupTss(k, ctx) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{ + Creator: sample.AccAddress(), + ChainId: chainID, + TxHash: tx.Hash().Hex(), + Proof: proof, + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + Nonce: 1, + }) + require.ErrorIs(t, types.ErrTxBodyVerificationFail, err) + _, found := k.GetOutTxTracker(ctx, chainID, 1) + require.False(t, found) + }) + + t.Run("fail add proof based tracker with wrong tx_hash", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, proof, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + setupTss(k, ctx) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{ + Creator: sample.AccAddress(), + ChainId: chainID, + TxHash: "wrong_hash", + Proof: proof, + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + Nonce: tx.Nonce(), + }) + require.ErrorIs(t, types.ErrTxBodyVerificationFail, err) + _, found := k.GetOutTxTracker(ctx, chainID, tx.Nonce()) + require.False(t, found) + }) + + t.Run("fail proof based tracker with incorrect proof", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, _, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + setupTss(k, ctx) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{ + Creator: sample.AccAddress(), + ChainId: chainID, + TxHash: tx.Hash().Hex(), + Proof: common.NewEthereumProof(ethereum.NewProof()), + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + Nonce: tx.Nonce(), + }) + require.ErrorIs(t, types.ErrProofVerificationFail, err) + _, found := k.GetOutTxTracker(ctx, chainID, tx.Nonce()) + require.False(t, found) + }) + t.Run("add proof based tracker with correct proof", func(t *testing.T) { + k, ctx, _, zk := keepertest.CrosschainKeeper(t) + chainID := int64(5) + txIndex, block, header, headerRLP, proof, tx, err := sample.Proof() + require.NoError(t, err) + setupVerificationParams(zk, ctx, txIndex, chainID, header, headerRLP, block) + setupTss(k, ctx) + msgServer := keeper.NewMsgServerImpl(*k) + _, err = msgServer.AddToOutTxTracker(ctx, &types.MsgAddToOutTxTracker{ + Creator: sample.AccAddress(), + ChainId: chainID, + TxHash: tx.Hash().Hex(), + Proof: proof, + BlockHash: block.Hash().Hex(), + TxIndex: txIndex, + Nonce: tx.Nonce(), + }) + require.NoError(t, err) + _, found := k.GetOutTxTracker(ctx, chainID, tx.Nonce()) + require.True(t, found) + }) +} + +func setupTss(k *keeper.Keeper, ctx sdk.Context) { + k.SetTSS(ctx, types.TSS{ + TssPubkey: "zetapub1addwnpepq28c57cvcs0a2htsem5zxr6qnlvq9mzhmm76z3jncsnzz32rclangr2g35p", + }) +} diff --git a/x/crosschain/keeper/verify_block_header.go b/x/crosschain/keeper/verify_block_header.go deleted file mode 100644 index 92f389987e..0000000000 --- a/x/crosschain/keeper/verify_block_header.go +++ /dev/null @@ -1,53 +0,0 @@ -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/keeper/verify_proof.go b/x/crosschain/keeper/verify_proof.go new file mode 100644 index 0000000000..c80a600078 --- /dev/null +++ b/x/crosschain/keeper/verify_proof.go @@ -0,0 +1,104 @@ +package keeper + +import ( + "fmt" + "math/big" + + 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" +) + +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 +} + +func (k Keeper) VerifyEVMInTxBody(ctx sdk.Context, msg *types.MsgAddToInTxTracker, txBytes []byte) error { + var txx ethtypes.Transaction + err := txx.UnmarshalBinary(txBytes) + if err != nil { + return err + } + if txx.Hash().Hex() != msg.TxHash { + return fmt.Errorf("want tx hash %s, got %s", txx.Hash().Hex(), msg.TxHash) + } + if txx.ChainId().Cmp(big.NewInt(msg.ChainId)) != 0 { + return fmt.Errorf("want evm chain id %d, got %d", txx.ChainId(), msg.ChainId) + } + switch msg.CoinType { + case common.CoinType_Zeta: + coreParams, found := k.zetaObserverKeeper.GetCoreParamsByChainID(ctx, msg.ChainId) + if !found { + return types.ErrUnsupportedChain.Wrapf("core params not found for chain %d", msg.ChainId) + } + 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: + coreParams, found := k.zetaObserverKeeper.GetCoreParamsByChainID(ctx, msg.ChainId) + if !found { + return types.ErrUnsupportedChain.Wrapf("core params not found for chain %d", msg.ChainId) + } + 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: + tss, err := k.GetTssAddress(ctx, &types.QueryGetTssAddressRequest{}) + if err != nil { + return err + } + tssAddr := eth.HexToAddress(tss.Eth) + if tssAddr == (eth.Address{}) { + return fmt.Errorf("tss address not found") + } + 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/types/errors.go b/x/crosschain/types/errors.go index c9186f9795..c1797d54b9 100644 --- a/x/crosschain/types/errors.go +++ b/x/crosschain/types/errors.go @@ -34,12 +34,10 @@ var ( 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") - ErrInvalidGasAmount = errorsmod.Register(ModuleName, 1137, "invalid gas amount") - 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") + ErrCannotFindGasParams = errorsmod.Register(ModuleName, 1136, "cannot find gas params") + ErrInvalidGasAmount = errorsmod.Register(ModuleName, 1137, "invalid gas amount") + 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") + ErrTxBodyVerificationFail = errorsmod.Register(ModuleName, 1141, "transaction body verification fail") ) diff --git a/x/crosschain/types/message_add_to_in_tx_tracker.go b/x/crosschain/types/message_add_to_in_tx_tracker.go index c44c15ba8c..5f15f4d735 100644 --- a/x/crosschain/types/message_add_to_in_tx_tracker.go +++ b/x/crosschain/types/message_add_to_in_tx_tracker.go @@ -51,11 +51,11 @@ func (msg *MsgAddToInTxTracker) ValidateBasic() error { 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) + return errorsmod.Wrapf(ErrProofVerificationFail, "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 errorsmod.Wrapf(ErrProofVerificationFail, "coin-type not supported") } return nil } From f9d998783db44d1d3a95127b5ae19da7cd482899 Mon Sep 17 00:00:00 2001 From: Luke Ma <867273263@qq.com> Date: Fri, 27 Oct 2023 01:45:35 +0800 Subject: [PATCH 15/26] refactor: Enhance the basic validation for MsgDeployFungibleCoinZRC20 (#1310) * add the basic validation for MsgDeployFungibleCoinZRC20 * modify erc20 decimals limit --- .../keeper/msg_server_deploy_fungible_coin_zrc20.go | 8 +++++--- .../keeper/msg_server_deploy_fungible_coin_zrc20_test.go | 2 +- x/fungible/types/message_deploy_fungible_coin_zrc20.go | 6 +++++- .../types/message_deploy_fungible_coin_zrc20_test.go | 8 ++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20.go b/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20.go index 24ab3f5f87..76bfbba39e 100644 --- a/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20.go +++ b/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20.go @@ -37,12 +37,14 @@ func (k msgServer) DeployFungibleCoinZRC20(goCtx context.Context, msg *types.Msg var address common.Address var err error + if err = msg.ValidateBasic(); err != nil { + return nil, err + } + if msg.Creator != k.observerKeeper.GetParams(ctx).GetAdminPolicyAccount(zetaObserverTypes.Policy_Type_group2) { return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Deploy can only be executed by the correct policy account") } - if msg.Decimals > 255 { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "decimals must be less than 256") - } + if msg.CoinType == zetacommon.CoinType_Gas { // #nosec G701 always in range address, err = k.SetupChainGasCoinAndPool(ctx, msg.ForeignChainId, msg.Name, msg.Symbol, uint8(msg.Decimals), big.NewInt(msg.GasLimit)) diff --git a/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20_test.go b/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20_test.go index 788feba0fb..95426c9437 100644 --- a/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20_test.go +++ b/x/fungible/keeper/msg_server_deploy_fungible_coin_zrc20_test.go @@ -122,7 +122,7 @@ func TestMsgServer_DeployFungibleCoinZRC20(t *testing.T) { admin, sample.EthAddress().Hex(), chainID, - 256, + 78, "foo", "foo", common.CoinType_Gas, diff --git a/x/fungible/types/message_deploy_fungible_coin_zrc20.go b/x/fungible/types/message_deploy_fungible_coin_zrc20.go index 14d6681b3f..6b23365001 100644 --- a/x/fungible/types/message_deploy_fungible_coin_zrc20.go +++ b/x/fungible/types/message_deploy_fungible_coin_zrc20.go @@ -50,7 +50,11 @@ func (msg *MsgDeployFungibleCoinZRC20) ValidateBasic() error { return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } if msg.GasLimit < 0 { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidGasLimit, "invalid gas limit (%s)", err) + return sdkerrors.Wrapf(sdkerrors.ErrInvalidGasLimit, "invalid gas limit") + } + + if msg.Decimals > 77 { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "decimals must be less than 78") } return nil } diff --git a/x/fungible/types/message_deploy_fungible_coin_zrc20_test.go b/x/fungible/types/message_deploy_fungible_coin_zrc20_test.go index 75f50bc290..e107af7781 100644 --- a/x/fungible/types/message_deploy_fungible_coin_zrc20_test.go +++ b/x/fungible/types/message_deploy_fungible_coin_zrc20_test.go @@ -30,6 +30,14 @@ func TestMsgDeployFungibleCoinZRC4_ValidateBasic(t *testing.T) { }, err: sdkerrors.ErrInvalidGasLimit, }, + { + name: "invalid decimals", + msg: types.MsgDeployFungibleCoinZRC20{ + Creator: sample.AccAddress(), + Decimals: 78, + }, + err: sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "decimals must be less than 78"), + }, { name: "valid message", msg: types.MsgDeployFungibleCoinZRC20{ From ea9ba1271de86bc06e58d51a0de1a29650908ef5 Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Thu, 26 Oct 2023 15:44:28 -0700 Subject: [PATCH 16/26] fix: register codec for all messages (#1210) * codec * add msgServer * fix tests * add new missing messages --- x/crosschain/keeper/gas_payment_test.go | 18 ++++++---- .../keeper/msg_server_whitelist_erc20.go | 2 +- .../keeper/msg_server_whitelist_erc20_test.go | 21 ++++++++---- x/crosschain/keeper/test_privnet.go | 3 +- x/crosschain/types/codec.go | 12 +++++-- ...blocker_deploy_system_contracts_privnet.go | 6 ++-- .../msg_server_update_contract_bytecode.go | 2 +- ...sg_server_update_contract_bytecode_test.go | 34 +++++++++++++------ .../msg_server_update_system_contract.go | 2 +- .../msg_server_update_system_contract_test.go | 9 +++-- .../msg_server_update_zrc20_paused_status.go | 2 +- ..._server_update_zrc20_paused_status_test.go | 25 ++++++++------ .../msg_server_update_zrc20_withdraw_fee.go | 2 +- ...g_server_update_zrc20_withdraw_fee_test.go | 26 +++++++++----- x/fungible/types/codec.go | 8 +++++ x/observer/types/codec.go | 8 ++++- 16 files changed, 123 insertions(+), 57 deletions(-) diff --git a/x/crosschain/keeper/gas_payment_test.go b/x/crosschain/keeper/gas_payment_test.go index 9f771ba542..a1ad790d4a 100644 --- a/x/crosschain/keeper/gas_payment_test.go +++ b/x/crosschain/keeper/gas_payment_test.go @@ -226,12 +226,13 @@ func TestKeeper_PayGasNativeAndUpdateCctx(t *testing.T) { k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin) + fungibleMsgServer := fungiblekeeper.NewMsgServerImpl(*zk.FungibleKeeper) // deploy gas coin and set fee params chainID := getValidEthChainID(t) deploySystemContracts(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper) zrc20 := setupGasCoin(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper, chainID, "foobar", "foobar") - _, err := zk.FungibleKeeper.UpdateZRC20WithdrawFee( + _, err := fungibleMsgServer.UpdateZRC20WithdrawFee( sdk.UnwrapSDKContext(ctx), fungibletypes.NewMsgUpdateZRC20WithdrawFee(admin, zrc20.String(), sdk.NewUint(withdrawFee), math.Uint{}), ) @@ -324,12 +325,13 @@ func TestKeeper_PayGasNativeAndUpdateCctx(t *testing.T) { k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin) + fungibleMsgServer := fungiblekeeper.NewMsgServerImpl(*zk.FungibleKeeper) // deploy gas coin and set fee params chainID := getValidEthChainID(t) deploySystemContracts(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper) zrc20 := setupGasCoin(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper, chainID, "foobar", "foobar") - _, err := zk.FungibleKeeper.UpdateZRC20WithdrawFee( + _, err := fungibleMsgServer.UpdateZRC20WithdrawFee( sdk.UnwrapSDKContext(ctx), fungibletypes.NewMsgUpdateZRC20WithdrawFee(admin, zrc20.String(), sdk.NewUint(withdrawFee), math.Uint{}), ) @@ -367,6 +369,7 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin) + fungibleMsgServer := fungiblekeeper.NewMsgServerImpl(*zk.FungibleKeeper) // deploy gas coin, erc20 and set fee params chainID := getValidEthChainID(t) @@ -383,7 +386,7 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { assetAddress, "bar", ) - _, err := zk.FungibleKeeper.UpdateZRC20WithdrawFee( + _, err := fungibleMsgServer.UpdateZRC20WithdrawFee( sdk.UnwrapSDKContext(ctx), fungibletypes.NewMsgUpdateZRC20WithdrawFee(admin, gasZRC20.String(), sdk.NewUint(withdrawFee), math.Uint{}), ) @@ -490,13 +493,14 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin) + fungibleMsgServer := fungiblekeeper.NewMsgServerImpl(*zk.FungibleKeeper) // deploy gas coin, erc20 and set fee params chainID := getValidEthChainID(t) assetAddress := sample.EthAddress().String() deploySystemContracts(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper) gasZRC20 := setupGasCoin(t, ctx, zk.FungibleKeeper, sdkk.EvmKeeper, chainID, "foo", "foo") - _, err := zk.FungibleKeeper.UpdateZRC20WithdrawFee( + _, err := fungibleMsgServer.UpdateZRC20WithdrawFee( sdk.UnwrapSDKContext(ctx), fungibletypes.NewMsgUpdateZRC20WithdrawFee(admin, gasZRC20.String(), sdk.NewUint(withdrawFee), math.Uint{}), ) @@ -534,6 +538,7 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin) + fungibleMsgServer := fungiblekeeper.NewMsgServerImpl(*zk.FungibleKeeper) // deploy gas coin, erc20 and set fee params chainID := getValidEthChainID(t) @@ -550,7 +555,7 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { assetAddress, "bar", ) - _, err := zk.FungibleKeeper.UpdateZRC20WithdrawFee( + _, err := fungibleMsgServer.UpdateZRC20WithdrawFee( sdk.UnwrapSDKContext(ctx), fungibletypes.NewMsgUpdateZRC20WithdrawFee(admin, gasZRC20.String(), sdk.NewUint(withdrawFee), math.Uint{}), ) @@ -588,6 +593,7 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin) + fungibleMsgServer := fungiblekeeper.NewMsgServerImpl(*zk.FungibleKeeper) // deploy gas coin, erc20 and set fee params chainID := getValidEthChainID(t) @@ -604,7 +610,7 @@ func TestKeeper_PayGasInERC20AndUpdateCctx(t *testing.T) { assetAddress, "bar", ) - _, err := zk.FungibleKeeper.UpdateZRC20WithdrawFee( + _, err := fungibleMsgServer.UpdateZRC20WithdrawFee( sdk.UnwrapSDKContext(ctx), fungibletypes.NewMsgUpdateZRC20WithdrawFee(admin, gasZRC20.String(), sdk.NewUint(withdrawFee), math.Uint{}), ) diff --git a/x/crosschain/keeper/msg_server_whitelist_erc20.go b/x/crosschain/keeper/msg_server_whitelist_erc20.go index bd8d7b5f60..7097f8c46b 100644 --- a/x/crosschain/keeper/msg_server_whitelist_erc20.go +++ b/x/crosschain/keeper/msg_server_whitelist_erc20.go @@ -21,7 +21,7 @@ import ( // WhitelistERC20 deploys a new zrc20, create a foreign coin object for the ERC20 // and emit a crosschain tx to whitelist the ERC20 on the external chain -func (k Keeper) WhitelistERC20(goCtx context.Context, msg *types.MsgWhitelistERC20) (*types.MsgWhitelistERC20Response, error) { +func (k msgServer) WhitelistERC20(goCtx context.Context, msg *types.MsgWhitelistERC20) (*types.MsgWhitelistERC20Response, error) { ctx := sdk.UnwrapSDKContext(goCtx) if msg.Creator != k.zetaObserverKeeper.GetParams(ctx).GetAdminPolicyAccount(zetaObserverTypes.Policy_Type_group1) { return nil, errorsmod.Wrap(sdkerrors.ErrUnauthorized, "Deploy can only be executed by the correct policy account") diff --git a/x/crosschain/keeper/msg_server_whitelist_erc20_test.go b/x/crosschain/keeper/msg_server_whitelist_erc20_test.go index 8a2925ddcd..7461ffc81b 100644 --- a/x/crosschain/keeper/msg_server_whitelist_erc20_test.go +++ b/x/crosschain/keeper/msg_server_whitelist_erc20_test.go @@ -10,6 +10,7 @@ import ( "github.com/zeta-chain/zetacore/common" keepertest "github.com/zeta-chain/zetacore/testutil/keeper" "github.com/zeta-chain/zetacore/testutil/sample" + crosschainkeeper "github.com/zeta-chain/zetacore/x/crosschain/keeper" "github.com/zeta-chain/zetacore/x/crosschain/types" fungibletypes "github.com/zeta-chain/zetacore/x/fungible/types" ) @@ -17,6 +18,7 @@ import ( func TestKeeper_WhitelistERC20(t *testing.T) { t.Run("can deploy and whitelist an erc20", func(t *testing.T) { k, ctx, sdkk, zk := keepertest.CrosschainKeeper(t) + msgServer := crosschainkeeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) chainID := getValidEthChainID(t) @@ -33,7 +35,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { }) erc20Address := sample.EthAddress().Hex() - res, err := k.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ + res, err := msgServer.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ Creator: admin, Erc20Address: erc20Address, ChainId: chainID, @@ -63,7 +65,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { require.Equal(t, uint64(100000), gasLimit.Uint64()) // Ensure that whitelist a new erc20 create a cctx with a different index - res, err = k.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ + res, err = msgServer.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ Creator: admin, Erc20Address: sample.EthAddress().Hex(), ChainId: chainID, @@ -79,9 +81,10 @@ func TestKeeper_WhitelistERC20(t *testing.T) { t.Run("should fail if not authorized", func(t *testing.T) { k, ctx, _, _ := keepertest.CrosschainKeeper(t) + msgServer := crosschainkeeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) - _, err := k.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ + _, err := msgServer.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ Creator: sample.AccAddress(), Erc20Address: sample.EthAddress().Hex(), ChainId: getValidEthChainID(t), @@ -95,12 +98,13 @@ func TestKeeper_WhitelistERC20(t *testing.T) { t.Run("should fail if invalid erc20 address", func(t *testing.T) { k, ctx, _, zk := keepertest.CrosschainKeeper(t) + msgServer := crosschainkeeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin) - _, err := k.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ + _, err := msgServer.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ Creator: admin, Erc20Address: "invalid", ChainId: getValidEthChainID(t), @@ -114,6 +118,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { t.Run("should fail if foreign coin already exists for the asset", func(t *testing.T) { k, ctx, _, zk := keepertest.CrosschainKeeper(t) + msgServer := crosschainkeeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() @@ -126,7 +131,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { fc.ForeignChainId = chainID zk.FungibleKeeper.SetForeignCoins(ctx, fc) - _, err := k.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ + _, err := msgServer.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ Creator: admin, Erc20Address: asset, ChainId: chainID, @@ -140,6 +145,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { t.Run("should fail if no tss set", func(t *testing.T) { k, ctx, _, zk := keepertest.CrosschainKeeper(t) + msgServer := crosschainkeeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) chainID := getValidEthChainID(t) @@ -147,7 +153,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { setAdminPolicies(ctx, zk, admin) erc20Address := sample.EthAddress().Hex() - _, err := k.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ + _, err := msgServer.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ Creator: admin, Erc20Address: erc20Address, ChainId: chainID, @@ -161,6 +167,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { t.Run("should fail if nox valid chain ID", func(t *testing.T) { k, ctx, _, zk := keepertest.CrosschainKeeper(t) + msgServer := crosschainkeeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, fungibletypes.ModuleName) admin := sample.AccAddress() @@ -168,7 +175,7 @@ func TestKeeper_WhitelistERC20(t *testing.T) { k.SetTssAndUpdateNonce(ctx, *sample.Tss()) erc20Address := sample.EthAddress().Hex() - _, err := k.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ + _, err := msgServer.WhitelistERC20(ctx, &types.MsgWhitelistERC20{ Creator: admin, Erc20Address: erc20Address, ChainId: 10000, diff --git a/x/crosschain/keeper/test_privnet.go b/x/crosschain/keeper/test_privnet.go index db2f68b2ad..a9a96a2586 100644 --- a/x/crosschain/keeper/test_privnet.go +++ b/x/crosschain/keeper/test_privnet.go @@ -15,7 +15,8 @@ func (k Keeper) TestWhitelistERC20(ctx sdk.Context) error { creator := k.zetaObserverKeeper.GetParams(ctx).GetAdminPolicyAccount(zetaObserverTypes.Policy_Type_group1) msg := types.NewMsgWhitelistERC20(creator, types.ModuleAddressEVM.Hex(), common.GoerliChain().ChainId, "test", "testerc20", 17, 90_000) - _, err := k.WhitelistERC20(goCtx, msg) + msgServer := NewMsgServerImpl(k) + _, err := msgServer.WhitelistERC20(goCtx, msg) if err != nil { panic(err) } diff --git a/x/crosschain/types/codec.go b/x/crosschain/types/codec.go index 0d9a0cf29d..02c0e849ea 100644 --- a/x/crosschain/types/codec.go +++ b/x/crosschain/types/codec.go @@ -9,24 +9,32 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgAddToOutTxTracker{}, "crosschain/AddToOutTxTracker", nil) + cdc.RegisterConcrete(&MsgAddToInTxTracker{}, "crosschain/AddToInTxTracker", nil) cdc.RegisterConcrete(&MsgRemoveFromOutTxTracker{}, "crosschain/RemoveFromOutTxTracker", nil) cdc.RegisterConcrete(&MsgCreateTSSVoter{}, "crosschain/CreateTSSVoter", nil) cdc.RegisterConcrete(&MsgGasPriceVoter{}, "crosschain/GasPriceVoter", nil) cdc.RegisterConcrete(&MsgNonceVoter{}, "crosschain/NonceVoter", nil) - cdc.RegisterConcrete(&MsgVoteOnObservedOutboundTxResponse{}, "crosschain/ReceiveConfirmation", nil) - cdc.RegisterConcrete(&MsgVoteOnObservedInboundTx{}, "crosschain/SendVoter", nil) + cdc.RegisterConcrete(&MsgVoteOnObservedOutboundTx{}, "crosschain/VoteOnObservedOutboundTx", nil) + cdc.RegisterConcrete(&MsgVoteOnObservedInboundTx{}, "crosschain/VoteOnObservedInboundTx", nil) + cdc.RegisterConcrete(&MsgWhitelistERC20{}, "crosschain/WhitelistERC20", nil) + cdc.RegisterConcrete(&MsgMigrateTssFunds{}, "crosschain/MigrateTssFunds", nil) + cdc.RegisterConcrete(&MsgUpdateTssAddress{}, "crosschain/UpdateTssAddress", nil) cdc.RegisterConcrete(&MsgSetNodeKeys{}, "crosschain/SetNodeKeys", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAddToOutTxTracker{}, + &MsgAddToInTxTracker{}, &MsgRemoveFromOutTxTracker{}, &MsgCreateTSSVoter{}, &MsgGasPriceVoter{}, &MsgNonceVoter{}, &MsgVoteOnObservedOutboundTx{}, &MsgVoteOnObservedInboundTx{}, + &MsgWhitelistERC20{}, + &MsgMigrateTssFunds{}, + &MsgUpdateTssAddress{}, &MsgSetNodeKeys{}, ) diff --git a/x/fungible/keeper/begin_blocker_deploy_system_contracts_privnet.go b/x/fungible/keeper/begin_blocker_deploy_system_contracts_privnet.go index c806073894..cbcedd747b 100644 --- a/x/fungible/keeper/begin_blocker_deploy_system_contracts_privnet.go +++ b/x/fungible/keeper/begin_blocker_deploy_system_contracts_privnet.go @@ -116,6 +116,7 @@ func (k Keeper) BlockOneDeploySystemContracts(goCtx context.Context) error { func (k Keeper) TestUpdateSystemContractAddress(goCtx context.Context) error { ctx := sdk.UnwrapSDKContext(goCtx) + msgServer := NewMsgServerImpl(k) wzeta, err := k.GetWZetaContractAddress(ctx) if err != nil { @@ -136,13 +137,14 @@ func (k Keeper) TestUpdateSystemContractAddress(goCtx context.Context) error { } creator := k.observerKeeper.GetParams(ctx).GetAdminPolicyAccount(observertypes.Policy_Type_group1) msg := types.NewMsgUpdateSystemContract(creator, SystemContractAddress.Hex()) - _, err = k.UpdateSystemContract(ctx, msg) + _, err = msgServer.UpdateSystemContract(ctx, msg) k.Logger(ctx).Info("System contract updated", "new address", SystemContractAddress.String()) return err } func (k Keeper) TestUpdateZRC20WithdrawFee(goCtx context.Context) error { ctx := sdk.UnwrapSDKContext(goCtx) + msgServer := NewMsgServerImpl(k) foreignCoins := k.GetAllForeignCoins(ctx) creator := k.observerKeeper.GetParams(ctx).GetAdminPolicyAccount(observertypes.Policy_Type_group1) @@ -154,7 +156,7 @@ func (k Keeper) TestUpdateZRC20WithdrawFee(goCtx context.Context) error { sdk.NewUint(uint64(foreignCoin.ForeignChainId)), math.Uint{}, ) - _, err := k.UpdateZRC20WithdrawFee(ctx, msg) + _, err := msgServer.UpdateZRC20WithdrawFee(ctx, msg) if err != nil { return err } diff --git a/x/fungible/keeper/msg_server_update_contract_bytecode.go b/x/fungible/keeper/msg_server_update_contract_bytecode.go index 8664be1121..5d5e7c7950 100644 --- a/x/fungible/keeper/msg_server_update_contract_bytecode.go +++ b/x/fungible/keeper/msg_server_update_contract_bytecode.go @@ -16,7 +16,7 @@ import ( // Only a ZRC20 contract or the WZeta connector contract can be updated // IMPORTANT: the new contract bytecode must have the same storage layout as the old contract bytecode // the new contract can add new variable but cannot remove any existing variable -func (k Keeper) UpdateContractBytecode(goCtx context.Context, msg *types.MsgUpdateContractBytecode) (*types.MsgUpdateContractBytecodeResponse, error) { +func (k msgServer) UpdateContractBytecode(goCtx context.Context, msg *types.MsgUpdateContractBytecode) (*types.MsgUpdateContractBytecodeResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // check authorization diff --git a/x/fungible/keeper/msg_server_update_contract_bytecode_test.go b/x/fungible/keeper/msg_server_update_contract_bytecode_test.go index fc5900d342..57f1c8b931 100644 --- a/x/fungible/keeper/msg_server_update_contract_bytecode_test.go +++ b/x/fungible/keeper/msg_server_update_contract_bytecode_test.go @@ -13,6 +13,7 @@ import ( zetacommon "github.com/zeta-chain/zetacore/common" keepertest "github.com/zeta-chain/zetacore/testutil/keeper" "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/fungible/keeper" "github.com/zeta-chain/zetacore/x/fungible/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) @@ -33,6 +34,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { k, ctx, sdkk, zk := keepertest.FungibleKeeper(t) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) admin := sample.AccAddress() + msgServer := keeper.NewMsgServerImpl(*k) // set admin policy setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -92,7 +94,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { require.NoError(t, err) // update the bytecode - res, err := k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + res, err := msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, zrc20, newCodeAddress, @@ -133,7 +135,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { big.NewInt(90_000), ) require.NoError(t, err) - _, err = k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err = msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, zrc20, newCodeAddress, @@ -154,6 +156,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { k, ctx, sdkk, zk := keepertest.FungibleKeeper(t) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) admin := sample.AccAddress() + msgServer := keeper.NewMsgServerImpl(*k) // deploy a connector setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -166,7 +169,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { assertContractDeployment(t, sdkk.EvmKeeper, ctx, newConnector) // can update the bytecode of the new connector with the old connector contract - _, err = k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err = msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, newConnector, oldConnector, @@ -176,8 +179,9 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { t.Run("should fail if unauthorized", func(t *testing.T) { k, ctx, _, _ := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) - _, err := k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err := msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( sample.AccAddress(), sample.EthAddress(), sample.EthAddress(), @@ -187,10 +191,12 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { t.Run("should fail invalid contract address", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) admin := sample.AccAddress() + setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) - _, err := k.UpdateContractBytecode(ctx, &types.MsgUpdateContractBytecode{ + _, err := msgServer.UpdateContractBytecode(ctx, &types.MsgUpdateContractBytecode{ Creator: admin, ContractAddress: "invalid", NewBytecodeAddress: sample.EthAddress().Hex(), @@ -202,6 +208,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{ UseEVMMock: true, }) + msgServer := keeper.NewMsgServerImpl(*k) mockEVMKeeper := keepertest.GetFungibleEVMMock(t, k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -213,7 +220,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { contractAddr, ).Return(nil) - _, err := k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err := msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, contractAddr, sample.EthAddress(), @@ -225,6 +232,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { t.Run("should fail neither a zrc20 nor wzeta connector", func(t *testing.T) { k, ctx, sdkk, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) admin := sample.AccAddress() @@ -232,7 +240,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { wzeta, _, _, _, _ := deploySystemContracts(t, ctx, k, sdkk.EvmKeeper) // can't update the bytecode of the wzeta contract - _, err := k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err := msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, wzeta, sample.EthAddress(), @@ -242,6 +250,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { t.Run("should fail if system contract not found", func(t *testing.T) { k, ctx, sdkk, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) admin := sample.AccAddress() @@ -252,7 +261,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { k.RemoveSystemContract(ctx) // can't update the bytecode of the wzeta contract - _, err := k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err := msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, connector, sample.EthAddress(), @@ -264,6 +273,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{ UseEVMMock: true, }) + msgServer := keeper.NewMsgServerImpl(*k) mockEVMKeeper := keepertest.GetFungibleEVMMock(t, k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -280,7 +290,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { mock.Anything, ).Return(&statedb.Account{}) - _, err := k.UpdateContractBytecode(ctx, &types.MsgUpdateContractBytecode{ + _, err := msgServer.UpdateContractBytecode(ctx, &types.MsgUpdateContractBytecode{ Creator: admin, ContractAddress: contract.Hex(), NewBytecodeAddress: "invalid", @@ -295,6 +305,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{ UseEVMMock: true, }) + msgServer := keeper.NewMsgServerImpl(*k) mockEVMKeeper := keepertest.GetFungibleEVMMock(t, k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -318,7 +329,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { newBytecodeAddr, ).Return(nil) - _, err := k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err := msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, contractAddr, newBytecodeAddr, @@ -332,6 +343,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{ UseEVMMock: true, }) + msgServer := keeper.NewMsgServerImpl(*k) mockEVMKeeper := keepertest.GetFungibleEVMMock(t, k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -362,7 +374,7 @@ func TestKeeper_UpdateContractBytecode(t *testing.T) { mock.Anything, ).Return(errors.New("can't set account")) - _, err := k.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( + _, err := msgServer.UpdateContractBytecode(ctx, types.NewMsgUpdateContractBytecode( admin, contractAddr, newBytecodeAddr, diff --git a/x/fungible/keeper/msg_server_update_system_contract.go b/x/fungible/keeper/msg_server_update_system_contract.go index f6de594ecf..365e09d4eb 100644 --- a/x/fungible/keeper/msg_server_update_system_contract.go +++ b/x/fungible/keeper/msg_server_update_system_contract.go @@ -14,7 +14,7 @@ import ( zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types" ) -func (k Keeper) UpdateSystemContract(goCtx context.Context, msg *types.MsgUpdateSystemContract) (*types.MsgUpdateSystemContractResponse, error) { +func (k msgServer) UpdateSystemContract(goCtx context.Context, msg *types.MsgUpdateSystemContract) (*types.MsgUpdateSystemContractResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) if msg.Creator != k.observerKeeper.GetParams(ctx).GetAdminPolicyAccount(zetaObserverTypes.Policy_Type_group2) { return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Deploy can only be executed by the correct policy account") diff --git a/x/fungible/keeper/msg_server_update_system_contract_test.go b/x/fungible/keeper/msg_server_update_system_contract_test.go index ebd72cd0d5..b464da209c 100644 --- a/x/fungible/keeper/msg_server_update_system_contract_test.go +++ b/x/fungible/keeper/msg_server_update_system_contract_test.go @@ -20,6 +20,7 @@ import ( func TestKeeper_UpdateSystemContract(t *testing.T) { t.Run("can update the system contract", func(t *testing.T) { k, ctx, sdkk, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -53,7 +54,7 @@ func TestKeeper_UpdateSystemContract(t *testing.T) { require.NotEqual(t, oldSystemContract, newSystemContract) // can update the system contract - _, err = k.UpdateSystemContract(ctx, types.NewMsgUpdateSystemContract(admin, newSystemContract.Hex())) + _, err = msgServer.UpdateSystemContract(ctx, types.NewMsgUpdateSystemContract(admin, newSystemContract.Hex())) require.NoError(t, err) // can retrieve the system contract @@ -75,6 +76,7 @@ func TestKeeper_UpdateSystemContract(t *testing.T) { t.Run("should not update the system contract if not admin", func(t *testing.T) { k, ctx, sdkk, _ := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) // deploy a new system contracts @@ -84,13 +86,14 @@ func TestKeeper_UpdateSystemContract(t *testing.T) { require.NotEqual(t, oldSystemContract, newSystemContract) // should not update the system contract if not admin - _, err = k.UpdateSystemContract(ctx, types.NewMsgUpdateSystemContract(sample.AccAddress(), newSystemContract.Hex())) + _, err = msgServer.UpdateSystemContract(ctx, types.NewMsgUpdateSystemContract(sample.AccAddress(), newSystemContract.Hex())) require.Error(t, err) require.ErrorIs(t, err, sdkerrors.ErrUnauthorized) }) t.Run("should not update the system contract if invalid address", func(t *testing.T) { k, ctx, sdkk, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) @@ -102,7 +105,7 @@ func TestKeeper_UpdateSystemContract(t *testing.T) { require.NotEqual(t, oldSystemContract, newSystemContract) // should not update the system contract if invalid address - _, err = k.UpdateSystemContract(ctx, types.NewMsgUpdateSystemContract(admin, "invalid")) + _, err = msgServer.UpdateSystemContract(ctx, types.NewMsgUpdateSystemContract(admin, "invalid")) require.Error(t, err) require.ErrorIs(t, err, sdkerrors.ErrInvalidAddress) }) diff --git a/x/fungible/keeper/msg_server_update_zrc20_paused_status.go b/x/fungible/keeper/msg_server_update_zrc20_paused_status.go index 2c0b89a4d0..739dbb7a2f 100644 --- a/x/fungible/keeper/msg_server_update_zrc20_paused_status.go +++ b/x/fungible/keeper/msg_server_update_zrc20_paused_status.go @@ -13,7 +13,7 @@ import ( // UpdateZRC20PausedStatus updates the paused status of a ZRC20 // The list of ZRC20s are either paused or unpaused -func (k Keeper) UpdateZRC20PausedStatus( +func (k msgServer) UpdateZRC20PausedStatus( goCtx context.Context, msg *types.MsgUpdateZRC20PausedStatus, ) (*types.MsgUpdateZRC20PausedStatusResponse, error) { diff --git a/x/fungible/keeper/msg_server_update_zrc20_paused_status_test.go b/x/fungible/keeper/msg_server_update_zrc20_paused_status_test.go index 33f02d8745..2183cccf9c 100644 --- a/x/fungible/keeper/msg_server_update_zrc20_paused_status_test.go +++ b/x/fungible/keeper/msg_server_update_zrc20_paused_status_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/require" keepertest "github.com/zeta-chain/zetacore/testutil/keeper" "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/fungible/keeper" "github.com/zeta-chain/zetacore/x/fungible/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) @@ -14,6 +15,7 @@ import ( func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { t.Run("can update the paused status of zrc20", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) admin := sample.AccAddress() requireUnpaused := func(zrc20 string) { @@ -39,7 +41,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group1) // can pause zrc20 - _, err := k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err := msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( admin, []string{ zrc20A, @@ -55,7 +57,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) // can unpause zrc20 - _, err = k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err = msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( admin, []string{ zrc20A, @@ -70,7 +72,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group1) // can pause already paused zrc20 - _, err = k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err = msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( admin, []string{ zrc20B, @@ -85,7 +87,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) // can unpause already unpaused zrc20 - _, err = k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err = msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( admin, []string{ zrc20C, @@ -100,7 +102,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group1) // can pause all zrc20 - _, err = k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err = msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( admin, []string{ zrc20A, @@ -117,7 +119,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) // can unpause all zrc20 - _, err = k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err = msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( admin, []string{ zrc20A, @@ -134,20 +136,22 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { t.Run("should fail if invalid message", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group1) invalidMsg := types.NewMsgUpdateZRC20PausedStatus(admin, []string{}, types.UpdatePausedStatusAction_PAUSE) require.ErrorIs(t, invalidMsg.ValidateBasic(), sdkerrors.ErrInvalidRequest) - _, err := k.UpdateZRC20PausedStatus(ctx, invalidMsg) + _, err := msgServer.UpdateZRC20PausedStatus(ctx, invalidMsg) require.ErrorIs(t, err, sdkerrors.ErrInvalidRequest) }) t.Run("should fail if not authorized", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) - _, err := k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err := msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( sample.AccAddress(), []string{sample.EthAddress().String()}, types.UpdatePausedStatusAction_PAUSE, @@ -156,7 +160,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group1) - _, err = k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err = msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( sample.AccAddress(), []string{sample.EthAddress().String()}, types.UpdatePausedStatusAction_UNPAUSE, @@ -167,6 +171,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { t.Run("should fail if zrc20 does not exist", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group1) @@ -174,7 +179,7 @@ func TestKeeper_UpdateZRC20PausedStatus(t *testing.T) { k.SetForeignCoins(ctx, sample.ForeignCoins(t, zrc20A)) k.SetForeignCoins(ctx, sample.ForeignCoins(t, zrc20B)) - _, err := k.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( + _, err := msgServer.UpdateZRC20PausedStatus(ctx, types.NewMsgUpdateZRC20PausedStatus( admin, []string{ zrc20A, diff --git a/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee.go b/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee.go index 2cdb6f30b0..3abb312276 100644 --- a/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee.go +++ b/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee.go @@ -12,7 +12,7 @@ import ( zetaObserverTypes "github.com/zeta-chain/zetacore/x/observer/types" ) -func (k Keeper) UpdateZRC20WithdrawFee(goCtx context.Context, msg *types.MsgUpdateZRC20WithdrawFee) (*types.MsgUpdateZRC20WithdrawFeeResponse, error) { +func (k msgServer) UpdateZRC20WithdrawFee(goCtx context.Context, msg *types.MsgUpdateZRC20WithdrawFee) (*types.MsgUpdateZRC20WithdrawFeeResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) // check signer permission diff --git a/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee_test.go b/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee_test.go index 9de490dc8b..108c70c664 100644 --- a/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee_test.go +++ b/x/fungible/keeper/msg_server_update_zrc20_withdraw_fee_test.go @@ -14,6 +14,7 @@ import ( "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/zrc20.sol" keepertest "github.com/zeta-chain/zetacore/testutil/keeper" "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/fungible/keeper" "github.com/zeta-chain/zetacore/x/fungible/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) @@ -21,6 +22,7 @@ import ( func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { t.Run("can update the withdraw fee", func(t *testing.T) { k, ctx, sdkk, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) chainID := getValidChainID(t) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) @@ -38,7 +40,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { require.Zero(t, protocolFee.Uint64()) // can update the protocol fee and gas limit - _, err = k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err = msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, zrc20Addr.String(), math.NewUint(42), @@ -55,7 +57,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { require.Equal(t, uint64(42), gasLimit.Uint64()) // can update protocol fee only - _, err = k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err = msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, zrc20Addr.String(), math.NewUint(43), @@ -70,7 +72,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { require.Equal(t, uint64(42), gasLimit.Uint64()) // can update gas limit only - _, err = k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err = msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, zrc20Addr.String(), math.Uint{}, @@ -87,8 +89,9 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { t.Run("should fail if not authorized", func(t *testing.T) { k, ctx, _, _ := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) - _, err := k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err := msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( sample.AccAddress(), sample.EthAddress().String(), math.NewUint(42), @@ -99,10 +102,11 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { t.Run("should fail if invalid zrc20 address", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) - _, err := k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err := msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, "invalid_address", math.NewUint(42), @@ -113,10 +117,11 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { t.Run("should fail if can't retrieve the foreign coin", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) admin := sample.AccAddress() setAdminPolicies(ctx, zk, admin, observertypes.Policy_Type_group2) - _, err := k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err := msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, sample.EthAddress().String(), math.NewUint(42), @@ -127,6 +132,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { t.Run("should fail if can't query old fee", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeper(t) + msgServer := keeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) // setup @@ -136,7 +142,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { k.SetForeignCoins(ctx, sample.ForeignCoins(t, zrc20.String())) // the method shall fail since we only set the foreign coin manually in the store but didn't deploy the contract - _, err := k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err := msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, zrc20.String(), math.NewUint(42), @@ -147,6 +153,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { t.Run("should fail if contract call for setting new protocol fee fails", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{UseEVMMock: true}) + msgServer := keeper.NewMsgServerImpl(*k) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) mockEVMKeeper := keepertest.GetFungibleEVMMock(t, k) @@ -196,7 +203,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { true, ).Return(&evmtypes.MsgEthereumTxResponse{}, errors.New("transaction failed")) - _, err = k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err = msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, zrc20Addr.String(), math.NewUint(42), @@ -210,6 +217,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { t.Run("should fail if contract call for setting new protocol fee fails", func(t *testing.T) { k, ctx, _, zk := keepertest.FungibleKeeperWithMocks(t, keepertest.FungibleMockOptions{UseEVMMock: true}) k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + msgServer := keeper.NewMsgServerImpl(*k) mockEVMKeeper := keepertest.GetFungibleEVMMock(t, k) // setup @@ -258,7 +266,7 @@ func TestKeeper_UpdateZRC20WithdrawFee(t *testing.T) { true, ).Return(&evmtypes.MsgEthereumTxResponse{}, errors.New("transaction failed")) - _, err = k.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( + _, err = msgServer.UpdateZRC20WithdrawFee(ctx, types.NewMsgUpdateZRC20WithdrawFee( admin, zrc20Addr.String(), math.Uint{}, diff --git a/x/fungible/types/codec.go b/x/fungible/types/codec.go index 3c06f02110..47bbfee990 100644 --- a/x/fungible/types/codec.go +++ b/x/fungible/types/codec.go @@ -10,6 +10,10 @@ import ( func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgDeployFungibleCoinZRC20{}, "fungible/DeployFungibleCoinZRC20", nil) cdc.RegisterConcrete(&MsgRemoveForeignCoin{}, "fungible/RemoveForeignCoin", nil) + cdc.RegisterConcrete(&MsgUpdateSystemContract{}, "fungible/UpdateSystemContract", nil) + cdc.RegisterConcrete(&MsgUpdateZRC20WithdrawFee{}, "fungible/UpdateZRC20WithdrawFee", nil) + cdc.RegisterConcrete(&MsgUpdateContractBytecode{}, "fungible/UpdateContractBytecode", nil) + cdc.RegisterConcrete(&MsgUpdateZRC20PausedStatus{}, "fungible/UpdateZRC20PausedStatus", nil) cdc.RegisterConcrete(&MsgUpdateZRC20LiquidityCap{}, "fungible/UpdateZRC20LiquidityCap", nil) } @@ -17,6 +21,10 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgDeployFungibleCoinZRC20{}, &MsgRemoveForeignCoin{}, + &MsgUpdateSystemContract{}, + &MsgUpdateZRC20WithdrawFee{}, + &MsgUpdateContractBytecode{}, + &MsgUpdateZRC20PausedStatus{}, &MsgUpdateZRC20LiquidityCap{}, ) diff --git a/x/observer/types/codec.go b/x/observer/types/codec.go index 76e51df8af..3d30bbc3a7 100644 --- a/x/observer/types/codec.go +++ b/x/observer/types/codec.go @@ -8,16 +8,22 @@ import ( ) func RegisterCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgUpdateCoreParams{}, "observer/UpdateClientParams", nil) + cdc.RegisterConcrete(&MsgAddObserver{}, "observer/AddObserver", nil) + cdc.RegisterConcrete(&MsgUpdateCoreParams{}, "observer/UpdateCoreParam", nil) + cdc.RegisterConcrete(&MsgAddBlameVote{}, "crosschain/AddBlameVote", nil) cdc.RegisterConcrete(&MsgUpdateCrosschainFlags{}, "crosschain/UpdateCrosschainFlags", nil) cdc.RegisterConcrete(&MsgUpdateKeygen{}, "crosschain/UpdateKeygen", nil) + cdc.RegisterConcrete(&MsgAddBlockHeader{}, "crosschain/AddBlockHeader", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgAddObserver{}, &MsgUpdateCoreParams{}, + &MsgAddBlameVote{}, &MsgUpdateCrosschainFlags{}, &MsgUpdateKeygen{}, + &MsgAddBlockHeader{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) From f83d70e266e94384c4b6c1185d5e3589eb725d42 Mon Sep 17 00:00:00 2001 From: Grant Zukel <80433392+gzukel@users.noreply.github.com> Date: Mon, 30 Oct 2023 09:44:23 -0600 Subject: [PATCH 17/26] fix: Update binary names upgrade path testing (#1341) * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * udpated * udpated --------- Co-authored-by: Lucas Bertrand --- .github/workflows/rc-release.yml | 233 ++++++++++++++++++++ .github/workflows/upgrade_path_testing.yaml | 33 ++- 2 files changed, 259 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/rc-release.yml diff --git a/.github/workflows/rc-release.yml b/.github/workflows/rc-release.yml new file mode 100644 index 0000000000..f18a7d58f5 --- /dev/null +++ b/.github/workflows/rc-release.yml @@ -0,0 +1,233 @@ +name: Publish Release + +on: + push: + tags: + - "v*.*.*-rc" + +concurrency: + group: publish-release + cancel-in-progress: false + +env: + GITHUB_REF_NAME: "$(echo ${{ github.ref_name }} | tr '//' '-')" + +jobs: + pre-release-checks: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Major Version in Upgrade Handler Must Match Tag + run: | + UPGRADE_HANDLER_MAJOR_VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"' | cut -d '.' -f1) + echo $UPGRADE_HANDLER_MAJOR_VERSION + GITHUB_TAG_MAJOR_VERSION=$(echo ${{ github.ref_name }} | cut -d '.' -f1) + if [ $GITHUB_TAG_MAJOR_VERSION != $UPGRADE_HANDLER_MAJOR_VERSION ]; then + echo "ERROR: The major version of this release (${{ github.ref_name }}) does not match the major version in the releaseVersion constant ($UPGRADE_HANDLER_MAJOR_VERSION) found in app/setup_handlers.go" + echo "Did you forget to update the 'releaseVersion' in app/setup_handlers.go?" + exit 1 + fi + echo "The major version found in 'releaseVersion' in app/setup_handlers.go matches this tagged release - Moving Forward!" + + publish-release: + runs-on: buildjet-4vcpu-ubuntu-2004 + timeout-minutes: 60 + needs: + - pre-release-checks + steps: + - uses: actions/checkout@v3 + + - name: Set CPU Architecture + shell: bash + run: | + if [ "$(uname -m)" == "aarch64" ]; then + echo "CPU_ARCH=arm64" >> $GITHUB_ENV + elif [ "$(uname -m)" == "x86_64" ]; then + echo "CPU_ARCH=amd64" >> $GITHUB_ENV + else + echo "Unsupported architecture" >&2 + exit 1 + fi + + - name: Install Pipeline Dependencies + uses: ./.github/actions/install-dependencies + timeout-minutes: 8 + with: + cpu_architecture: ${{ env.CPU_ARCH }} + skip_python: "true" + skip_aws_cli: "true" + skip_docker_compose: "true" + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + generate_release_notes: true + + - name: Publish Release Files + env: + GITHUB_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + run: | + touch .release-env + make release + + ## TODO - Will add in later after optimizing docker images + # - name: Build, tag, and push docker images + # uses: ./.github/actions/build-docker-images + # with: + # DOCKER_FILENAME: Dockerfile + # REPOSITORY_NAME: zeta-node + # IMAGE_TAG: ${{ env.TAG_NAME }} + # GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} + # GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + + build-alpine: + runs-on: ["ubuntu-latest"] + timeout-minutes: 30 + concurrency: + group: "alpine-build-test" + needs: + - pre-release-checks + steps: + - uses: actions/checkout@v3 + + - name: Set CPU Architecture + shell: bash + run: | + if [ "$(uname -m)" == "aarch64" ]; then + echo "CPU_ARCH=arm64" >> $GITHUB_ENV + elif [ "$(uname -m)" == "x86_64" ]; then + echo "CPU_ARCH=amd64" >> $GITHUB_ENV + else + echo "Unsupported architecture" >&2 + exit 1 + fi + + - name: Install Pipeline Dependencies + uses: ./.github/actions/install-dependencies + timeout-minutes: 8 + with: + cpu_architecture: ${{ env.CPU_ARCH }} + skip_python: "true" + skip_aws_cli: "true" + skip_docker_compose: "false" + + - uses: jirutka/setup-alpine@v1 + with: + branch: v3.17 + arch: x86_64 + packages: > + build-base + pkgconf + lld + go + gcc + g++ + libusb-dev + linux-headers + git + shell-name: alpine.sh + + - name: Build zetacored and zetaclientd + env: + CGO_ENABLED: 1 + GOOS: linux + GOARCH: ${{ env.CPU_ARCH }} + shell: alpine.sh --root {0} + run: | + git config --global --add safe.directory '*' + make install-testnet + cp "$HOME"/go/bin/* ./ + + - name: Binary Docker Test + env: + CPU_ARCH: ${{ env.CPU_ARCH }} + shell: alpine.sh --root {0} + run: | + chmod a+x ./zetacored + ./zetacored version + mv zetacored zetacored-testnet-alpine-$CPU_ARCH + mv zetaclientd zetaclientd-testnet-alpine-$CPU_ARCH + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + generate_release_notes: true + files: | + zetacored-* + zetaclientd-* + + - name: Clean Up Alpine Workspace + if: always() + shell: alpine.sh --root {0} + run: | + set -e # fail on error + rm -rf * + + - name: Clean Up Workspace + if: always() + shell: bash + run: rm -rf * + + announce-release: + runs-on: ubuntu-latest + timeout-minutes: 10 + needs: + - publish-release + - build-alpine + steps: + - uses: actions/checkout@v3 + - name: Get Version + run: | + VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"') + echo "BINARY_VERSION=${VERSION}" >> ${GITHUB_ENV} + + - name: Determine Release Type + id: determine_release_type + run: | + if [[ "${{ env.BINARY_VERSION }}" =~ ^v[0-9]+\.0\.0+$ ]]; then + echo "RELEASE_TYPE=major" >> ${GITHUB_ENV} + elif [[ "${{ env.BINARY_VERSION }}" =~ ^v[0-9]+\.[0-9]+\.[1-9]+$ ]]; then + echo "RELEASE_TYPE=minor" >> ${GITHUB_ENV} + else + echo "RELEASE_TYPE=unknown" >> ${GITHUB_ENV} + fi + + - name: "SEND:DISCORD:MESSAGE" + if: steps.determine_release_type.outputs.RELEASE_TYPE == 'major' + uses: gzukel/CosmosComposites/send_discord_message@main + with: + discord_token: "${{ secrets.DISCORD_TOKEN }}" + discord_channel_id: "${{ secrets.DISCORD_CHANNEL_ID }}" + discord_message: | + Hey <@&1122981184255840306>! A new version of the ZetaChain software has been released. + + Major Version Upgrade (e.g. v5.x.x to V6.x.x) must be completed through a governance proposal. + We will submit a governance proposal in the next few days. + More specific information including block height will be shared as part of the governance proposal. + + See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} + + # - name: "SEND:DISCORD:MESSAGE" + # if: steps.determine_release_type.outputs.RELEASE_TYPE == 'minor' + # uses: gzukel/CosmosComposites/send_discord_message@main + # with: + # discord_token: "${{ secrets.DISCORD_TOKEN }}" + # discord_channel_id: "${{ secrets.DISCORD_CHANNEL_ID }}" + # discord_message: | + # Hey <@&1122981184255840306>! A new version of the zetachain node has been released. + + # Minor Version Upgrade (e.g. v5.0.x to v5.1.x) can be applied without a governance proposal. + # Please review the release notes for any specific upgrade instructions or considerations. + + # See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} + + - name: Clean Up Workspace + if: always() + shell: bash + run: rm -rf * diff --git a/.github/workflows/upgrade_path_testing.yaml b/.github/workflows/upgrade_path_testing.yaml index 002c1df6d6..681e6a28dc 100644 --- a/.github/workflows/upgrade_path_testing.yaml +++ b/.github/workflows/upgrade_path_testing.yaml @@ -6,10 +6,14 @@ on: version: description: 'The new version of tag you are going to download the binary from..' required: true - default: 'v10.0.0-rc2' + default: 'v10.1.0' upgrade_name: description: 'The version that is set in setup_handlers.go' required: true + default: 'v10.1.0' + current_version: + description: 'The version that the network is currently on.' + required: true default: 'v10.0.0' jobs: @@ -18,7 +22,7 @@ jobs: runs-on: ["buildjet-8vcpu-ubuntu-2204"] env: latest_state_export: "https://zetachain-external-files.s3.amazonaws.com/state-export/athens3/latest.json" - github_binary_version_link: "https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.version }}/zetacored-testnet-linux-amd64" + github_binary_version_link: "https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.version }}/zetacored_testnet-linux-amd64" downloaded_binary_name: "zetacored-testnet-linux-amd64" VERSION: "${{ github.event.inputs.version }}" aws_region: "us-east-1" @@ -119,16 +123,21 @@ jobs: ls -lah /home/runner/.zetacored/zetavisor/upgrades/${{ github.event.inputs.upgrade_name }}/bin/zetacored echo "ZETACORED_CHECKSUM=${ZETACORED_CHECKSUM}" >> ${GITHUB_ENV} - UPGRADE_INFO='{"binaries": {"zetacored-linux/amd64": "https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.version }}/zetacored-testnet-linux-amd64?checksum=sha256:'${ZETACORED_CHECKSUM}'"}}' + UPGRADE_INFO='{"binaries": {"zetacored-linux/amd64": "https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.version }}/zetacored_testnet-linux-amd64?checksum=sha256:'${ZETACORED_CHECKSUM}'"}}' echo ${UPGRADE_INFO} - - echo "*********DOWNLOAD CURRENT BINARY AND PUT IN ZETAVISOR GENESIS & CURRENT FOLDER*********" current_version=$(curl https://rpc-archive.athens.zetachain.com:26657/abci_info -s | jq .result.response.version -r | tr -d '\n') + current_version=${{ github.event.inputs.current_version }} echo "STARTING_VERSION=${current_version}" >> ${GITHUB_ENV} echo "STARTING_VERSION=${current_version}" - wget -q https://github.com/zeta-chain/node/releases/download/${current_version}/zetacored-testnet-linux-amd64 -O /home/runner/.zetacored/zetavisor/genesis/bin/zetacored + if [ "${{ github.event.inputs.current_version }}" == "v10.0.0" ]; then + echo "download 10.0.0 binary" + wget -q https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.current_version }}/zetacored-ubuntu-22-amd64 -O /home/runner/.zetacored/zetavisor/genesis/bin/zetacored + else + echo "download non 10.0.0 version" + wget -q https://github.com/zeta-chain/node/releases/download/${{ github.event.inputs.current_version }}/zetacored_testnet-linux-amd64 -O /home/runner/.zetacored/zetavisor/genesis/bin/zetacored + fi sudo chmod a+x /home/runner/.zetacored/zetavisor/genesis/bin/zetacored echo "PATH=/home/runner/.zetacored/zetavisor/genesis/bin:$PATH" >> ${GITHUB_ENV} @@ -199,6 +208,12 @@ jobs: echo "Move Manipulated Genesis" cp ./genesis-edited.json $DAEMON_HOME/config/genesis.json + cat $DAEMON_HOME/config/genesis.json | grep -A 10 -B 10 out_tx_tracker + + echo "Zetavisor Version" + zetavisor version || echo "zetavisor not found" + zetacored version || echo "zetcored not found" + echo "Start Network" nohup zetavisor start --rpc.laddr tcp://0.0.0.0:26657 --minimum-gas-prices ${GAS_PRICES} "--grpc.enable=true" > cosmovisor.log 2>&1 & @@ -220,8 +235,12 @@ jobs: minor_version = version.split(".")[1] sub_version = version.split(".")[2] + print("${{ github.event.inputs.version }}") git_env_file = open(os.environ["GITHUB_ENV"], "a+") - if major_version == first_major_version and minor_version != first_minor_version: + + if "${{ github.event.inputs.version }}" == "v10.1.0": + git_env_file.write("UPGRADE_TYPE=GOV") + elif major_version == first_major_version and minor_version != first_minor_version: git_env_file.write("UPGRADE_TYPE=NONCON") elif major_version == first_major_version and minor_version == first_minor_version and sub_version != first_sub_version: git_env_file.write("UPGRADE_TYPE=NONCON") From e5bffa9a7b19bdc22a0722552503ec200786e64a Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 02:42:54 +0400 Subject: [PATCH 18/26] feat: `docs` cmd to generate `zetacored` CLI docs (#960) * feat: generate zetacored CLI docs * refactor: move docs cmd into docs.go * refactor: rename makefile target * remove flags.LineBreak, * AppName * make generate * Replace home dir with ~ to make the check pass * replace [appd] with zetacored * replace IP * remove (default ...) * Update cmd/zetacored/docs.go Co-authored-by: Lucas Bertrand * make generate * make generate * make generate * make generate * make generate * fix gosec * fix makefile * remove last line * use nosec for params * fix gosec in docs.go --------- Co-authored-by: Lucas Bertrand --- .github/workflows/generate-files.yml | 10 +- Makefile | 12 +- cmd/zetacore_utils/main.go | 7 +- cmd/zetacored/config/config.go | 1 + cmd/zetacored/docs.go | 49 +++++++ cmd/zetacored/root.go | 5 +- docs/cli/zetacored/zetacored.md | 42 ++++++ .../zetacored_add-genesis-account.md | 44 +++++++ .../zetacored/zetacored_add-observer-list.md | 29 +++++ .../zetacored/zetacored_addr-conversion.md | 35 +++++ .../cli/zetacored/zetacored_collect-gentxs.md | 28 ++++ .../zetacored_collect-observer-info.md | 28 ++++ docs/cli/zetacored/zetacored_config.md | 27 ++++ docs/cli/zetacored/zetacored_debug.md | 31 +++++ docs/cli/zetacored/zetacored_debug_addr.md | 35 +++++ .../zetacored/zetacored_debug_pubkey-raw.md | 36 ++++++ docs/cli/zetacored/zetacored_debug_pubkey.md | 35 +++++ .../zetacored/zetacored_debug_raw-bytes.md | 35 +++++ docs/cli/zetacored/zetacored_docs.md | 28 ++++ docs/cli/zetacored/zetacored_export.md | 30 +++++ docs/cli/zetacored/zetacored_gentx.md | 91 +++++++++++++ docs/cli/zetacored/zetacored_get-pubkey.md | 27 ++++ docs/cli/zetacored/zetacored_index-eth-tx.md | 37 ++++++ docs/cli/zetacored/zetacored_init.md | 35 +++++ docs/cli/zetacored/zetacored_keys.md | 64 +++++++++ docs/cli/zetacored/zetacored_keys_.md | 30 +++++ docs/cli/zetacored/zetacored_keys_add.md | 66 ++++++++++ docs/cli/zetacored/zetacored_keys_delete.md | 41 ++++++ docs/cli/zetacored/zetacored_keys_export.md | 43 ++++++ docs/cli/zetacored/zetacored_keys_import.md | 34 +++++ docs/cli/zetacored/zetacored_keys_list.md | 36 ++++++ docs/cli/zetacored/zetacored_keys_migrate.md | 43 ++++++ docs/cli/zetacored/zetacored_keys_mnemonic.md | 35 +++++ docs/cli/zetacored/zetacored_keys_parse.md | 36 ++++++ docs/cli/zetacored/zetacored_keys_rename.md | 40 ++++++ docs/cli/zetacored/zetacored_keys_show.md | 41 ++++++ .../zetacored_keys_unsafe-export-eth-key.md | 34 +++++ .../zetacored_keys_unsafe-import-eth-key.md | 34 +++++ docs/cli/zetacored/zetacored_query.md | 50 +++++++ docs/cli/zetacored/zetacored_query_account.md | 33 +++++ docs/cli/zetacored/zetacored_query_auth.md | 34 +++++ .../zetacored/zetacored_query_auth_account.md | 33 +++++ .../zetacored_query_auth_accounts.md | 39 ++++++ ...zetacored_query_auth_address-by-acc-num.md | 39 ++++++ .../zetacored_query_auth_module-account.md | 39 ++++++ .../zetacored_query_auth_module-accounts.md | 33 +++++ .../zetacored/zetacored_query_auth_params.md | 39 ++++++ docs/cli/zetacored/zetacored_query_authz.md | 31 +++++ ...zetacored_query_authz_grants-by-grantee.md | 45 +++++++ ...zetacored_query_authz_grants-by-granter.md | 45 +++++++ .../zetacored/zetacored_query_authz_grants.md | 47 +++++++ docs/cli/zetacored/zetacored_query_bank.md | 31 +++++ .../zetacored_query_bank_balances.md | 48 +++++++ .../zetacored_query_bank_denom-metadata.md | 45 +++++++ .../zetacored/zetacored_query_bank_total.md | 50 +++++++ docs/cli/zetacored/zetacored_query_block.md | 29 +++++ .../zetacored/zetacored_query_crosschain.md | 48 +++++++ ...acored_query_crosschain_get-tss-address.md | 33 +++++ ...uery_crosschain_in-tx-hash-to-cctx-data.md | 33 +++++ ...cored_query_crosschain_last-zeta-height.md | 33 +++++ ...uery_crosschain_list-all-in-tx-trackers.md | 33 +++++ .../zetacored_query_crosschain_list-cctx.md | 39 ++++++ ...ored_query_crosschain_list-chain-nonces.md | 39 ++++++ ...tacored_query_crosschain_list-gas-price.md | 39 ++++++ ...uery_crosschain_list-in-tx-hash-to-cctx.md | 39 ++++++ ...red_query_crosschain_list-in-tx-tracker.md | 39 ++++++ ...ed_query_crosschain_list-out-tx-tracker.md | 39 ++++++ ...ored_query_crosschain_list-pending-cctx.md | 33 +++++ ...ed_query_crosschain_list-pending-nonces.md | 33 +++++ ...cored_query_crosschain_list-tss-history.md | 33 +++++ .../zetacored_query_crosschain_params.md | 33 +++++ .../zetacored_query_crosschain_show-cctx.md | 33 +++++ ...ored_query_crosschain_show-chain-nonces.md | 33 +++++ ...tacored_query_crosschain_show-gas-price.md | 33 +++++ ...uery_crosschain_show-in-tx-hash-to-cctx.md | 33 +++++ ...ed_query_crosschain_show-out-tx-tracker.md | 33 +++++ .../zetacored_query_crosschain_show-tss.md | 33 +++++ .../zetacored/zetacored_query_distribution.md | 34 +++++ ...zetacored_query_distribution_commission.md | 40 ++++++ ...cored_query_distribution_community-pool.md | 40 ++++++ .../zetacored_query_distribution_params.md | 33 +++++ .../zetacored_query_distribution_rewards.md | 41 ++++++ .../zetacored_query_distribution_slashes.md | 46 +++++++ ...tribution_validator-outstanding-rewards.md | 40 ++++++ .../zetacored/zetacored_query_emissions.md | 32 +++++ ...ed_query_emissions_get-emmisons-factors.md | 33 +++++ ...red_query_emissions_list-pool-addresses.md | 33 +++++ .../zetacored_query_emissions_params.md | 33 +++++ ...uery_emissions_show-available-emissions.md | 33 +++++ .../cli/zetacored/zetacored_query_evidence.md | 47 +++++++ docs/cli/zetacored/zetacored_query_evm.md | 31 +++++ .../cli/zetacored/zetacored_query_evm_code.md | 37 ++++++ .../zetacored/zetacored_query_evm_params.md | 37 ++++++ .../zetacored/zetacored_query_evm_storage.md | 37 ++++++ .../zetacored/zetacored_query_feemarket.md | 31 +++++ .../zetacored_query_feemarket_base-fee.md | 38 ++++++ .../zetacored_query_feemarket_block-gas.md | 38 ++++++ .../zetacored_query_feemarket_params.md | 37 ++++++ .../cli/zetacored/zetacored_query_fungible.md | 35 +++++ ...ery_fungible_gas-stability-pool-address.md | 39 ++++++ ...ery_fungible_gas-stability-pool-balance.md | 39 ++++++ ...ry_fungible_gas-stability-pool-balances.md | 39 ++++++ ...cored_query_fungible_list-foreign-coins.md | 39 ++++++ .../zetacored_query_fungible_params.md | 33 +++++ ...cored_query_fungible_show-foreign-coins.md | 33 +++++ ...etacored_query_fungible_system-contract.md | 33 +++++ docs/cli/zetacored/zetacored_query_gov.md | 38 ++++++ .../zetacored/zetacored_query_gov_deposit.md | 40 ++++++ .../zetacored/zetacored_query_gov_deposits.md | 47 +++++++ .../zetacored/zetacored_query_gov_param.md | 42 ++++++ .../zetacored/zetacored_query_gov_params.md | 40 ++++++ .../zetacored/zetacored_query_gov_proposal.md | 41 ++++++ .../zetacored_query_gov_proposals.md | 52 ++++++++ .../zetacored/zetacored_query_gov_proposer.md | 40 ++++++ .../zetacored/zetacored_query_gov_tally.md | 41 ++++++ .../cli/zetacored/zetacored_query_gov_vote.md | 40 ++++++ .../zetacored/zetacored_query_gov_votes.md | 47 +++++++ docs/cli/zetacored/zetacored_query_group.md | 42 ++++++ .../zetacored_query_group_group-info.md | 33 +++++ .../zetacored_query_group_group-members.md | 33 +++++ ...red_query_group_group-policies-by-admin.md | 33 +++++ ...red_query_group_group-policies-by-group.md | 33 +++++ ...zetacored_query_group_group-policy-info.md | 33 +++++ .../zetacored_query_group_groups-by-admin.md | 33 +++++ .../zetacored_query_group_groups-by-member.md | 39 ++++++ .../zetacored/zetacored_query_group_groups.md | 39 ++++++ .../zetacored_query_group_proposal.md | 33 +++++ ...d_query_group_proposals-by-group-policy.md | 33 +++++ .../zetacored_query_group_tally-result.md | 33 +++++ .../zetacored/zetacored_query_group_vote.md | 33 +++++ ...zetacored_query_group_votes-by-proposal.md | 33 +++++ .../zetacored_query_group_votes-by-voter.md | 33 +++++ .../cli/zetacored/zetacored_query_observer.md | 43 ++++++ ...acored_query_observer_list-blame-by-msg.md | 33 +++++ .../zetacored_query_observer_list-blame.md | 33 +++++ .../zetacored_query_observer_list-chains.md | 39 ++++++ ...tacored_query_observer_list-core-params.md | 33 +++++ ...acored_query_observer_list-node-account.md | 39 ++++++ .../zetacored_query_observer_list-observer.md | 33 +++++ .../zetacored_query_observer_params.md | 33 +++++ .../zetacored_query_observer_show-ballot.md | 33 +++++ .../zetacored_query_observer_show-blame.md | 33 +++++ ...tacored_query_observer_show-core-params.md | 33 +++++ ...ed_query_observer_show-crosschain-flags.md | 33 +++++ .../zetacored_query_observer_show-keygen.md | 33 +++++ ...acored_query_observer_show-node-account.md | 33 +++++ ...ored_query_observer_show-observer-count.md | 33 +++++ .../zetacored_query_observer_show-observer.md | 33 +++++ docs/cli/zetacored/zetacored_query_params.md | 29 +++++ .../zetacored_query_params_subspace.md | 33 +++++ .../cli/zetacored/zetacored_query_slashing.md | 31 +++++ .../zetacored_query_slashing_params.md | 39 ++++++ .../zetacored_query_slashing_signing-info.md | 39 ++++++ .../zetacored_query_slashing_signing-infos.md | 45 +++++++ docs/cli/zetacored/zetacored_query_staking.md | 42 ++++++ .../zetacored_query_staking_delegation.md | 40 ++++++ .../zetacored_query_staking_delegations-to.md | 46 +++++++ .../zetacored_query_staking_delegations.md | 46 +++++++ ...zetacored_query_staking_historical-info.md | 40 ++++++ .../zetacored_query_staking_params.md | 40 ++++++ .../zetacored/zetacored_query_staking_pool.md | 40 ++++++ .../zetacored_query_staking_redelegation.md | 40 ++++++ ...acored_query_staking_redelegations-from.md | 46 +++++++ .../zetacored_query_staking_redelegations.md | 46 +++++++ ...ored_query_staking_unbonding-delegation.md | 40 ++++++ ...uery_staking_unbonding-delegations-from.md | 46 +++++++ ...red_query_staking_unbonding-delegations.md | 46 +++++++ .../zetacored_query_staking_validator.md | 40 ++++++ .../zetacored_query_staking_validators.md | 46 +++++++ ...etacored_query_tendermint-validator-set.md | 32 +++++ docs/cli/zetacored/zetacored_query_tx.md | 41 ++++++ docs/cli/zetacored/zetacored_query_txs.md | 46 +++++++ docs/cli/zetacored/zetacored_query_upgrade.md | 27 ++++ .../zetacored_query_upgrade_applied.md | 38 ++++++ ...zetacored_query_upgrade_module_versions.md | 39 ++++++ .../zetacored/zetacored_query_upgrade_plan.md | 37 ++++++ docs/cli/zetacored/zetacored_rollback.md | 38 ++++++ docs/cli/zetacored/zetacored_rosetta.md | 38 ++++++ docs/cli/zetacored/zetacored_start.md | 122 ++++++++++++++++++ docs/cli/zetacored/zetacored_status.md | 28 ++++ docs/cli/zetacored/zetacored_tendermint.md | 29 +++++ .../zetacored_tendermint_reset-state.md | 27 ++++ .../zetacored_tendermint_show-address.md | 27 ++++ .../zetacored_tendermint_show-node-id.md | 27 ++++ .../zetacored_tendermint_show-validator.md | 27 ++++ .../zetacored_tendermint_unsafe-reset-all.md | 28 ++++ .../zetacored/zetacored_tendermint_version.md | 31 +++++ docs/cli/zetacored/zetacored_testnet.md | 29 +++++ .../zetacored/zetacored_testnet_init-files.md | 50 +++++++ docs/cli/zetacored/zetacored_testnet_start.md | 48 +++++++ docs/cli/zetacored/zetacored_tx.md | 51 ++++++++ docs/cli/zetacored/zetacored_tx_authz.md | 35 +++++ docs/cli/zetacored/zetacored_tx_authz_exec.md | 59 +++++++++ .../cli/zetacored/zetacored_tx_authz_grant.md | 65 ++++++++++ .../zetacored/zetacored_tx_authz_revoke.md | 58 +++++++++ docs/cli/zetacored/zetacored_tx_bank.md | 30 +++++ .../zetacored/zetacored_tx_bank_multi-send.md | 62 +++++++++ docs/cli/zetacored/zetacored_tx_bank_send.md | 59 +++++++++ docs/cli/zetacored/zetacored_tx_broadcast.md | 61 +++++++++ docs/cli/zetacored/zetacored_tx_crisis.md | 29 +++++ .../zetacored_tx_crisis_invariant-broken.md | 52 ++++++++ docs/cli/zetacored/zetacored_tx_crosschain.md | 39 ++++++ ...ored_tx_crosschain_add-to-in-tx-tracker.md | 53 ++++++++ ...red_tx_crosschain_add-to-out-tx-tracker.md | 52 ++++++++ ...etacored_tx_crosschain_create-tss-voter.md | 52 ++++++++ ...zetacored_tx_crosschain_gas-price-voter.md | 52 ++++++++ .../zetacored_tx_crosschain_inbound-voter.md | 52 ++++++++ ...tacored_tx_crosschain_migrate-tss-funds.md | 52 ++++++++ .../zetacored_tx_crosschain_nonce-voter.md | 52 ++++++++ .../zetacored_tx_crosschain_outbound-voter.md | 52 ++++++++ ...x_crosschain_remove-from-out-tx-tracker.md | 52 ++++++++ ...acored_tx_crosschain_update-tss-address.md | 52 ++++++++ docs/cli/zetacored/zetacored_tx_decode.md | 53 ++++++++ .../zetacored/zetacored_tx_distribution.md | 32 +++++ ...red_tx_distribution_fund-community-pool.md | 59 +++++++++ ...cored_tx_distribution_set-withdraw-addr.md | 59 +++++++++ ...ed_tx_distribution_withdraw-all-rewards.md | 61 +++++++++ ...acored_tx_distribution_withdraw-rewards.md | 62 +++++++++ docs/cli/zetacored/zetacored_tx_emissions.md | 28 ++++ docs/cli/zetacored/zetacored_tx_encode.md | 58 +++++++++ docs/cli/zetacored/zetacored_tx_evidence.md | 28 ++++ docs/cli/zetacored/zetacored_tx_evm.md | 29 +++++ docs/cli/zetacored/zetacored_tx_evm_raw.md | 52 ++++++++ docs/cli/zetacored/zetacored_tx_fungible.md | 31 +++++ ..._tx_fungible_deploy-fungible-coin-zrc-4.md | 52 ++++++++ ...tacored_tx_fungible_remove-foreign-coin.md | 52 ++++++++ ..._tx_fungible_update-zrc20-liquidity-cap.md | 52 ++++++++ docs/cli/zetacored/zetacored_tx_gov.md | 34 +++++ .../cli/zetacored/zetacored_tx_gov_deposit.md | 60 +++++++++ .../zetacored_tx_gov_draft-proposal.md | 52 ++++++++ ...zetacored_tx_gov_submit-legacy-proposal.md | 82 ++++++++++++ ...legacy-proposal_cancel-software-upgrade.md | 59 +++++++++ ...it-legacy-proposal_community-pool-spend.md | 70 ++++++++++ ...gov_submit-legacy-proposal_param-change.md | 84 ++++++++++++ ...submit-legacy-proposal_software-upgrade.md | 65 ++++++++++ .../zetacored_tx_gov_submit-proposal.md | 76 +++++++++++ docs/cli/zetacored/zetacored_tx_gov_vote.md | 61 +++++++++ .../zetacored_tx_gov_weighted-vote.md | 61 +++++++++ docs/cli/zetacored/zetacored_tx_group.md | 43 ++++++ .../zetacored_tx_group_create-group-policy.md | 81 ++++++++++++ ...cored_tx_group_create-group-with-policy.md | 96 ++++++++++++++ .../zetacored_tx_group_create-group.md | 81 ++++++++++++ .../zetacored_tx_group_draft-proposal.md | 52 ++++++++ docs/cli/zetacored/zetacored_tx_group_exec.md | 52 ++++++++ .../zetacored_tx_group_leave-group.md | 62 +++++++++ .../zetacored_tx_group_submit-proposal.md | 83 ++++++++++++ .../zetacored_tx_group_update-group-admin.md | 52 ++++++++ ...zetacored_tx_group_update-group-members.md | 79 ++++++++++++ ...etacored_tx_group_update-group-metadata.md | 52 ++++++++ ...ored_tx_group_update-group-policy-admin.md | 52 ++++++++ ...oup_update-group-policy-decision-policy.md | 52 ++++++++ ...d_tx_group_update-group-policy-metadata.md | 52 ++++++++ docs/cli/zetacored/zetacored_tx_group_vote.md | 69 ++++++++++ .../zetacored_tx_group_withdraw-proposal.md | 62 +++++++++ docs/cli/zetacored/zetacored_tx_multi-sign.md | 75 +++++++++++ .../zetacored/zetacored_tx_multisign-batch.md | 68 ++++++++++ docs/cli/zetacored/zetacored_tx_observer.md | 34 +++++ .../zetacored_tx_observer_add-blame-vote.md | 52 ++++++++ .../zetacored_tx_observer_add-observer.md | 52 ++++++++ .../zetacored/zetacored_tx_observer_encode.md | 52 ++++++++ ...acored_tx_observer_update-client-params.md | 52 ++++++++ ...red_tx_observer_update-crosschain-flags.md | 52 ++++++++ .../zetacored_tx_observer_update-keygen.md | 52 ++++++++ docs/cli/zetacored/zetacored_tx_sign-batch.md | 78 +++++++++++ docs/cli/zetacored/zetacored_tx_sign.md | 74 +++++++++++ docs/cli/zetacored/zetacored_tx_slashing.md | 29 +++++ .../zetacored/zetacored_tx_slashing_unjail.md | 59 +++++++++ docs/cli/zetacored/zetacored_tx_staking.md | 34 +++++ .../zetacored_tx_staking_cancel-unbond.md | 65 ++++++++++ .../zetacored_tx_staking_create-validator.md | 65 ++++++++++ .../zetacored_tx_staking_delegate.md | 59 +++++++++ .../zetacored_tx_staking_edit-validator.md | 59 +++++++++ .../zetacored_tx_staking_redelegate.md | 59 +++++++++ .../zetacored/zetacored_tx_staking_unbond.md | 59 +++++++++ .../zetacored_tx_validate-signatures.md | 63 +++++++++ docs/cli/zetacored/zetacored_tx_vesting.md | 31 +++++ ...vesting_create-periodic-vesting-account.md | 72 +++++++++++ ...vesting_create-permanent-locked-account.md | 58 +++++++++ ...cored_tx_vesting_create-vesting-account.md | 61 +++++++++ .../zetacored/zetacored_validate-genesis.md | 27 ++++ docs/cli/zetacored/zetacored_version.md | 29 +++++ go.mod | 2 + go.sum | 2 - scripts/gen-docs-zetacored.sh | 43 ++++++ 284 files changed, 12084 insertions(+), 18 deletions(-) create mode 100644 cmd/zetacored/docs.go create mode 100644 docs/cli/zetacored/zetacored.md create mode 100644 docs/cli/zetacored/zetacored_add-genesis-account.md create mode 100644 docs/cli/zetacored/zetacored_add-observer-list.md create mode 100644 docs/cli/zetacored/zetacored_addr-conversion.md create mode 100644 docs/cli/zetacored/zetacored_collect-gentxs.md create mode 100644 docs/cli/zetacored/zetacored_collect-observer-info.md create mode 100644 docs/cli/zetacored/zetacored_config.md create mode 100644 docs/cli/zetacored/zetacored_debug.md create mode 100644 docs/cli/zetacored/zetacored_debug_addr.md create mode 100644 docs/cli/zetacored/zetacored_debug_pubkey-raw.md create mode 100644 docs/cli/zetacored/zetacored_debug_pubkey.md create mode 100644 docs/cli/zetacored/zetacored_debug_raw-bytes.md create mode 100644 docs/cli/zetacored/zetacored_docs.md create mode 100644 docs/cli/zetacored/zetacored_export.md create mode 100644 docs/cli/zetacored/zetacored_gentx.md create mode 100644 docs/cli/zetacored/zetacored_get-pubkey.md create mode 100644 docs/cli/zetacored/zetacored_index-eth-tx.md create mode 100644 docs/cli/zetacored/zetacored_init.md create mode 100644 docs/cli/zetacored/zetacored_keys.md create mode 100644 docs/cli/zetacored/zetacored_keys_.md create mode 100644 docs/cli/zetacored/zetacored_keys_add.md create mode 100644 docs/cli/zetacored/zetacored_keys_delete.md create mode 100644 docs/cli/zetacored/zetacored_keys_export.md create mode 100644 docs/cli/zetacored/zetacored_keys_import.md create mode 100644 docs/cli/zetacored/zetacored_keys_list.md create mode 100644 docs/cli/zetacored/zetacored_keys_migrate.md create mode 100644 docs/cli/zetacored/zetacored_keys_mnemonic.md create mode 100644 docs/cli/zetacored/zetacored_keys_parse.md create mode 100644 docs/cli/zetacored/zetacored_keys_rename.md create mode 100644 docs/cli/zetacored/zetacored_keys_show.md create mode 100644 docs/cli/zetacored/zetacored_keys_unsafe-export-eth-key.md create mode 100644 docs/cli/zetacored/zetacored_keys_unsafe-import-eth-key.md create mode 100644 docs/cli/zetacored/zetacored_query.md create mode 100644 docs/cli/zetacored/zetacored_query_account.md create mode 100644 docs/cli/zetacored/zetacored_query_auth.md create mode 100644 docs/cli/zetacored/zetacored_query_auth_account.md create mode 100644 docs/cli/zetacored/zetacored_query_auth_accounts.md create mode 100644 docs/cli/zetacored/zetacored_query_auth_address-by-acc-num.md create mode 100644 docs/cli/zetacored/zetacored_query_auth_module-account.md create mode 100644 docs/cli/zetacored/zetacored_query_auth_module-accounts.md create mode 100644 docs/cli/zetacored/zetacored_query_auth_params.md create mode 100644 docs/cli/zetacored/zetacored_query_authz.md create mode 100644 docs/cli/zetacored/zetacored_query_authz_grants-by-grantee.md create mode 100644 docs/cli/zetacored/zetacored_query_authz_grants-by-granter.md create mode 100644 docs/cli/zetacored/zetacored_query_authz_grants.md create mode 100644 docs/cli/zetacored/zetacored_query_bank.md create mode 100644 docs/cli/zetacored/zetacored_query_bank_balances.md create mode 100644 docs/cli/zetacored/zetacored_query_bank_denom-metadata.md create mode 100644 docs/cli/zetacored/zetacored_query_bank_total.md create mode 100644 docs/cli/zetacored/zetacored_query_block.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_get-tss-address.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_in-tx-hash-to-cctx-data.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_last-zeta-height.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-all-in-tx-trackers.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-cctx.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-chain-nonces.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-gas-price.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-hash-to-cctx.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-tracker.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-out-tx-tracker.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-pending-cctx.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-pending-nonces.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_list-tss-history.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_params.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_show-cctx.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_show-chain-nonces.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_show-gas-price.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_show-in-tx-hash-to-cctx.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_show-out-tx-tracker.md create mode 100644 docs/cli/zetacored/zetacored_query_crosschain_show-tss.md create mode 100644 docs/cli/zetacored/zetacored_query_distribution.md create mode 100644 docs/cli/zetacored/zetacored_query_distribution_commission.md create mode 100644 docs/cli/zetacored/zetacored_query_distribution_community-pool.md create mode 100644 docs/cli/zetacored/zetacored_query_distribution_params.md create mode 100644 docs/cli/zetacored/zetacored_query_distribution_rewards.md create mode 100644 docs/cli/zetacored/zetacored_query_distribution_slashes.md create mode 100644 docs/cli/zetacored/zetacored_query_distribution_validator-outstanding-rewards.md create mode 100644 docs/cli/zetacored/zetacored_query_emissions.md create mode 100644 docs/cli/zetacored/zetacored_query_emissions_get-emmisons-factors.md create mode 100644 docs/cli/zetacored/zetacored_query_emissions_list-pool-addresses.md create mode 100644 docs/cli/zetacored/zetacored_query_emissions_params.md create mode 100644 docs/cli/zetacored/zetacored_query_emissions_show-available-emissions.md create mode 100644 docs/cli/zetacored/zetacored_query_evidence.md create mode 100644 docs/cli/zetacored/zetacored_query_evm.md create mode 100644 docs/cli/zetacored/zetacored_query_evm_code.md create mode 100644 docs/cli/zetacored/zetacored_query_evm_params.md create mode 100644 docs/cli/zetacored/zetacored_query_evm_storage.md create mode 100644 docs/cli/zetacored/zetacored_query_feemarket.md create mode 100644 docs/cli/zetacored/zetacored_query_feemarket_base-fee.md create mode 100644 docs/cli/zetacored/zetacored_query_feemarket_block-gas.md create mode 100644 docs/cli/zetacored/zetacored_query_feemarket_params.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-address.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balance.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balances.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible_list-foreign-coins.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible_params.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible_show-foreign-coins.md create mode 100644 docs/cli/zetacored/zetacored_query_fungible_system-contract.md create mode 100644 docs/cli/zetacored/zetacored_query_gov.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_deposit.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_deposits.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_param.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_params.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_proposal.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_proposals.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_proposer.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_tally.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_vote.md create mode 100644 docs/cli/zetacored/zetacored_query_gov_votes.md create mode 100644 docs/cli/zetacored/zetacored_query_group.md create mode 100644 docs/cli/zetacored/zetacored_query_group_group-info.md create mode 100644 docs/cli/zetacored/zetacored_query_group_group-members.md create mode 100644 docs/cli/zetacored/zetacored_query_group_group-policies-by-admin.md create mode 100644 docs/cli/zetacored/zetacored_query_group_group-policies-by-group.md create mode 100644 docs/cli/zetacored/zetacored_query_group_group-policy-info.md create mode 100644 docs/cli/zetacored/zetacored_query_group_groups-by-admin.md create mode 100644 docs/cli/zetacored/zetacored_query_group_groups-by-member.md create mode 100644 docs/cli/zetacored/zetacored_query_group_groups.md create mode 100644 docs/cli/zetacored/zetacored_query_group_proposal.md create mode 100644 docs/cli/zetacored/zetacored_query_group_proposals-by-group-policy.md create mode 100644 docs/cli/zetacored/zetacored_query_group_tally-result.md create mode 100644 docs/cli/zetacored/zetacored_query_group_vote.md create mode 100644 docs/cli/zetacored/zetacored_query_group_votes-by-proposal.md create mode 100644 docs/cli/zetacored/zetacored_query_group_votes-by-voter.md create mode 100644 docs/cli/zetacored/zetacored_query_observer.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_list-blame-by-msg.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_list-blame.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_list-chains.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_list-core-params.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_list-node-account.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_list-observer.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_params.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-ballot.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-blame.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-core-params.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-crosschain-flags.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-keygen.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-node-account.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-observer-count.md create mode 100644 docs/cli/zetacored/zetacored_query_observer_show-observer.md create mode 100644 docs/cli/zetacored/zetacored_query_params.md create mode 100644 docs/cli/zetacored/zetacored_query_params_subspace.md create mode 100644 docs/cli/zetacored/zetacored_query_slashing.md create mode 100644 docs/cli/zetacored/zetacored_query_slashing_params.md create mode 100644 docs/cli/zetacored/zetacored_query_slashing_signing-info.md create mode 100644 docs/cli/zetacored/zetacored_query_slashing_signing-infos.md create mode 100644 docs/cli/zetacored/zetacored_query_staking.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_delegation.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_delegations-to.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_delegations.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_historical-info.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_params.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_pool.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_redelegation.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_redelegations-from.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_redelegations.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_unbonding-delegation.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_unbonding-delegations-from.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_unbonding-delegations.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_validator.md create mode 100644 docs/cli/zetacored/zetacored_query_staking_validators.md create mode 100644 docs/cli/zetacored/zetacored_query_tendermint-validator-set.md create mode 100644 docs/cli/zetacored/zetacored_query_tx.md create mode 100644 docs/cli/zetacored/zetacored_query_txs.md create mode 100644 docs/cli/zetacored/zetacored_query_upgrade.md create mode 100644 docs/cli/zetacored/zetacored_query_upgrade_applied.md create mode 100644 docs/cli/zetacored/zetacored_query_upgrade_module_versions.md create mode 100644 docs/cli/zetacored/zetacored_query_upgrade_plan.md create mode 100644 docs/cli/zetacored/zetacored_rollback.md create mode 100644 docs/cli/zetacored/zetacored_rosetta.md create mode 100644 docs/cli/zetacored/zetacored_start.md create mode 100644 docs/cli/zetacored/zetacored_status.md create mode 100644 docs/cli/zetacored/zetacored_tendermint.md create mode 100644 docs/cli/zetacored/zetacored_tendermint_reset-state.md create mode 100644 docs/cli/zetacored/zetacored_tendermint_show-address.md create mode 100644 docs/cli/zetacored/zetacored_tendermint_show-node-id.md create mode 100644 docs/cli/zetacored/zetacored_tendermint_show-validator.md create mode 100644 docs/cli/zetacored/zetacored_tendermint_unsafe-reset-all.md create mode 100644 docs/cli/zetacored/zetacored_tendermint_version.md create mode 100644 docs/cli/zetacored/zetacored_testnet.md create mode 100644 docs/cli/zetacored/zetacored_testnet_init-files.md create mode 100644 docs/cli/zetacored/zetacored_testnet_start.md create mode 100644 docs/cli/zetacored/zetacored_tx.md create mode 100644 docs/cli/zetacored/zetacored_tx_authz.md create mode 100644 docs/cli/zetacored/zetacored_tx_authz_exec.md create mode 100644 docs/cli/zetacored/zetacored_tx_authz_grant.md create mode 100644 docs/cli/zetacored/zetacored_tx_authz_revoke.md create mode 100644 docs/cli/zetacored/zetacored_tx_bank.md create mode 100644 docs/cli/zetacored/zetacored_tx_bank_multi-send.md create mode 100644 docs/cli/zetacored/zetacored_tx_bank_send.md create mode 100644 docs/cli/zetacored/zetacored_tx_broadcast.md create mode 100644 docs/cli/zetacored/zetacored_tx_crisis.md create mode 100644 docs/cli/zetacored/zetacored_tx_crisis_invariant-broken.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_add-to-in-tx-tracker.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_add-to-out-tx-tracker.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_create-tss-voter.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_gas-price-voter.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_migrate-tss-funds.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_nonce-voter.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_outbound-voter.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_remove-from-out-tx-tracker.md create mode 100644 docs/cli/zetacored/zetacored_tx_crosschain_update-tss-address.md create mode 100644 docs/cli/zetacored/zetacored_tx_decode.md create mode 100644 docs/cli/zetacored/zetacored_tx_distribution.md create mode 100644 docs/cli/zetacored/zetacored_tx_distribution_fund-community-pool.md create mode 100644 docs/cli/zetacored/zetacored_tx_distribution_set-withdraw-addr.md create mode 100644 docs/cli/zetacored/zetacored_tx_distribution_withdraw-all-rewards.md create mode 100644 docs/cli/zetacored/zetacored_tx_distribution_withdraw-rewards.md create mode 100644 docs/cli/zetacored/zetacored_tx_emissions.md create mode 100644 docs/cli/zetacored/zetacored_tx_encode.md create mode 100644 docs/cli/zetacored/zetacored_tx_evidence.md create mode 100644 docs/cli/zetacored/zetacored_tx_evm.md create mode 100644 docs/cli/zetacored/zetacored_tx_evm_raw.md create mode 100644 docs/cli/zetacored/zetacored_tx_fungible.md create mode 100644 docs/cli/zetacored/zetacored_tx_fungible_deploy-fungible-coin-zrc-4.md create mode 100644 docs/cli/zetacored/zetacored_tx_fungible_remove-foreign-coin.md create mode 100644 docs/cli/zetacored/zetacored_tx_fungible_update-zrc20-liquidity-cap.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_deposit.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_draft-proposal.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_cancel-software-upgrade.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_community-pool-spend.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_param-change.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_software-upgrade.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_submit-proposal.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_vote.md create mode 100644 docs/cli/zetacored/zetacored_tx_gov_weighted-vote.md create mode 100644 docs/cli/zetacored/zetacored_tx_group.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_create-group-policy.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_create-group-with-policy.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_create-group.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_draft-proposal.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_exec.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_leave-group.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_submit-proposal.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_update-group-admin.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_update-group-members.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_update-group-metadata.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_update-group-policy-admin.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_update-group-policy-decision-policy.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_update-group-policy-metadata.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_vote.md create mode 100644 docs/cli/zetacored/zetacored_tx_group_withdraw-proposal.md create mode 100644 docs/cli/zetacored/zetacored_tx_multi-sign.md create mode 100644 docs/cli/zetacored/zetacored_tx_multisign-batch.md create mode 100644 docs/cli/zetacored/zetacored_tx_observer.md create mode 100644 docs/cli/zetacored/zetacored_tx_observer_add-blame-vote.md create mode 100644 docs/cli/zetacored/zetacored_tx_observer_add-observer.md create mode 100644 docs/cli/zetacored/zetacored_tx_observer_encode.md create mode 100644 docs/cli/zetacored/zetacored_tx_observer_update-client-params.md create mode 100644 docs/cli/zetacored/zetacored_tx_observer_update-crosschain-flags.md create mode 100644 docs/cli/zetacored/zetacored_tx_observer_update-keygen.md create mode 100644 docs/cli/zetacored/zetacored_tx_sign-batch.md create mode 100644 docs/cli/zetacored/zetacored_tx_sign.md create mode 100644 docs/cli/zetacored/zetacored_tx_slashing.md create mode 100644 docs/cli/zetacored/zetacored_tx_slashing_unjail.md create mode 100644 docs/cli/zetacored/zetacored_tx_staking.md create mode 100644 docs/cli/zetacored/zetacored_tx_staking_cancel-unbond.md create mode 100644 docs/cli/zetacored/zetacored_tx_staking_create-validator.md create mode 100644 docs/cli/zetacored/zetacored_tx_staking_delegate.md create mode 100644 docs/cli/zetacored/zetacored_tx_staking_edit-validator.md create mode 100644 docs/cli/zetacored/zetacored_tx_staking_redelegate.md create mode 100644 docs/cli/zetacored/zetacored_tx_staking_unbond.md create mode 100644 docs/cli/zetacored/zetacored_tx_validate-signatures.md create mode 100644 docs/cli/zetacored/zetacored_tx_vesting.md create mode 100644 docs/cli/zetacored/zetacored_tx_vesting_create-periodic-vesting-account.md create mode 100644 docs/cli/zetacored/zetacored_tx_vesting_create-permanent-locked-account.md create mode 100644 docs/cli/zetacored/zetacored_tx_vesting_create-vesting-account.md create mode 100644 docs/cli/zetacored/zetacored_validate-genesis.md create mode 100644 docs/cli/zetacored/zetacored_version.md create mode 100755 scripts/gen-docs-zetacored.sh diff --git a/.github/workflows/generate-files.yml b/.github/workflows/generate-files.yml index a76000a0de..3e1d9561d9 100644 --- a/.github/workflows/generate-files.yml +++ b/.github/workflows/generate-files.yml @@ -17,14 +17,8 @@ jobs: run: | echo "$HOME/go/bin" >> $GITHUB_PATH - - name: Generate Go code from proto files - run: make proto - - - name: Generate OpenAPI - run: make openapi - - - name: Generate Module Documentation - run: make specs + - name: Generate Go code, docs and specs + run: make generate - name: Check for changes run: | diff --git a/Makefile b/Makefile index c5662752b0..03684cf2aa 100644 --- a/Makefile +++ b/Makefile @@ -174,12 +174,18 @@ specs: @go run ./scripts/gen-spec.go .PHONY: specs +docs-zetacored: + @echo "--> Generating zetacored documentation" + @bash ./scripts/gen-docs-zetacored.sh +.PHONY: docs-zetacored + +generate: proto openapi specs docs-zetacored +.PHONY: generate + mocks: @echo "--> Generating mocks" @bash ./scripts/mocks-generate.sh - -generate: proto openapi specs -.PHONY: generate +.PHONY: mocks ############################################################################### ### Docker Images ### diff --git a/cmd/zetacore_utils/main.go b/cmd/zetacore_utils/main.go index cee1b46a48..f7dcff1e67 100644 --- a/cmd/zetacore_utils/main.go +++ b/cmd/zetacore_utils/main.go @@ -54,7 +54,8 @@ func main() { distributionList := make([]TokenDistribution, len(addresses)) for i, address := range addresses { - cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node) // #nosec G204 + // #nosec G204 + cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node) output, err := cmd.CombinedOutput() if err != nil { fmt.Println(cmd.String()) @@ -85,6 +86,7 @@ func main() { args = append(args, []string{distributionList[0].TokensDistributed.String(), "--keyring-backend", "test", "--chain-id", chainID, "--yes", "--broadcast-mode", broadcastMode, "--gas=auto", "--gas-adjustment=2", "--gas-prices=0.001azeta", "--node", node}...) + // #nosec G204 cmd := exec.Command("zetacored", args...) output, err := cmd.CombinedOutput() if err != nil { @@ -97,7 +99,8 @@ func main() { time.Sleep(7 * time.Second) for i, address := range addresses { - cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node) // #nosec G204 + // #nosec G204 + cmd := exec.Command("zetacored", "q", "bank", "balances", address, "--output", "json", "--denom", "azeta", "--node", node) output, err := cmd.CombinedOutput() if err != nil { fmt.Println(cmd.String()) diff --git a/cmd/zetacored/config/config.go b/cmd/zetacored/config/config.go index 8c30cab481..4036a7cd72 100644 --- a/cmd/zetacored/config/config.go +++ b/cmd/zetacored/config/config.go @@ -15,6 +15,7 @@ func SetBech32Prefixes(config *sdk.Config) { const ( DisplayDenom = "zeta" BaseDenom = "azeta" + AppName = "zetacored" ) // RegisterDenoms registers the base and display denominations to the SDK. diff --git a/cmd/zetacored/docs.go b/cmd/zetacored/docs.go new file mode 100644 index 0000000000..c6ae4bcbc6 --- /dev/null +++ b/cmd/zetacored/docs.go @@ -0,0 +1,49 @@ +package main + +import ( + "os" + + "github.com/spf13/cobra" + "github.com/spf13/cobra/doc" +) + +func docsCmd(cmd *cobra.Command, args []string) error { + var path string + + // If path is provided as an argument, use it. Else, get from flag. + if len(args) > 0 { + path = args[0] + } else { + var err error + path, err = cmd.Flags().GetString("path") + if err != nil { + return err + } + } + + if _, err := os.Stat(path); os.IsNotExist(err) { + err = os.MkdirAll(path, 0750) + if err != nil { + return err + } + } + + err := doc.GenMarkdownTree(cmd.Root(), path) + if err != nil { + return err + } + return nil +} + +func docsCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "docs [path]", + Short: "Generate markdown documentation for zetacored", + RunE: docsCmd, + Args: cobra.MaximumNArgs(1), + } + + cmd.Flags().String("path", "docs/cli/zetacored", "Path where the docs will be generated") + + return cmd +} diff --git a/cmd/zetacored/root.go b/cmd/zetacored/root.go index 68c60efcce..468c163e9f 100644 --- a/cmd/zetacored/root.go +++ b/cmd/zetacored/root.go @@ -27,7 +27,6 @@ import ( "github.com/cosmos/cosmos-sdk/snapshots" "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/version" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -69,7 +68,7 @@ func NewRootCmd() (*cobra.Command, appparams.EncodingConfig) { WithViper(EnvPrefix) rootCmd := &cobra.Command{ - Use: version.AppName, + Use: zetacoredconfig.AppName, Short: "Zetacore Daemon (server)", PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { // set the default command outputs @@ -152,6 +151,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig appparams.EncodingConfig rpc.StatusCommand(), queryCommand(), txCommand(), + docsCommand(), ethermintclient.KeyCommands(app.DefaultNodeHome), ) @@ -206,7 +206,6 @@ func txCommand() *cobra.Command { authcmd.GetMultiSignCommand(), authcmd.GetMultiSignBatchCmd(), authcmd.GetValidateSignaturesCommand(), - flags.LineBreak, authcmd.GetBroadcastCommand(), authcmd.GetEncodeCommand(), authcmd.GetDecodeCommand(), diff --git a/docs/cli/zetacored/zetacored.md b/docs/cli/zetacored/zetacored.md new file mode 100644 index 0000000000..d4a602ec91 --- /dev/null +++ b/docs/cli/zetacored/zetacored.md @@ -0,0 +1,42 @@ +## zetacored + +Zetacore Daemon (server) + +### Options + +``` + -h, --help help for zetacored + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored add-genesis-account](zetacored_add-genesis-account.md) - Add a genesis account to genesis.json +* [zetacored add-observer-list](zetacored_add-observer-list.md) - Add a list of observers to the observer mapper ,default path is ~/.zetacored/os_info/observer_info.json +* [zetacored addr-conversion](zetacored_addr-conversion.md) - convert a zeta1xxx address to validator operator address zetavaloper1xxx +* [zetacored collect-gentxs](zetacored_collect-gentxs.md) - Collect genesis txs and output a genesis.json file +* [zetacored collect-observer-info](zetacored_collect-observer-info.md) - collect observer info from a folder , default path is ~/.zetacored/os_info/ + +* [zetacored config](zetacored_config.md) - Create or query an application CLI configuration file +* [zetacored debug](zetacored_debug.md) - Tool for helping with debugging your application +* [zetacored docs](zetacored_docs.md) - Generate markdown documentation for zetacored +* [zetacored export](zetacored_export.md) - Export state to JSON +* [zetacored gentx](zetacored_gentx.md) - Generate a genesis tx carrying a self delegation +* [zetacored get-pubkey](zetacored_get-pubkey.md) - Get you node account +* [zetacored index-eth-tx](zetacored_index-eth-tx.md) - Index historical eth txs +* [zetacored init](zetacored_init.md) - Initialize private validator, p2p, genesis, and application configuration files +* [zetacored keys](zetacored_keys.md) - Manage your application's keys +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored rollback](zetacored_rollback.md) - rollback cosmos-sdk and tendermint state by one height +* [zetacored rosetta](zetacored_rosetta.md) - spin up a rosetta server +* [zetacored start](zetacored_start.md) - Run the full node +* [zetacored status](zetacored_status.md) - Query remote node for status +* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands +* [zetacored testnet](zetacored_testnet.md) - subcommands for starting or configuring local testnets +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored validate-genesis](zetacored_validate-genesis.md) - validates the genesis file at the default location or at the location passed as an arg +* [zetacored version](zetacored_version.md) - Print the application binary version information + diff --git a/docs/cli/zetacored/zetacored_add-genesis-account.md b/docs/cli/zetacored/zetacored_add-genesis-account.md new file mode 100644 index 0000000000..3bd28a9bcd --- /dev/null +++ b/docs/cli/zetacored/zetacored_add-genesis-account.md @@ -0,0 +1,44 @@ +# add-genesis-account + +Add a genesis account to genesis.json + +### Synopsis + +Add a genesis account to genesis.json. The provided account must specify +the account address or key name and a list of initial coins. If a key name is given, +the address will be looked up in the local Keybase. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. + + +``` +zetacored add-genesis-account [address_or_key_name] [coin][,[coin]] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for add-genesis-account + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test) + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) + --vesting-amount string amount of coins for vesting accounts + --vesting-end-time int schedule end time (unix epoch) for vesting accounts + --vesting-start-time int schedule start time (unix epoch) for vesting accounts +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_add-observer-list.md b/docs/cli/zetacored/zetacored_add-observer-list.md new file mode 100644 index 0000000000..2678e965dd --- /dev/null +++ b/docs/cli/zetacored/zetacored_add-observer-list.md @@ -0,0 +1,29 @@ +# add-observer-list + +Add a list of observers to the observer mapper ,default path is ~/.zetacored/os_info/observer_info.json + +``` +zetacored add-observer-list [observer-list.json] [flags] +``` + +### Options + +``` + -h, --help help for add-observer-list + --keygen-block int set keygen block , default is 20 (default 20) + --tss-pubkey string set TSS pubkey if using older keygen +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_addr-conversion.md b/docs/cli/zetacored/zetacored_addr-conversion.md new file mode 100644 index 0000000000..f99cd72a9a --- /dev/null +++ b/docs/cli/zetacored/zetacored_addr-conversion.md @@ -0,0 +1,35 @@ +# addr-conversion + +convert a zeta1xxx address to validator operator address zetavaloper1xxx + +### Synopsis + + +read a zeta1xxx or zetavaloper1xxx address and convert it to the other type; +it always outputs three lines; the first line is the zeta1xxx address, the second line is the zetavaloper1xxx address +and the third line is the ethereum address. + + +``` +zetacored addr-conversion [zeta address] [flags] +``` + +### Options + +``` + -h, --help help for addr-conversion +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_collect-gentxs.md b/docs/cli/zetacored/zetacored_collect-gentxs.md new file mode 100644 index 0000000000..12638006ae --- /dev/null +++ b/docs/cli/zetacored/zetacored_collect-gentxs.md @@ -0,0 +1,28 @@ +# collect-gentxs + +Collect genesis txs and output a genesis.json file + +``` +zetacored collect-gentxs [flags] +``` + +### Options + +``` + --gentx-dir string override default "gentx" directory from which collect and execute genesis transactions; default [--home]/config/gentx/ + -h, --help help for collect-gentxs + --home string The application home directory +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_collect-observer-info.md b/docs/cli/zetacored/zetacored_collect-observer-info.md new file mode 100644 index 0000000000..b695791423 --- /dev/null +++ b/docs/cli/zetacored/zetacored_collect-observer-info.md @@ -0,0 +1,28 @@ +# collect-observer-info + +collect observer info from a folder , default path is ~/.zetacored/os_info/ + + +``` +zetacored collect-observer-info [folder] [flags] +``` + +### Options + +``` + -h, --help help for collect-observer-info +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_config.md b/docs/cli/zetacored/zetacored_config.md new file mode 100644 index 0000000000..9e28944a3c --- /dev/null +++ b/docs/cli/zetacored/zetacored_config.md @@ -0,0 +1,27 @@ +# config + +Create or query an application CLI configuration file + +``` +zetacored config [key] [value] [flags] +``` + +### Options + +``` + -h, --help help for config +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_debug.md b/docs/cli/zetacored/zetacored_debug.md new file mode 100644 index 0000000000..9f0ba3fb24 --- /dev/null +++ b/docs/cli/zetacored/zetacored_debug.md @@ -0,0 +1,31 @@ +# debug + +Tool for helping with debugging your application + +``` +zetacored debug [flags] +``` + +### Options + +``` + -h, --help help for debug +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) +* [zetacored debug addr](zetacored_debug_addr.md) - Convert an address between hex and bech32 +* [zetacored debug pubkey](zetacored_debug_pubkey.md) - Decode a pubkey from proto JSON +* [zetacored debug pubkey-raw](zetacored_debug_pubkey-raw.md) - Decode a ED25519 or secp256k1 pubkey from hex, base64, or bech32 +* [zetacored debug raw-bytes](zetacored_debug_raw-bytes.md) - Convert raw bytes output (eg. [10 21 13 255]) to hex + diff --git a/docs/cli/zetacored/zetacored_debug_addr.md b/docs/cli/zetacored/zetacored_debug_addr.md new file mode 100644 index 0000000000..1ab387aa8f --- /dev/null +++ b/docs/cli/zetacored/zetacored_debug_addr.md @@ -0,0 +1,35 @@ +# debug addr + +Convert an address between hex and bech32 + +### Synopsis + +Convert an address between hex encoding and bech32. + +Example: +$ zetacored debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg + + +``` +zetacored debug addr [address] [flags] +``` + +### Options + +``` + -h, --help help for addr +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored debug](zetacored_debug.md) - Tool for helping with debugging your application + diff --git a/docs/cli/zetacored/zetacored_debug_pubkey-raw.md b/docs/cli/zetacored/zetacored_debug_pubkey-raw.md new file mode 100644 index 0000000000..796abde406 --- /dev/null +++ b/docs/cli/zetacored/zetacored_debug_pubkey-raw.md @@ -0,0 +1,36 @@ +# debug pubkey-raw + +Decode a ED25519 or secp256k1 pubkey from hex, base64, or bech32 + +### Synopsis + +Decode a pubkey from hex, base64, or bech32. +Example: +$ zetacored debug pubkey-raw TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz +$ zetacored debug pubkey-raw cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg + + +``` +zetacored debug pubkey-raw [pubkey] -t [{ed25519, secp256k1}] [flags] +``` + +### Options + +``` + -h, --help help for pubkey-raw + -t, --type string Pubkey type to decode (oneof secp256k1, ed25519) +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored debug](zetacored_debug.md) - Tool for helping with debugging your application + diff --git a/docs/cli/zetacored/zetacored_debug_pubkey.md b/docs/cli/zetacored/zetacored_debug_pubkey.md new file mode 100644 index 0000000000..2668863745 --- /dev/null +++ b/docs/cli/zetacored/zetacored_debug_pubkey.md @@ -0,0 +1,35 @@ +# debug pubkey + +Decode a pubkey from proto JSON + +### Synopsis + +Decode a pubkey from proto JSON and display it's address. + +Example: +$ zetacored debug pubkey '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AurroA7jvfPd1AadmmOvWM2rJSwipXfRf8yD6pLbA2DJ"}' + + +``` +zetacored debug pubkey [pubkey] [flags] +``` + +### Options + +``` + -h, --help help for pubkey +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored debug](zetacored_debug.md) - Tool for helping with debugging your application + diff --git a/docs/cli/zetacored/zetacored_debug_raw-bytes.md b/docs/cli/zetacored/zetacored_debug_raw-bytes.md new file mode 100644 index 0000000000..c60a83efac --- /dev/null +++ b/docs/cli/zetacored/zetacored_debug_raw-bytes.md @@ -0,0 +1,35 @@ +# debug raw-bytes + +Convert raw bytes output (eg. [10 21 13 255]) to hex + +### Synopsis + +Convert raw-bytes to hex. + +Example: +$ zetacored debug raw-bytes [72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100] + + +``` +zetacored debug raw-bytes [raw-bytes] [flags] +``` + +### Options + +``` + -h, --help help for raw-bytes +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored debug](zetacored_debug.md) - Tool for helping with debugging your application + diff --git a/docs/cli/zetacored/zetacored_docs.md b/docs/cli/zetacored/zetacored_docs.md new file mode 100644 index 0000000000..953748f297 --- /dev/null +++ b/docs/cli/zetacored/zetacored_docs.md @@ -0,0 +1,28 @@ +# docs + +Generate markdown documentation for zetacored + +``` +zetacored docs [path] [flags] +``` + +### Options + +``` + -h, --help help for docs + --path string Path where the docs will be generated +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_export.md b/docs/cli/zetacored/zetacored_export.md new file mode 100644 index 0000000000..a737712ff7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_export.md @@ -0,0 +1,30 @@ +# export + +Export state to JSON + +``` +zetacored export [flags] +``` + +### Options + +``` + --for-zero-height Export state to start at height zero (perform preproccessing) + --height int Export state from a particular height (-1 means latest height) (default -1) + -h, --help help for export + --home string The application home directory + --jail-allowed-addrs strings Comma-separated list of operator addresses of jailed validators to unjail +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_gentx.md b/docs/cli/zetacored/zetacored_gentx.md new file mode 100644 index 0000000000..fe1f09c6aa --- /dev/null +++ b/docs/cli/zetacored/zetacored_gentx.md @@ -0,0 +1,91 @@ +# gentx + +Generate a genesis tx carrying a self delegation + +### Synopsis + +Generate a genesis transaction that creates a validator with a self-delegation, +that is signed by the key in the Keyring referenced by a given name. A node ID and Bech32 consensus +pubkey may optionally be provided. If they are omitted, they will be retrieved from the priv_validator.json +file. The following default parameters are included: + + delegation amount: 100000000stake + commission rate: 0.1 + commission max rate: 0.2 + commission max change rate: 0.01 + minimum self delegation: 1 + + +Example: +$ zetacored gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=os --chain-id=test-chain-1 \ + --moniker="myvalidator" \ + --commission-max-change-rate=0.01 \ + --commission-max-rate=1.0 \ + --commission-rate=0.07 \ + --details="..." \ + --security-contact="..." \ + --website="..." + + +``` +zetacored gentx [key_name] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --amount string Amount of coins to bond + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --chain-id string The network chain ID + --commission-max-change-rate string The maximum commission change rate percentage (per day) + --commission-max-rate string The maximum commission rate percentage + --commission-rate string The initial commission rate percentage + --details string The validator's (optional) details + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for gentx + --home string The application home directory + --identity string The (optional) identity signature (ex. UPort or Keybase) + --ip string The node's public IP + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --min-self-delegation string The minimum self delegation required on the validator + --moniker string The validator's (optional) moniker + --node string [host]:[port] to tendermint rpc interface for this chain + --node-id string The node's NodeID + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --output-document string Write the genesis transaction JSON document to the given file instead of the default location + --pubkey string The validator's Protobuf JSON encoded public key + --security-contact string The validator's (optional) security contact email + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + --website string The validator's (optional) website + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_get-pubkey.md b/docs/cli/zetacored/zetacored_get-pubkey.md new file mode 100644 index 0000000000..c0b35505a1 --- /dev/null +++ b/docs/cli/zetacored/zetacored_get-pubkey.md @@ -0,0 +1,27 @@ +# get-pubkey + +Get you node account + +``` +zetacored get-pubkey [tssKeyName] [Password] [flags] +``` + +### Options + +``` + -h, --help help for get-pubkey +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_index-eth-tx.md b/docs/cli/zetacored/zetacored_index-eth-tx.md new file mode 100644 index 0000000000..4b57d28308 --- /dev/null +++ b/docs/cli/zetacored/zetacored_index-eth-tx.md @@ -0,0 +1,37 @@ +# index-eth-tx + +Index historical eth txs + +### Synopsis + +Index historical eth txs, it only support two traverse direction to avoid creating gaps in the indexer db if using arbitrary block ranges: + - backward: index the blocks from the first indexed block to the earliest block in the chain, if indexer db is empty, start from the latest block. + - forward: index the blocks from the latest indexed block to latest block in the chain. + + When start the node, the indexer start from the latest indexed block to avoid creating gap. + Backward mode should be used most of the time, so the latest indexed block is always up-to-date. + + +``` +zetacored index-eth-tx [backward|forward] [flags] +``` + +### Options + +``` + -h, --help help for index-eth-tx +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_init.md b/docs/cli/zetacored/zetacored_init.md new file mode 100644 index 0000000000..364ff49656 --- /dev/null +++ b/docs/cli/zetacored/zetacored_init.md @@ -0,0 +1,35 @@ +# init + +Initialize private validator, p2p, genesis, and application configuration files + +### Synopsis + +Initialize validators's and node's configuration files. + +``` +zetacored init [moniker] [flags] +``` + +### Options + +``` + --chain-id string genesis file chain-id, if left blank will be randomly created + -h, --help help for init + --home string node's home directory + -o, --overwrite overwrite the genesis.json file + --recover provide seed phrase to recover existing key instead of creating + --staking-bond-denom string genesis file staking bond denomination, if left blank default value is 'stake' +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_keys.md b/docs/cli/zetacored/zetacored_keys.md new file mode 100644 index 0000000000..f1d11ef250 --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys.md @@ -0,0 +1,64 @@ +# keys + +Manage your application's keys + +### Synopsis + +Keyring management commands. These keys may be in any format supported by the +Tendermint crypto library and can be used by light-clients, full nodes, or any other application +that needs to sign with a private key. + +The keyring supports the following backends: + + os Uses the operating system's default credentials store. + file Uses encrypted file-based keystore within the app's configuration directory. + This keyring will request a password each time it is accessed, which may occur + multiple times in a single command resulting in repeated password prompts. + kwallet Uses KDE Wallet Manager as a credentials management application. + pass Uses the pass command line utility to store and retrieve keys. + test Stores keys insecurely to disk. It does not prompt for a password to be unlocked + and it should be use only for testing purposes. + +kwallet and pass backends depend on external tools. Refer to their respective documentation for more +information: + KWallet https://github.com/KDE/kwallet + pass https://www.passwordstore.org/ + +The pass backend requires GnuPG: https://gnupg.org/ + + +### Options + +``` + -h, --help help for keys + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) +* [zetacored keys ](zetacored_keys_.md) - +* [zetacored keys add](zetacored_keys_add.md) - Add an encrypted private key (either newly generated or recovered), encrypt it, and save to [name] file +* [zetacored keys delete](zetacored_keys_delete.md) - Delete the given keys +* [zetacored keys export](zetacored_keys_export.md) - Export private keys +* [zetacored keys import](zetacored_keys_import.md) - Import private keys into the local keybase +* [zetacored keys list](zetacored_keys_list.md) - List all keys +* [zetacored keys migrate](zetacored_keys_migrate.md) - Migrate keys from amino to proto serialization format +* [zetacored keys mnemonic](zetacored_keys_mnemonic.md) - Compute the bip39 mnemonic for some input entropy +* [zetacored keys parse](zetacored_keys_parse.md) - Parse address from hex to bech32 and vice versa +* [zetacored keys rename](zetacored_keys_rename.md) - Rename an existing key +* [zetacored keys show](zetacored_keys_show.md) - Retrieve key information by name or address +* [zetacored keys unsafe-export-eth-key](zetacored_keys_unsafe-export-eth-key.md) - **UNSAFE** Export an Ethereum private key +* [zetacored keys unsafe-import-eth-key](zetacored_keys_unsafe-import-eth-key.md) - **UNSAFE** Import Ethereum private keys into the local keybase + diff --git a/docs/cli/zetacored/zetacored_keys_.md b/docs/cli/zetacored/zetacored_keys_.md new file mode 100644 index 0000000000..cb72d3d3a6 --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_.md @@ -0,0 +1,30 @@ +# keys + + + +``` +zetacored keys [flags] +``` + +### Options + +``` + -h, --help help for this command +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_add.md b/docs/cli/zetacored/zetacored_keys_add.md new file mode 100644 index 0000000000..44e4b3d9cb --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_add.md @@ -0,0 +1,66 @@ +# keys add + +Add an encrypted private key (either newly generated or recovered), encrypt it, and save to [name] file + +### Synopsis + +Derive a new private key and encrypt to disk. +Optionally specify a BIP39 mnemonic, a BIP39 passphrase to further secure the mnemonic, +and a bip32 HD path to derive a specific account. The key will be stored under the given name +and encrypted with the given password. The only input that is required is the encryption password. + +If run with -i, it will prompt the user for BIP44 path, BIP39 mnemonic, and passphrase. +The flag --recover allows one to recover a key from a seed passphrase. +If run with --dry-run, a key would be generated (or recovered) but not stored to the +local keystore. +Use the --pubkey flag to add arbitrary public keys to the keystore for constructing +multisig transactions. + +You can create and store a multisig key by passing the list of key names stored in a keyring +and the minimum number of signatures required through --multisig-threshold. The keys are +sorted by address, unless the flag --nosort is set. +Example: + + keys add mymultisig --multisig "keyname1,keyname2,keyname3" --multisig-threshold 2 + + +``` +zetacored keys add [name] [flags] +``` + +### Options + +``` + --account uint32 Account number for HD derivation (less than equal 2147483647) + --algo string Key signing algorithm to generate keys for + --coin-type uint32 coin type number for HD derivation (default 118) + --dry-run Perform action, but don't add key to local keystore + --hd-path string Manual HD Path derivation (overrides BIP44 config) + -h, --help help for add + --index uint32 Address index number for HD derivation (less than equal 2147483647) + -i, --interactive Interactively prompt user for BIP39 passphrase and mnemonic + --ledger Store a local reference to a private key on a Ledger device + --multisig strings List of key names stored in keyring to construct a public legacy multisig key + --multisig-threshold int K out of N required signatures. For use in conjunction with --multisig (default 1) + --no-backup Don't print out seed phrase (if others are watching the terminal) + --nosort Keys passed to --multisig are taken in the order they're supplied + --pubkey string Parse a public key in JSON format and saves key info to [name] file. + --recover Provide seed phrase to recover existing key instead of creating +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_delete.md b/docs/cli/zetacored/zetacored_keys_delete.md new file mode 100644 index 0000000000..77e81a7c3c --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_delete.md @@ -0,0 +1,41 @@ +# keys delete + +Delete the given keys + +### Synopsis + +Delete keys from the Keybase backend. + +Note that removing offline or ledger keys will remove +only the public key references stored locally, i.e. +private keys stored in a ledger device cannot be deleted with the CLI. + + +``` +zetacored keys delete [name]... [flags] +``` + +### Options + +``` + -f, --force Remove the key unconditionally without asking for the passphrase. Deprecated. + -h, --help help for delete + -y, --yes Skip confirmation prompt when deleting offline or ledger key references +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_export.md b/docs/cli/zetacored/zetacored_keys_export.md new file mode 100644 index 0000000000..1326bafdf7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_export.md @@ -0,0 +1,43 @@ +# keys export + +Export private keys + +### Synopsis + +Export a private key from the local keyring in ASCII-armored encrypted format. + +When both the --unarmored-hex and --unsafe flags are selected, cryptographic +private key material is exported in an INSECURE fashion that is designed to +allow users to import their keys in hot wallets. This feature is for advanced +users only that are confident about how to handle private keys work and are +FULLY AWARE OF THE RISKS. If you are unsure, you may want to do some research +and export your keys in ASCII-armored encrypted format. + +``` +zetacored keys export [name] [flags] +``` + +### Options + +``` + -h, --help help for export + --unarmored-hex Export unarmored hex privkey. Requires --unsafe. + --unsafe Enable unsafe operations. This flag must be switched on along with all unsafe operation-specific options. +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_import.md b/docs/cli/zetacored/zetacored_keys_import.md new file mode 100644 index 0000000000..ef13052b24 --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_import.md @@ -0,0 +1,34 @@ +# keys import + +Import private keys into the local keybase + +### Synopsis + +Import a ASCII armored private key into the local keybase. + +``` +zetacored keys import [name] [keyfile] [flags] +``` + +### Options + +``` + -h, --help help for import +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_list.md b/docs/cli/zetacored/zetacored_keys_list.md new file mode 100644 index 0000000000..ebe4e311b2 --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_list.md @@ -0,0 +1,36 @@ +# keys list + +List all keys + +### Synopsis + +Return a list of all public keys stored by this key manager +along with their associated name and address. + +``` +zetacored keys list [flags] +``` + +### Options + +``` + -h, --help help for list + -n, --list-names List names only +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_migrate.md b/docs/cli/zetacored/zetacored_keys_migrate.md new file mode 100644 index 0000000000..eb870c13a5 --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_migrate.md @@ -0,0 +1,43 @@ +# keys migrate + +Migrate keys from amino to proto serialization format + +### Synopsis + +Migrate keys from Amino to Protocol Buffers records. +For each key material entry, the command will check if the key can be deserialized using proto. +If this is the case, the key is already migrated. Therefore, we skip it and continue with a next one. +Otherwise, we try to deserialize it using Amino into LegacyInfo. If this attempt is successful, we serialize +LegacyInfo to Protobuf serialization format and overwrite the keyring entry. If any error occurred, it will be +outputted in CLI and migration will be continued until all keys in the keyring DB are exhausted. +See https://github.com/cosmos/cosmos-sdk/pull/9695 for more details. + +It is recommended to run in 'dry-run' mode first to verify all key migration material. + + +``` +zetacored keys migrate [flags] +``` + +### Options + +``` + -h, --help help for migrate +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_mnemonic.md b/docs/cli/zetacored/zetacored_keys_mnemonic.md new file mode 100644 index 0000000000..090bd8242b --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_mnemonic.md @@ -0,0 +1,35 @@ +# keys mnemonic + +Compute the bip39 mnemonic for some input entropy + +### Synopsis + +Create a bip39 mnemonic, sometimes called a seed phrase, by reading from the system entropy. To pass your own entropy, use --unsafe-entropy + +``` +zetacored keys mnemonic [flags] +``` + +### Options + +``` + -h, --help help for mnemonic + --unsafe-entropy Prompt the user to supply their own entropy, instead of relying on the system +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_parse.md b/docs/cli/zetacored/zetacored_keys_parse.md new file mode 100644 index 0000000000..9d7f83a7de --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_parse.md @@ -0,0 +1,36 @@ +# keys parse + +Parse address from hex to bech32 and vice versa + +### Synopsis + +Convert and print to stdout key addresses and fingerprints from +hexadecimal into bech32 cosmos prefixed format and vice versa. + + +``` +zetacored keys parse [hex-or-bech32-address] [flags] +``` + +### Options + +``` + -h, --help help for parse +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_rename.md b/docs/cli/zetacored/zetacored_keys_rename.md new file mode 100644 index 0000000000..ea3533f4dd --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_rename.md @@ -0,0 +1,40 @@ +# keys rename + +Rename an existing key + +### Synopsis + +Rename a key from the Keybase backend. + +Note that renaming offline or ledger keys will rename +only the public key references stored locally, i.e. +private keys stored in a ledger device cannot be renamed with the CLI. + + +``` +zetacored keys rename [old_name] [new_name] [flags] +``` + +### Options + +``` + -h, --help help for rename + -y, --yes Skip confirmation prompt when renaming offline or ledger key references +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_show.md b/docs/cli/zetacored/zetacored_keys_show.md new file mode 100644 index 0000000000..a416702f9c --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_show.md @@ -0,0 +1,41 @@ +# keys show + +Retrieve key information by name or address + +### Synopsis + +Display keys details. If multiple names or addresses are provided, +then an ephemeral multisig key will be created under the name "multi" +consisting of all the keys provided by name and multisig threshold. + +``` +zetacored keys show [name_or_address [name_or_address...]] [flags] +``` + +### Options + +``` + -a, --address Output the address only (overrides --output) + --bech string The Bech32 prefix encoding for a key (acc|val|cons) + -d, --device Output the address in a ledger device + -h, --help help for show + --multisig-threshold int K out of N required signatures (default 1) + -p, --pubkey Output the public key only (overrides --output) +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_unsafe-export-eth-key.md b/docs/cli/zetacored/zetacored_keys_unsafe-export-eth-key.md new file mode 100644 index 0000000000..cfc8d6cfab --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_unsafe-export-eth-key.md @@ -0,0 +1,34 @@ +# keys unsafe-export-eth-key + +**UNSAFE** Export an Ethereum private key + +### Synopsis + +**UNSAFE** Export an Ethereum private key unencrypted to use in dev tooling + +``` +zetacored keys unsafe-export-eth-key [name] [flags] +``` + +### Options + +``` + -h, --help help for unsafe-export-eth-key +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_keys_unsafe-import-eth-key.md b/docs/cli/zetacored/zetacored_keys_unsafe-import-eth-key.md new file mode 100644 index 0000000000..0892d27a87 --- /dev/null +++ b/docs/cli/zetacored/zetacored_keys_unsafe-import-eth-key.md @@ -0,0 +1,34 @@ +# keys unsafe-import-eth-key + +**UNSAFE** Import Ethereum private keys into the local keybase + +### Synopsis + +**UNSAFE** Import a hex-encoded Ethereum private key into the local keybase. + +``` +zetacored keys unsafe-import-eth-key [name] [pk] [flags] +``` + +### Options + +``` + -h, --help help for unsafe-import-eth-key +``` + +### Options inherited from parent commands + +``` + --home string The application home directory + --keyring-backend string Select keyring's backend (os|file|test) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --output string Output format (text|json) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored keys](zetacored_keys.md) - Manage your application's keys + diff --git a/docs/cli/zetacored/zetacored_query.md b/docs/cli/zetacored/zetacored_query.md new file mode 100644 index 0000000000..c962a93bbf --- /dev/null +++ b/docs/cli/zetacored/zetacored_query.md @@ -0,0 +1,50 @@ +# query + +Querying subcommands + +``` +zetacored query [flags] +``` + +### Options + +``` + --chain-id string The network chain ID + -h, --help help for query +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) +* [zetacored query account](zetacored_query_account.md) - Query for account by address +* [zetacored query auth](zetacored_query_auth.md) - Querying commands for the auth module +* [zetacored query authz](zetacored_query_authz.md) - Querying commands for the authz module +* [zetacored query bank](zetacored_query_bank.md) - Querying commands for the bank module +* [zetacored query block](zetacored_query_block.md) - Get verified data for the block at given height +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module +* [zetacored query distribution](zetacored_query_distribution.md) - Querying commands for the distribution module +* [zetacored query emissions](zetacored_query_emissions.md) - Querying commands for the emissions module +* [zetacored query evidence](zetacored_query_evidence.md) - Query for evidence by hash or for all (paginated) submitted evidence +* [zetacored query evm](zetacored_query_evm.md) - Querying commands for the evm module +* [zetacored query feemarket](zetacored_query_feemarket.md) - Querying commands for the fee market module +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module +* [zetacored query params](zetacored_query_params.md) - Querying commands for the params module +* [zetacored query slashing](zetacored_query_slashing.md) - Querying commands for the slashing module +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module +* [zetacored query tendermint-validator-set](zetacored_query_tendermint-validator-set.md) - Get the full tendermint validator set at given height +* [zetacored query tx](zetacored_query_tx.md) - Query for a transaction by hash, "[addr]/[seq]" combination or comma-separated signatures in a committed block +* [zetacored query txs](zetacored_query_txs.md) - Query for paginated transactions that match a set of events +* [zetacored query upgrade](zetacored_query_upgrade.md) - Querying commands for the upgrade module + diff --git a/docs/cli/zetacored/zetacored_query_account.md b/docs/cli/zetacored/zetacored_query_account.md new file mode 100644 index 0000000000..e848bf4c6a --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_account.md @@ -0,0 +1,33 @@ +# query account + +Query for account by address + +``` +zetacored query account [address] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for account + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands + diff --git a/docs/cli/zetacored/zetacored_query_auth.md b/docs/cli/zetacored/zetacored_query_auth.md new file mode 100644 index 0000000000..46e34dd398 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_auth.md @@ -0,0 +1,34 @@ +# query auth + +Querying commands for the auth module + +``` +zetacored query auth [flags] +``` + +### Options + +``` + -h, --help help for auth +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query auth account](zetacored_query_auth_account.md) - Query for account by address +* [zetacored query auth accounts](zetacored_query_auth_accounts.md) - Query all the accounts +* [zetacored query auth address-by-acc-num](zetacored_query_auth_address-by-acc-num.md) - Query for an address by account number +* [zetacored query auth module-account](zetacored_query_auth_module-account.md) - Query module account info by module name +* [zetacored query auth module-accounts](zetacored_query_auth_module-accounts.md) - Query all module accounts +* [zetacored query auth params](zetacored_query_auth_params.md) - Query the current auth parameters + diff --git a/docs/cli/zetacored/zetacored_query_auth_account.md b/docs/cli/zetacored/zetacored_query_auth_account.md new file mode 100644 index 0000000000..79c205d568 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_auth_account.md @@ -0,0 +1,33 @@ +# query auth account + +Query for account by address + +``` +zetacored query auth account [address] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for account + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query auth](zetacored_query_auth.md) - Querying commands for the auth module + diff --git a/docs/cli/zetacored/zetacored_query_auth_accounts.md b/docs/cli/zetacored/zetacored_query_auth_accounts.md new file mode 100644 index 0000000000..089490512c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_auth_accounts.md @@ -0,0 +1,39 @@ +# query auth accounts + +Query all the accounts + +``` +zetacored query auth accounts [flags] +``` + +### Options + +``` + --count-total count total number of records in all-accounts to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for accounts + --limit uint pagination limit of all-accounts to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of all-accounts to query for + -o, --output string Output format (text|json) + --page uint pagination page of all-accounts to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of all-accounts to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query auth](zetacored_query_auth.md) - Querying commands for the auth module + diff --git a/docs/cli/zetacored/zetacored_query_auth_address-by-acc-num.md b/docs/cli/zetacored/zetacored_query_auth_address-by-acc-num.md new file mode 100644 index 0000000000..dd3b30c80b --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_auth_address-by-acc-num.md @@ -0,0 +1,39 @@ +# query auth address-by-acc-num + +Query for an address by account number + +``` +zetacored query auth address-by-acc-num [acc-num] [flags] +``` + +### Examples + +``` +zetacored q auth address-by-acc-num 1 +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for address-by-acc-num + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query auth](zetacored_query_auth.md) - Querying commands for the auth module + diff --git a/docs/cli/zetacored/zetacored_query_auth_module-account.md b/docs/cli/zetacored/zetacored_query_auth_module-account.md new file mode 100644 index 0000000000..5b55993855 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_auth_module-account.md @@ -0,0 +1,39 @@ +# query auth module-account + +Query module account info by module name + +``` +zetacored query auth module-account [module-name] [flags] +``` + +### Examples + +``` +zetacored q auth module-account auth +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for module-account + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query auth](zetacored_query_auth.md) - Querying commands for the auth module + diff --git a/docs/cli/zetacored/zetacored_query_auth_module-accounts.md b/docs/cli/zetacored/zetacored_query_auth_module-accounts.md new file mode 100644 index 0000000000..1cd402bc45 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_auth_module-accounts.md @@ -0,0 +1,33 @@ +# query auth module-accounts + +Query all module accounts + +``` +zetacored query auth module-accounts [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for module-accounts + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query auth](zetacored_query_auth.md) - Querying commands for the auth module + diff --git a/docs/cli/zetacored/zetacored_query_auth_params.md b/docs/cli/zetacored/zetacored_query_auth_params.md new file mode 100644 index 0000000000..da51b2af48 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_auth_params.md @@ -0,0 +1,39 @@ +# query auth params + +Query the current auth parameters + +### Synopsis + +Query the current auth parameters: + +$ zetacored query auth params + +``` +zetacored query auth params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query auth](zetacored_query_auth.md) - Querying commands for the auth module + diff --git a/docs/cli/zetacored/zetacored_query_authz.md b/docs/cli/zetacored/zetacored_query_authz.md new file mode 100644 index 0000000000..dce403e24e --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_authz.md @@ -0,0 +1,31 @@ +# query authz + +Querying commands for the authz module + +``` +zetacored query authz [flags] +``` + +### Options + +``` + -h, --help help for authz +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query authz grants](zetacored_query_authz_grants.md) - query grants for a granter-grantee pair and optionally a msg-type-url +* [zetacored query authz grants-by-grantee](zetacored_query_authz_grants-by-grantee.md) - query authorization grants granted to a grantee +* [zetacored query authz grants-by-granter](zetacored_query_authz_grants-by-granter.md) - query authorization grants granted by granter + diff --git a/docs/cli/zetacored/zetacored_query_authz_grants-by-grantee.md b/docs/cli/zetacored/zetacored_query_authz_grants-by-grantee.md new file mode 100644 index 0000000000..c00276bf85 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_authz_grants-by-grantee.md @@ -0,0 +1,45 @@ +# query authz grants-by-grantee + +query authorization grants granted to a grantee + +### Synopsis + +Query authorization grants granted to a grantee. +Examples: +$ zetacored q authz grants-by-grantee cosmos1skj.. + +``` +zetacored query authz grants-by-grantee [grantee-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in grantee-grants to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for grants-by-grantee + --limit uint pagination limit of grantee-grants to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of grantee-grants to query for + -o, --output string Output format (text|json) + --page uint pagination page of grantee-grants to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of grantee-grants to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query authz](zetacored_query_authz.md) - Querying commands for the authz module + diff --git a/docs/cli/zetacored/zetacored_query_authz_grants-by-granter.md b/docs/cli/zetacored/zetacored_query_authz_grants-by-granter.md new file mode 100644 index 0000000000..3d9490f7d9 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_authz_grants-by-granter.md @@ -0,0 +1,45 @@ +# query authz grants-by-granter + +query authorization grants granted by granter + +### Synopsis + +Query authorization grants granted by granter. +Examples: +$ zetacored q authz grants-by-granter cosmos1skj.. + +``` +zetacored query authz grants-by-granter [granter-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in granter-grants to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for grants-by-granter + --limit uint pagination limit of granter-grants to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of granter-grants to query for + -o, --output string Output format (text|json) + --page uint pagination page of granter-grants to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of granter-grants to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query authz](zetacored_query_authz.md) - Querying commands for the authz module + diff --git a/docs/cli/zetacored/zetacored_query_authz_grants.md b/docs/cli/zetacored/zetacored_query_authz_grants.md new file mode 100644 index 0000000000..060217e1c3 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_authz_grants.md @@ -0,0 +1,47 @@ +# query authz grants + +query grants for a granter-grantee pair and optionally a msg-type-url + +### Synopsis + +Query authorization grants for a granter-grantee pair. If msg-type-url +is set, it will select grants only for that msg type. +Examples: +$ zetacored query authz grants cosmos1skj.. cosmos1skjwj.. +$ zetacored query authz grants cosmos1skjw.. cosmos1skjwj.. /cosmos.bank.v1beta1.MsgSend + +``` +zetacored query authz grants [granter-addr] [grantee-addr] [msg-type-url]? [flags] +``` + +### Options + +``` + --count-total count total number of records in grants to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for grants + --limit uint pagination limit of grants to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of grants to query for + -o, --output string Output format (text|json) + --page uint pagination page of grants to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of grants to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query authz](zetacored_query_authz.md) - Querying commands for the authz module + diff --git a/docs/cli/zetacored/zetacored_query_bank.md b/docs/cli/zetacored/zetacored_query_bank.md new file mode 100644 index 0000000000..663651c3b3 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_bank.md @@ -0,0 +1,31 @@ +# query bank + +Querying commands for the bank module + +``` +zetacored query bank [flags] +``` + +### Options + +``` + -h, --help help for bank +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query bank balances](zetacored_query_bank_balances.md) - Query for account balances by address +* [zetacored query bank denom-metadata](zetacored_query_bank_denom-metadata.md) - Query the client metadata for coin denominations +* [zetacored query bank total](zetacored_query_bank_total.md) - Query the total supply of coins of the chain + diff --git a/docs/cli/zetacored/zetacored_query_bank_balances.md b/docs/cli/zetacored/zetacored_query_bank_balances.md new file mode 100644 index 0000000000..17960f4c3a --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_bank_balances.md @@ -0,0 +1,48 @@ +# query bank balances + +Query for account balances by address + +### Synopsis + +Query the total balance of an account or of a specific denomination. + +Example: + $ zetacored query bank balances [address] + $ zetacored query bank balances [address] --denom=[denom] + +``` +zetacored query bank balances [address] [flags] +``` + +### Options + +``` + --count-total count total number of records in all balances to query for + --denom string The specific balance denomination to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for balances + --limit uint pagination limit of all balances to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of all balances to query for + -o, --output string Output format (text|json) + --page uint pagination page of all balances to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of all balances to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query bank](zetacored_query_bank.md) - Querying commands for the bank module + diff --git a/docs/cli/zetacored/zetacored_query_bank_denom-metadata.md b/docs/cli/zetacored/zetacored_query_bank_denom-metadata.md new file mode 100644 index 0000000000..03a0737e73 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_bank_denom-metadata.md @@ -0,0 +1,45 @@ +# query bank denom-metadata + +Query the client metadata for coin denominations + +### Synopsis + +Query the client metadata for all the registered coin denominations + +Example: + To query for the client metadata of all coin denominations use: + $ zetacored query bank denom-metadata + +To query for the client metadata of a specific coin denomination use: + $ zetacored query bank denom-metadata --denom=[denom] + +``` +zetacored query bank denom-metadata [flags] +``` + +### Options + +``` + --denom string The specific denomination to query client metadata for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for denom-metadata + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query bank](zetacored_query_bank.md) - Querying commands for the bank module + diff --git a/docs/cli/zetacored/zetacored_query_bank_total.md b/docs/cli/zetacored/zetacored_query_bank_total.md new file mode 100644 index 0000000000..a8bf3d0f6e --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_bank_total.md @@ -0,0 +1,50 @@ +# query bank total + +Query the total supply of coins of the chain + +### Synopsis + +Query total supply of coins that are held by accounts in the chain. + +Example: + $ zetacored query bank total + +To query for the total supply of a specific coin denomination use: + $ zetacored query bank total --denom=[denom] + +``` +zetacored query bank total [flags] +``` + +### Options + +``` + --count-total count total number of records in all supply totals to query for + --denom string The specific balance denomination to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for total + --limit uint pagination limit of all supply totals to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of all supply totals to query for + -o, --output string Output format (text|json) + --page uint pagination page of all supply totals to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of all supply totals to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query bank](zetacored_query_bank.md) - Querying commands for the bank module + diff --git a/docs/cli/zetacored/zetacored_query_block.md b/docs/cli/zetacored/zetacored_query_block.md new file mode 100644 index 0000000000..ed4368c9b8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_block.md @@ -0,0 +1,29 @@ +# query block + +Get verified data for the block at given height + +``` +zetacored query block [height] [flags] +``` + +### Options + +``` + -h, --help help for block + -n, --node string Node to connect to +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands + diff --git a/docs/cli/zetacored/zetacored_query_crosschain.md b/docs/cli/zetacored/zetacored_query_crosschain.md new file mode 100644 index 0000000000..0ccdb37d15 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain.md @@ -0,0 +1,48 @@ +# query crosschain + +Querying commands for the crosschain module + +``` +zetacored query crosschain [flags] +``` + +### Options + +``` + -h, --help help for crosschain +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query crosschain get-tss-address](zetacored_query_crosschain_get-tss-address.md) - Query current tss address +* [zetacored query crosschain in-tx-hash-to-cctx-data](zetacored_query_crosschain_in-tx-hash-to-cctx-data.md) - query a cctx data from a in tx hash +* [zetacored query crosschain last-zeta-height](zetacored_query_crosschain_last-zeta-height.md) - Query last Zeta Height +* [zetacored query crosschain list-all-in-tx-trackers](zetacored_query_crosschain_list-all-in-tx-trackers.md) - shows all inTxTrackers +* [zetacored query crosschain list-cctx](zetacored_query_crosschain_list-cctx.md) - list all CCTX +* [zetacored query crosschain list-chain-nonces](zetacored_query_crosschain_list-chain-nonces.md) - list all chainNonces +* [zetacored query crosschain list-gas-price](zetacored_query_crosschain_list-gas-price.md) - list all gasPrice +* [zetacored query crosschain list-in-tx-hash-to-cctx](zetacored_query_crosschain_list-in-tx-hash-to-cctx.md) - list all inTxHashToCctx +* [zetacored query crosschain list-in-tx-tracker](zetacored_query_crosschain_list-in-tx-tracker.md) - shows a list of in tx tracker by chainId +* [zetacored query crosschain list-out-tx-tracker](zetacored_query_crosschain_list-out-tx-tracker.md) - list all OutTxTracker +* [zetacored query crosschain list-pending-cctx](zetacored_query_crosschain_list-pending-cctx.md) - shows pending CCTX +* [zetacored query crosschain list-pending-nonces](zetacored_query_crosschain_list-pending-nonces.md) - shows a chainNonces +* [zetacored query crosschain list-tss-history](zetacored_query_crosschain_list-tss-history.md) - show historical list of TSS +* [zetacored query crosschain params](zetacored_query_crosschain_params.md) - shows the parameters of the module +* [zetacored query crosschain show-cctx](zetacored_query_crosschain_show-cctx.md) - shows a CCTX +* [zetacored query crosschain show-chain-nonces](zetacored_query_crosschain_show-chain-nonces.md) - shows a chainNonces +* [zetacored query crosschain show-gas-price](zetacored_query_crosschain_show-gas-price.md) - shows a gasPrice +* [zetacored query crosschain show-in-tx-hash-to-cctx](zetacored_query_crosschain_show-in-tx-hash-to-cctx.md) - shows a inTxHashToCctx +* [zetacored query crosschain show-out-tx-tracker](zetacored_query_crosschain_show-out-tx-tracker.md) - shows a OutTxTracker +* [zetacored query crosschain show-tss](zetacored_query_crosschain_show-tss.md) - shows a TSS + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_get-tss-address.md b/docs/cli/zetacored/zetacored_query_crosschain_get-tss-address.md new file mode 100644 index 0000000000..b75dbc1079 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_get-tss-address.md @@ -0,0 +1,33 @@ +# query crosschain get-tss-address + +Query current tss address + +``` +zetacored query crosschain get-tss-address [tss-pubkey] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for get-tss-address + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_in-tx-hash-to-cctx-data.md b/docs/cli/zetacored/zetacored_query_crosschain_in-tx-hash-to-cctx-data.md new file mode 100644 index 0000000000..34d1c6b321 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_in-tx-hash-to-cctx-data.md @@ -0,0 +1,33 @@ +# query crosschain in-tx-hash-to-cctx-data + +query a cctx data from a in tx hash + +``` +zetacored query crosschain in-tx-hash-to-cctx-data [in-tx-hash] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for in-tx-hash-to-cctx-data + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_last-zeta-height.md b/docs/cli/zetacored/zetacored_query_crosschain_last-zeta-height.md new file mode 100644 index 0000000000..accc88a36a --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_last-zeta-height.md @@ -0,0 +1,33 @@ +# query crosschain last-zeta-height + +Query last Zeta Height + +``` +zetacored query crosschain last-zeta-height [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for last-zeta-height + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-all-in-tx-trackers.md b/docs/cli/zetacored/zetacored_query_crosschain_list-all-in-tx-trackers.md new file mode 100644 index 0000000000..6a195b1df4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-all-in-tx-trackers.md @@ -0,0 +1,33 @@ +# query crosschain list-all-in-tx-trackers + +shows all inTxTrackers + +``` +zetacored query crosschain list-all-in-tx-trackers [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-all-in-tx-trackers + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-cctx.md b/docs/cli/zetacored/zetacored_query_crosschain_list-cctx.md new file mode 100644 index 0000000000..c0d70a9ee8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-cctx.md @@ -0,0 +1,39 @@ +# query crosschain list-cctx + +list all CCTX + +``` +zetacored query crosschain list-cctx [flags] +``` + +### Options + +``` + --count-total count total number of records in list-cctx to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-cctx + --limit uint pagination limit of list-cctx to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-cctx to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-cctx to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-cctx to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-chain-nonces.md b/docs/cli/zetacored/zetacored_query_crosschain_list-chain-nonces.md new file mode 100644 index 0000000000..5fa031861b --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-chain-nonces.md @@ -0,0 +1,39 @@ +# query crosschain list-chain-nonces + +list all chainNonces + +``` +zetacored query crosschain list-chain-nonces [flags] +``` + +### Options + +``` + --count-total count total number of records in list-chain-nonces to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-chain-nonces + --limit uint pagination limit of list-chain-nonces to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-chain-nonces to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-chain-nonces to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-chain-nonces to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-gas-price.md b/docs/cli/zetacored/zetacored_query_crosschain_list-gas-price.md new file mode 100644 index 0000000000..5ff569c9d8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-gas-price.md @@ -0,0 +1,39 @@ +# query crosschain list-gas-price + +list all gasPrice + +``` +zetacored query crosschain list-gas-price [flags] +``` + +### Options + +``` + --count-total count total number of records in list-gas-price to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-gas-price + --limit uint pagination limit of list-gas-price to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-gas-price to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-gas-price to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-gas-price to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-hash-to-cctx.md b/docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-hash-to-cctx.md new file mode 100644 index 0000000000..35f5cc1696 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-hash-to-cctx.md @@ -0,0 +1,39 @@ +# query crosschain list-in-tx-hash-to-cctx + +list all inTxHashToCctx + +``` +zetacored query crosschain list-in-tx-hash-to-cctx [flags] +``` + +### Options + +``` + --count-total count total number of records in list-in-tx-hash-to-cctx to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-in-tx-hash-to-cctx + --limit uint pagination limit of list-in-tx-hash-to-cctx to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-in-tx-hash-to-cctx to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-in-tx-hash-to-cctx to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-in-tx-hash-to-cctx to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-tracker.md b/docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-tracker.md new file mode 100644 index 0000000000..89f2186de8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-in-tx-tracker.md @@ -0,0 +1,39 @@ +# query crosschain list-in-tx-tracker + +shows a list of in tx tracker by chainId + +``` +zetacored query crosschain list-in-tx-tracker [chainId] [flags] +``` + +### Options + +``` + --count-total count total number of records in list-in-tx-tracker [chainId] to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-in-tx-tracker + --limit uint pagination limit of list-in-tx-tracker [chainId] to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-in-tx-tracker [chainId] to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-in-tx-tracker [chainId] to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-in-tx-tracker [chainId] to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-out-tx-tracker.md b/docs/cli/zetacored/zetacored_query_crosschain_list-out-tx-tracker.md new file mode 100644 index 0000000000..a21ea726b5 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-out-tx-tracker.md @@ -0,0 +1,39 @@ +# query crosschain list-out-tx-tracker + +list all OutTxTracker + +``` +zetacored query crosschain list-out-tx-tracker [flags] +``` + +### Options + +``` + --count-total count total number of records in list-out-tx-tracker to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-out-tx-tracker + --limit uint pagination limit of list-out-tx-tracker to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-out-tx-tracker to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-out-tx-tracker to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-out-tx-tracker to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-pending-cctx.md b/docs/cli/zetacored/zetacored_query_crosschain_list-pending-cctx.md new file mode 100644 index 0000000000..3ac808d77c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-pending-cctx.md @@ -0,0 +1,33 @@ +# query crosschain list-pending-cctx + +shows pending CCTX + +``` +zetacored query crosschain list-pending-cctx [chain-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-pending-cctx + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-pending-nonces.md b/docs/cli/zetacored/zetacored_query_crosschain_list-pending-nonces.md new file mode 100644 index 0000000000..0e45b9d2c1 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-pending-nonces.md @@ -0,0 +1,33 @@ +# query crosschain list-pending-nonces + +shows a chainNonces + +``` +zetacored query crosschain list-pending-nonces [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-pending-nonces + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_list-tss-history.md b/docs/cli/zetacored/zetacored_query_crosschain_list-tss-history.md new file mode 100644 index 0000000000..47af816847 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_list-tss-history.md @@ -0,0 +1,33 @@ +# query crosschain list-tss-history + +show historical list of TSS + +``` +zetacored query crosschain list-tss-history [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-tss-history + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_params.md b/docs/cli/zetacored/zetacored_query_crosschain_params.md new file mode 100644 index 0000000000..e10e8cb5b1 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_params.md @@ -0,0 +1,33 @@ +# query crosschain params + +shows the parameters of the module + +``` +zetacored query crosschain params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_show-cctx.md b/docs/cli/zetacored/zetacored_query_crosschain_show-cctx.md new file mode 100644 index 0000000000..ff278e95a3 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_show-cctx.md @@ -0,0 +1,33 @@ +# query crosschain show-cctx + +shows a CCTX + +``` +zetacored query crosschain show-cctx [index] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-cctx + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_show-chain-nonces.md b/docs/cli/zetacored/zetacored_query_crosschain_show-chain-nonces.md new file mode 100644 index 0000000000..cca85f76cf --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_show-chain-nonces.md @@ -0,0 +1,33 @@ +# query crosschain show-chain-nonces + +shows a chainNonces + +``` +zetacored query crosschain show-chain-nonces [index] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-chain-nonces + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_show-gas-price.md b/docs/cli/zetacored/zetacored_query_crosschain_show-gas-price.md new file mode 100644 index 0000000000..4b34188eea --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_show-gas-price.md @@ -0,0 +1,33 @@ +# query crosschain show-gas-price + +shows a gasPrice + +``` +zetacored query crosschain show-gas-price [index] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-gas-price + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_show-in-tx-hash-to-cctx.md b/docs/cli/zetacored/zetacored_query_crosschain_show-in-tx-hash-to-cctx.md new file mode 100644 index 0000000000..75c2735dfe --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_show-in-tx-hash-to-cctx.md @@ -0,0 +1,33 @@ +# query crosschain show-in-tx-hash-to-cctx + +shows a inTxHashToCctx + +``` +zetacored query crosschain show-in-tx-hash-to-cctx [in-tx-hash] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-in-tx-hash-to-cctx + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_show-out-tx-tracker.md b/docs/cli/zetacored/zetacored_query_crosschain_show-out-tx-tracker.md new file mode 100644 index 0000000000..47786d54dd --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_show-out-tx-tracker.md @@ -0,0 +1,33 @@ +# query crosschain show-out-tx-tracker + +shows a OutTxTracker + +``` +zetacored query crosschain show-out-tx-tracker [chainId] [nonce] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-out-tx-tracker + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_crosschain_show-tss.md b/docs/cli/zetacored/zetacored_query_crosschain_show-tss.md new file mode 100644 index 0000000000..7fc0f687d3 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_crosschain_show-tss.md @@ -0,0 +1,33 @@ +# query crosschain show-tss + +shows a TSS + +``` +zetacored query crosschain show-tss [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-tss + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query crosschain](zetacored_query_crosschain.md) - Querying commands for the crosschain module + diff --git a/docs/cli/zetacored/zetacored_query_distribution.md b/docs/cli/zetacored/zetacored_query_distribution.md new file mode 100644 index 0000000000..2219cd5356 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_distribution.md @@ -0,0 +1,34 @@ +# query distribution + +Querying commands for the distribution module + +``` +zetacored query distribution [flags] +``` + +### Options + +``` + -h, --help help for distribution +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query distribution commission](zetacored_query_distribution_commission.md) - Query distribution validator commission +* [zetacored query distribution community-pool](zetacored_query_distribution_community-pool.md) - Query the amount of coins in the community pool +* [zetacored query distribution params](zetacored_query_distribution_params.md) - Query distribution params +* [zetacored query distribution rewards](zetacored_query_distribution_rewards.md) - Query all distribution delegator rewards or rewards from a particular validator +* [zetacored query distribution slashes](zetacored_query_distribution_slashes.md) - Query distribution validator slashes +* [zetacored query distribution validator-outstanding-rewards](zetacored_query_distribution_validator-outstanding-rewards.md) - Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations + diff --git a/docs/cli/zetacored/zetacored_query_distribution_commission.md b/docs/cli/zetacored/zetacored_query_distribution_commission.md new file mode 100644 index 0000000000..db12182e9a --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_distribution_commission.md @@ -0,0 +1,40 @@ +# query distribution commission + +Query distribution validator commission + +### Synopsis + +Query validator commission rewards from delegators to that validator. + +Example: +$ zetacored query distribution commission zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query distribution commission [validator] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for commission + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query distribution](zetacored_query_distribution.md) - Querying commands for the distribution module + diff --git a/docs/cli/zetacored/zetacored_query_distribution_community-pool.md b/docs/cli/zetacored/zetacored_query_distribution_community-pool.md new file mode 100644 index 0000000000..e3908f2cb6 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_distribution_community-pool.md @@ -0,0 +1,40 @@ +# query distribution community-pool + +Query the amount of coins in the community pool + +### Synopsis + +Query all coins in the community pool which is under Governance control. + +Example: +$ zetacored query distribution community-pool + +``` +zetacored query distribution community-pool [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for community-pool + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query distribution](zetacored_query_distribution.md) - Querying commands for the distribution module + diff --git a/docs/cli/zetacored/zetacored_query_distribution_params.md b/docs/cli/zetacored/zetacored_query_distribution_params.md new file mode 100644 index 0000000000..41fe2e1d9c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_distribution_params.md @@ -0,0 +1,33 @@ +# query distribution params + +Query distribution params + +``` +zetacored query distribution params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query distribution](zetacored_query_distribution.md) - Querying commands for the distribution module + diff --git a/docs/cli/zetacored/zetacored_query_distribution_rewards.md b/docs/cli/zetacored/zetacored_query_distribution_rewards.md new file mode 100644 index 0000000000..314fd0ac67 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_distribution_rewards.md @@ -0,0 +1,41 @@ +# query distribution rewards + +Query all distribution delegator rewards or rewards from a particular validator + +### Synopsis + +Query all rewards earned by a delegator, optionally restrict to rewards from a single validator. + +Example: +$ zetacored query distribution rewards zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p +$ zetacored query distribution rewards zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query distribution rewards [delegator-addr] [validator-addr] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for rewards + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query distribution](zetacored_query_distribution.md) - Querying commands for the distribution module + diff --git a/docs/cli/zetacored/zetacored_query_distribution_slashes.md b/docs/cli/zetacored/zetacored_query_distribution_slashes.md new file mode 100644 index 0000000000..376c9a9d10 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_distribution_slashes.md @@ -0,0 +1,46 @@ +# query distribution slashes + +Query distribution validator slashes + +### Synopsis + +Query all slashes of a validator for a given block range. + +Example: +$ zetacored query distribution slashes zetavalopervaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 0 100 + +``` +zetacored query distribution slashes [validator] [start-height] [end-height] [flags] +``` + +### Options + +``` + --count-total count total number of records in validator slashes to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for slashes + --limit uint pagination limit of validator slashes to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of validator slashes to query for + -o, --output string Output format (text|json) + --page uint pagination page of validator slashes to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of validator slashes to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query distribution](zetacored_query_distribution.md) - Querying commands for the distribution module + diff --git a/docs/cli/zetacored/zetacored_query_distribution_validator-outstanding-rewards.md b/docs/cli/zetacored/zetacored_query_distribution_validator-outstanding-rewards.md new file mode 100644 index 0000000000..37491de3c4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_distribution_validator-outstanding-rewards.md @@ -0,0 +1,40 @@ +# query distribution validator-outstanding-rewards + +Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations + +### Synopsis + +Query distribution outstanding (un-withdrawn) rewards for a validator and all their delegations. + +Example: +$ zetacored query distribution validator-outstanding-rewards zetavaloper1lwjmdnks33xwnmfayc64ycprww49n33mtm92ne + +``` +zetacored query distribution validator-outstanding-rewards [validator] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for validator-outstanding-rewards + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query distribution](zetacored_query_distribution.md) - Querying commands for the distribution module + diff --git a/docs/cli/zetacored/zetacored_query_emissions.md b/docs/cli/zetacored/zetacored_query_emissions.md new file mode 100644 index 0000000000..64c7d0962a --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_emissions.md @@ -0,0 +1,32 @@ +# query emissions + +Querying commands for the emissions module + +``` +zetacored query emissions [flags] +``` + +### Options + +``` + -h, --help help for emissions +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query emissions get-emmisons-factors](zetacored_query_emissions_get-emmisons-factors.md) - Query GetEmmisonsFactors +* [zetacored query emissions list-pool-addresses](zetacored_query_emissions_list-pool-addresses.md) - Query list-pool-addresses +* [zetacored query emissions params](zetacored_query_emissions_params.md) - shows the parameters of the module +* [zetacored query emissions show-available-emissions](zetacored_query_emissions_show-available-emissions.md) - Query show-available-emissions + diff --git a/docs/cli/zetacored/zetacored_query_emissions_get-emmisons-factors.md b/docs/cli/zetacored/zetacored_query_emissions_get-emmisons-factors.md new file mode 100644 index 0000000000..d6d7e50ded --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_emissions_get-emmisons-factors.md @@ -0,0 +1,33 @@ +# query emissions get-emmisons-factors + +Query GetEmmisonsFactors + +``` +zetacored query emissions get-emmisons-factors [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for get-emmisons-factors + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query emissions](zetacored_query_emissions.md) - Querying commands for the emissions module + diff --git a/docs/cli/zetacored/zetacored_query_emissions_list-pool-addresses.md b/docs/cli/zetacored/zetacored_query_emissions_list-pool-addresses.md new file mode 100644 index 0000000000..c7f6d128cb --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_emissions_list-pool-addresses.md @@ -0,0 +1,33 @@ +# query emissions list-pool-addresses + +Query list-pool-addresses + +``` +zetacored query emissions list-pool-addresses [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-pool-addresses + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query emissions](zetacored_query_emissions.md) - Querying commands for the emissions module + diff --git a/docs/cli/zetacored/zetacored_query_emissions_params.md b/docs/cli/zetacored/zetacored_query_emissions_params.md new file mode 100644 index 0000000000..8ed7ad6936 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_emissions_params.md @@ -0,0 +1,33 @@ +# query emissions params + +shows the parameters of the module + +``` +zetacored query emissions params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query emissions](zetacored_query_emissions.md) - Querying commands for the emissions module + diff --git a/docs/cli/zetacored/zetacored_query_emissions_show-available-emissions.md b/docs/cli/zetacored/zetacored_query_emissions_show-available-emissions.md new file mode 100644 index 0000000000..64298eb1cd --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_emissions_show-available-emissions.md @@ -0,0 +1,33 @@ +# query emissions show-available-emissions + +Query show-available-emissions + +``` +zetacored query emissions show-available-emissions [address] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-available-emissions + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query emissions](zetacored_query_emissions.md) - Querying commands for the emissions module + diff --git a/docs/cli/zetacored/zetacored_query_evidence.md b/docs/cli/zetacored/zetacored_query_evidence.md new file mode 100644 index 0000000000..6531727bfd --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_evidence.md @@ -0,0 +1,47 @@ +# query evidence + +Query for evidence by hash or for all (paginated) submitted evidence + +### Synopsis + +Query for specific submitted evidence by hash or query for all (paginated) evidence: + +Example: +$ zetacored query evidence DF0C23E8634E480F84B9D5674A7CDC9816466DEC28A3358F73260F68D28D7660 +$ zetacored query evidence --page=2 --limit=50 + +``` +zetacored query evidence [flags] +``` + +### Options + +``` + --count-total count total number of records in evidence to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for evidence + --limit uint pagination limit of evidence to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of evidence to query for + -o, --output string Output format (text|json) + --page uint pagination page of evidence to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of evidence to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands + diff --git a/docs/cli/zetacored/zetacored_query_evm.md b/docs/cli/zetacored/zetacored_query_evm.md new file mode 100644 index 0000000000..5ee6a1ba5c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_evm.md @@ -0,0 +1,31 @@ +# query evm + +Querying commands for the evm module + +``` +zetacored query evm [flags] +``` + +### Options + +``` + -h, --help help for evm +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query evm code](zetacored_query_evm_code.md) - Gets code from an account +* [zetacored query evm params](zetacored_query_evm_params.md) - Get the evm params +* [zetacored query evm storage](zetacored_query_evm_storage.md) - Gets storage for an account with a given key and height + diff --git a/docs/cli/zetacored/zetacored_query_evm_code.md b/docs/cli/zetacored/zetacored_query_evm_code.md new file mode 100644 index 0000000000..25db6243ac --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_evm_code.md @@ -0,0 +1,37 @@ +# query evm code + +Gets code from an account + +### Synopsis + +Gets code from an account. If the height is not provided, it will use the latest height from context. + +``` +zetacored query evm code ADDRESS [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for code + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query evm](zetacored_query_evm.md) - Querying commands for the evm module + diff --git a/docs/cli/zetacored/zetacored_query_evm_params.md b/docs/cli/zetacored/zetacored_query_evm_params.md new file mode 100644 index 0000000000..31792401a8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_evm_params.md @@ -0,0 +1,37 @@ +# query evm params + +Get the evm params + +### Synopsis + +Get the evm parameter values. + +``` +zetacored query evm params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query evm](zetacored_query_evm.md) - Querying commands for the evm module + diff --git a/docs/cli/zetacored/zetacored_query_evm_storage.md b/docs/cli/zetacored/zetacored_query_evm_storage.md new file mode 100644 index 0000000000..02e81bca0c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_evm_storage.md @@ -0,0 +1,37 @@ +# query evm storage + +Gets storage for an account with a given key and height + +### Synopsis + +Gets storage for an account with a given key and height. If the height is not provided, it will use the latest height from context. + +``` +zetacored query evm storage ADDRESS KEY [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for storage + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query evm](zetacored_query_evm.md) - Querying commands for the evm module + diff --git a/docs/cli/zetacored/zetacored_query_feemarket.md b/docs/cli/zetacored/zetacored_query_feemarket.md new file mode 100644 index 0000000000..142edf58a0 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_feemarket.md @@ -0,0 +1,31 @@ +# query feemarket + +Querying commands for the fee market module + +``` +zetacored query feemarket [flags] +``` + +### Options + +``` + -h, --help help for feemarket +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query feemarket base-fee](zetacored_query_feemarket_base-fee.md) - Get the base fee amount at a given block height +* [zetacored query feemarket block-gas](zetacored_query_feemarket_block-gas.md) - Get the block gas used at a given block height +* [zetacored query feemarket params](zetacored_query_feemarket_params.md) - Get the fee market params + diff --git a/docs/cli/zetacored/zetacored_query_feemarket_base-fee.md b/docs/cli/zetacored/zetacored_query_feemarket_base-fee.md new file mode 100644 index 0000000000..a6bfaafdf1 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_feemarket_base-fee.md @@ -0,0 +1,38 @@ +# query feemarket base-fee + +Get the base fee amount at a given block height + +### Synopsis + +Get the base fee amount at a given block height. +If the height is not provided, it will use the latest height from context. + +``` +zetacored query feemarket base-fee [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for base-fee + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query feemarket](zetacored_query_feemarket.md) - Querying commands for the fee market module + diff --git a/docs/cli/zetacored/zetacored_query_feemarket_block-gas.md b/docs/cli/zetacored/zetacored_query_feemarket_block-gas.md new file mode 100644 index 0000000000..8548a00cab --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_feemarket_block-gas.md @@ -0,0 +1,38 @@ +# query feemarket block-gas + +Get the block gas used at a given block height + +### Synopsis + +Get the block gas used at a given block height. +If the height is not provided, it will use the latest height from context + +``` +zetacored query feemarket block-gas [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for block-gas + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query feemarket](zetacored_query_feemarket.md) - Querying commands for the fee market module + diff --git a/docs/cli/zetacored/zetacored_query_feemarket_params.md b/docs/cli/zetacored/zetacored_query_feemarket_params.md new file mode 100644 index 0000000000..35805cb5be --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_feemarket_params.md @@ -0,0 +1,37 @@ +# query feemarket params + +Get the fee market params + +### Synopsis + +Get the fee market parameter values. + +``` +zetacored query feemarket params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query feemarket](zetacored_query_feemarket.md) - Querying commands for the fee market module + diff --git a/docs/cli/zetacored/zetacored_query_fungible.md b/docs/cli/zetacored/zetacored_query_fungible.md new file mode 100644 index 0000000000..284cd10e17 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible.md @@ -0,0 +1,35 @@ +# query fungible + +Querying commands for the fungible module + +``` +zetacored query fungible [flags] +``` + +### Options + +``` + -h, --help help for fungible +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query fungible gas-stability-pool-address](zetacored_query_fungible_gas-stability-pool-address.md) - query the address of a gas stability pool +* [zetacored query fungible gas-stability-pool-balance](zetacored_query_fungible_gas-stability-pool-balance.md) - query the balance of a gas stability pool for a chain +* [zetacored query fungible gas-stability-pool-balances](zetacored_query_fungible_gas-stability-pool-balances.md) - query all gas stability pool balances +* [zetacored query fungible list-foreign-coins](zetacored_query_fungible_list-foreign-coins.md) - list all ForeignCoins +* [zetacored query fungible params](zetacored_query_fungible_params.md) - shows the parameters of the module +* [zetacored query fungible show-foreign-coins](zetacored_query_fungible_show-foreign-coins.md) - shows a ForeignCoins +* [zetacored query fungible system-contract](zetacored_query_fungible_system-contract.md) - query system contract + diff --git a/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-address.md b/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-address.md new file mode 100644 index 0000000000..0ac34a6d09 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-address.md @@ -0,0 +1,39 @@ +# query fungible gas-stability-pool-address + +query the address of a gas stability pool + +``` +zetacored query fungible gas-stability-pool-address [flags] +``` + +### Options + +``` + --count-total count total number of records in gas-stability-pool-address to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for gas-stability-pool-address + --limit uint pagination limit of gas-stability-pool-address to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of gas-stability-pool-address to query for + -o, --output string Output format (text|json) + --page uint pagination page of gas-stability-pool-address to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of gas-stability-pool-address to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module + diff --git a/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balance.md b/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balance.md new file mode 100644 index 0000000000..b8afb756f7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balance.md @@ -0,0 +1,39 @@ +# query fungible gas-stability-pool-balance + +query the balance of a gas stability pool for a chain + +``` +zetacored query fungible gas-stability-pool-balance [chain-id] [flags] +``` + +### Options + +``` + --count-total count total number of records in gas-stability-pool-balance [chain-id] to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for gas-stability-pool-balance + --limit uint pagination limit of gas-stability-pool-balance [chain-id] to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of gas-stability-pool-balance [chain-id] to query for + -o, --output string Output format (text|json) + --page uint pagination page of gas-stability-pool-balance [chain-id] to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of gas-stability-pool-balance [chain-id] to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module + diff --git a/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balances.md b/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balances.md new file mode 100644 index 0000000000..43cdc1bf67 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible_gas-stability-pool-balances.md @@ -0,0 +1,39 @@ +# query fungible gas-stability-pool-balances + +query all gas stability pool balances + +``` +zetacored query fungible gas-stability-pool-balances [flags] +``` + +### Options + +``` + --count-total count total number of records in gas-stability-pool-balances to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for gas-stability-pool-balances + --limit uint pagination limit of gas-stability-pool-balances to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of gas-stability-pool-balances to query for + -o, --output string Output format (text|json) + --page uint pagination page of gas-stability-pool-balances to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of gas-stability-pool-balances to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module + diff --git a/docs/cli/zetacored/zetacored_query_fungible_list-foreign-coins.md b/docs/cli/zetacored/zetacored_query_fungible_list-foreign-coins.md new file mode 100644 index 0000000000..2a5f6a3809 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible_list-foreign-coins.md @@ -0,0 +1,39 @@ +# query fungible list-foreign-coins + +list all ForeignCoins + +``` +zetacored query fungible list-foreign-coins [flags] +``` + +### Options + +``` + --count-total count total number of records in list-foreign-coins to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-foreign-coins + --limit uint pagination limit of list-foreign-coins to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-foreign-coins to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-foreign-coins to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-foreign-coins to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module + diff --git a/docs/cli/zetacored/zetacored_query_fungible_params.md b/docs/cli/zetacored/zetacored_query_fungible_params.md new file mode 100644 index 0000000000..9845c39cf3 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible_params.md @@ -0,0 +1,33 @@ +# query fungible params + +shows the parameters of the module + +``` +zetacored query fungible params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module + diff --git a/docs/cli/zetacored/zetacored_query_fungible_show-foreign-coins.md b/docs/cli/zetacored/zetacored_query_fungible_show-foreign-coins.md new file mode 100644 index 0000000000..8bb0ff9d70 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible_show-foreign-coins.md @@ -0,0 +1,33 @@ +# query fungible show-foreign-coins + +shows a ForeignCoins + +``` +zetacored query fungible show-foreign-coins [index] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-foreign-coins + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module + diff --git a/docs/cli/zetacored/zetacored_query_fungible_system-contract.md b/docs/cli/zetacored/zetacored_query_fungible_system-contract.md new file mode 100644 index 0000000000..f31b40e493 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_fungible_system-contract.md @@ -0,0 +1,33 @@ +# query fungible system-contract + +query system contract + +``` +zetacored query fungible system-contract [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for system-contract + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query fungible](zetacored_query_fungible.md) - Querying commands for the fungible module + diff --git a/docs/cli/zetacored/zetacored_query_gov.md b/docs/cli/zetacored/zetacored_query_gov.md new file mode 100644 index 0000000000..9ab0a1b9de --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov.md @@ -0,0 +1,38 @@ +# query gov + +Querying commands for the governance module + +``` +zetacored query gov [flags] +``` + +### Options + +``` + -h, --help help for gov +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query gov deposit](zetacored_query_gov_deposit.md) - Query details of a deposit +* [zetacored query gov deposits](zetacored_query_gov_deposits.md) - Query deposits on a proposal +* [zetacored query gov param](zetacored_query_gov_param.md) - Query the parameters (voting|tallying|deposit) of the governance process +* [zetacored query gov params](zetacored_query_gov_params.md) - Query the parameters of the governance process +* [zetacored query gov proposal](zetacored_query_gov_proposal.md) - Query details of a single proposal +* [zetacored query gov proposals](zetacored_query_gov_proposals.md) - Query proposals with optional filters +* [zetacored query gov proposer](zetacored_query_gov_proposer.md) - Query the proposer of a governance proposal +* [zetacored query gov tally](zetacored_query_gov_tally.md) - Get the tally of a proposal vote +* [zetacored query gov vote](zetacored_query_gov_vote.md) - Query details of a single vote +* [zetacored query gov votes](zetacored_query_gov_votes.md) - Query votes on a proposal + diff --git a/docs/cli/zetacored/zetacored_query_gov_deposit.md b/docs/cli/zetacored/zetacored_query_gov_deposit.md new file mode 100644 index 0000000000..e1be829fdf --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_deposit.md @@ -0,0 +1,40 @@ +# query gov deposit + +Query details of a deposit + +### Synopsis + +Query details for a single proposal deposit on a proposal by its identifier. + +Example: +$ zetacored query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk + +``` +zetacored query gov deposit [proposal-id] [depositer-addr] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for deposit + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_deposits.md b/docs/cli/zetacored/zetacored_query_gov_deposits.md new file mode 100644 index 0000000000..b9b0187caa --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_deposits.md @@ -0,0 +1,47 @@ +# query gov deposits + +Query deposits on a proposal + +### Synopsis + +Query details for all deposits on a proposal. +You can find the proposal-id by running "zetacored query gov proposals". + +Example: +$ zetacored query gov deposits 1 + +``` +zetacored query gov deposits [proposal-id] [flags] +``` + +### Options + +``` + --count-total count total number of records in deposits to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for deposits + --limit uint pagination limit of deposits to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of deposits to query for + -o, --output string Output format (text|json) + --page uint pagination page of deposits to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of deposits to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_param.md b/docs/cli/zetacored/zetacored_query_gov_param.md new file mode 100644 index 0000000000..da4d57003c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_param.md @@ -0,0 +1,42 @@ +# query gov param + +Query the parameters (voting|tallying|deposit) of the governance process + +### Synopsis + +Query the all the parameters for the governance process. + +Example: +$ zetacored query gov param voting +$ zetacored query gov param tallying +$ zetacored query gov param deposit + +``` +zetacored query gov param [param-type] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for param + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_params.md b/docs/cli/zetacored/zetacored_query_gov_params.md new file mode 100644 index 0000000000..216da703cb --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_params.md @@ -0,0 +1,40 @@ +# query gov params + +Query the parameters of the governance process + +### Synopsis + +Query the all the parameters for the governance process. + +Example: +$ zetacored query gov params + +``` +zetacored query gov params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_proposal.md b/docs/cli/zetacored/zetacored_query_gov_proposal.md new file mode 100644 index 0000000000..65c7caf733 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_proposal.md @@ -0,0 +1,41 @@ +# query gov proposal + +Query details of a single proposal + +### Synopsis + +Query details for a proposal. You can find the +proposal-id by running "zetacored query gov proposals". + +Example: +$ zetacored query gov proposal 1 + +``` +zetacored query gov proposal [proposal-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for proposal + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_proposals.md b/docs/cli/zetacored/zetacored_query_gov_proposals.md new file mode 100644 index 0000000000..ac78a2fe00 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_proposals.md @@ -0,0 +1,52 @@ +# query gov proposals + +Query proposals with optional filters + +### Synopsis + +Query for a all paginated proposals that match optional filters: + +Example: +$ zetacored query gov proposals --depositor cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +$ zetacored query gov proposals --voter cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk +$ zetacored query gov proposals --status (DepositPeriod|VotingPeriod|Passed|Rejected) +$ zetacored query gov proposals --page=2 --limit=100 + +``` +zetacored query gov proposals [flags] +``` + +### Options + +``` + --count-total count total number of records in proposals to query for + --depositor string (optional) filter by proposals deposited on by depositor + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for proposals + --limit uint pagination limit of proposals to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of proposals to query for + -o, --output string Output format (text|json) + --page uint pagination page of proposals to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of proposals to query for + --reverse results are sorted in descending order + --status string (optional) filter proposals by proposal status, status: deposit_period/voting_period/passed/rejected + --voter string (optional) filter by proposals voted on by voted +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_proposer.md b/docs/cli/zetacored/zetacored_query_gov_proposer.md new file mode 100644 index 0000000000..95e67f8e35 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_proposer.md @@ -0,0 +1,40 @@ +# query gov proposer + +Query the proposer of a governance proposal + +### Synopsis + +Query which address proposed a proposal with a given ID. + +Example: +$ zetacored query gov proposer 1 + +``` +zetacored query gov proposer [proposal-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for proposer + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_tally.md b/docs/cli/zetacored/zetacored_query_gov_tally.md new file mode 100644 index 0000000000..61194cbdf4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_tally.md @@ -0,0 +1,41 @@ +# query gov tally + +Get the tally of a proposal vote + +### Synopsis + +Query tally of votes on a proposal. You can find +the proposal-id by running "zetacored query gov proposals". + +Example: +$ zetacored query gov tally 1 + +``` +zetacored query gov tally [proposal-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for tally + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_vote.md b/docs/cli/zetacored/zetacored_query_gov_vote.md new file mode 100644 index 0000000000..804d6d211c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_vote.md @@ -0,0 +1,40 @@ +# query gov vote + +Query details of a single vote + +### Synopsis + +Query details for a single vote on a proposal given its identifier. + +Example: +$ zetacored query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk + +``` +zetacored query gov vote [proposal-id] [voter-addr] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for vote + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_gov_votes.md b/docs/cli/zetacored/zetacored_query_gov_votes.md new file mode 100644 index 0000000000..7db7631f74 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_gov_votes.md @@ -0,0 +1,47 @@ +# query gov votes + +Query votes on a proposal + +### Synopsis + +Query vote details for a single proposal by its identifier. + +Example: +$ zetacored query gov votes 1 +$ zetacored query gov votes 1 --page=2 --limit=100 + +``` +zetacored query gov votes [proposal-id] [flags] +``` + +### Options + +``` + --count-total count total number of records in votes to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for votes + --limit uint pagination limit of votes to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of votes to query for + -o, --output string Output format (text|json) + --page uint pagination page of votes to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of votes to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query gov](zetacored_query_gov.md) - Querying commands for the governance module + diff --git a/docs/cli/zetacored/zetacored_query_group.md b/docs/cli/zetacored/zetacored_query_group.md new file mode 100644 index 0000000000..4d997aad4d --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group.md @@ -0,0 +1,42 @@ +# query group + +Querying commands for the group module + +``` +zetacored query group [flags] +``` + +### Options + +``` + -h, --help help for group +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query group group-info](zetacored_query_group_group-info.md) - Query for group info by group id +* [zetacored query group group-members](zetacored_query_group_group-members.md) - Query for group members by group id with pagination flags +* [zetacored query group group-policies-by-admin](zetacored_query_group_group-policies-by-admin.md) - Query for group policies by admin account address with pagination flags +* [zetacored query group group-policies-by-group](zetacored_query_group_group-policies-by-group.md) - Query for group policies by group id with pagination flags +* [zetacored query group group-policy-info](zetacored_query_group_group-policy-info.md) - Query for group policy info by account address of group policy +* [zetacored query group groups](zetacored_query_group_groups.md) - Query for groups present in the state +* [zetacored query group groups-by-admin](zetacored_query_group_groups-by-admin.md) - Query for groups by admin account address with pagination flags +* [zetacored query group groups-by-member](zetacored_query_group_groups-by-member.md) - Query for groups by member address with pagination flags +* [zetacored query group proposal](zetacored_query_group_proposal.md) - Query for proposal by id +* [zetacored query group proposals-by-group-policy](zetacored_query_group_proposals-by-group-policy.md) - Query for proposals by account address of group policy with pagination flags +* [zetacored query group tally-result](zetacored_query_group_tally-result.md) - Query tally result of proposal +* [zetacored query group vote](zetacored_query_group_vote.md) - Query for vote by proposal id and voter account address +* [zetacored query group votes-by-proposal](zetacored_query_group_votes-by-proposal.md) - Query for votes by proposal id with pagination flags +* [zetacored query group votes-by-voter](zetacored_query_group_votes-by-voter.md) - Query for votes by voter account address with pagination flags + diff --git a/docs/cli/zetacored/zetacored_query_group_group-info.md b/docs/cli/zetacored/zetacored_query_group_group-info.md new file mode 100644 index 0000000000..ba8ebee597 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_group-info.md @@ -0,0 +1,33 @@ +# query group group-info + +Query for group info by group id + +``` +zetacored query group group-info [id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for group-info + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_group-members.md b/docs/cli/zetacored/zetacored_query_group_group-members.md new file mode 100644 index 0000000000..598b879f5a --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_group-members.md @@ -0,0 +1,33 @@ +# query group group-members + +Query for group members by group id with pagination flags + +``` +zetacored query group group-members [id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for group-members + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_group-policies-by-admin.md b/docs/cli/zetacored/zetacored_query_group_group-policies-by-admin.md new file mode 100644 index 0000000000..ac0c3806eb --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_group-policies-by-admin.md @@ -0,0 +1,33 @@ +# query group group-policies-by-admin + +Query for group policies by admin account address with pagination flags + +``` +zetacored query group group-policies-by-admin [admin] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for group-policies-by-admin + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_group-policies-by-group.md b/docs/cli/zetacored/zetacored_query_group_group-policies-by-group.md new file mode 100644 index 0000000000..fd154d8be8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_group-policies-by-group.md @@ -0,0 +1,33 @@ +# query group group-policies-by-group + +Query for group policies by group id with pagination flags + +``` +zetacored query group group-policies-by-group [group-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for group-policies-by-group + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_group-policy-info.md b/docs/cli/zetacored/zetacored_query_group_group-policy-info.md new file mode 100644 index 0000000000..25c9619178 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_group-policy-info.md @@ -0,0 +1,33 @@ +# query group group-policy-info + +Query for group policy info by account address of group policy + +``` +zetacored query group group-policy-info [group-policy-account] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for group-policy-info + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_groups-by-admin.md b/docs/cli/zetacored/zetacored_query_group_groups-by-admin.md new file mode 100644 index 0000000000..8914583fd5 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_groups-by-admin.md @@ -0,0 +1,33 @@ +# query group groups-by-admin + +Query for groups by admin account address with pagination flags + +``` +zetacored query group groups-by-admin [admin] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for groups-by-admin + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_groups-by-member.md b/docs/cli/zetacored/zetacored_query_group_groups-by-member.md new file mode 100644 index 0000000000..deb8387c71 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_groups-by-member.md @@ -0,0 +1,39 @@ +# query group groups-by-member + +Query for groups by member address with pagination flags + +``` +zetacored query group groups-by-member [address] [flags] +``` + +### Options + +``` + --count-total count total number of records in groups-by-members to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for groups-by-member + --limit uint pagination limit of groups-by-members to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of groups-by-members to query for + -o, --output string Output format (text|json) + --page uint pagination page of groups-by-members to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of groups-by-members to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_groups.md b/docs/cli/zetacored/zetacored_query_group_groups.md new file mode 100644 index 0000000000..a629b9d5c7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_groups.md @@ -0,0 +1,39 @@ +# query group groups + +Query for groups present in the state + +``` +zetacored query group groups [flags] +``` + +### Options + +``` + --count-total count total number of records in groups to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for groups + --limit uint pagination limit of groups to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of groups to query for + -o, --output string Output format (text|json) + --page uint pagination page of groups to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of groups to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_proposal.md b/docs/cli/zetacored/zetacored_query_group_proposal.md new file mode 100644 index 0000000000..d072cd1a85 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_proposal.md @@ -0,0 +1,33 @@ +# query group proposal + +Query for proposal by id + +``` +zetacored query group proposal [id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for proposal + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_proposals-by-group-policy.md b/docs/cli/zetacored/zetacored_query_group_proposals-by-group-policy.md new file mode 100644 index 0000000000..0a2ee4cb1d --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_proposals-by-group-policy.md @@ -0,0 +1,33 @@ +# query group proposals-by-group-policy + +Query for proposals by account address of group policy with pagination flags + +``` +zetacored query group proposals-by-group-policy [group-policy-account] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for proposals-by-group-policy + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_tally-result.md b/docs/cli/zetacored/zetacored_query_group_tally-result.md new file mode 100644 index 0000000000..cd9354baf1 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_tally-result.md @@ -0,0 +1,33 @@ +# query group tally-result + +Query tally result of proposal + +``` +zetacored query group tally-result [proposal-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for tally-result + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_vote.md b/docs/cli/zetacored/zetacored_query_group_vote.md new file mode 100644 index 0000000000..3e406df08b --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_vote.md @@ -0,0 +1,33 @@ +# query group vote + +Query for vote by proposal id and voter account address + +``` +zetacored query group vote [proposal-id] [voter] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for vote + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_votes-by-proposal.md b/docs/cli/zetacored/zetacored_query_group_votes-by-proposal.md new file mode 100644 index 0000000000..9a1fcc82d0 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_votes-by-proposal.md @@ -0,0 +1,33 @@ +# query group votes-by-proposal + +Query for votes by proposal id with pagination flags + +``` +zetacored query group votes-by-proposal [proposal-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for votes-by-proposal + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_group_votes-by-voter.md b/docs/cli/zetacored/zetacored_query_group_votes-by-voter.md new file mode 100644 index 0000000000..13e84dde9b --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_group_votes-by-voter.md @@ -0,0 +1,33 @@ +# query group votes-by-voter + +Query for votes by voter account address with pagination flags + +``` +zetacored query group votes-by-voter [voter] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for votes-by-voter + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query group](zetacored_query_group.md) - Querying commands for the group module + diff --git a/docs/cli/zetacored/zetacored_query_observer.md b/docs/cli/zetacored/zetacored_query_observer.md new file mode 100644 index 0000000000..609b81f31f --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer.md @@ -0,0 +1,43 @@ +# query observer + +Querying commands for the observer module + +``` +zetacored query observer [flags] +``` + +### Options + +``` + -h, --help help for observer +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query observer list-blame](zetacored_query_observer_list-blame.md) - Query AllBlameRecords +* [zetacored query observer list-blame-by-msg](zetacored_query_observer_list-blame-by-msg.md) - Query AllBlameRecords +* [zetacored query observer list-chains](zetacored_query_observer_list-chains.md) - list all SupportedChains +* [zetacored query observer list-core-params](zetacored_query_observer_list-core-params.md) - Query GetCoreParams +* [zetacored query observer list-node-account](zetacored_query_observer_list-node-account.md) - list all NodeAccount +* [zetacored query observer list-observer](zetacored_query_observer_list-observer.md) - Query All Observer Mappers +* [zetacored query observer params](zetacored_query_observer_params.md) - shows the parameters of the module +* [zetacored query observer show-ballot](zetacored_query_observer_show-ballot.md) - Query BallotByIdentifier +* [zetacored query observer show-blame](zetacored_query_observer_show-blame.md) - Query BlameByIdentifier +* [zetacored query observer show-core-params](zetacored_query_observer_show-core-params.md) - Query GetCoreParamsForChain +* [zetacored query observer show-crosschain-flags](zetacored_query_observer_show-crosschain-flags.md) - shows the crosschain flags +* [zetacored query observer show-keygen](zetacored_query_observer_show-keygen.md) - shows keygen +* [zetacored query observer show-node-account](zetacored_query_observer_show-node-account.md) - shows a NodeAccount +* [zetacored query observer show-observer](zetacored_query_observer_show-observer.md) - Query ObserversByChainAndType , Use common.chain for querying +* [zetacored query observer show-observer-count](zetacored_query_observer_show-observer-count.md) - Query show-observer-count + diff --git a/docs/cli/zetacored/zetacored_query_observer_list-blame-by-msg.md b/docs/cli/zetacored/zetacored_query_observer_list-blame-by-msg.md new file mode 100644 index 0000000000..3a62fba6c2 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_list-blame-by-msg.md @@ -0,0 +1,33 @@ +# query observer list-blame-by-msg + +Query AllBlameRecords + +``` +zetacored query observer list-blame-by-msg [chainId] [nonce] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-blame-by-msg + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_list-blame.md b/docs/cli/zetacored/zetacored_query_observer_list-blame.md new file mode 100644 index 0000000000..3cb99f2d0f --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_list-blame.md @@ -0,0 +1,33 @@ +# query observer list-blame + +Query AllBlameRecords + +``` +zetacored query observer list-blame [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-blame + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_list-chains.md b/docs/cli/zetacored/zetacored_query_observer_list-chains.md new file mode 100644 index 0000000000..0af9244e29 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_list-chains.md @@ -0,0 +1,39 @@ +# query observer list-chains + +list all SupportedChains + +``` +zetacored query observer list-chains [flags] +``` + +### Options + +``` + --count-total count total number of records in list-chains to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-chains + --limit uint pagination limit of list-chains to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-chains to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-chains to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-chains to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_list-core-params.md b/docs/cli/zetacored/zetacored_query_observer_list-core-params.md new file mode 100644 index 0000000000..4375476625 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_list-core-params.md @@ -0,0 +1,33 @@ +# query observer list-core-params + +Query GetCoreParams + +``` +zetacored query observer list-core-params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-core-params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_list-node-account.md b/docs/cli/zetacored/zetacored_query_observer_list-node-account.md new file mode 100644 index 0000000000..4908b58223 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_list-node-account.md @@ -0,0 +1,39 @@ +# query observer list-node-account + +list all NodeAccount + +``` +zetacored query observer list-node-account [flags] +``` + +### Options + +``` + --count-total count total number of records in list-node-account to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-node-account + --limit uint pagination limit of list-node-account to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of list-node-account to query for + -o, --output string Output format (text|json) + --page uint pagination page of list-node-account to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of list-node-account to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_list-observer.md b/docs/cli/zetacored/zetacored_query_observer_list-observer.md new file mode 100644 index 0000000000..55e179fcdd --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_list-observer.md @@ -0,0 +1,33 @@ +# query observer list-observer + +Query All Observer Mappers + +``` +zetacored query observer list-observer [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for list-observer + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_params.md b/docs/cli/zetacored/zetacored_query_observer_params.md new file mode 100644 index 0000000000..96f5f2eca1 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_params.md @@ -0,0 +1,33 @@ +# query observer params + +shows the parameters of the module + +``` +zetacored query observer params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-ballot.md b/docs/cli/zetacored/zetacored_query_observer_show-ballot.md new file mode 100644 index 0000000000..40451e655b --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-ballot.md @@ -0,0 +1,33 @@ +# query observer show-ballot + +Query BallotByIdentifier + +``` +zetacored query observer show-ballot [ballot-identifier] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-ballot + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-blame.md b/docs/cli/zetacored/zetacored_query_observer_show-blame.md new file mode 100644 index 0000000000..61b1b08b9f --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-blame.md @@ -0,0 +1,33 @@ +# query observer show-blame + +Query BlameByIdentifier + +``` +zetacored query observer show-blame [blame-identifier] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-blame + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-core-params.md b/docs/cli/zetacored/zetacored_query_observer_show-core-params.md new file mode 100644 index 0000000000..ea5651d15e --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-core-params.md @@ -0,0 +1,33 @@ +# query observer show-core-params + +Query GetCoreParamsForChain + +``` +zetacored query observer show-core-params [chain-id] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-core-params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-crosschain-flags.md b/docs/cli/zetacored/zetacored_query_observer_show-crosschain-flags.md new file mode 100644 index 0000000000..bd46be73ad --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-crosschain-flags.md @@ -0,0 +1,33 @@ +# query observer show-crosschain-flags + +shows the crosschain flags + +``` +zetacored query observer show-crosschain-flags [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-crosschain-flags + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-keygen.md b/docs/cli/zetacored/zetacored_query_observer_show-keygen.md new file mode 100644 index 0000000000..96118f90c5 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-keygen.md @@ -0,0 +1,33 @@ +# query observer show-keygen + +shows keygen + +``` +zetacored query observer show-keygen [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-keygen + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-node-account.md b/docs/cli/zetacored/zetacored_query_observer_show-node-account.md new file mode 100644 index 0000000000..673a341b36 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-node-account.md @@ -0,0 +1,33 @@ +# query observer show-node-account + +shows a NodeAccount + +``` +zetacored query observer show-node-account [index] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-node-account + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-observer-count.md b/docs/cli/zetacored/zetacored_query_observer_show-observer-count.md new file mode 100644 index 0000000000..abad040a54 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-observer-count.md @@ -0,0 +1,33 @@ +# query observer show-observer-count + +Query show-observer-count + +``` +zetacored query observer show-observer-count [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-observer-count + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_observer_show-observer.md b/docs/cli/zetacored/zetacored_query_observer_show-observer.md new file mode 100644 index 0000000000..decc06cd60 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_observer_show-observer.md @@ -0,0 +1,33 @@ +# query observer show-observer + +Query ObserversByChainAndType , Use common.chain for querying + +``` +zetacored query observer show-observer [observation-chain] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for show-observer + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query observer](zetacored_query_observer.md) - Querying commands for the observer module + diff --git a/docs/cli/zetacored/zetacored_query_params.md b/docs/cli/zetacored/zetacored_query_params.md new file mode 100644 index 0000000000..f090db8bfe --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_params.md @@ -0,0 +1,29 @@ +# query params + +Querying commands for the params module + +``` +zetacored query params [flags] +``` + +### Options + +``` + -h, --help help for params +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query params subspace](zetacored_query_params_subspace.md) - Query for raw parameters by subspace and key + diff --git a/docs/cli/zetacored/zetacored_query_params_subspace.md b/docs/cli/zetacored/zetacored_query_params_subspace.md new file mode 100644 index 0000000000..4dc265c581 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_params_subspace.md @@ -0,0 +1,33 @@ +# query params subspace + +Query for raw parameters by subspace and key + +``` +zetacored query params subspace [subspace] [key] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for subspace + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query params](zetacored_query_params.md) - Querying commands for the params module + diff --git a/docs/cli/zetacored/zetacored_query_slashing.md b/docs/cli/zetacored/zetacored_query_slashing.md new file mode 100644 index 0000000000..10af5225d7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_slashing.md @@ -0,0 +1,31 @@ +# query slashing + +Querying commands for the slashing module + +``` +zetacored query slashing [flags] +``` + +### Options + +``` + -h, --help help for slashing +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query slashing params](zetacored_query_slashing_params.md) - Query the current slashing parameters +* [zetacored query slashing signing-info](zetacored_query_slashing_signing-info.md) - Query a validator's signing information +* [zetacored query slashing signing-infos](zetacored_query_slashing_signing-infos.md) - Query signing information of all validators + diff --git a/docs/cli/zetacored/zetacored_query_slashing_params.md b/docs/cli/zetacored/zetacored_query_slashing_params.md new file mode 100644 index 0000000000..c2b4359edf --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_slashing_params.md @@ -0,0 +1,39 @@ +# query slashing params + +Query the current slashing parameters + +### Synopsis + +Query genesis parameters for the slashing module: + +$ zetacored query slashing params + +``` +zetacored query slashing params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query slashing](zetacored_query_slashing.md) - Querying commands for the slashing module + diff --git a/docs/cli/zetacored/zetacored_query_slashing_signing-info.md b/docs/cli/zetacored/zetacored_query_slashing_signing-info.md new file mode 100644 index 0000000000..1e8f13b914 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_slashing_signing-info.md @@ -0,0 +1,39 @@ +# query slashing signing-info + +Query a validator's signing information + +### Synopsis + +Use a validators' consensus public key to find the signing-info for that validator: + +$ zetacored query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"OauFcTKbN5Lx3fJL689cikXBqe+hcp6Y+x0rYUdR9Jk="}' + +``` +zetacored query slashing signing-info [validator-conspub] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for signing-info + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query slashing](zetacored_query_slashing.md) - Querying commands for the slashing module + diff --git a/docs/cli/zetacored/zetacored_query_slashing_signing-infos.md b/docs/cli/zetacored/zetacored_query_slashing_signing-infos.md new file mode 100644 index 0000000000..b1a3d5f31b --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_slashing_signing-infos.md @@ -0,0 +1,45 @@ +# query slashing signing-infos + +Query signing information of all validators + +### Synopsis + +signing infos of validators: + +$ zetacored query slashing signing-infos + +``` +zetacored query slashing signing-infos [flags] +``` + +### Options + +``` + --count-total count total number of records in signing infos to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for signing-infos + --limit uint pagination limit of signing infos to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of signing infos to query for + -o, --output string Output format (text|json) + --page uint pagination page of signing infos to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of signing infos to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query slashing](zetacored_query_slashing.md) - Querying commands for the slashing module + diff --git a/docs/cli/zetacored/zetacored_query_staking.md b/docs/cli/zetacored/zetacored_query_staking.md new file mode 100644 index 0000000000..b7770b1b64 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking.md @@ -0,0 +1,42 @@ +# query staking + +Querying commands for the staking module + +``` +zetacored query staking [flags] +``` + +### Options + +``` + -h, --help help for staking +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query staking delegation](zetacored_query_staking_delegation.md) - Query a delegation based on address and validator address +* [zetacored query staking delegations](zetacored_query_staking_delegations.md) - Query all delegations made by one delegator +* [zetacored query staking delegations-to](zetacored_query_staking_delegations-to.md) - Query all delegations made to one validator +* [zetacored query staking historical-info](zetacored_query_staking_historical-info.md) - Query historical info at given height +* [zetacored query staking params](zetacored_query_staking_params.md) - Query the current staking parameters information +* [zetacored query staking pool](zetacored_query_staking_pool.md) - Query the current staking pool values +* [zetacored query staking redelegation](zetacored_query_staking_redelegation.md) - Query a redelegation record based on delegator and a source and destination validator address +* [zetacored query staking redelegations](zetacored_query_staking_redelegations.md) - Query all redelegations records for one delegator +* [zetacored query staking redelegations-from](zetacored_query_staking_redelegations-from.md) - Query all outgoing redelegatations from a validator +* [zetacored query staking unbonding-delegation](zetacored_query_staking_unbonding-delegation.md) - Query an unbonding-delegation record based on delegator and validator address +* [zetacored query staking unbonding-delegations](zetacored_query_staking_unbonding-delegations.md) - Query all unbonding-delegations records for one delegator +* [zetacored query staking unbonding-delegations-from](zetacored_query_staking_unbonding-delegations-from.md) - Query all unbonding delegatations from a validator +* [zetacored query staking validator](zetacored_query_staking_validator.md) - Query a validator +* [zetacored query staking validators](zetacored_query_staking_validators.md) - Query for all validators + diff --git a/docs/cli/zetacored/zetacored_query_staking_delegation.md b/docs/cli/zetacored/zetacored_query_staking_delegation.md new file mode 100644 index 0000000000..e9a6c6c521 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_delegation.md @@ -0,0 +1,40 @@ +# query staking delegation + +Query a delegation based on address and validator address + +### Synopsis + +Query delegations for an individual delegator on an individual validator. + +Example: +$ zetacored query staking delegation zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query staking delegation [delegator-addr] [validator-addr] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for delegation + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_delegations-to.md b/docs/cli/zetacored/zetacored_query_staking_delegations-to.md new file mode 100644 index 0000000000..bb76506225 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_delegations-to.md @@ -0,0 +1,46 @@ +# query staking delegations-to + +Query all delegations made to one validator + +### Synopsis + +Query delegations on an individual validator. + +Example: +$ zetacored query staking delegations-to zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query staking delegations-to [validator-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in validator delegations to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for delegations-to + --limit uint pagination limit of validator delegations to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of validator delegations to query for + -o, --output string Output format (text|json) + --page uint pagination page of validator delegations to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of validator delegations to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_delegations.md b/docs/cli/zetacored/zetacored_query_staking_delegations.md new file mode 100644 index 0000000000..a136886ebd --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_delegations.md @@ -0,0 +1,46 @@ +# query staking delegations + +Query all delegations made by one delegator + +### Synopsis + +Query delegations for an individual delegator on all validators. + +Example: +$ zetacored query staking delegations zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p + +``` +zetacored query staking delegations [delegator-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in delegations to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for delegations + --limit uint pagination limit of delegations to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of delegations to query for + -o, --output string Output format (text|json) + --page uint pagination page of delegations to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of delegations to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_historical-info.md b/docs/cli/zetacored/zetacored_query_staking_historical-info.md new file mode 100644 index 0000000000..fd747bef1d --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_historical-info.md @@ -0,0 +1,40 @@ +# query staking historical-info + +Query historical info at given height + +### Synopsis + +Query historical info at given height. + +Example: +$ zetacored query staking historical-info 5 + +``` +zetacored query staking historical-info [height] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for historical-info + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_params.md b/docs/cli/zetacored/zetacored_query_staking_params.md new file mode 100644 index 0000000000..96dc7f11b6 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_params.md @@ -0,0 +1,40 @@ +# query staking params + +Query the current staking parameters information + +### Synopsis + +Query values set as staking parameters. + +Example: +$ zetacored query staking params + +``` +zetacored query staking params [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for params + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_pool.md b/docs/cli/zetacored/zetacored_query_staking_pool.md new file mode 100644 index 0000000000..9c2cb6c2aa --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_pool.md @@ -0,0 +1,40 @@ +# query staking pool + +Query the current staking pool values + +### Synopsis + +Query values for amounts stored in the staking pool. + +Example: +$ zetacored query staking pool + +``` +zetacored query staking pool [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for pool + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_redelegation.md b/docs/cli/zetacored/zetacored_query_staking_redelegation.md new file mode 100644 index 0000000000..35e4e64352 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_redelegation.md @@ -0,0 +1,40 @@ +# query staking redelegation + +Query a redelegation record based on delegator and a source and destination validator address + +### Synopsis + +Query a redelegation record for an individual delegator between a source and destination validator. + +Example: +$ zetacored query staking redelegation zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p zetavaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query staking redelegation [delegator-addr] [src-validator-addr] [dst-validator-addr] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for redelegation + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_redelegations-from.md b/docs/cli/zetacored/zetacored_query_staking_redelegations-from.md new file mode 100644 index 0000000000..d14af625eb --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_redelegations-from.md @@ -0,0 +1,46 @@ +# query staking redelegations-from + +Query all outgoing redelegatations from a validator + +### Synopsis + +Query delegations that are redelegating _from_ a validator. + +Example: +$ zetacored query staking redelegations-from zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query staking redelegations-from [validator-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in validator redelegations to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for redelegations-from + --limit uint pagination limit of validator redelegations to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of validator redelegations to query for + -o, --output string Output format (text|json) + --page uint pagination page of validator redelegations to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of validator redelegations to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_redelegations.md b/docs/cli/zetacored/zetacored_query_staking_redelegations.md new file mode 100644 index 0000000000..1e017bff43 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_redelegations.md @@ -0,0 +1,46 @@ +# query staking redelegations + +Query all redelegations records for one delegator + +### Synopsis + +Query all redelegation records for an individual delegator. + +Example: +$ zetacored query staking redelegation zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p + +``` +zetacored query staking redelegations [delegator-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in delegator redelegations to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for redelegations + --limit uint pagination limit of delegator redelegations to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of delegator redelegations to query for + -o, --output string Output format (text|json) + --page uint pagination page of delegator redelegations to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of delegator redelegations to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_unbonding-delegation.md b/docs/cli/zetacored/zetacored_query_staking_unbonding-delegation.md new file mode 100644 index 0000000000..a987f5b6d9 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_unbonding-delegation.md @@ -0,0 +1,40 @@ +# query staking unbonding-delegation + +Query an unbonding-delegation record based on delegator and validator address + +### Synopsis + +Query unbonding delegations for an individual delegator on an individual validator. + +Example: +$ zetacored query staking unbonding-delegation zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query staking unbonding-delegation [delegator-addr] [validator-addr] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for unbonding-delegation + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_unbonding-delegations-from.md b/docs/cli/zetacored/zetacored_query_staking_unbonding-delegations-from.md new file mode 100644 index 0000000000..e3fa26259c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_unbonding-delegations-from.md @@ -0,0 +1,46 @@ +# query staking unbonding-delegations-from + +Query all unbonding delegatations from a validator + +### Synopsis + +Query delegations that are unbonding _from_ a validator. + +Example: +$ zetacored query staking unbonding-delegations-from zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query staking unbonding-delegations-from [validator-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in unbonding delegations to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for unbonding-delegations-from + --limit uint pagination limit of unbonding delegations to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of unbonding delegations to query for + -o, --output string Output format (text|json) + --page uint pagination page of unbonding delegations to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of unbonding delegations to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_unbonding-delegations.md b/docs/cli/zetacored/zetacored_query_staking_unbonding-delegations.md new file mode 100644 index 0000000000..103b656828 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_unbonding-delegations.md @@ -0,0 +1,46 @@ +# query staking unbonding-delegations + +Query all unbonding-delegations records for one delegator + +### Synopsis + +Query unbonding delegations for an individual delegator. + +Example: +$ zetacored query staking unbonding-delegations zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p + +``` +zetacored query staking unbonding-delegations [delegator-addr] [flags] +``` + +### Options + +``` + --count-total count total number of records in unbonding delegations to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for unbonding-delegations + --limit uint pagination limit of unbonding delegations to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of unbonding delegations to query for + -o, --output string Output format (text|json) + --page uint pagination page of unbonding delegations to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of unbonding delegations to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_validator.md b/docs/cli/zetacored/zetacored_query_staking_validator.md new file mode 100644 index 0000000000..cdf17315cd --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_validator.md @@ -0,0 +1,40 @@ +# query staking validator + +Query a validator + +### Synopsis + +Query details about an individual validator. + +Example: +$ zetacored query staking validator zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj + +``` +zetacored query staking validator [validator-addr] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for validator + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_staking_validators.md b/docs/cli/zetacored/zetacored_query_staking_validators.md new file mode 100644 index 0000000000..bec49a6eb2 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_staking_validators.md @@ -0,0 +1,46 @@ +# query staking validators + +Query for all validators + +### Synopsis + +Query details about all validators on a network. + +Example: +$ zetacored query staking validators + +``` +zetacored query staking validators [flags] +``` + +### Options + +``` + --count-total count total number of records in validators to query for + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for validators + --limit uint pagination limit of validators to query for (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + --offset uint pagination offset of validators to query for + -o, --output string Output format (text|json) + --page uint pagination page of validators to query for. This sets offset to a multiple of limit (default 1) + --page-key string pagination page-key of validators to query for + --reverse results are sorted in descending order +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query staking](zetacored_query_staking.md) - Querying commands for the staking module + diff --git a/docs/cli/zetacored/zetacored_query_tendermint-validator-set.md b/docs/cli/zetacored/zetacored_query_tendermint-validator-set.md new file mode 100644 index 0000000000..05136fde49 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_tendermint-validator-set.md @@ -0,0 +1,32 @@ +# query tendermint-validator-set + +Get the full tendermint validator set at given height + +``` +zetacored query tendermint-validator-set [height] [flags] +``` + +### Options + +``` + -h, --help help for tendermint-validator-set + --limit int Query number of results returned per page (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) + --page int Query a specific page of paginated results (default 1) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands + diff --git a/docs/cli/zetacored/zetacored_query_tx.md b/docs/cli/zetacored/zetacored_query_tx.md new file mode 100644 index 0000000000..fdb41b947b --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_tx.md @@ -0,0 +1,41 @@ +# query tx + +Query for a transaction by hash, "[addr]/[seq]" combination or comma-separated signatures in a committed block + +### Synopsis + +Example: +$ zetacored query tx [hash] +$ zetacored query tx --type=acc_seq [addr]/[sequence] +$ zetacored query tx --type=signature [sig1_base64],[sig2_base64...] + +``` +zetacored query tx --type=[hash|acc_seq|signature] [hash|acc_seq|signature] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for tx + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) + --type string The type to be used when querying tx, can be one of "hash", "acc_seq", "signature" +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands + diff --git a/docs/cli/zetacored/zetacored_query_txs.md b/docs/cli/zetacored/zetacored_query_txs.md new file mode 100644 index 0000000000..d004bb1bfa --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_txs.md @@ -0,0 +1,46 @@ +# query txs + +Query for paginated transactions that match a set of events + +### Synopsis + +Search for transactions that match the exact given events where results are paginated. +Each event takes the form of '{eventType}.{eventAttribute}={value}'. Please refer +to each module's documentation for the full set of events to query for. Each module +documents its respective events under 'xx_events.md'. + +Example: +$ zetacored query txs --events 'message.sender=cosmos1...&message.action=withdraw_delegator_reward' --page 1 --limit 30 + +``` +zetacored query txs [flags] +``` + +### Options + +``` + --events string list of transaction events in the form of {eventType}.{eventAttribute}={value} + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for txs + --limit int Query number of transactions results per page returned (default 100) + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) + --page int Query a specific page of paginated results (default 1) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands + diff --git a/docs/cli/zetacored/zetacored_query_upgrade.md b/docs/cli/zetacored/zetacored_query_upgrade.md new file mode 100644 index 0000000000..ec54fb0a46 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_upgrade.md @@ -0,0 +1,27 @@ +# query upgrade + +Querying commands for the upgrade module + +### Options + +``` + -h, --help help for upgrade +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query](zetacored_query.md) - Querying subcommands +* [zetacored query upgrade applied](zetacored_query_upgrade_applied.md) - block header for height at which a completed upgrade was applied +* [zetacored query upgrade module_versions](zetacored_query_upgrade_module_versions.md) - get the list of module versions +* [zetacored query upgrade plan](zetacored_query_upgrade_plan.md) - get upgrade plan (if one exists) + diff --git a/docs/cli/zetacored/zetacored_query_upgrade_applied.md b/docs/cli/zetacored/zetacored_query_upgrade_applied.md new file mode 100644 index 0000000000..caa94c576c --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_upgrade_applied.md @@ -0,0 +1,38 @@ +# query upgrade applied + +block header for height at which a completed upgrade was applied + +### Synopsis + +If upgrade-name was previously executed on the chain, this returns the header for the block at which it was applied. +This helps a client determine which binary was valid over a given range of blocks, as well as more context to understand past migrations. + +``` +zetacored query upgrade applied [upgrade-name] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for applied + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query upgrade](zetacored_query_upgrade.md) - Querying commands for the upgrade module + diff --git a/docs/cli/zetacored/zetacored_query_upgrade_module_versions.md b/docs/cli/zetacored/zetacored_query_upgrade_module_versions.md new file mode 100644 index 0000000000..97f936b556 --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_upgrade_module_versions.md @@ -0,0 +1,39 @@ +# query upgrade module_versions + +get the list of module versions + +### Synopsis + +Gets a list of module names and their respective consensus versions. +Following the command with a specific module name will return only +that module's information. + +``` +zetacored query upgrade module_versions [optional module_name] [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for module_versions + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query upgrade](zetacored_query_upgrade.md) - Querying commands for the upgrade module + diff --git a/docs/cli/zetacored/zetacored_query_upgrade_plan.md b/docs/cli/zetacored/zetacored_query_upgrade_plan.md new file mode 100644 index 0000000000..8176eb43de --- /dev/null +++ b/docs/cli/zetacored/zetacored_query_upgrade_plan.md @@ -0,0 +1,37 @@ +# query upgrade plan + +get upgrade plan (if one exists) + +### Synopsis + +Gets the currently scheduled upgrade plan, if one exists + +``` +zetacored query upgrade plan [flags] +``` + +### Options + +``` + --grpc-addr string the gRPC endpoint to use for this chain + --grpc-insecure allow gRPC over insecure channels, if not TLS the server must use TLS + --height int Use a specific height to query state at (this can error if the node is pruning state) + -h, --help help for plan + --node string [host]:[port] to Tendermint RPC interface for this chain + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored query upgrade](zetacored_query_upgrade.md) - Querying commands for the upgrade module + diff --git a/docs/cli/zetacored/zetacored_rollback.md b/docs/cli/zetacored/zetacored_rollback.md new file mode 100644 index 0000000000..76e5ec557b --- /dev/null +++ b/docs/cli/zetacored/zetacored_rollback.md @@ -0,0 +1,38 @@ +# rollback + +rollback cosmos-sdk and tendermint state by one height + +### Synopsis + + +A state rollback is performed to recover from an incorrect application state transition, +when Tendermint has persisted an incorrect app hash and is thus unable to make +progress. Rollback overwrites a state at height n with the state at height n - 1. +The application also rolls back to height n - 1. No blocks are removed, so upon +restarting Tendermint the transactions in block n will be re-executed against the +application. + + +``` +zetacored rollback [flags] +``` + +### Options + +``` + -h, --help help for rollback + --home string The application home directory +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_rosetta.md b/docs/cli/zetacored/zetacored_rosetta.md new file mode 100644 index 0000000000..3ff2cbd78a --- /dev/null +++ b/docs/cli/zetacored/zetacored_rosetta.md @@ -0,0 +1,38 @@ +# rosetta + +spin up a rosetta server + +``` +zetacored rosetta [flags] +``` + +### Options + +``` + --addr string the address rosetta will bind to + --blockchain string the blockchain type + --denom-to-suggest string default denom for fee suggestion + --enable-fee-suggestion enable default fee suggestion + --gas-to-suggest int default gas for fee suggestion (default 200000) + --grpc string the app gRPC endpoint + -h, --help help for rosetta + --network string the network name + --offline run rosetta only with construction API + --prices-to-suggest string default prices for fee suggestion + --retries int the number of retries that will be done before quitting (default 5) + --tendermint string the tendermint rpc endpoint, without tcp:// +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_start.md b/docs/cli/zetacored/zetacored_start.md new file mode 100644 index 0000000000..e4694111e5 --- /dev/null +++ b/docs/cli/zetacored/zetacored_start.md @@ -0,0 +1,122 @@ +# start + +Run the full node + +### Synopsis + +Run the full node application with Tendermint in or out of process. By +default, the application will run with Tendermint in process. + +Pruning options can be provided via the '--pruning' flag or alternatively with '--pruning-keep-recent', +'pruning-keep-every', and 'pruning-interval' together. + +For '--pruning' the options are as follows: + +default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals +nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node) +everything: all saved states will be deleted, storing only the current state; pruning at 10 block intervals +custom: allow pruning options to be manually specified through 'pruning-keep-recent', 'pruning-keep-every', and 'pruning-interval' + +Node halting configurations exist in the form of two flags: '--halt-height' and '--halt-time'. During +the ABCI Commit phase, the node will check if the current block height is greater than or equal to +the halt-height or if the current block time is greater than or equal to the halt-time. If so, the +node will attempt to gracefully shutdown and the block will not be committed. In addition, the node +will not be able to commit subsequent blocks. + +For profiling and benchmarking purposes, CPU profiling can be enabled via the '--cpu-profile' flag +which accepts a path for the resulting pprof file. + + +``` +zetacored start [flags] +``` + +### Options + +``` + --abci string specify abci transport (socket | grpc) + --address string Listen address + --api.enable Defines if Cosmos-sdk REST server should be enabled + --api.enabled-unsafe-cors Defines if CORS should be enabled (unsafe - use it at your own risk) + --app-db-backend string The type of database for application and snapshots databases + --consensus.create_empty_blocks set this to false to only produce blocks when there are txs or when the AppHash changes (default true) + --consensus.create_empty_blocks_interval string the possible interval between empty blocks + --consensus.double_sign_check_height int how many blocks to look back to check existence of the node's consensus votes before joining consensus + --cpu-profile string Enable CPU profiling and write to the provided file + --db_backend string database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb + --db_dir string database directory + --evm.max-tx-gas-wanted uint the gas wanted for each eth tx returned in ante handler in check tx mode + --evm.tracer string the EVM tracer type to collect execution traces from the EVM transaction execution (json|struct|access_list|markdown) + --fast_sync fast blockchain syncing (default true) + --genesis_hash bytesHex optional SHA-256 hash of the genesis file + --grpc-only Start the node in gRPC query only mode without Tendermint process + --grpc-web.address string The gRPC-Web server address to listen on + --grpc-web.enable Define if the gRPC-Web server should be enabled. (Note: gRPC must also be enabled.) (default true) + --grpc.address string the gRPC server address to listen on + --grpc.enable Define if the gRPC server should be enabled (default true) + --halt-height uint Block height at which to gracefully halt the chain and shutdown the node + --halt-time uint Minimum block time (in Unix seconds) at which to gracefully halt the chain and shutdown the node + -h, --help help for start + --home string The application home directory + --inter-block-cache Enable inter-block caching (default true) + --inv-check-period uint Assert registered invariants every N blocks + --json-rpc.address string the JSON-RPC server address to listen on + --json-rpc.allow-unprotected-txs Allow for unprotected (non EIP155 signed) transactions to be submitted via the node's RPC when the global parameter is disabled + --json-rpc.api strings Defines a list of JSON-RPC namespaces that should be enabled (default [eth,net,web3]) + --json-rpc.block-range-cap eth_getLogs Sets the max block range allowed for eth_getLogs query (default 10000) + --json-rpc.enable Define if the JSON-RPC server should be enabled (default true) + --json-rpc.enable-indexer Enable the custom tx indexer for json-rpc + --json-rpc.evm-timeout duration Sets a timeout used for eth_call (0=infinite) (default 5s) + --json-rpc.filter-cap int32 Sets the global cap for total number of filters that can be created (default 200) + --json-rpc.gas-cap uint Sets a cap on gas that can be used in eth_call/estimateGas unit is aphoton (0=infinite) (default 25000000) + --json-rpc.http-idle-timeout duration Sets a idle timeout for json-rpc http server (0=infinite) (default 2m0s) + --json-rpc.http-timeout duration Sets a read/write timeout for json-rpc http server (0=infinite) (default 30s) + --json-rpc.logs-cap eth_getLogs Sets the max number of results can be returned from single eth_getLogs query (default 10000) + --json-rpc.max-open-connections int Sets the maximum number of simultaneous connections for the server listener + --json-rpc.txfee-cap float Sets a cap on transaction fee that can be sent via the RPC APIs (1 = default 1 photon) (default 1) + --json-rpc.ws-address string the JSON-RPC WS server address to listen on + --metrics Define if EVM rpc metrics server should be enabled + --min-retain-blocks uint Minimum block height offset during ABCI commit to prune Tendermint blocks + --minimum-gas-prices string Minimum gas prices to accept for transactions; Any fee in a tx must meet this minimum (e.g. 0.01photon;0.0001stake) + --moniker string node name + --p2p.external-address string ip:port address to advertise to peers for them to dial + --p2p.laddr string node listen address. (0.0.0.0:0 means any interface, any port) + --p2p.persistent_peers string comma-delimited ID@host:port persistent peers + --p2p.pex enable/disable Peer-Exchange (default true) + --p2p.private_peer_ids string comma-delimited private peer IDs + --p2p.seed_mode enable/disable seed mode + --p2p.seeds string comma-delimited ID@host:port seed nodes + --p2p.unconditional_peer_ids string comma-delimited IDs of unconditional peers + --p2p.upnp enable/disable UPNP port forwarding + --priv_validator_laddr string socket address to listen on for connections from external priv_validator process + --proxy_app string proxy app address, or one of: 'kvstore', 'persistent_kvstore', 'counter', 'e2e' or 'noop' for local testing. + --pruning string Pruning strategy (default|nothing|everything|custom) + --pruning-interval uint Height interval at which pruned heights are removed from disk (ignored if pruning is not 'custom') + --pruning-keep-recent uint Number of recent heights to keep on disk (ignored if pruning is not 'custom') + --rpc.grpc_laddr string GRPC listen address (BroadcastTx only). Port required + --rpc.laddr string RPC listen address. Port required + --rpc.pprof_laddr string pprof listen address (https://golang.org/pkg/net/http/pprof) + --rpc.unsafe enabled unsafe rpc methods + --state-sync.snapshot-interval uint State sync snapshot interval + --state-sync.snapshot-keep-recent uint32 State sync snapshot to keep (default 2) + --tls.certificate-path string the cert.pem file path for the server TLS configuration + --tls.key-path string the key.pem file path for the server TLS configuration + --trace Provide full stack traces for errors in ABCI Log + --trace-store string Enable KVStore tracing to an output file + --transport string Transport protocol: socket, grpc + --unsafe-skip-upgrades ints Skip a set of upgrade heights to continue the old binary + --with-tendermint Run abci app embedded in-process with tendermint (default true) + --x-crisis-skip-assert-invariants Skip x/crisis invariants check on startup +``` + +### Options inherited from parent commands + +``` + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_status.md b/docs/cli/zetacored/zetacored_status.md new file mode 100644 index 0000000000..3c0c262afe --- /dev/null +++ b/docs/cli/zetacored/zetacored_status.md @@ -0,0 +1,28 @@ +# status + +Query remote node for status + +``` +zetacored status [flags] +``` + +### Options + +``` + -h, --help help for status + -n, --node string Node to connect to +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_tendermint.md b/docs/cli/zetacored/zetacored_tendermint.md new file mode 100644 index 0000000000..fe715dbd01 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tendermint.md @@ -0,0 +1,29 @@ +# tendermint + +Tendermint subcommands + +### Options + +``` + -h, --help help for tendermint +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) +* [zetacored tendermint reset-state](zetacored_tendermint_reset-state.md) - Remove all the data and WAL +* [zetacored tendermint show-address](zetacored_tendermint_show-address.md) - Shows this node's tendermint validator consensus address +* [zetacored tendermint show-node-id](zetacored_tendermint_show-node-id.md) - Show this node's ID +* [zetacored tendermint show-validator](zetacored_tendermint_show-validator.md) - Show this node's tendermint validator info +* [zetacored tendermint unsafe-reset-all](zetacored_tendermint_unsafe-reset-all.md) - (unsafe) Remove all the data and WAL, reset this node's validator to genesis state +* [zetacored tendermint version](zetacored_tendermint_version.md) - Print tendermint libraries' version + diff --git a/docs/cli/zetacored/zetacored_tendermint_reset-state.md b/docs/cli/zetacored/zetacored_tendermint_reset-state.md new file mode 100644 index 0000000000..ea9468027f --- /dev/null +++ b/docs/cli/zetacored/zetacored_tendermint_reset-state.md @@ -0,0 +1,27 @@ +# tendermint reset-state + +Remove all the data and WAL + +``` +zetacored tendermint reset-state [flags] +``` + +### Options + +``` + -h, --help help for reset-state +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands + diff --git a/docs/cli/zetacored/zetacored_tendermint_show-address.md b/docs/cli/zetacored/zetacored_tendermint_show-address.md new file mode 100644 index 0000000000..9caed7dad9 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tendermint_show-address.md @@ -0,0 +1,27 @@ +# tendermint show-address + +Shows this node's tendermint validator consensus address + +``` +zetacored tendermint show-address [flags] +``` + +### Options + +``` + -h, --help help for show-address +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands + diff --git a/docs/cli/zetacored/zetacored_tendermint_show-node-id.md b/docs/cli/zetacored/zetacored_tendermint_show-node-id.md new file mode 100644 index 0000000000..e4155258eb --- /dev/null +++ b/docs/cli/zetacored/zetacored_tendermint_show-node-id.md @@ -0,0 +1,27 @@ +# tendermint show-node-id + +Show this node's ID + +``` +zetacored tendermint show-node-id [flags] +``` + +### Options + +``` + -h, --help help for show-node-id +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands + diff --git a/docs/cli/zetacored/zetacored_tendermint_show-validator.md b/docs/cli/zetacored/zetacored_tendermint_show-validator.md new file mode 100644 index 0000000000..adde101d5d --- /dev/null +++ b/docs/cli/zetacored/zetacored_tendermint_show-validator.md @@ -0,0 +1,27 @@ +# tendermint show-validator + +Show this node's tendermint validator info + +``` +zetacored tendermint show-validator [flags] +``` + +### Options + +``` + -h, --help help for show-validator +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands + diff --git a/docs/cli/zetacored/zetacored_tendermint_unsafe-reset-all.md b/docs/cli/zetacored/zetacored_tendermint_unsafe-reset-all.md new file mode 100644 index 0000000000..7447c462eb --- /dev/null +++ b/docs/cli/zetacored/zetacored_tendermint_unsafe-reset-all.md @@ -0,0 +1,28 @@ +# tendermint unsafe-reset-all + +(unsafe) Remove all the data and WAL, reset this node's validator to genesis state + +``` +zetacored tendermint unsafe-reset-all [flags] +``` + +### Options + +``` + -h, --help help for unsafe-reset-all + --keep-addr-book keep the address book intact +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands + diff --git a/docs/cli/zetacored/zetacored_tendermint_version.md b/docs/cli/zetacored/zetacored_tendermint_version.md new file mode 100644 index 0000000000..93e660df81 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tendermint_version.md @@ -0,0 +1,31 @@ +# tendermint version + +Print tendermint libraries' version + +### Synopsis + +Print protocols' and libraries' version numbers against which this app has been compiled. + +``` +zetacored tendermint version [flags] +``` + +### Options + +``` + -h, --help help for version +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tendermint](zetacored_tendermint.md) - Tendermint subcommands + diff --git a/docs/cli/zetacored/zetacored_testnet.md b/docs/cli/zetacored/zetacored_testnet.md new file mode 100644 index 0000000000..f6c0ffc8eb --- /dev/null +++ b/docs/cli/zetacored/zetacored_testnet.md @@ -0,0 +1,29 @@ +# testnet + +subcommands for starting or configuring local testnets + +``` +zetacored testnet [flags] +``` + +### Options + +``` + -h, --help help for testnet +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) +* [zetacored testnet init-files](zetacored_testnet_init-files.md) - Initialize config directories & files for a multi-validator testnet running locally via separate processes (e.g. Docker Compose or similar) +* [zetacored testnet start](zetacored_testnet_start.md) - Launch an in-process multi-validator testnet + diff --git a/docs/cli/zetacored/zetacored_testnet_init-files.md b/docs/cli/zetacored/zetacored_testnet_init-files.md new file mode 100644 index 0000000000..e1a94a7e02 --- /dev/null +++ b/docs/cli/zetacored/zetacored_testnet_init-files.md @@ -0,0 +1,50 @@ +# testnet init-files + +Initialize config directories & files for a multi-validator testnet running locally via separate processes (e.g. Docker Compose or similar) + +### Synopsis + +init-files will setup "v" number of directories and populate each with +necessary files (private validator, genesis, config, etc.) for running "v" validator nodes. + +Booting up a network with these validator folders is intended to be used with Docker Compose, +or a similar setup where each node has a manually configurable IP address. + +Note, strict routability for addresses is turned off in the config file. + +Example: + evmosd testnet init-files --v 4 --output-dir ./.testnets --starting-ip-address 192.168.10.2 + + +``` +zetacored testnet init-files [flags] +``` + +### Options + +``` + --algo string Key signing algorithm to generate keys for + --chain-id string genesis file chain-id, if left blank will be randomly created + -h, --help help for init-files + --keyring-backend string Select keyring's backend (os|file|test) + --minimum-gas-prices string Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake) + --node-daemon-home string Home directory of the node's daemon configuration + --node-dir-prefix string Prefix the directory name for each node with (node results in node0, node1, ...) + -o, --output-dir string Directory to store initialization data for the testnet + --starting-ip-address string Starting IP address (192.168.0.1 results in persistent peers list ID0@192.168.0.1:46656, ID1@192.168.0.2:46656, ...) + --v int Number of validators to initialize the testnet with (default 4) +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored testnet](zetacored_testnet.md) - subcommands for starting or configuring local testnets + diff --git a/docs/cli/zetacored/zetacored_testnet_start.md b/docs/cli/zetacored/zetacored_testnet_start.md new file mode 100644 index 0000000000..5098b9768c --- /dev/null +++ b/docs/cli/zetacored/zetacored_testnet_start.md @@ -0,0 +1,48 @@ +# testnet start + +Launch an in-process multi-validator testnet + +### Synopsis + +testnet will launch an in-process multi-validator testnet, +and generate "v" directories, populated with necessary validator configuration files +(private validator, genesis, config, etc.). + +Example: + evmosd testnet --v 4 --output-dir ./.testnets + + +``` +zetacored testnet start [flags] +``` + +### Options + +``` + --algo string Key signing algorithm to generate keys for + --api.address string the address to listen on for REST API + --chain-id string genesis file chain-id, if left blank will be randomly created + --enable-logging Enable INFO logging of tendermint validator nodes + --grpc.address string the gRPC server address to listen on + -h, --help help for start + --json-rpc.address string the JSON-RPC server address to listen on + --minimum-gas-prices string Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake) + -o, --output-dir string Directory to store initialization data for the testnet + --print-mnemonic print mnemonic of first validator to stdout for manual testing (default true) + --rpc.address string the RPC address to listen on + --v int Number of validators to initialize the testnet with (default 4) +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored testnet](zetacored_testnet.md) - subcommands for starting or configuring local testnets + diff --git a/docs/cli/zetacored/zetacored_tx.md b/docs/cli/zetacored/zetacored_tx.md new file mode 100644 index 0000000000..2d8b13430e --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx.md @@ -0,0 +1,51 @@ +# tx + +Transactions subcommands + +``` +zetacored tx [flags] +``` + +### Options + +``` + --chain-id string The network chain ID + -h, --help help for tx +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) +* [zetacored tx authz](zetacored_tx_authz.md) - Authorization transactions subcommands +* [zetacored tx bank](zetacored_tx_bank.md) - Bank transaction subcommands +* [zetacored tx broadcast](zetacored_tx_broadcast.md) - Broadcast transactions generated offline +* [zetacored tx crisis](zetacored_tx_crisis.md) - Crisis transactions subcommands +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands +* [zetacored tx decode](zetacored_tx_decode.md) - Decode a binary encoded transaction string +* [zetacored tx distribution](zetacored_tx_distribution.md) - Distribution transactions subcommands +* [zetacored tx emissions](zetacored_tx_emissions.md) - emissions transactions subcommands +* [zetacored tx encode](zetacored_tx_encode.md) - Encode transactions generated offline +* [zetacored tx evidence](zetacored_tx_evidence.md) - Evidence transaction subcommands +* [zetacored tx evm](zetacored_tx_evm.md) - evm transactions subcommands +* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands +* [zetacored tx gov](zetacored_tx_gov.md) - Governance transactions subcommands +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands +* [zetacored tx multi-sign](zetacored_tx_multi-sign.md) - Generate multisig signatures for transactions generated offline +* [zetacored tx multisign-batch](zetacored_tx_multisign-batch.md) - Assemble multisig transactions in batch from batch signatures +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands +* [zetacored tx sign](zetacored_tx_sign.md) - Sign a transaction generated offline +* [zetacored tx sign-batch](zetacored_tx_sign-batch.md) - Sign transaction batch files +* [zetacored tx slashing](zetacored_tx_slashing.md) - Slashing transaction subcommands +* [zetacored tx staking](zetacored_tx_staking.md) - Staking transaction subcommands +* [zetacored tx validate-signatures](zetacored_tx_validate-signatures.md) - validate transactions signatures +* [zetacored tx vesting](zetacored_tx_vesting.md) - Vesting transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_authz.md b/docs/cli/zetacored/zetacored_tx_authz.md new file mode 100644 index 0000000000..17e4869027 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_authz.md @@ -0,0 +1,35 @@ +# tx authz + +Authorization transactions subcommands + +### Synopsis + +Authorize and revoke access to execute transactions on behalf of your address + +``` +zetacored tx authz [flags] +``` + +### Options + +``` + -h, --help help for authz +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx authz exec](zetacored_tx_authz_exec.md) - execute tx on behalf of granter account +* [zetacored tx authz grant](zetacored_tx_authz_grant.md) - Grant authorization to an address +* [zetacored tx authz revoke](zetacored_tx_authz_revoke.md) - revoke authorization + diff --git a/docs/cli/zetacored/zetacored_tx_authz_exec.md b/docs/cli/zetacored/zetacored_tx_authz_exec.md new file mode 100644 index 0000000000..b9f29172b9 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_authz_exec.md @@ -0,0 +1,59 @@ +# tx authz exec + +execute tx on behalf of granter account + +### Synopsis + +execute tx on behalf of granter account: +Example: + $ zetacored tx authz exec tx.json --from grantee + $ zetacored tx bank send [granter] [recipient] --from [granter] --chain-id [chain-id] --generate-only > tx.json && zetacored tx authz exec tx.json --from grantee + +``` +zetacored tx authz exec [tx-json-file] --from [grantee] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for exec + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx authz](zetacored_tx_authz.md) - Authorization transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_authz_grant.md b/docs/cli/zetacored/zetacored_tx_authz_grant.md new file mode 100644 index 0000000000..7ce03835e8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_authz_grant.md @@ -0,0 +1,65 @@ +# tx authz grant + +Grant authorization to an address + +### Synopsis + +create a new grant authorization to an address to execute a transaction on your behalf: + +Examples: + $ zetacored tx authz grant cosmos1skjw.. send /cosmos.bank.v1beta1.MsgSend --spend-limit=1000stake --from=cosmos1skl.. + $ zetacored tx authz grant cosmos1skjw.. generic --msg-type=/cosmos.gov.v1.MsgVote --from=cosmos1sk.. + +``` +zetacored tx authz grant [grantee] [authorization_type="send"|"generic"|"delegate"|"unbond"|"redelegate"] --from [granter] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --allowed-validators strings Allowed validators addresses separated by , + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --deny-validators strings Deny validators addresses separated by , + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --expiration int Expire time as Unix timestamp. Set zero (0) for no expiry. Default is 0. + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for grant + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --msg-type string The Msg method name for which we are creating a GenericAuthorization + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --spend-limit string SpendLimit for Send Authorization, an array of Coins allowed spend + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx authz](zetacored_tx_authz.md) - Authorization transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_authz_revoke.md b/docs/cli/zetacored/zetacored_tx_authz_revoke.md new file mode 100644 index 0000000000..243f0e8010 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_authz_revoke.md @@ -0,0 +1,58 @@ +# tx authz revoke + +revoke authorization + +### Synopsis + +revoke authorization from a granter to a grantee: +Example: + $ zetacored tx authz revoke cosmos1skj.. /cosmos.bank.v1beta1.MsgSend --from=cosmos1skj.. + +``` +zetacored tx authz revoke [grantee] [msg-type-url] --from=[granter] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for revoke + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx authz](zetacored_tx_authz.md) - Authorization transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_bank.md b/docs/cli/zetacored/zetacored_tx_bank.md new file mode 100644 index 0000000000..efcb9eadf9 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_bank.md @@ -0,0 +1,30 @@ +# tx bank + +Bank transaction subcommands + +``` +zetacored tx bank [flags] +``` + +### Options + +``` + -h, --help help for bank +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx bank multi-send](zetacored_tx_bank_multi-send.md) - Send funds from one account to two or more accounts. +* [zetacored tx bank send](zetacored_tx_bank_send.md) - Send funds from one account to another. + diff --git a/docs/cli/zetacored/zetacored_tx_bank_multi-send.md b/docs/cli/zetacored/zetacored_tx_bank_multi-send.md new file mode 100644 index 0000000000..c8fd491ffa --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_bank_multi-send.md @@ -0,0 +1,62 @@ +# tx bank multi-send + +Send funds from one account to two or more accounts. + +### Synopsis + +Send funds from one account to two or more accounts. +By default, sends the [amount] to each address of the list. +Using the '--split' flag, the [amount] is split equally between the addresses. +Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. +When using '--dry-run' a key name cannot be used, only a bech32 address. + + +``` +zetacored tx bank multi-send [from_key_or_address] [to_address_1, to_address_2, ...] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for multi-send + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --split Send the equally split token amount to each address + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx bank](zetacored_tx_bank.md) - Bank transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_bank_send.md b/docs/cli/zetacored/zetacored_tx_bank_send.md new file mode 100644 index 0000000000..342846e74b --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_bank_send.md @@ -0,0 +1,59 @@ +# tx bank send + +Send funds from one account to another. + +### Synopsis + +Send funds from one account to another. +Note, the '--from' flag is ignored as it is implied from [from_key_or_address]. +When using '--dry-run' a key name cannot be used, only a bech32 address. + + +``` +zetacored tx bank send [from_key_or_address] [to_address] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for send + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx bank](zetacored_tx_bank.md) - Bank transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_broadcast.md b/docs/cli/zetacored/zetacored_tx_broadcast.md new file mode 100644 index 0000000000..be08af8bd0 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_broadcast.md @@ -0,0 +1,61 @@ +# tx broadcast + +Broadcast transactions generated offline + +### Synopsis + +Broadcast transactions created with the --generate-only +flag and signed with the sign command. Read a transaction from [file_path] and +broadcast it to a node. If you supply a dash (-) argument in place of an input +filename, the command reads from standard input. + +$ zetacored tx broadcast ./mytxn.json + +``` +zetacored tx broadcast [file_path] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for broadcast + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crisis.md b/docs/cli/zetacored/zetacored_tx_crisis.md new file mode 100644 index 0000000000..2b168b5201 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crisis.md @@ -0,0 +1,29 @@ +# tx crisis + +Crisis transactions subcommands + +``` +zetacored tx crisis [flags] +``` + +### Options + +``` + -h, --help help for crisis +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx crisis invariant-broken](zetacored_tx_crisis_invariant-broken.md) - Submit proof that an invariant broken to halt the chain + diff --git a/docs/cli/zetacored/zetacored_tx_crisis_invariant-broken.md b/docs/cli/zetacored/zetacored_tx_crisis_invariant-broken.md new file mode 100644 index 0000000000..584603ba38 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crisis_invariant-broken.md @@ -0,0 +1,52 @@ +# tx crisis invariant-broken + +Submit proof that an invariant broken to halt the chain + +``` +zetacored tx crisis invariant-broken [module-name] [invariant-route] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for invariant-broken + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crisis](zetacored_tx_crisis.md) - Crisis transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain.md b/docs/cli/zetacored/zetacored_tx_crosschain.md new file mode 100644 index 0000000000..d74024b3ea --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain.md @@ -0,0 +1,39 @@ +# tx crosschain + +crosschain transactions subcommands + +``` +zetacored tx crosschain [flags] +``` + +### Options + +``` + -h, --help help for crosschain +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx crosschain add-to-in-tx-tracker](zetacored_tx_crosschain_add-to-in-tx-tracker.md) - Add a in-tx-tracker + Use 0:Zeta,1:Gas,2:ERC20 +* [zetacored tx crosschain add-to-out-tx-tracker](zetacored_tx_crosschain_add-to-out-tx-tracker.md) - Add a out-tx-tracker +* [zetacored tx crosschain create-tss-voter](zetacored_tx_crosschain_create-tss-voter.md) - Create a new TSSVoter +* [zetacored tx crosschain gas-price-voter](zetacored_tx_crosschain_gas-price-voter.md) - Broadcast message gasPriceVoter +* [zetacored tx crosschain inbound-voter](zetacored_tx_crosschain_inbound-voter.md) - Broadcast message sendVoter +* [zetacored tx crosschain migrate-tss-funds](zetacored_tx_crosschain_migrate-tss-funds.md) - Migrate TSS funds to the latest TSS address +* [zetacored tx crosschain nonce-voter](zetacored_tx_crosschain_nonce-voter.md) - Broadcast message nonceVoter +* [zetacored tx crosschain outbound-voter](zetacored_tx_crosschain_outbound-voter.md) - Broadcast message receiveConfirmation +* [zetacored tx crosschain remove-from-out-tx-tracker](zetacored_tx_crosschain_remove-from-out-tx-tracker.md) - Remove a out-tx-tracker +* [zetacored tx crosschain update-tss-address](zetacored_tx_crosschain_update-tss-address.md) - Create a new TSSVoter + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_add-to-in-tx-tracker.md b/docs/cli/zetacored/zetacored_tx_crosschain_add-to-in-tx-tracker.md new file mode 100644 index 0000000000..a78ed41f4e --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_add-to-in-tx-tracker.md @@ -0,0 +1,53 @@ +# tx crosschain add-to-in-tx-tracker + +Add a in-tx-tracker + Use 0:Zeta,1:Gas,2:ERC20 + +``` +zetacored tx crosschain add-to-in-tx-tracker [chain-id] [tx-hash] [coin-type] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for add-to-in-tx-tracker + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_add-to-out-tx-tracker.md b/docs/cli/zetacored/zetacored_tx_crosschain_add-to-out-tx-tracker.md new file mode 100644 index 0000000000..1468ead036 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_add-to-out-tx-tracker.md @@ -0,0 +1,52 @@ +# tx crosschain add-to-out-tx-tracker + +Add a out-tx-tracker + +``` +zetacored tx crosschain add-to-out-tx-tracker [chain] [nonce] [tx-hash] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for add-to-out-tx-tracker + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_create-tss-voter.md b/docs/cli/zetacored/zetacored_tx_crosschain_create-tss-voter.md new file mode 100644 index 0000000000..b6932a3cd8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_create-tss-voter.md @@ -0,0 +1,52 @@ +# tx crosschain create-tss-voter + +Create a new TSSVoter + +``` +zetacored tx crosschain create-tss-voter [pubkey] [keygenBlock] [status] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for create-tss-voter + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_gas-price-voter.md b/docs/cli/zetacored/zetacored_tx_crosschain_gas-price-voter.md new file mode 100644 index 0000000000..e3804f9615 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_gas-price-voter.md @@ -0,0 +1,52 @@ +# tx crosschain gas-price-voter + +Broadcast message gasPriceVoter + +``` +zetacored tx crosschain gas-price-voter [chain] [price] [supply] [blockNumber] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for gas-price-voter + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md b/docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md new file mode 100644 index 0000000000..2e419e9158 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_inbound-voter.md @@ -0,0 +1,52 @@ +# tx crosschain inbound-voter + +Broadcast message sendVoter + +``` +zetacored tx crosschain inbound-voter [sender] [senderChainID] [txOrigin] [receiver] [receiverChainID] [amount] [message] [inTxHash] [inBlockHeight] [coinType] [asset] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for inbound-voter + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_migrate-tss-funds.md b/docs/cli/zetacored/zetacored_tx_crosschain_migrate-tss-funds.md new file mode 100644 index 0000000000..4942cc91bd --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_migrate-tss-funds.md @@ -0,0 +1,52 @@ +# tx crosschain migrate-tss-funds + +Migrate TSS funds to the latest TSS address + +``` +zetacored tx crosschain migrate-tss-funds [chainID] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for migrate-tss-funds + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_nonce-voter.md b/docs/cli/zetacored/zetacored_tx_crosschain_nonce-voter.md new file mode 100644 index 0000000000..edbd3c23e7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_nonce-voter.md @@ -0,0 +1,52 @@ +# tx crosschain nonce-voter + +Broadcast message nonceVoter + +``` +zetacored tx crosschain nonce-voter [chain] [nonce] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for nonce-voter + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_outbound-voter.md b/docs/cli/zetacored/zetacored_tx_crosschain_outbound-voter.md new file mode 100644 index 0000000000..e48b29d4fc --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_outbound-voter.md @@ -0,0 +1,52 @@ +# tx crosschain outbound-voter + +Broadcast message receiveConfirmation + +``` +zetacored tx crosschain outbound-voter [sendHash] [outTxHash] [outBlockHeight] [outGasUsed] [outEffectiveGasPrice] [outEffectiveGasLimit] [valueReceived] [Status] [chain] [outTXNonce] [coinType] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for outbound-voter + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_remove-from-out-tx-tracker.md b/docs/cli/zetacored/zetacored_tx_crosschain_remove-from-out-tx-tracker.md new file mode 100644 index 0000000000..8b16d994cd --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_remove-from-out-tx-tracker.md @@ -0,0 +1,52 @@ +# tx crosschain remove-from-out-tx-tracker + +Remove a out-tx-tracker + +``` +zetacored tx crosschain remove-from-out-tx-tracker [chain] [nonce] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for remove-from-out-tx-tracker + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_update-tss-address.md b/docs/cli/zetacored/zetacored_tx_crosschain_update-tss-address.md new file mode 100644 index 0000000000..9825c4f48b --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_crosschain_update-tss-address.md @@ -0,0 +1,52 @@ +# tx crosschain update-tss-address + +Create a new TSSVoter + +``` +zetacored tx crosschain update-tss-address [pubkey] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-tss-address + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_decode.md b/docs/cli/zetacored/zetacored_tx_decode.md new file mode 100644 index 0000000000..f56c07eb66 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_decode.md @@ -0,0 +1,53 @@ +# tx decode + +Decode a binary encoded transaction string + +``` +zetacored tx decode [protobuf-byte-string] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for decode + -x, --hex Treat input as hexadecimal instead of base64 + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_distribution.md b/docs/cli/zetacored/zetacored_tx_distribution.md new file mode 100644 index 0000000000..24ba494079 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_distribution.md @@ -0,0 +1,32 @@ +# tx distribution + +Distribution transactions subcommands + +``` +zetacored tx distribution [flags] +``` + +### Options + +``` + -h, --help help for distribution +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx distribution fund-community-pool](zetacored_tx_distribution_fund-community-pool.md) - Funds the community pool with the specified amount +* [zetacored tx distribution set-withdraw-addr](zetacored_tx_distribution_set-withdraw-addr.md) - change the default withdraw address for rewards associated with an address +* [zetacored tx distribution withdraw-all-rewards](zetacored_tx_distribution_withdraw-all-rewards.md) - withdraw all delegations rewards for a delegator +* [zetacored tx distribution withdraw-rewards](zetacored_tx_distribution_withdraw-rewards.md) - Withdraw rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator + diff --git a/docs/cli/zetacored/zetacored_tx_distribution_fund-community-pool.md b/docs/cli/zetacored/zetacored_tx_distribution_fund-community-pool.md new file mode 100644 index 0000000000..d1f8f5b934 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_distribution_fund-community-pool.md @@ -0,0 +1,59 @@ +# tx distribution fund-community-pool + +Funds the community pool with the specified amount + +### Synopsis + +Funds the community pool with the specified amount + +Example: +$ zetacored tx distribution fund-community-pool 100uatom --from mykey + +``` +zetacored tx distribution fund-community-pool [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for fund-community-pool + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx distribution](zetacored_tx_distribution.md) - Distribution transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_distribution_set-withdraw-addr.md b/docs/cli/zetacored/zetacored_tx_distribution_set-withdraw-addr.md new file mode 100644 index 0000000000..16e4238826 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_distribution_set-withdraw-addr.md @@ -0,0 +1,59 @@ +# tx distribution set-withdraw-addr + +change the default withdraw address for rewards associated with an address + +### Synopsis + +Set the withdraw address for rewards associated with a delegator address. + +Example: +$ zetacored tx distribution set-withdraw-addr zeta1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p --from mykey + +``` +zetacored tx distribution set-withdraw-addr [withdraw-addr] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for set-withdraw-addr + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx distribution](zetacored_tx_distribution.md) - Distribution transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_distribution_withdraw-all-rewards.md b/docs/cli/zetacored/zetacored_tx_distribution_withdraw-all-rewards.md new file mode 100644 index 0000000000..1953201680 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_distribution_withdraw-all-rewards.md @@ -0,0 +1,61 @@ +# tx distribution withdraw-all-rewards + +withdraw all delegations rewards for a delegator + +### Synopsis + +Withdraw all rewards for a single delegator. +Note that if you use this command with --broadcast-mode=sync or --broadcast-mode=async, the max-msgs flag will automatically be set to 0. + +Example: +$ zetacored tx distribution withdraw-all-rewards --from mykey + +``` +zetacored tx distribution withdraw-all-rewards [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for withdraw-all-rewards + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --max-msgs int Limit the number of messages per tx (0 for unlimited) + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx distribution](zetacored_tx_distribution.md) - Distribution transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_distribution_withdraw-rewards.md b/docs/cli/zetacored/zetacored_tx_distribution_withdraw-rewards.md new file mode 100644 index 0000000000..690512f929 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_distribution_withdraw-rewards.md @@ -0,0 +1,62 @@ +# tx distribution withdraw-rewards + +Withdraw rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator + +### Synopsis + +Withdraw rewards from a given delegation address, +and optionally withdraw validator commission if the delegation address given is a validator operator. + +Example: +$ zetacored tx distribution withdraw-rewards zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey +$ zetacored tx distribution withdraw-rewards zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj --from mykey --commission + +``` +zetacored tx distribution withdraw-rewards [validator-addr] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --commission Withdraw the validator's commission in addition to the rewards + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for withdraw-rewards + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx distribution](zetacored_tx_distribution.md) - Distribution transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_emissions.md b/docs/cli/zetacored/zetacored_tx_emissions.md new file mode 100644 index 0000000000..f782c072d1 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_emissions.md @@ -0,0 +1,28 @@ +# tx emissions + +emissions transactions subcommands + +``` +zetacored tx emissions [flags] +``` + +### Options + +``` + -h, --help help for emissions +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_encode.md b/docs/cli/zetacored/zetacored_tx_encode.md new file mode 100644 index 0000000000..5065aea539 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_encode.md @@ -0,0 +1,58 @@ +# tx encode + +Encode transactions generated offline + +### Synopsis + +Encode transactions created with the --generate-only flag and signed with the sign command. +Read a transaction from [file], serialize it to the Protobuf wire protocol, and output it as base64. +If you supply a dash (-) argument in place of an input filename, the command reads from standard input. + +``` +zetacored tx encode [file] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for encode + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_evidence.md b/docs/cli/zetacored/zetacored_tx_evidence.md new file mode 100644 index 0000000000..e597d3afb8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_evidence.md @@ -0,0 +1,28 @@ +# tx evidence + +Evidence transaction subcommands + +``` +zetacored tx evidence [flags] +``` + +### Options + +``` + -h, --help help for evidence +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_evm.md b/docs/cli/zetacored/zetacored_tx_evm.md new file mode 100644 index 0000000000..a804fbebd0 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_evm.md @@ -0,0 +1,29 @@ +# tx evm + +evm transactions subcommands + +``` +zetacored tx evm [flags] +``` + +### Options + +``` + -h, --help help for evm +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx evm raw](zetacored_tx_evm_raw.md) - Build cosmos transaction from raw ethereum transaction + diff --git a/docs/cli/zetacored/zetacored_tx_evm_raw.md b/docs/cli/zetacored/zetacored_tx_evm_raw.md new file mode 100644 index 0000000000..554fc5edf8 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_evm_raw.md @@ -0,0 +1,52 @@ +# tx evm raw + +Build cosmos transaction from raw ethereum transaction + +``` +zetacored tx evm raw TX_HEX [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for raw + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx evm](zetacored_tx_evm.md) - evm transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_fungible.md b/docs/cli/zetacored/zetacored_tx_fungible.md new file mode 100644 index 0000000000..0ba5834cd3 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_fungible.md @@ -0,0 +1,31 @@ +# tx fungible + +fungible transactions subcommands + +``` +zetacored tx fungible [flags] +``` + +### Options + +``` + -h, --help help for fungible +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx fungible deploy-fungible-coin-zrc-4](zetacored_tx_fungible_deploy-fungible-coin-zrc-4.md) - Broadcast message DeployFungibleCoinZRC20 +* [zetacored tx fungible remove-foreign-coin](zetacored_tx_fungible_remove-foreign-coin.md) - Broadcast message RemoveForeignCoin +* [zetacored tx fungible update-zrc20-liquidity-cap](zetacored_tx_fungible_update-zrc20-liquidity-cap.md) - Broadcast message UpdateZRC20LiquidityCap + diff --git a/docs/cli/zetacored/zetacored_tx_fungible_deploy-fungible-coin-zrc-4.md b/docs/cli/zetacored/zetacored_tx_fungible_deploy-fungible-coin-zrc-4.md new file mode 100644 index 0000000000..efb5f50aa4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_fungible_deploy-fungible-coin-zrc-4.md @@ -0,0 +1,52 @@ +# tx fungible deploy-fungible-coin-zrc-4 + +Broadcast message DeployFungibleCoinZRC20 + +``` +zetacored tx fungible deploy-fungible-coin-zrc-4 [erc-20] [foreign-chain] [decimals] [name] [symbol] [coin-type] [gas-limit] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for deploy-fungible-coin-zrc-4 + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_fungible_remove-foreign-coin.md b/docs/cli/zetacored/zetacored_tx_fungible_remove-foreign-coin.md new file mode 100644 index 0000000000..4f706ad6e7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_fungible_remove-foreign-coin.md @@ -0,0 +1,52 @@ +# tx fungible remove-foreign-coin + +Broadcast message RemoveForeignCoin + +``` +zetacored tx fungible remove-foreign-coin [name] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for remove-foreign-coin + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_fungible_update-zrc20-liquidity-cap.md b/docs/cli/zetacored/zetacored_tx_fungible_update-zrc20-liquidity-cap.md new file mode 100644 index 0000000000..f3d4032925 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_fungible_update-zrc20-liquidity-cap.md @@ -0,0 +1,52 @@ +# tx fungible update-zrc20-liquidity-cap + +Broadcast message UpdateZRC20LiquidityCap + +``` +zetacored tx fungible update-zrc20-liquidity-cap [zrc20] [liquidity-cap] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-zrc20-liquidity-cap + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx fungible](zetacored_tx_fungible.md) - fungible transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_gov.md b/docs/cli/zetacored/zetacored_tx_gov.md new file mode 100644 index 0000000000..07e657f276 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov.md @@ -0,0 +1,34 @@ +# tx gov + +Governance transactions subcommands + +``` +zetacored tx gov [flags] +``` + +### Options + +``` + -h, --help help for gov +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx gov deposit](zetacored_tx_gov_deposit.md) - Deposit tokens for an active proposal +* [zetacored tx gov draft-proposal](zetacored_tx_gov_draft-proposal.md) - Generate a draft proposal json file. The generated proposal json contains only one message (skeleton). +* [zetacored tx gov submit-legacy-proposal](zetacored_tx_gov_submit-legacy-proposal.md) - Submit a legacy proposal along with an initial deposit +* [zetacored tx gov submit-proposal](zetacored_tx_gov_submit-proposal.md) - Submit a proposal along with some messages, metadata and deposit +* [zetacored tx gov vote](zetacored_tx_gov_vote.md) - Vote for an active proposal, options: yes/no/no_with_veto/abstain +* [zetacored tx gov weighted-vote](zetacored_tx_gov_weighted-vote.md) - Vote for an active proposal, options: yes/no/no_with_veto/abstain + diff --git a/docs/cli/zetacored/zetacored_tx_gov_deposit.md b/docs/cli/zetacored/zetacored_tx_gov_deposit.md new file mode 100644 index 0000000000..d36702fc5b --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_deposit.md @@ -0,0 +1,60 @@ +# tx gov deposit + +Deposit tokens for an active proposal + +### Synopsis + +Submit a deposit for an active proposal. You can +find the proposal-id by running "zetacored query gov proposals". + +Example: +$ zetacored tx gov deposit 1 10stake --from mykey + +``` +zetacored tx gov deposit [proposal-id] [deposit] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for deposit + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov](zetacored_tx_gov.md) - Governance transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_gov_draft-proposal.md b/docs/cli/zetacored/zetacored_tx_gov_draft-proposal.md new file mode 100644 index 0000000000..8a95f75cb6 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_draft-proposal.md @@ -0,0 +1,52 @@ +# tx gov draft-proposal + +Generate a draft proposal json file. The generated proposal json contains only one message (skeleton). + +``` +zetacored tx gov draft-proposal [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for draft-proposal + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov](zetacored_tx_gov.md) - Governance transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal.md b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal.md new file mode 100644 index 0000000000..a51c9830d5 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal.md @@ -0,0 +1,82 @@ +# tx gov submit-legacy-proposal + +Submit a legacy proposal along with an initial deposit + +### Synopsis + +Submit a legacy proposal along with an initial deposit. +Proposal title, description, type and deposit can be given directly or through a proposal JSON file. + +Example: +$ zetacored tx gov submit-legacy-proposal --proposal="path/to/proposal.json" --from mykey + +Where proposal.json contains: + +{ + "title": "Test Proposal", + "description": "My awesome proposal", + "type": "Text", + "deposit": "10test" +} + +Which is equivalent to: + +$ zetacored tx gov submit-legacy-proposal --title="Test Proposal" --description="My awesome proposal" --type="Text" --deposit="10test" --from mykey + +``` +zetacored tx gov submit-legacy-proposal [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --deposit string The proposal deposit + --description string The proposal description + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for submit-legacy-proposal + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --proposal string Proposal file path (if this path is given, other proposal flags are ignored) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + --title string The proposal title + --type string The proposal Type + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov](zetacored_tx_gov.md) - Governance transactions subcommands +* [zetacored tx gov submit-legacy-proposal cancel-software-upgrade](zetacored_tx_gov_submit-legacy-proposal_cancel-software-upgrade.md) - Cancel the current software upgrade proposal +* [zetacored tx gov submit-legacy-proposal community-pool-spend](zetacored_tx_gov_submit-legacy-proposal_community-pool-spend.md) - Submit a community pool spend proposal +* [zetacored tx gov submit-legacy-proposal param-change](zetacored_tx_gov_submit-legacy-proposal_param-change.md) - Submit a parameter change proposal +* [zetacored tx gov submit-legacy-proposal software-upgrade](zetacored_tx_gov_submit-legacy-proposal_software-upgrade.md) - Submit a software upgrade proposal + diff --git a/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_cancel-software-upgrade.md b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_cancel-software-upgrade.md new file mode 100644 index 0000000000..37df646f6e --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_cancel-software-upgrade.md @@ -0,0 +1,59 @@ +# tx gov submit-legacy-proposal cancel-software-upgrade + +Cancel the current software upgrade proposal + +### Synopsis + +Cancel a software upgrade along with an initial deposit. + +``` +zetacored tx gov submit-legacy-proposal cancel-software-upgrade [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --deposit string deposit of proposal + --description string description of proposal + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for cancel-software-upgrade + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + --title string title of proposal + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov submit-legacy-proposal](zetacored_tx_gov_submit-legacy-proposal.md) - Submit a legacy proposal along with an initial deposit + diff --git a/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_community-pool-spend.md b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_community-pool-spend.md new file mode 100644 index 0000000000..9698694c40 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_community-pool-spend.md @@ -0,0 +1,70 @@ +# tx gov submit-legacy-proposal community-pool-spend + +Submit a community pool spend proposal + +### Synopsis + +Submit a community pool spend proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. + +Example: +$ zetacored tx gov submit-proposal community-pool-spend [path/to/proposal.json] --from=[key_or_address] + +Where proposal.json contains: + +{ + "title": "Community Pool Spend", + "description": "Pay me some Atoms!", + "recipient": "zeta1s5afhd6gxevu37mkqcvvsj8qeylhn0rz46zdlq", + "amount": "1000stake", + "deposit": "1000stake" +} + +``` +zetacored tx gov submit-legacy-proposal community-pool-spend [proposal-file] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for community-pool-spend + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov submit-legacy-proposal](zetacored_tx_gov_submit-legacy-proposal.md) - Submit a legacy proposal along with an initial deposit + diff --git a/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_param-change.md b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_param-change.md new file mode 100644 index 0000000000..ea0d00808f --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_param-change.md @@ -0,0 +1,84 @@ +# tx gov submit-legacy-proposal param-change + +Submit a parameter change proposal + +### Synopsis + +Submit a parameter proposal along with an initial deposit. +The proposal details must be supplied via a JSON file. For values that contains +objects, only non-empty fields will be updated. + +IMPORTANT: Currently parameter changes are evaluated but not validated, so it is +very important that any "value" change is valid (ie. correct type and within bounds) +for its respective parameter, eg. "MaxValidators" should be an integer and not a decimal. + +Proper vetting of a parameter change proposal should prevent this from happening +(no deposits should occur during the governance process), but it should be noted +regardless. + +Example: +$ zetacored tx gov submit-proposal param-change [path/to/proposal.json] --from=[key_or_address] + +Where proposal.json contains: + +{ + "title": "Staking Param Change", + "description": "Update max validators", + "changes": [ + { + "subspace": "staking", + "key": "MaxValidators", + "value": 105 + } + ], + "deposit": "1000stake" +} + +``` +zetacored tx gov submit-legacy-proposal param-change [proposal-file] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for param-change + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov submit-legacy-proposal](zetacored_tx_gov_submit-legacy-proposal.md) - Submit a legacy proposal along with an initial deposit + diff --git a/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_software-upgrade.md b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_software-upgrade.md new file mode 100644 index 0000000000..3102f3023a --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_submit-legacy-proposal_software-upgrade.md @@ -0,0 +1,65 @@ +# tx gov submit-legacy-proposal software-upgrade + +Submit a software upgrade proposal + +### Synopsis + +Submit a software upgrade along with an initial deposit. +Please specify a unique name and height for the upgrade to take effect. +You may include info to reference a binary download link, in a format compatible with: https://github.com/cosmos/cosmos-sdk/tree/main/cosmovisor + +``` +zetacored tx gov submit-legacy-proposal software-upgrade [name] (--upgrade-height [height]) (--upgrade-info [info]) [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --daemon-name string The name of the executable being upgraded (for upgrade-info validation). Default is the DAEMON_NAME env var if set, or else this executable + --deposit string deposit of proposal + --description string description of proposal + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for software-upgrade + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --no-validate Skip validation of the upgrade info + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + --title string title of proposal + --upgrade-height int The height at which the upgrade must happen + --upgrade-info string Info for the upgrade plan such as new version download urls, etc. + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov submit-legacy-proposal](zetacored_tx_gov_submit-legacy-proposal.md) - Submit a legacy proposal along with an initial deposit + diff --git a/docs/cli/zetacored/zetacored_tx_gov_submit-proposal.md b/docs/cli/zetacored/zetacored_tx_gov_submit-proposal.md new file mode 100644 index 0000000000..a529531ff2 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_submit-proposal.md @@ -0,0 +1,76 @@ +# tx gov submit-proposal + +Submit a proposal along with some messages, metadata and deposit + +### Synopsis + +Submit a proposal along with some messages, metadata and deposit. +They should be defined in a JSON file. + +Example: +$ zetacored tx gov submit-proposal path/to/proposal.json + +Where proposal.json contains: + +{ + // array of proto-JSON-encoded sdk.Msgs + "messages": [ + { + "@type": "/cosmos.bank.v1beta1.MsgSend", + "from_address": "cosmos1...", + "to_address": "cosmos1...", + "amount":[{"denom": "stake","amount": "10"}] + } + ], + "metadata: "4pIMOgIGx1vZGU=", // base64-encoded metadata + "deposit": "10stake" +} + +``` +zetacored tx gov submit-proposal [path/to/proposal.json] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for submit-proposal + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov](zetacored_tx_gov.md) - Governance transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_gov_vote.md b/docs/cli/zetacored/zetacored_tx_gov_vote.md new file mode 100644 index 0000000000..9e2053f8f7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_vote.md @@ -0,0 +1,61 @@ +# tx gov vote + +Vote for an active proposal, options: yes/no/no_with_veto/abstain + +### Synopsis + +Submit a vote for an active proposal. You can +find the proposal-id by running "zetacored query gov proposals". + +Example: +$ zetacored tx gov vote 1 yes --from mykey + +``` +zetacored tx gov vote [proposal-id] [option] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for vote + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --metadata string Specify metadata of the vote + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov](zetacored_tx_gov.md) - Governance transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_gov_weighted-vote.md b/docs/cli/zetacored/zetacored_tx_gov_weighted-vote.md new file mode 100644 index 0000000000..061cb11537 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_gov_weighted-vote.md @@ -0,0 +1,61 @@ +# tx gov weighted-vote + +Vote for an active proposal, options: yes/no/no_with_veto/abstain + +### Synopsis + +Submit a vote for an active proposal. You can +find the proposal-id by running "zetacored query gov proposals". + +Example: +$ zetacored tx gov weighted-vote 1 yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05 --from mykey + +``` +zetacored tx gov weighted-vote [proposal-id] [weighted-options] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for weighted-vote + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --metadata string Specify metadata of the weighted vote + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx gov](zetacored_tx_gov.md) - Governance transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group.md b/docs/cli/zetacored/zetacored_tx_group.md new file mode 100644 index 0000000000..7e2ec701fb --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group.md @@ -0,0 +1,43 @@ +# tx group + +Group transaction subcommands + +``` +zetacored tx group [flags] +``` + +### Options + +``` + -h, --help help for group +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx group create-group](zetacored_tx_group_create-group.md) - Create a group which is an aggregation of member accounts with associated weights and an administrator account. +* [zetacored tx group create-group-policy](zetacored_tx_group_create-group-policy.md) - Create a group policy which is an account associated with a group and a decision policy. Note, the '--from' flag is ignored as it is implied from [admin]. +* [zetacored tx group create-group-with-policy](zetacored_tx_group_create-group-with-policy.md) - Create a group with policy which is an aggregation of member accounts with associated weights, an administrator account and decision policy. +* [zetacored tx group draft-proposal](zetacored_tx_group_draft-proposal.md) - Generate a draft proposal json file. The generated proposal json contains only one message (skeleton). +* [zetacored tx group exec](zetacored_tx_group_exec.md) - Execute a proposal +* [zetacored tx group leave-group](zetacored_tx_group_leave-group.md) - Remove member from the group +* [zetacored tx group submit-proposal](zetacored_tx_group_submit-proposal.md) - Submit a new proposal +* [zetacored tx group update-group-admin](zetacored_tx_group_update-group-admin.md) - Update a group's admin +* [zetacored tx group update-group-members](zetacored_tx_group_update-group-members.md) - Update a group's members. Set a member's weight to "0" to delete it. +* [zetacored tx group update-group-metadata](zetacored_tx_group_update-group-metadata.md) - Update a group's metadata +* [zetacored tx group update-group-policy-admin](zetacored_tx_group_update-group-policy-admin.md) - Update a group policy admin +* [zetacored tx group update-group-policy-decision-policy](zetacored_tx_group_update-group-policy-decision-policy.md) - Update a group policy's decision policy +* [zetacored tx group update-group-policy-metadata](zetacored_tx_group_update-group-policy-metadata.md) - Update a group policy metadata +* [zetacored tx group vote](zetacored_tx_group_vote.md) - Vote on a proposal +* [zetacored tx group withdraw-proposal](zetacored_tx_group_withdraw-proposal.md) - Withdraw a submitted proposal + diff --git a/docs/cli/zetacored/zetacored_tx_group_create-group-policy.md b/docs/cli/zetacored/zetacored_tx_group_create-group-policy.md new file mode 100644 index 0000000000..61a0e58dde --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_create-group-policy.md @@ -0,0 +1,81 @@ +# tx group create-group-policy + +Create a group policy which is an account associated with a group and a decision policy. Note, the '--from' flag is ignored as it is implied from [admin]. + +``` +zetacored tx group create-group-policy [admin] [group-id] [metadata] [decision-policy-json-file] [flags] +``` + +### Examples + +``` + +zetacored tx group create-group-policy [admin] [group-id] [metadata] policy.json + +where policy.json contains: + +{ + "@type": "/cosmos.group.v1.ThresholdDecisionPolicy", + "threshold": "1", + "windows": { + "voting_period": "120h", + "min_execution_period": "0s" + } +} + +Here, we can use percentage decision policy when needed, where 0 < percentage <= 1: + +{ + "@type": "/cosmos.group.v1.PercentageDecisionPolicy", + "percentage": "0.5", + "windows": { + "voting_period": "120h", + "min_execution_period": "0s" + } +} +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for create-group-policy + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_create-group-with-policy.md b/docs/cli/zetacored/zetacored_tx_group_create-group-with-policy.md new file mode 100644 index 0000000000..799e1d37b4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_create-group-with-policy.md @@ -0,0 +1,96 @@ +# tx group create-group-with-policy + +Create a group with policy which is an aggregation of member accounts with associated weights, an administrator account and decision policy. + +### Synopsis + +Create a group with policy which is an aggregation of member accounts with associated weights, +an administrator account and decision policy. Note, the '--from' flag is ignored as it is implied from [admin]. +Members accounts can be given through a members JSON file that contains an array of members. +If group-policy-as-admin flag is set to true, the admin of the newly created group and group policy is set with the group policy address itself. + +``` +zetacored tx group create-group-with-policy [admin] [group-metadata] [group-policy-metadata] [members-json-file] [decision-policy-json-file] [flags] +``` + +### Examples + +``` + +zetacored tx group create-group-with-policy [admin] [group-metadata] [group-policy-metadata] members.json policy.json + +where members.json contains: + +{ + "members": [ + { + "address": "addr1", + "weight": "1", + "metadata": "some metadata" + }, + { + "address": "addr2", + "weight": "1", + "metadata": "some metadata" + } + ] +} + +and policy.json contains: + +{ + "@type": "/cosmos.group.v1.ThresholdDecisionPolicy", + "threshold": "1", + "windows": { + "voting_period": "120h", + "min_execution_period": "0s" + } +} + +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + --group-policy-as-admin Sets admin of the newly created group and group policy with group policy address itself when true + -h, --help help for create-group-with-policy + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_create-group.md b/docs/cli/zetacored/zetacored_tx_group_create-group.md new file mode 100644 index 0000000000..40bf5d12fb --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_create-group.md @@ -0,0 +1,81 @@ +# tx group create-group + +Create a group which is an aggregation of member accounts with associated weights and an administrator account. + +### Synopsis + +Create a group which is an aggregation of member accounts with associated weights and an administrator account. +Note, the '--from' flag is ignored as it is implied from [admin]. Members accounts can be given through a members JSON file that contains an array of members. + +``` +zetacored tx group create-group [admin] [metadata] [members-json-file] [flags] +``` + +### Examples + +``` + +zetacored tx group create-group [admin] [metadata] [members-json-file] + +Where members.json contains: + +{ + "members": [ + { + "address": "addr1", + "weight": "1", + "metadata": "some metadata" + }, + { + "address": "addr2", + "weight": "1", + "metadata": "some metadata" + } + ] +} +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for create-group + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_draft-proposal.md b/docs/cli/zetacored/zetacored_tx_group_draft-proposal.md new file mode 100644 index 0000000000..2aa80bb161 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_draft-proposal.md @@ -0,0 +1,52 @@ +# tx group draft-proposal + +Generate a draft proposal json file. The generated proposal json contains only one message (skeleton). + +``` +zetacored tx group draft-proposal [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for draft-proposal + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_exec.md b/docs/cli/zetacored/zetacored_tx_group_exec.md new file mode 100644 index 0000000000..bbca4e53b6 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_exec.md @@ -0,0 +1,52 @@ +# tx group exec + +Execute a proposal + +``` +zetacored tx group exec [proposal-id] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for exec + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_leave-group.md b/docs/cli/zetacored/zetacored_tx_group_leave-group.md new file mode 100644 index 0000000000..e1b618bdc0 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_leave-group.md @@ -0,0 +1,62 @@ +# tx group leave-group + +Remove member from the group + +### Synopsis + +Remove member from the group + +Parameters: + group-id: unique id of the group + member-address: account address of the group member + Note, the '--from' flag is ignored as it is implied from [member-address] + + +``` +zetacored tx group leave-group [member-address] [group-id] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for leave-group + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_submit-proposal.md b/docs/cli/zetacored/zetacored_tx_group_submit-proposal.md new file mode 100644 index 0000000000..81a220e84b --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_submit-proposal.md @@ -0,0 +1,83 @@ +# tx group submit-proposal + +Submit a new proposal + +### Synopsis + +Submit a new proposal. +Parameters: + msg_tx_json_file: path to json file with messages that will be executed if the proposal is accepted. + +``` +zetacored tx group submit-proposal [proposal_json_file] [flags] +``` + +### Examples + +``` + +zetacored tx group submit-proposal path/to/proposal.json + + Where proposal.json contains: + +{ + "group_policy_address": "cosmos1...", + // array of proto-JSON-encoded sdk.Msgs + "messages": [ + { + "@type": "/cosmos.bank.v1beta1.MsgSend", + "from_address": "cosmos1...", + "to_address": "cosmos1...", + "amount":[{"denom": "stake","amount": "10"}] + } + ], + "metadata": "4pIMOgIGx1vZGU=", // base64-encoded metadata + "proposers": ["cosmos1...", "cosmos1..."], +} +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --exec string Set to 1 to try to execute proposal immediately after creation (proposers signatures are considered as Yes votes) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for submit-proposal + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_update-group-admin.md b/docs/cli/zetacored/zetacored_tx_group_update-group-admin.md new file mode 100644 index 0000000000..61683036d7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_update-group-admin.md @@ -0,0 +1,52 @@ +# tx group update-group-admin + +Update a group's admin + +``` +zetacored tx group update-group-admin [admin] [group-id] [new-admin] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-group-admin + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_update-group-members.md b/docs/cli/zetacored/zetacored_tx_group_update-group-members.md new file mode 100644 index 0000000000..8fd88040d0 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_update-group-members.md @@ -0,0 +1,79 @@ +# tx group update-group-members + +Update a group's members. Set a member's weight to "0" to delete it. + +``` +zetacored tx group update-group-members [admin] [group-id] [members-json-file] [flags] +``` + +### Examples + +``` + +zetacored tx group update-group-members [admin] [group-id] [members-json-file] + +Where members.json contains: + +{ + "members": [ + { + "address": "addr1", + "weight": "1", + "metadata": "some new metadata" + }, + { + "address": "addr2", + "weight": "0", + "metadata": "some metadata" + } + ] +} + +Set a member's weight to "0" to delete it. + +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-group-members + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_update-group-metadata.md b/docs/cli/zetacored/zetacored_tx_group_update-group-metadata.md new file mode 100644 index 0000000000..9c891cc30a --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_update-group-metadata.md @@ -0,0 +1,52 @@ +# tx group update-group-metadata + +Update a group's metadata + +``` +zetacored tx group update-group-metadata [admin] [group-id] [metadata] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-group-metadata + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_update-group-policy-admin.md b/docs/cli/zetacored/zetacored_tx_group_update-group-policy-admin.md new file mode 100644 index 0000000000..1f8d82174e --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_update-group-policy-admin.md @@ -0,0 +1,52 @@ +# tx group update-group-policy-admin + +Update a group policy admin + +``` +zetacored tx group update-group-policy-admin [admin] [group-policy-account] [new-admin] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-group-policy-admin + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_update-group-policy-decision-policy.md b/docs/cli/zetacored/zetacored_tx_group_update-group-policy-decision-policy.md new file mode 100644 index 0000000000..6cb8672e22 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_update-group-policy-decision-policy.md @@ -0,0 +1,52 @@ +# tx group update-group-policy-decision-policy + +Update a group policy's decision policy + +``` +zetacored tx group update-group-policy-decision-policy [admin] [group-policy-account] [decision-policy-json-file] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-group-policy-decision-policy + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_update-group-policy-metadata.md b/docs/cli/zetacored/zetacored_tx_group_update-group-policy-metadata.md new file mode 100644 index 0000000000..b274c72e08 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_update-group-policy-metadata.md @@ -0,0 +1,52 @@ +# tx group update-group-policy-metadata + +Update a group policy metadata + +``` +zetacored tx group update-group-policy-metadata [admin] [group-policy-account] [new-metadata] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-group-policy-metadata + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_vote.md b/docs/cli/zetacored/zetacored_tx_group_vote.md new file mode 100644 index 0000000000..c50b17c951 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_vote.md @@ -0,0 +1,69 @@ +# tx group vote + +Vote on a proposal + +### Synopsis + +Vote on a proposal. + +Parameters: + proposal-id: unique ID of the proposal + voter: voter account addresses. + vote-option: choice of the voter(s) + VOTE_OPTION_UNSPECIFIED: no-op + VOTE_OPTION_NO: no + VOTE_OPTION_YES: yes + VOTE_OPTION_ABSTAIN: abstain + VOTE_OPTION_NO_WITH_VETO: no-with-veto + Metadata: metadata for the vote + + +``` +zetacored tx group vote [proposal-id] [voter] [vote-option] [metadata] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --exec string Set to 1 to try to execute proposal immediately after voting + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for vote + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_group_withdraw-proposal.md b/docs/cli/zetacored/zetacored_tx_group_withdraw-proposal.md new file mode 100644 index 0000000000..03443daf7c --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_group_withdraw-proposal.md @@ -0,0 +1,62 @@ +# tx group withdraw-proposal + +Withdraw a submitted proposal + +### Synopsis + +Withdraw a submitted proposal. + +Parameters: + proposal-id: unique ID of the proposal. + group-policy-admin-or-proposer: either admin of the group policy or one the proposer of the proposal. + Note: --from flag will be ignored here. + + +``` +zetacored tx group withdraw-proposal [proposal-id] [group-policy-admin-or-proposer] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for withdraw-proposal + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx group](zetacored_tx_group.md) - Group transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_multi-sign.md b/docs/cli/zetacored/zetacored_tx_multi-sign.md new file mode 100644 index 0000000000..c09adeaa69 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_multi-sign.md @@ -0,0 +1,75 @@ +# tx multi-sign + +Generate multisig signatures for transactions generated offline + +### Synopsis + +Sign transactions created with the --generate-only flag that require multisig signatures. + +Read one or more signatures from one or more [signature] file, generate a multisig signature compliant to the +multisig key [name], and attach the key name to the transaction read from [file]. + +Example: +$ zetacored tx multisign transaction.json k1k2k3 k1sig.json k2sig.json k3sig.json + +If --signature-only flag is on, output a JSON representation +of only the generated signature. + +If the --offline flag is on, the client will not reach out to an external node. +Account number or sequence number lookups are not performed so you must +set these parameters manually. + +The current multisig implementation defaults to amino-json sign mode. +The SIGN_MODE_DIRECT sign mode is not supported.' + +``` +zetacored tx multi-sign [file] [name] [[signature]...] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --amino Generate Amino-encoded JSON suitable for submitting to the txs REST endpoint + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --chain-id string network chain ID + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for multi-sign + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --output-document string The document is written to the given file instead of STDOUT + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --signature-only Print only the generated signature, then exit + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_multisign-batch.md b/docs/cli/zetacored/zetacored_tx_multisign-batch.md new file mode 100644 index 0000000000..d624d6b76e --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_multisign-batch.md @@ -0,0 +1,68 @@ +# tx multisign-batch + +Assemble multisig transactions in batch from batch signatures + +### Synopsis + +Assemble a batch of multisig transactions generated by batch sign command. + +Read one or more signatures from one or more [signature] file, generate a multisig signature compliant to the +multisig key [name], and attach the key name to the transaction read from [file]. + +Example: +$ zetacored tx multisign-batch transactions.json multisigk1k2k3 k1sigs.json k2sigs.json k3sig.json + +The current multisig implementation defaults to amino-json sign mode. +The SIGN_MODE_DIRECT sign mode is not supported.' + +``` +zetacored tx multisign-batch [file] [name] [[signature-file]...] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for multisign-batch + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --multisig string Address of the multisig account that the transaction signs on behalf of + --no-auto-increment disable sequence auto increment + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --output-document string The document is written to the given file instead of STDOUT + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_observer.md b/docs/cli/zetacored/zetacored_tx_observer.md new file mode 100644 index 0000000000..a072bed60f --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_observer.md @@ -0,0 +1,34 @@ +# tx observer + +observer transactions subcommands + +``` +zetacored tx observer [flags] +``` + +### Options + +``` + -h, --help help for observer +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx observer add-blame-vote](zetacored_tx_observer_add-blame-vote.md) - Broadcast message add-blame-vote +* [zetacored tx observer add-observer](zetacored_tx_observer_add-observer.md) - Broadcast message add-observer +* [zetacored tx observer encode](zetacored_tx_observer_encode.md) - Encode a json string into hex +* [zetacored tx observer update-client-params](zetacored_tx_observer_update-client-params.md) - Broadcast message updateClientParams +* [zetacored tx observer update-crosschain-flags](zetacored_tx_observer_update-crosschain-flags.md) - Update crosschain flags +* [zetacored tx observer update-keygen](zetacored_tx_observer_update-keygen.md) - command to update the keygen block via a group proposal + diff --git a/docs/cli/zetacored/zetacored_tx_observer_add-blame-vote.md b/docs/cli/zetacored/zetacored_tx_observer_add-blame-vote.md new file mode 100644 index 0000000000..9557065174 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_observer_add-blame-vote.md @@ -0,0 +1,52 @@ +# tx observer add-blame-vote + +Broadcast message add-blame-vote + +``` +zetacored tx observer add-blame-vote [chain-id] [index] [failure-reason] [node-list] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for add-blame-vote + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_observer_add-observer.md b/docs/cli/zetacored/zetacored_tx_observer_add-observer.md new file mode 100644 index 0000000000..179edd49c7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_observer_add-observer.md @@ -0,0 +1,52 @@ +# tx observer add-observer + +Broadcast message add-observer + +``` +zetacored tx observer add-observer [observer-address] [zetaclient-grantee-pubkey] [add_node_account_only] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for add-observer + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_observer_encode.md b/docs/cli/zetacored/zetacored_tx_observer_encode.md new file mode 100644 index 0000000000..7cfe76080b --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_observer_encode.md @@ -0,0 +1,52 @@ +# tx observer encode + +Encode a json string into hex + +``` +zetacored tx observer encode [file.json] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for encode + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_observer_update-client-params.md b/docs/cli/zetacored/zetacored_tx_observer_update-client-params.md new file mode 100644 index 0000000000..e1505b3bfc --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_observer_update-client-params.md @@ -0,0 +1,52 @@ +# tx observer update-client-params + +Broadcast message updateClientParams + +``` +zetacored tx observer update-client-params [chain-id] [client-params.json] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-client-params + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_observer_update-crosschain-flags.md b/docs/cli/zetacored/zetacored_tx_observer_update-crosschain-flags.md new file mode 100644 index 0000000000..2a7f86ee80 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_observer_update-crosschain-flags.md @@ -0,0 +1,52 @@ +# tx observer update-crosschain-flags + +Update crosschain flags + +``` +zetacored tx observer update-crosschain-flags [is-inbound-enabled] [is-outbound-enabled] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-crosschain-flags + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_observer_update-keygen.md b/docs/cli/zetacored/zetacored_tx_observer_update-keygen.md new file mode 100644 index 0000000000..504891410e --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_observer_update-keygen.md @@ -0,0 +1,52 @@ +# tx observer update-keygen + +command to update the keygen block via a group proposal + +``` +zetacored tx observer update-keygen [block] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for update-keygen + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_sign-batch.md b/docs/cli/zetacored/zetacored_tx_sign-batch.md new file mode 100644 index 0000000000..2dbbff55af --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_sign-batch.md @@ -0,0 +1,78 @@ +# tx sign-batch + +Sign transaction batch files + +### Synopsis + +Sign batch files of transactions generated with --generate-only. +The command processes list of transactions from a file (one StdTx each line), or multiple files. +Then generates signed transactions or signatures and print their JSON encoding, delimited by '\n'. +As the signatures are generated, the command updates the account and sequence number accordingly. + +If the --signature-only flag is set, it will output the signature parts only. + +The --offline flag makes sure that the client will not reach out to full node. +As a result, the account and the sequence number queries will not be performed and +it is required to set such parameters manually. Note, invalid values will cause +the transaction to fail. The sequence will be incremented automatically for each +transaction that is signed. + +If --account-number or --sequence flag is used when offline=false, they are ignored and +overwritten by the default flag values. + +The --multisig=[multisig_key] flag generates a signature on behalf of a multisig +account key. It implies --signature-only. + + +``` +zetacored tx sign-batch [file] ([file2]...) [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --append Combine all message and generate single signed transaction for broadcast. + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --chain-id string network chain ID + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for sign-batch + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --multisig string Address or key name of the multisig account on behalf of which the transaction shall be signed + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --output-document string The document will be written to the given file instead of STDOUT + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --signature-only Print only the generated signature, then exit + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_sign.md b/docs/cli/zetacored/zetacored_tx_sign.md new file mode 100644 index 0000000000..85549cd59f --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_sign.md @@ -0,0 +1,74 @@ +# tx sign + +Sign a transaction generated offline + +### Synopsis + +Sign a transaction created with the --generate-only flag. +It will read a transaction from [file], sign it, and print its JSON encoding. + +If the --signature-only flag is set, it will output the signature parts only. + +The --offline flag makes sure that the client will not reach out to full node. +As a result, the account and sequence number queries will not be performed and +it is required to set such parameters manually. Note, invalid values will cause +the transaction to fail. + +The --multisig=[multisig_key] flag generates a signature on behalf of a multisig account +key. It implies --signature-only. Full multisig signed transactions may eventually +be generated via the 'multisign' command. + + +``` +zetacored tx sign [file] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --amino Generate Amino encoded JSON suitable for submiting to the txs REST endpoint + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --chain-id string The network chain ID + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for sign + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --multisig string Address or key name of the multisig account on behalf of which the transaction shall be signed + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --output-document string The document will be written to the given file instead of STDOUT + --overwrite Overwrite existing signatures with a new one. If disabled, new signature will be appended + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --signature-only Print only the signatures + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_slashing.md b/docs/cli/zetacored/zetacored_tx_slashing.md new file mode 100644 index 0000000000..1352d1937c --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_slashing.md @@ -0,0 +1,29 @@ +# tx slashing + +Slashing transaction subcommands + +``` +zetacored tx slashing [flags] +``` + +### Options + +``` + -h, --help help for slashing +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx slashing unjail](zetacored_tx_slashing_unjail.md) - unjail validator previously jailed for downtime + diff --git a/docs/cli/zetacored/zetacored_tx_slashing_unjail.md b/docs/cli/zetacored/zetacored_tx_slashing_unjail.md new file mode 100644 index 0000000000..0521563e8c --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_slashing_unjail.md @@ -0,0 +1,59 @@ +# tx slashing unjail + +unjail validator previously jailed for downtime + +### Synopsis + +unjail a jailed validator: + +$ zetacored tx slashing unjail --from mykey + + +``` +zetacored tx slashing unjail [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for unjail + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx slashing](zetacored_tx_slashing.md) - Slashing transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_staking.md b/docs/cli/zetacored/zetacored_tx_staking.md new file mode 100644 index 0000000000..3dd7eefdfb --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_staking.md @@ -0,0 +1,34 @@ +# tx staking + +Staking transaction subcommands + +``` +zetacored tx staking [flags] +``` + +### Options + +``` + -h, --help help for staking +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx staking cancel-unbond](zetacored_tx_staking_cancel-unbond.md) - Cancel unbonding delegation and delegate back to the validator +* [zetacored tx staking create-validator](zetacored_tx_staking_create-validator.md) - create new validator initialized with a self-delegation to it +* [zetacored tx staking delegate](zetacored_tx_staking_delegate.md) - Delegate liquid tokens to a validator +* [zetacored tx staking edit-validator](zetacored_tx_staking_edit-validator.md) - edit an existing validator account +* [zetacored tx staking redelegate](zetacored_tx_staking_redelegate.md) - Redelegate illiquid tokens from one validator to another +* [zetacored tx staking unbond](zetacored_tx_staking_unbond.md) - Unbond shares from a validator + diff --git a/docs/cli/zetacored/zetacored_tx_staking_cancel-unbond.md b/docs/cli/zetacored/zetacored_tx_staking_cancel-unbond.md new file mode 100644 index 0000000000..35365c959f --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_staking_cancel-unbond.md @@ -0,0 +1,65 @@ +# tx staking cancel-unbond + +Cancel unbonding delegation and delegate back to the validator + +### Synopsis + +Cancel Unbonding Delegation and delegate back to the validator. + +Example: +$ zetacored tx staking cancel-unbond zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake 2 --from mykey + +``` +zetacored tx staking cancel-unbond [validator-addr] [amount] [creation-height] [flags] +``` + +### Examples + +``` +$ zetacored tx staking cancel-unbond zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake 2 --from mykey +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for cancel-unbond + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx staking](zetacored_tx_staking.md) - Staking transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_staking_create-validator.md b/docs/cli/zetacored/zetacored_tx_staking_create-validator.md new file mode 100644 index 0000000000..68c874526d --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_staking_create-validator.md @@ -0,0 +1,65 @@ +# tx staking create-validator + +create new validator initialized with a self-delegation to it + +``` +zetacored tx staking create-validator [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --amount string Amount of coins to bond + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --commission-max-change-rate string The maximum commission change rate percentage (per day) + --commission-max-rate string The maximum commission rate percentage + --commission-rate string The initial commission rate percentage + --details string The validator's (optional) details + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for create-validator + --identity string The optional identity signature (ex. UPort or Keybase) + --ip string The node's public IP. It takes effect only when used in combination with --generate-only + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --min-self-delegation string The minimum self delegation required on the validator + --moniker string The validator's name + --node string [host]:[port] to tendermint rpc interface for this chain + --node-id string The node's ID + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --pubkey string The validator's Protobuf JSON encoded public key + --security-contact string The validator's (optional) security contact email + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + --website string The validator's (optional) website + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx staking](zetacored_tx_staking.md) - Staking transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_staking_delegate.md b/docs/cli/zetacored/zetacored_tx_staking_delegate.md new file mode 100644 index 0000000000..7159e8ce06 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_staking_delegate.md @@ -0,0 +1,59 @@ +# tx staking delegate + +Delegate liquid tokens to a validator + +### Synopsis + +Delegate an amount of liquid coins to a validator from your wallet. + +Example: +$ zetacored tx staking delegate zetavaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 1000stake --from mykey + +``` +zetacored tx staking delegate [validator-addr] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for delegate + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx staking](zetacored_tx_staking.md) - Staking transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_staking_edit-validator.md b/docs/cli/zetacored/zetacored_tx_staking_edit-validator.md new file mode 100644 index 0000000000..931e319af4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_staking_edit-validator.md @@ -0,0 +1,59 @@ +# tx staking edit-validator + +edit an existing validator account + +``` +zetacored tx staking edit-validator [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --commission-rate string The new commission rate percentage + --details string The validator's (optional) details + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for edit-validator + --identity string The (optional) identity signature (ex. UPort or Keybase) + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --min-self-delegation string The minimum self delegation required on the validator + --new-moniker string The validator's name + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + --security-contact string The validator's (optional) security contact email + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + --website string The validator's (optional) website + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx staking](zetacored_tx_staking.md) - Staking transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_staking_redelegate.md b/docs/cli/zetacored/zetacored_tx_staking_redelegate.md new file mode 100644 index 0000000000..962cfeb9f4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_staking_redelegate.md @@ -0,0 +1,59 @@ +# tx staking redelegate + +Redelegate illiquid tokens from one validator to another + +### Synopsis + +Redelegate an amount of illiquid staking tokens from one validator to another. + +Example: +$ zetacored tx staking redelegate zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj zetavaloper1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm 100stake --from mykey + +``` +zetacored tx staking redelegate [src-validator-addr] [dst-validator-addr] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for redelegate + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx staking](zetacored_tx_staking.md) - Staking transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_staking_unbond.md b/docs/cli/zetacored/zetacored_tx_staking_unbond.md new file mode 100644 index 0000000000..5f891d27f5 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_staking_unbond.md @@ -0,0 +1,59 @@ +# tx staking unbond + +Unbond shares from a validator + +### Synopsis + +Unbond an amount of bonded shares from a validator. + +Example: +$ zetacored tx staking unbond zetavaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj 100stake --from mykey + +``` +zetacored tx staking unbond [validator-addr] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for unbond + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx staking](zetacored_tx_staking.md) - Staking transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_validate-signatures.md b/docs/cli/zetacored/zetacored_tx_validate-signatures.md new file mode 100644 index 0000000000..474fe95a04 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_validate-signatures.md @@ -0,0 +1,63 @@ +# tx validate-signatures + +validate transactions signatures + +### Synopsis + +Print the addresses that must sign the transaction, those who have already +signed it, and make sure that signatures are in the correct order. + +The command would check whether all required signers have signed the transactions, whether +the signatures were collected in the right order, and if the signature is valid over the +given transaction. If the --offline flag is also set, signature validation over the +transaction will be not be performed as that will require RPC communication with a full node. + + +``` +zetacored tx validate-signatures [file] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --chain-id string The network chain ID + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for validate-signatures + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_vesting.md b/docs/cli/zetacored/zetacored_tx_vesting.md new file mode 100644 index 0000000000..9cb22ff682 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_vesting.md @@ -0,0 +1,31 @@ +# tx vesting + +Vesting transaction subcommands + +``` +zetacored tx vesting [flags] +``` + +### Options + +``` + -h, --help help for vesting +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx](zetacored_tx.md) - Transactions subcommands +* [zetacored tx vesting create-periodic-vesting-account](zetacored_tx_vesting_create-periodic-vesting-account.md) - Create a new vesting account funded with an allocation of tokens. +* [zetacored tx vesting create-permanent-locked-account](zetacored_tx_vesting_create-permanent-locked-account.md) - Create a new permanently locked account funded with an allocation of tokens. +* [zetacored tx vesting create-vesting-account](zetacored_tx_vesting_create-vesting-account.md) - Create a new vesting account funded with an allocation of tokens. + diff --git a/docs/cli/zetacored/zetacored_tx_vesting_create-periodic-vesting-account.md b/docs/cli/zetacored/zetacored_tx_vesting_create-periodic-vesting-account.md new file mode 100644 index 0000000000..93affb0766 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_vesting_create-periodic-vesting-account.md @@ -0,0 +1,72 @@ +# tx vesting create-periodic-vesting-account + +Create a new vesting account funded with an allocation of tokens. + +### Synopsis + +A sequence of coins and period length in seconds. Periods are sequential, in that the duration of of a period only starts at the end of the previous period. The duration of the first period starts upon account creation. For instance, the following periods.json file shows 20 "test" coins vesting 30 days apart from each other. + Where periods.json contains: + + An array of coin strings and unix epoch times for coins to vest +{ "start_time": 1625204910, +"periods":[ + { + "coins": "10test", + "length_seconds":2592000 //30 days + }, + { + "coins": "10test", + "length_seconds":2592000 //30 days + }, +] + } + + +``` +zetacored tx vesting create-periodic-vesting-account [to_address] [periods_json_file] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for create-periodic-vesting-account + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx vesting](zetacored_tx_vesting.md) - Vesting transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_vesting_create-permanent-locked-account.md b/docs/cli/zetacored/zetacored_tx_vesting_create-permanent-locked-account.md new file mode 100644 index 0000000000..5fba92e9f4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_vesting_create-permanent-locked-account.md @@ -0,0 +1,58 @@ +# tx vesting create-permanent-locked-account + +Create a new permanently locked account funded with an allocation of tokens. + +### Synopsis + +Create a new account funded with an allocation of permanently locked tokens. These +tokens may be used for staking but are non-transferable. Staking rewards will acrue as liquid and transferable +tokens. + +``` +zetacored tx vesting create-permanent-locked-account [to_address] [amount] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for create-permanent-locked-account + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx vesting](zetacored_tx_vesting.md) - Vesting transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_tx_vesting_create-vesting-account.md b/docs/cli/zetacored/zetacored_tx_vesting_create-vesting-account.md new file mode 100644 index 0000000000..992e4b9843 --- /dev/null +++ b/docs/cli/zetacored/zetacored_tx_vesting_create-vesting-account.md @@ -0,0 +1,61 @@ +# tx vesting create-vesting-account + +Create a new vesting account funded with an allocation of tokens. + +### Synopsis + +Create a new vesting account funded with an allocation of tokens. The +account can either be a delayed or continuous vesting account, which is determined +by the '--delayed' flag. All vesting accounts created will have their start time +set by the committed block's time. The end_time must be provided as a UNIX epoch +timestamp. + +``` +zetacored tx vesting create-vesting-account [to_address] [amount] [end_time] [flags] +``` + +### Options + +``` + -a, --account-number uint The account number of the signing account (offline mode only) + --aux Generate aux signer data instead of sending a tx + -b, --broadcast-mode string Transaction broadcasting mode (sync|async|block) + --delayed Create a delayed vesting account if true + --dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible) + --fee-granter string Fee granter grants fees for the transaction + --fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer + --fees string Fees to pay along with transaction; eg: 10uatom + --from string Name or address of private key with which to sign + --gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000) + --gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1) + --gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom) + --generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name) + -h, --help help for create-vesting-account + --keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory) + --keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used + --ledger Use a connected Ledger device + --node string [host]:[port] to tendermint rpc interface for this chain + --note string Note to add a description to the transaction (previously --memo) + --offline Offline mode (does not allow any online functionality) + -o, --output string Output format (text|json) + -s, --sequence uint The sequence number of the signing account (offline mode only) + --sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature + --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height + --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + -y, --yes Skip tx broadcasting prompt confirmation +``` + +### Options inherited from parent commands + +``` + --chain-id string The network chain ID + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored tx vesting](zetacored_tx_vesting.md) - Vesting transaction subcommands + diff --git a/docs/cli/zetacored/zetacored_validate-genesis.md b/docs/cli/zetacored/zetacored_validate-genesis.md new file mode 100644 index 0000000000..25d37981e4 --- /dev/null +++ b/docs/cli/zetacored/zetacored_validate-genesis.md @@ -0,0 +1,27 @@ +# validate-genesis + +validates the genesis file at the default location or at the location passed as an arg + +``` +zetacored validate-genesis [file] [flags] +``` + +### Options + +``` + -h, --help help for validate-genesis +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/docs/cli/zetacored/zetacored_version.md b/docs/cli/zetacored/zetacored_version.md new file mode 100644 index 0000000000..f10c6c2fd7 --- /dev/null +++ b/docs/cli/zetacored/zetacored_version.md @@ -0,0 +1,29 @@ +# version + +Print the application binary version information + +``` +zetacored version [flags] +``` + +### Options + +``` + -h, --help help for version + --long Print long version information + -o, --output string Output format (text|json) +``` + +### Options inherited from parent commands + +``` + --home string directory for config and data + --log_format string The logging format (json|plain) + --log_level string The logging level (trace|debug|info|warn|error|fatal|panic) + --trace print out full stack trace on errors +``` + +### SEE ALSO + +* [zetacored](zetacored.md) - Zetacore Daemon (server) + diff --git a/go.mod b/go.mod index 037cb886c0..0d6bbafa53 100644 --- a/go.mod +++ b/go.mod @@ -64,6 +64,7 @@ require ( github.com/cockroachdb/pebble v0.0.0-20230209160836-829675f94811 // indirect github.com/cockroachdb/redact v1.1.3 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect @@ -86,6 +87,7 @@ require ( github.com/quic-go/quic-go v0.33.0 // indirect github.com/quic-go/webtransport-go v0.5.3 // indirect github.com/rjeczalik/notify v0.9.1 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tidwall/gjson v1.14.4 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/go.sum b/go.sum index 3ccf99bb4d..8745f3e5b3 100644 --- a/go.sum +++ b/go.sum @@ -1031,7 +1031,6 @@ github.com/cosmos/ibc-go/v6 v6.1.0 h1:o7oXws2vKkKfOFzJI+oNylRn44PCNt5wzHd/zKQKbv github.com/cosmos/ibc-go/v6 v6.1.0/go.mod h1:CY3zh2HLfetRiW8LY6kVHMATe90Wj/UOoY8T6cuB0is= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= github.com/cosmos/ledger-cosmos-go v0.12.2/go.mod h1:ZcqYgnfNJ6lAXe4HPtWgarNEY+B74i+2/8MhZw4ziiI= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -2594,7 +2593,6 @@ github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= diff --git a/scripts/gen-docs-zetacored.sh b/scripts/gen-docs-zetacored.sh new file mode 100755 index 0000000000..1392a47ecf --- /dev/null +++ b/scripts/gen-docs-zetacored.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +DIR=docs/cli/zetacored + +rm -rf $DIR + +go install ./cmd/zetacored + +zetacored docs --path $DIR + +# Recursive function to process files +process_files() { + local dir="$1" + + # Process all files in the directory + for file in "$dir"/*; do + if [ -f "$file" ]; then + # Replace <...> with [...] in the file, otherwise Docusaurus thinks it's a link + sed -i.bak 's/<\([^<>]*\)>/\[\1\]/g' "$file" + + # Modify the heading by replacing ## zetacored with # + sed -i.bak 's/^## zetacored /# /g' "$file" + + # Replace all instances of [appd] with zetacored + sed -i.bak 's/\[appd\]/zetacored/g' "$file" + + # Remove the pattern (default "SOMETHING") + sed -i.bak 's/(default ".*")//g' "$file" + + # Remove the last line "###### Auto generated by spf13/cobra on ..." + sed -i.bak '$ d' "$file" + + # Remove the backup files + rm -f "$file.bak" + elif [ -d "$file" ]; then + # Recurse into subdirectory + process_files "$file" + fi + done +} + +# Start processing from the given directory +process_files $DIR From c324935da876ad0531930b15706b68e2b1d34de0 Mon Sep 17 00:00:00 2001 From: Denis Fadeev Date: Tue, 31 Oct 2023 21:20:10 +0400 Subject: [PATCH 19/26] feat: generate typescript bindings (#825) * feat: generate typescript bindigns * remove _pb * add index.d.ts * package.json * make typescript --------- Co-authored-by: Lucas Bertrand --- Makefile | 11 +- proto/buf.ts.yaml | 7 + scripts/protoc-gen-typescript.sh | 38 + typescript/common/bitcoin/bitcoin_pb.d.ts | 42 + typescript/common/bitcoin/index.d.ts | 1 + typescript/common/common_pb.d.ts | 333 +++ typescript/common/ethereum/ethereum_pb.d.ts | 37 + typescript/common/ethereum/index.d.ts | 1 + typescript/common/index.d.ts | 1 + typescript/crosschain/chain_nonces_pb.d.ts | 57 + typescript/crosschain/cross_chain_tx_pb.d.ts | 313 +++ typescript/crosschain/events_pb.d.ts | 293 +++ typescript/crosschain/gas_price_pb.d.ts | 62 + typescript/crosschain/genesis_pb.d.ts | 88 + .../crosschain/in_tx_hash_to_cctx_pb.d.ts | 37 + typescript/crosschain/in_tx_tracker_pb.d.ts | 43 + typescript/crosschain/index.d.ts | 14 + .../crosschain/last_block_height_pb.d.ts | 52 + typescript/crosschain/nonce_to_cctx_pb.d.ts | 90 + typescript/crosschain/out_tx_tracker_pb.d.ts | 83 + typescript/crosschain/params_pb.d.ts | 34 + typescript/crosschain/query_pb.d.ts | 1797 +++++++++++++++++ typescript/crosschain/tss_pb.d.ts | 52 + typescript/crosschain/tx_pb.d.ts | 824 ++++++++ typescript/emissions/events_pb.d.ts | 140 ++ typescript/emissions/genesis_pb.d.ts | 41 + typescript/emissions/index.d.ts | 5 + typescript/emissions/params_pb.d.ts | 74 + typescript/emissions/query_pb.d.ts | 212 ++ .../emissions/withdrawable_emissions_pb.d.ts | 37 + typescript/fungible/events_pb.d.ts | 216 ++ typescript/fungible/foreign_coins_pb.d.ts | 82 + typescript/fungible/genesis_pb.d.ts | 47 + typescript/fungible/index.d.ts | 7 + typescript/fungible/params_pb.d.ts | 29 + typescript/fungible/query_pb.d.ts | 373 ++++ typescript/fungible/system_contract_pb.d.ts | 37 + typescript/fungible/tx_pb.d.ts | 427 ++++ typescript/observer/ballot_pb.d.ts | 139 ++ typescript/observer/blame_pb.d.ts | 76 + typescript/observer/crosschain_flags_pb.d.ts | 152 ++ typescript/observer/events_pb.d.ts | 180 ++ typescript/observer/genesis_pb.d.ts | 73 + typescript/observer/index.d.ts | 11 + typescript/observer/keygen_pb.d.ts | 66 + typescript/observer/node_account_pb.d.ts | 83 + typescript/observer/observer_pb.d.ts | 102 + typescript/observer/params_pb.d.ts | 226 +++ typescript/observer/query_pb.d.ts | 924 +++++++++ typescript/observer/tx_pb.d.ts | 345 ++++ typescript/package.json | 9 + 51 files changed, 8420 insertions(+), 3 deletions(-) create mode 100644 proto/buf.ts.yaml create mode 100755 scripts/protoc-gen-typescript.sh create mode 100644 typescript/common/bitcoin/bitcoin_pb.d.ts create mode 100644 typescript/common/bitcoin/index.d.ts create mode 100644 typescript/common/common_pb.d.ts create mode 100644 typescript/common/ethereum/ethereum_pb.d.ts create mode 100644 typescript/common/ethereum/index.d.ts create mode 100644 typescript/common/index.d.ts create mode 100644 typescript/crosschain/chain_nonces_pb.d.ts create mode 100644 typescript/crosschain/cross_chain_tx_pb.d.ts create mode 100644 typescript/crosschain/events_pb.d.ts create mode 100644 typescript/crosschain/gas_price_pb.d.ts create mode 100644 typescript/crosschain/genesis_pb.d.ts create mode 100644 typescript/crosschain/in_tx_hash_to_cctx_pb.d.ts create mode 100644 typescript/crosschain/in_tx_tracker_pb.d.ts create mode 100644 typescript/crosschain/index.d.ts create mode 100644 typescript/crosschain/last_block_height_pb.d.ts create mode 100644 typescript/crosschain/nonce_to_cctx_pb.d.ts create mode 100644 typescript/crosschain/out_tx_tracker_pb.d.ts create mode 100644 typescript/crosschain/params_pb.d.ts create mode 100644 typescript/crosschain/query_pb.d.ts create mode 100644 typescript/crosschain/tss_pb.d.ts create mode 100644 typescript/crosschain/tx_pb.d.ts create mode 100644 typescript/emissions/events_pb.d.ts create mode 100644 typescript/emissions/genesis_pb.d.ts create mode 100644 typescript/emissions/index.d.ts create mode 100644 typescript/emissions/params_pb.d.ts create mode 100644 typescript/emissions/query_pb.d.ts create mode 100644 typescript/emissions/withdrawable_emissions_pb.d.ts create mode 100644 typescript/fungible/events_pb.d.ts create mode 100644 typescript/fungible/foreign_coins_pb.d.ts create mode 100644 typescript/fungible/genesis_pb.d.ts create mode 100644 typescript/fungible/index.d.ts create mode 100644 typescript/fungible/params_pb.d.ts create mode 100644 typescript/fungible/query_pb.d.ts create mode 100644 typescript/fungible/system_contract_pb.d.ts create mode 100644 typescript/fungible/tx_pb.d.ts create mode 100644 typescript/observer/ballot_pb.d.ts create mode 100644 typescript/observer/blame_pb.d.ts create mode 100644 typescript/observer/crosschain_flags_pb.d.ts create mode 100644 typescript/observer/events_pb.d.ts create mode 100644 typescript/observer/genesis_pb.d.ts create mode 100644 typescript/observer/index.d.ts create mode 100644 typescript/observer/keygen_pb.d.ts create mode 100644 typescript/observer/node_account_pb.d.ts create mode 100644 typescript/observer/observer_pb.d.ts create mode 100644 typescript/observer/params_pb.d.ts create mode 100644 typescript/observer/query_pb.d.ts create mode 100644 typescript/observer/tx_pb.d.ts create mode 100644 typescript/package.json diff --git a/Makefile b/Makefile index 03684cf2aa..121d55c079 100644 --- a/Makefile +++ b/Makefile @@ -161,6 +161,11 @@ proto: @buf format -w .PHONY: proto +typescript: + @echo "--> Generating TypeScript bindings" + @bash ./scripts/protoc-gen-typescript.sh +.PHONY: typescript + proto-format: @bash ./scripts/proto-format.sh @@ -179,14 +184,14 @@ docs-zetacored: @bash ./scripts/gen-docs-zetacored.sh .PHONY: docs-zetacored -generate: proto openapi specs docs-zetacored -.PHONY: generate - mocks: @echo "--> Generating mocks" @bash ./scripts/mocks-generate.sh .PHONY: mocks +generate: proto openapi specs typescript docs-zetacored +.PHONY: generate + ############################################################################### ### Docker Images ### ############################################################################### diff --git a/proto/buf.ts.yaml b/proto/buf.ts.yaml new file mode 100644 index 0000000000..c9fa155abc --- /dev/null +++ b/proto/buf.ts.yaml @@ -0,0 +1,7 @@ +version: v1 +managed: + enabled: true +plugins: + - plugin: buf.build/bufbuild/es:v1.3.0 + out: ../typescript + opt: target=dts diff --git a/scripts/protoc-gen-typescript.sh b/scripts/protoc-gen-typescript.sh new file mode 100755 index 0000000000..526d4773da --- /dev/null +++ b/scripts/protoc-gen-typescript.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +DIR="typescript" + +rm -rf $DIR + +(cd proto && buf generate --template buf.ts.yaml) + +cat < $DIR/package.json +{ + "name": "@zetachain/blockchain-types", + "version": "0.0.0-set-on-publish", + "description": "", + "main": "", + "keywords": [], + "author": "ZetaChain", + "license": "MIT" +} +EOL + +# Loop through all directories recursively +find "$DIR" -type d | while read -r dir; do + # Check if there are any .d.ts files in the directory + if ls "$dir"/*.d.ts &> /dev/null; then + # Create or clear index.d.ts in the directory + > "$dir/index.d.ts" + + # Loop through all .d.ts files in the directory + for file in "$dir"/*.d.ts; do + # Extract the base filename without the .d.ts extension + base_name=$(basename "$file" .d.ts) + # If the base name is not 'index', append the export line to index.d.ts + if [ "$base_name" != "index" ]; then + echo "export * from \"./$base_name\";" >> "$dir/index.d.ts" + fi + done + fi +done diff --git a/typescript/common/bitcoin/bitcoin_pb.d.ts b/typescript/common/bitcoin/bitcoin_pb.d.ts new file mode 100644 index 0000000000..4ba8f93863 --- /dev/null +++ b/typescript/common/bitcoin/bitcoin_pb.d.ts @@ -0,0 +1,42 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file common/bitcoin/bitcoin.proto (package bitcoin, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message bitcoin.Proof + */ +export declare class Proof extends Message { + /** + * @generated from field: bytes tx_bytes = 1; + */ + txBytes: Uint8Array; + + /** + * @generated from field: bytes path = 2; + */ + path: Uint8Array; + + /** + * @generated from field: uint32 index = 3; + */ + index: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "bitcoin.Proof"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Proof; + + static fromJson(jsonValue: JsonValue, options?: Partial): Proof; + + static fromJsonString(jsonString: string, options?: Partial): Proof; + + static equals(a: Proof | PlainMessage | undefined, b: Proof | PlainMessage | undefined): boolean; +} + diff --git a/typescript/common/bitcoin/index.d.ts b/typescript/common/bitcoin/index.d.ts new file mode 100644 index 0000000000..152ef02de9 --- /dev/null +++ b/typescript/common/bitcoin/index.d.ts @@ -0,0 +1 @@ +export * from "./bitcoin_pb"; diff --git a/typescript/common/common_pb.d.ts b/typescript/common/common_pb.d.ts new file mode 100644 index 0000000000..fdf8d0e3f4 --- /dev/null +++ b/typescript/common/common_pb.d.ts @@ -0,0 +1,333 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file common/common.proto (package common, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Proof as Proof$1 } from "./ethereum/ethereum_pb.js"; +import type { Proof as Proof$2 } from "./bitcoin/bitcoin_pb.js"; + +/** + * @generated from enum common.ReceiveStatus + */ +export declare enum ReceiveStatus { + /** + * some observer sees inbound tx + * + * @generated from enum value: Created = 0; + */ + Created = 0, + + /** + * @generated from enum value: Success = 1; + */ + Success = 1, + + /** + * @generated from enum value: Failed = 2; + */ + Failed = 2, +} + +/** + * @generated from enum common.CoinType + */ +export declare enum CoinType { + /** + * @generated from enum value: Zeta = 0; + */ + Zeta = 0, + + /** + * Ether, BNB, Matic, Klay, BTC, etc + * + * @generated from enum value: Gas = 1; + */ + Gas = 1, + + /** + * ERC20 token + * + * @generated from enum value: ERC20 = 2; + */ + ERC20 = 2, + + /** + * not a real coin, rather a command + * + * @generated from enum value: Cmd = 3; + */ + Cmd = 3, +} + +/** + * @generated from enum common.ChainName + */ +export declare enum ChainName { + /** + * @generated from enum value: empty = 0; + */ + empty = 0, + + /** + * @generated from enum value: eth_mainnet = 1; + */ + eth_mainnet = 1, + + /** + * @generated from enum value: zeta_mainnet = 2; + */ + zeta_mainnet = 2, + + /** + * @generated from enum value: btc_mainnet = 3; + */ + btc_mainnet = 3, + + /** + * @generated from enum value: polygon_mainnet = 4; + */ + polygon_mainnet = 4, + + /** + * @generated from enum value: bsc_mainnet = 5; + */ + bsc_mainnet = 5, + + /** + * Testnet + * + * @generated from enum value: goerli_testnet = 6; + */ + goerli_testnet = 6, + + /** + * @generated from enum value: mumbai_testnet = 7; + */ + mumbai_testnet = 7, + + /** + * @generated from enum value: ganache_testnet = 8; + */ + ganache_testnet = 8, + + /** + * @generated from enum value: baobab_testnet = 9; + */ + baobab_testnet = 9, + + /** + * @generated from enum value: bsc_testnet = 10; + */ + bsc_testnet = 10, + + /** + * @generated from enum value: zeta_testnet = 11; + */ + zeta_testnet = 11, + + /** + * @generated from enum value: btc_testnet = 12; + */ + btc_testnet = 12, + + /** + * LocalNet + * zeta_localnet = 13; + * + * @generated from enum value: goerli_localnet = 14; + */ + goerli_localnet = 14, + + /** + * Athens + * zeta_athensnet=15; + * + * @generated from enum value: btc_regtest = 15; + */ + btc_regtest = 15, +} + +/** + * PubKeySet contains two pub keys , secp256k1 and ed25519 + * + * @generated from message common.PubKeySet + */ +export declare class PubKeySet extends Message { + /** + * @generated from field: string secp256k1 = 1; + */ + secp256k1: string; + + /** + * @generated from field: string ed25519 = 2; + */ + ed25519: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "common.PubKeySet"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): PubKeySet; + + static fromJson(jsonValue: JsonValue, options?: Partial): PubKeySet; + + static fromJsonString(jsonString: string, options?: Partial): PubKeySet; + + static equals(a: PubKeySet | PlainMessage | undefined, b: PubKeySet | PlainMessage | undefined): boolean; +} + +/** + * @generated from message common.Chain + */ +export declare class Chain extends Message { + /** + * @generated from field: common.ChainName chain_name = 1; + */ + chainName: ChainName; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "common.Chain"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Chain; + + static fromJson(jsonValue: JsonValue, options?: Partial): Chain; + + static fromJsonString(jsonString: string, options?: Partial): Chain; + + static equals(a: Chain | PlainMessage | undefined, b: Chain | PlainMessage | undefined): boolean; +} + +/** + * @generated from message common.BlockHeader + */ +export declare class BlockHeader extends Message { + /** + * @generated from field: int64 height = 1; + */ + height: bigint; + + /** + * @generated from field: bytes hash = 2; + */ + hash: Uint8Array; + + /** + * @generated from field: bytes parent_hash = 3; + */ + parentHash: Uint8Array; + + /** + * @generated from field: int64 chain_id = 4; + */ + chainId: bigint; + + /** + * chain specific header + * + * @generated from field: common.HeaderData header = 5; + */ + header?: HeaderData; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "common.BlockHeader"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): BlockHeader; + + static fromJson(jsonValue: JsonValue, options?: Partial): BlockHeader; + + static fromJsonString(jsonString: string, options?: Partial): BlockHeader; + + static equals(a: BlockHeader | PlainMessage | undefined, b: BlockHeader | PlainMessage | undefined): boolean; +} + +/** + * @generated from message common.HeaderData + */ +export declare class HeaderData extends Message { + /** + * @generated from oneof common.HeaderData.data + */ + data: { + /** + * binary encoded headers; RLP for ethereum + * + * @generated from field: bytes ethereum_header = 1; + */ + value: Uint8Array; + case: "ethereumHeader"; + } | { + /** + * 80-byte little-endian encoded binary data + * + * @generated from field: bytes bitcoin_header = 2; + */ + value: Uint8Array; + case: "bitcoinHeader"; + } | { case: undefined; value?: undefined }; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "common.HeaderData"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): HeaderData; + + static fromJson(jsonValue: JsonValue, options?: Partial): HeaderData; + + static fromJsonString(jsonString: string, options?: Partial): HeaderData; + + static equals(a: HeaderData | PlainMessage | undefined, b: HeaderData | PlainMessage | undefined): boolean; +} + +/** + * @generated from message common.Proof + */ +export declare class Proof extends Message { + /** + * @generated from oneof common.Proof.proof + */ + proof: { + /** + * @generated from field: ethereum.Proof ethereum_proof = 1; + */ + value: Proof$1; + case: "ethereumProof"; + } | { + /** + * @generated from field: bitcoin.Proof bitcoin_proof = 2; + */ + value: Proof$2; + case: "bitcoinProof"; + } | { case: undefined; value?: undefined }; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "common.Proof"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Proof; + + static fromJson(jsonValue: JsonValue, options?: Partial): Proof; + + static fromJsonString(jsonString: string, options?: Partial): Proof; + + static equals(a: Proof | PlainMessage | undefined, b: Proof | PlainMessage | undefined): boolean; +} + diff --git a/typescript/common/ethereum/ethereum_pb.d.ts b/typescript/common/ethereum/ethereum_pb.d.ts new file mode 100644 index 0000000000..d0d2fa9513 --- /dev/null +++ b/typescript/common/ethereum/ethereum_pb.d.ts @@ -0,0 +1,37 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file common/ethereum/ethereum.proto (package ethereum, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message ethereum.Proof + */ +export declare class Proof extends Message { + /** + * @generated from field: repeated bytes keys = 1; + */ + keys: Uint8Array[]; + + /** + * @generated from field: repeated bytes values = 2; + */ + values: Uint8Array[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "ethereum.Proof"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Proof; + + static fromJson(jsonValue: JsonValue, options?: Partial): Proof; + + static fromJsonString(jsonString: string, options?: Partial): Proof; + + static equals(a: Proof | PlainMessage | undefined, b: Proof | PlainMessage | undefined): boolean; +} + diff --git a/typescript/common/ethereum/index.d.ts b/typescript/common/ethereum/index.d.ts new file mode 100644 index 0000000000..35459f1f5c --- /dev/null +++ b/typescript/common/ethereum/index.d.ts @@ -0,0 +1 @@ +export * from "./ethereum_pb"; diff --git a/typescript/common/index.d.ts b/typescript/common/index.d.ts new file mode 100644 index 0000000000..78b610bcc1 --- /dev/null +++ b/typescript/common/index.d.ts @@ -0,0 +1 @@ +export * from "./common_pb"; diff --git a/typescript/crosschain/chain_nonces_pb.d.ts b/typescript/crosschain/chain_nonces_pb.d.ts new file mode 100644 index 0000000000..2f629ad9d9 --- /dev/null +++ b/typescript/crosschain/chain_nonces_pb.d.ts @@ -0,0 +1,57 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/chain_nonces.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.crosschain.ChainNonces + */ +export declare class ChainNonces extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string index = 2; + */ + index: string; + + /** + * @generated from field: int64 chain_id = 3; + */ + chainId: bigint; + + /** + * @generated from field: uint64 nonce = 4; + */ + nonce: bigint; + + /** + * @generated from field: repeated string signers = 5; + */ + signers: string[]; + + /** + * @generated from field: uint64 finalizedHeight = 6; + */ + finalizedHeight: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.ChainNonces"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ChainNonces; + + static fromJson(jsonValue: JsonValue, options?: Partial): ChainNonces; + + static fromJsonString(jsonString: string, options?: Partial): ChainNonces; + + static equals(a: ChainNonces | PlainMessage | undefined, b: ChainNonces | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/cross_chain_tx_pb.d.ts b/typescript/crosschain/cross_chain_tx_pb.d.ts new file mode 100644 index 0000000000..3d4934dc05 --- /dev/null +++ b/typescript/crosschain/cross_chain_tx_pb.d.ts @@ -0,0 +1,313 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/cross_chain_tx.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { CoinType } from "../common/common_pb.js"; + +/** + * @generated from enum zetachain.zetacore.crosschain.CctxStatus + */ +export declare enum CctxStatus { + /** + * some observer sees inbound tx + * + * @generated from enum value: PendingInbound = 0; + */ + PendingInbound = 0, + + /** + * super majority observer see inbound tx + * + * @generated from enum value: PendingOutbound = 1; + */ + PendingOutbound = 1, + + /** + * the corresponding outbound tx is mined + * + * @generated from enum value: OutboundMined = 3; + */ + OutboundMined = 3, + + /** + * outbound cannot succeed; should revert inbound + * + * @generated from enum value: PendingRevert = 4; + */ + PendingRevert = 4, + + /** + * inbound reverted. + * + * @generated from enum value: Reverted = 5; + */ + Reverted = 5, + + /** + * inbound tx error or invalid paramters and cannot revert; just abort + * + * @generated from enum value: Aborted = 6; + */ + Aborted = 6, +} + +/** + * @generated from message zetachain.zetacore.crosschain.InboundTxParams + */ +export declare class InboundTxParams extends Message { + /** + * this address is the immediate contract/EOA that calls the Connector.send() + * + * @generated from field: string sender = 1; + */ + sender: string; + + /** + * @generated from field: int64 sender_chain_id = 2; + */ + senderChainId: bigint; + + /** + * this address is the EOA that signs the inbound tx + * + * @generated from field: string tx_origin = 3; + */ + txOrigin: string; + + /** + * @generated from field: common.CoinType coin_type = 4; + */ + coinType: CoinType; + + /** + * for ERC20 coin type, the asset is an address of the ERC20 contract + * + * @generated from field: string asset = 5; + */ + asset: string; + + /** + * @generated from field: string amount = 6; + */ + amount: string; + + /** + * @generated from field: string inbound_tx_observed_hash = 7; + */ + inboundTxObservedHash: string; + + /** + * @generated from field: uint64 inbound_tx_observed_external_height = 8; + */ + inboundTxObservedExternalHeight: bigint; + + /** + * @generated from field: string inbound_tx_ballot_index = 9; + */ + inboundTxBallotIndex: string; + + /** + * @generated from field: uint64 inbound_tx_finalized_zeta_height = 10; + */ + inboundTxFinalizedZetaHeight: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.InboundTxParams"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): InboundTxParams; + + static fromJson(jsonValue: JsonValue, options?: Partial): InboundTxParams; + + static fromJsonString(jsonString: string, options?: Partial): InboundTxParams; + + static equals(a: InboundTxParams | PlainMessage | undefined, b: InboundTxParams | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.OutboundTxParams + */ +export declare class OutboundTxParams extends Message { + /** + * @generated from field: string receiver = 1; + */ + receiver: string; + + /** + * @generated from field: int64 receiver_chainId = 2; + */ + receiverChainId: bigint; + + /** + * @generated from field: common.CoinType coin_type = 3; + */ + coinType: CoinType; + + /** + * @generated from field: string amount = 4; + */ + amount: string; + + /** + * @generated from field: uint64 outbound_tx_tss_nonce = 5; + */ + outboundTxTssNonce: bigint; + + /** + * @generated from field: uint64 outbound_tx_gas_limit = 6; + */ + outboundTxGasLimit: bigint; + + /** + * @generated from field: string outbound_tx_gas_price = 7; + */ + outboundTxGasPrice: string; + + /** + * the above are commands for zetaclients + * the following fields are used when the outbound tx is mined + * + * @generated from field: string outbound_tx_hash = 8; + */ + outboundTxHash: string; + + /** + * @generated from field: string outbound_tx_ballot_index = 9; + */ + outboundTxBallotIndex: string; + + /** + * @generated from field: uint64 outbound_tx_observed_external_height = 10; + */ + outboundTxObservedExternalHeight: bigint; + + /** + * @generated from field: uint64 outbound_tx_gas_used = 20; + */ + outboundTxGasUsed: bigint; + + /** + * @generated from field: string outbound_tx_effective_gas_price = 21; + */ + outboundTxEffectiveGasPrice: string; + + /** + * @generated from field: uint64 outbound_tx_effective_gas_limit = 22; + */ + outboundTxEffectiveGasLimit: bigint; + + /** + * @generated from field: string tss_pubkey = 11; + */ + tssPubkey: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.OutboundTxParams"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): OutboundTxParams; + + static fromJson(jsonValue: JsonValue, options?: Partial): OutboundTxParams; + + static fromJsonString(jsonString: string, options?: Partial): OutboundTxParams; + + static equals(a: OutboundTxParams | PlainMessage | undefined, b: OutboundTxParams | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.Status + */ +export declare class Status extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.CctxStatus status = 1; + */ + status: CctxStatus; + + /** + * @generated from field: string status_message = 2; + */ + statusMessage: string; + + /** + * @generated from field: int64 lastUpdate_timestamp = 3; + */ + lastUpdateTimestamp: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.Status"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Status; + + static fromJson(jsonValue: JsonValue, options?: Partial): Status; + + static fromJsonString(jsonString: string, options?: Partial): Status; + + static equals(a: Status | PlainMessage | undefined, b: Status | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.CrossChainTx + */ +export declare class CrossChainTx extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string index = 2; + */ + index: string; + + /** + * @generated from field: string zeta_fees = 5; + */ + zetaFees: string; + + /** + * Not used by protocol , just relayed across + * + * @generated from field: string relayed_message = 6; + */ + relayedMessage: string; + + /** + * @generated from field: zetachain.zetacore.crosschain.Status cctx_status = 8; + */ + cctxStatus?: Status; + + /** + * @generated from field: zetachain.zetacore.crosschain.InboundTxParams inbound_tx_params = 9; + */ + inboundTxParams?: InboundTxParams; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.OutboundTxParams outbound_tx_params = 10; + */ + outboundTxParams: OutboundTxParams[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.CrossChainTx"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): CrossChainTx; + + static fromJson(jsonValue: JsonValue, options?: Partial): CrossChainTx; + + static fromJsonString(jsonString: string, options?: Partial): CrossChainTx; + + static equals(a: CrossChainTx | PlainMessage | undefined, b: CrossChainTx | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/events_pb.d.ts b/typescript/crosschain/events_pb.d.ts new file mode 100644 index 0000000000..4bcfde46e6 --- /dev/null +++ b/typescript/crosschain/events_pb.d.ts @@ -0,0 +1,293 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/events.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.crosschain.EventInboundFinalized + */ +export declare class EventInboundFinalized extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string cctx_index = 2; + */ + cctxIndex: string; + + /** + * @generated from field: string sender = 3; + */ + sender: string; + + /** + * @generated from field: string tx_orgin = 4; + */ + txOrgin: string; + + /** + * @generated from field: string asset = 5; + */ + asset: string; + + /** + * @generated from field: string in_tx_hash = 6; + */ + inTxHash: string; + + /** + * @generated from field: string in_block_height = 7; + */ + inBlockHeight: string; + + /** + * @generated from field: string receiver = 8; + */ + receiver: string; + + /** + * @generated from field: string receiver_chain = 9; + */ + receiverChain: string; + + /** + * @generated from field: string amount = 10; + */ + amount: string; + + /** + * @generated from field: string relayed_message = 11; + */ + relayedMessage: string; + + /** + * @generated from field: string new_status = 12; + */ + newStatus: string; + + /** + * @generated from field: string status_message = 13; + */ + statusMessage: string; + + /** + * @generated from field: string sender_chain = 14; + */ + senderChain: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.EventInboundFinalized"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventInboundFinalized; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventInboundFinalized; + + static fromJsonString(jsonString: string, options?: Partial): EventInboundFinalized; + + static equals(a: EventInboundFinalized | PlainMessage | undefined, b: EventInboundFinalized | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.EventZrcWithdrawCreated + */ +export declare class EventZrcWithdrawCreated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string cctx_index = 2; + */ + cctxIndex: string; + + /** + * @generated from field: string sender = 3; + */ + sender: string; + + /** + * @generated from field: string sender_chain = 4; + */ + senderChain: string; + + /** + * @generated from field: string in_tx_hash = 5; + */ + inTxHash: string; + + /** + * @generated from field: string receiver = 6; + */ + receiver: string; + + /** + * @generated from field: string receiver_chain = 7; + */ + receiverChain: string; + + /** + * @generated from field: string amount = 8; + */ + amount: string; + + /** + * @generated from field: string new_status = 9; + */ + newStatus: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.EventZrcWithdrawCreated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventZrcWithdrawCreated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventZrcWithdrawCreated; + + static fromJsonString(jsonString: string, options?: Partial): EventZrcWithdrawCreated; + + static equals(a: EventZrcWithdrawCreated | PlainMessage | undefined, b: EventZrcWithdrawCreated | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.EventZetaWithdrawCreated + */ +export declare class EventZetaWithdrawCreated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string cctx_index = 2; + */ + cctxIndex: string; + + /** + * @generated from field: string sender = 3; + */ + sender: string; + + /** + * @generated from field: string in_tx_hash = 4; + */ + inTxHash: string; + + /** + * @generated from field: string new_status = 5; + */ + newStatus: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.EventZetaWithdrawCreated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventZetaWithdrawCreated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventZetaWithdrawCreated; + + static fromJsonString(jsonString: string, options?: Partial): EventZetaWithdrawCreated; + + static equals(a: EventZetaWithdrawCreated | PlainMessage | undefined, b: EventZetaWithdrawCreated | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.EventOutboundFailure + */ +export declare class EventOutboundFailure extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string cctx_index = 2; + */ + cctxIndex: string; + + /** + * @generated from field: string old_status = 3; + */ + oldStatus: string; + + /** + * @generated from field: string new_status = 4; + */ + newStatus: string; + + /** + * @generated from field: string value_received = 5; + */ + valueReceived: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.EventOutboundFailure"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventOutboundFailure; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventOutboundFailure; + + static fromJsonString(jsonString: string, options?: Partial): EventOutboundFailure; + + static equals(a: EventOutboundFailure | PlainMessage | undefined, b: EventOutboundFailure | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.EventOutboundSuccess + */ +export declare class EventOutboundSuccess extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string cctx_index = 2; + */ + cctxIndex: string; + + /** + * @generated from field: string old_status = 3; + */ + oldStatus: string; + + /** + * @generated from field: string new_status = 4; + */ + newStatus: string; + + /** + * @generated from field: string value_received = 5; + */ + valueReceived: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.EventOutboundSuccess"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventOutboundSuccess; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventOutboundSuccess; + + static fromJsonString(jsonString: string, options?: Partial): EventOutboundSuccess; + + static equals(a: EventOutboundSuccess | PlainMessage | undefined, b: EventOutboundSuccess | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/gas_price_pb.d.ts b/typescript/crosschain/gas_price_pb.d.ts new file mode 100644 index 0000000000..cd05e2a8dd --- /dev/null +++ b/typescript/crosschain/gas_price_pb.d.ts @@ -0,0 +1,62 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/gas_price.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.crosschain.GasPrice + */ +export declare class GasPrice extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string index = 2; + */ + index: string; + + /** + * @generated from field: int64 chain_id = 3; + */ + chainId: bigint; + + /** + * @generated from field: repeated string signers = 4; + */ + signers: string[]; + + /** + * @generated from field: repeated uint64 block_nums = 5; + */ + blockNums: bigint[]; + + /** + * @generated from field: repeated uint64 prices = 6; + */ + prices: bigint[]; + + /** + * @generated from field: uint64 median_index = 7; + */ + medianIndex: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.GasPrice"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): GasPrice; + + static fromJson(jsonValue: JsonValue, options?: Partial): GasPrice; + + static fromJsonString(jsonString: string, options?: Partial): GasPrice; + + static equals(a: GasPrice | PlainMessage | undefined, b: GasPrice | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/genesis_pb.d.ts b/typescript/crosschain/genesis_pb.d.ts new file mode 100644 index 0000000000..b08be54a4a --- /dev/null +++ b/typescript/crosschain/genesis_pb.d.ts @@ -0,0 +1,88 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/genesis.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Params } from "./params_pb.js"; +import type { OutTxTracker } from "./out_tx_tracker_pb.js"; +import type { TSS } from "./tss_pb.js"; +import type { GasPrice } from "./gas_price_pb.js"; +import type { ChainNonces } from "./chain_nonces_pb.js"; +import type { CrossChainTx } from "./cross_chain_tx_pb.js"; +import type { LastBlockHeight } from "./last_block_height_pb.js"; +import type { InTxHashToCctx } from "./in_tx_hash_to_cctx_pb.js"; +import type { InTxTracker } from "./in_tx_tracker_pb.js"; + +/** + * GenesisState defines the metacore module's genesis state. + * + * @generated from message zetachain.zetacore.crosschain.GenesisState + */ +export declare class GenesisState extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.Params params = 1; + */ + params?: Params; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.OutTxTracker outTxTrackerList = 2; + */ + outTxTrackerList: OutTxTracker[]; + + /** + * @generated from field: zetachain.zetacore.crosschain.TSS tss = 4; + */ + tss?: TSS; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.GasPrice gasPriceList = 5; + */ + gasPriceList: GasPrice[]; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.ChainNonces chainNoncesList = 6; + */ + chainNoncesList: ChainNonces[]; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.CrossChainTx CrossChainTxs = 7; + */ + CrossChainTxs: CrossChainTx[]; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.LastBlockHeight lastBlockHeightList = 8; + */ + lastBlockHeightList: LastBlockHeight[]; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.InTxHashToCctx inTxHashToCctxList = 9; + */ + inTxHashToCctxList: InTxHashToCctx[]; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.TSS tss_history = 10; + */ + tssHistory: TSS[]; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.InTxTracker in_tx_tracker_list = 11; + */ + inTxTrackerList: InTxTracker[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.GenesisState"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): GenesisState; + + static fromJson(jsonValue: JsonValue, options?: Partial): GenesisState; + + static fromJsonString(jsonString: string, options?: Partial): GenesisState; + + static equals(a: GenesisState | PlainMessage | undefined, b: GenesisState | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/in_tx_hash_to_cctx_pb.d.ts b/typescript/crosschain/in_tx_hash_to_cctx_pb.d.ts new file mode 100644 index 0000000000..5505abd6a4 --- /dev/null +++ b/typescript/crosschain/in_tx_hash_to_cctx_pb.d.ts @@ -0,0 +1,37 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/in_tx_hash_to_cctx.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.crosschain.InTxHashToCctx + */ +export declare class InTxHashToCctx extends Message { + /** + * @generated from field: string in_tx_hash = 1; + */ + inTxHash: string; + + /** + * @generated from field: repeated string cctx_index = 2; + */ + cctxIndex: string[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.InTxHashToCctx"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): InTxHashToCctx; + + static fromJson(jsonValue: JsonValue, options?: Partial): InTxHashToCctx; + + static fromJsonString(jsonString: string, options?: Partial): InTxHashToCctx; + + static equals(a: InTxHashToCctx | PlainMessage | undefined, b: InTxHashToCctx | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/in_tx_tracker_pb.d.ts b/typescript/crosschain/in_tx_tracker_pb.d.ts new file mode 100644 index 0000000000..d280f82524 --- /dev/null +++ b/typescript/crosschain/in_tx_tracker_pb.d.ts @@ -0,0 +1,43 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/in_tx_tracker.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { CoinType } from "../common/common_pb.js"; + +/** + * @generated from message zetachain.zetacore.crosschain.InTxTracker + */ +export declare class InTxTracker extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: string tx_hash = 2; + */ + txHash: string; + + /** + * @generated from field: common.CoinType coin_type = 3; + */ + coinType: CoinType; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.InTxTracker"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): InTxTracker; + + static fromJson(jsonValue: JsonValue, options?: Partial): InTxTracker; + + static fromJsonString(jsonString: string, options?: Partial): InTxTracker; + + static equals(a: InTxTracker | PlainMessage | undefined, b: InTxTracker | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/index.d.ts b/typescript/crosschain/index.d.ts new file mode 100644 index 0000000000..f788e6e87e --- /dev/null +++ b/typescript/crosschain/index.d.ts @@ -0,0 +1,14 @@ +export * from "./chain_nonces_pb"; +export * from "./cross_chain_tx_pb"; +export * from "./events_pb"; +export * from "./gas_price_pb"; +export * from "./genesis_pb"; +export * from "./in_tx_hash_to_cctx_pb"; +export * from "./in_tx_tracker_pb"; +export * from "./last_block_height_pb"; +export * from "./nonce_to_cctx_pb"; +export * from "./out_tx_tracker_pb"; +export * from "./params_pb"; +export * from "./query_pb"; +export * from "./tss_pb"; +export * from "./tx_pb"; diff --git a/typescript/crosschain/last_block_height_pb.d.ts b/typescript/crosschain/last_block_height_pb.d.ts new file mode 100644 index 0000000000..f6c454ff33 --- /dev/null +++ b/typescript/crosschain/last_block_height_pb.d.ts @@ -0,0 +1,52 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/last_block_height.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.crosschain.LastBlockHeight + */ +export declare class LastBlockHeight extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string index = 2; + */ + index: string; + + /** + * @generated from field: string chain = 3; + */ + chain: string; + + /** + * @generated from field: uint64 lastSendHeight = 4; + */ + lastSendHeight: bigint; + + /** + * @generated from field: uint64 lastReceiveHeight = 5; + */ + lastReceiveHeight: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.LastBlockHeight"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): LastBlockHeight; + + static fromJson(jsonValue: JsonValue, options?: Partial): LastBlockHeight; + + static fromJsonString(jsonString: string, options?: Partial): LastBlockHeight; + + static equals(a: LastBlockHeight | PlainMessage | undefined, b: LastBlockHeight | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/nonce_to_cctx_pb.d.ts b/typescript/crosschain/nonce_to_cctx_pb.d.ts new file mode 100644 index 0000000000..e2a75c5aa8 --- /dev/null +++ b/typescript/crosschain/nonce_to_cctx_pb.d.ts @@ -0,0 +1,90 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/nonce_to_cctx.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * store key is tss+chainid+nonce + * + * @generated from message zetachain.zetacore.crosschain.NonceToCctx + */ +export declare class NonceToCctx extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: int64 nonce = 2; + */ + nonce: bigint; + + /** + * @generated from field: string cctxIndex = 3; + */ + cctxIndex: string; + + /** + * @generated from field: string tss = 4; + */ + tss: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.NonceToCctx"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): NonceToCctx; + + static fromJson(jsonValue: JsonValue, options?: Partial): NonceToCctx; + + static fromJsonString(jsonString: string, options?: Partial): NonceToCctx; + + static equals(a: NonceToCctx | PlainMessage | undefined, b: NonceToCctx | PlainMessage | undefined): boolean; +} + +/** + * store key is tss+chainid + * + * @generated from message zetachain.zetacore.crosschain.PendingNonces + */ +export declare class PendingNonces extends Message { + /** + * @generated from field: int64 nonce_low = 1; + */ + nonceLow: bigint; + + /** + * @generated from field: int64 nonce_high = 2; + */ + nonceHigh: bigint; + + /** + * @generated from field: int64 chain_id = 3; + */ + chainId: bigint; + + /** + * @generated from field: string tss = 4; + */ + tss: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.PendingNonces"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): PendingNonces; + + static fromJson(jsonValue: JsonValue, options?: Partial): PendingNonces; + + static fromJsonString(jsonString: string, options?: Partial): PendingNonces; + + static equals(a: PendingNonces | PlainMessage | undefined, b: PendingNonces | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/out_tx_tracker_pb.d.ts b/typescript/crosschain/out_tx_tracker_pb.d.ts new file mode 100644 index 0000000000..75286b5b5b --- /dev/null +++ b/typescript/crosschain/out_tx_tracker_pb.d.ts @@ -0,0 +1,83 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/out_tx_tracker.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.crosschain.TxHashList + */ +export declare class TxHashList extends Message { + /** + * @generated from field: string tx_hash = 1; + */ + txHash: string; + + /** + * @generated from field: string tx_signer = 2; + */ + txSigner: string; + + /** + * @generated from field: bool proved = 3; + */ + proved: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.TxHashList"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): TxHashList; + + static fromJson(jsonValue: JsonValue, options?: Partial): TxHashList; + + static fromJsonString(jsonString: string, options?: Partial): TxHashList; + + static equals(a: TxHashList | PlainMessage | undefined, b: TxHashList | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.OutTxTracker + */ +export declare class OutTxTracker extends Message { + /** + * format: "chain-nonce" + * + * @generated from field: string index = 1; + */ + index: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: uint64 nonce = 3; + */ + nonce: bigint; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.TxHashList hash_list = 4; + */ + hashList: TxHashList[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.OutTxTracker"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): OutTxTracker; + + static fromJson(jsonValue: JsonValue, options?: Partial): OutTxTracker; + + static fromJsonString(jsonString: string, options?: Partial): OutTxTracker; + + static equals(a: OutTxTracker | PlainMessage | undefined, b: OutTxTracker | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/params_pb.d.ts b/typescript/crosschain/params_pb.d.ts new file mode 100644 index 0000000000..e3c135725c --- /dev/null +++ b/typescript/crosschain/params_pb.d.ts @@ -0,0 +1,34 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/params.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * Params defines the parameters for the module. + * + * @generated from message zetachain.zetacore.crosschain.Params + */ +export declare class Params extends Message { + /** + * @generated from field: bool enabled = 1; + */ + enabled: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.Params"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Params; + + static fromJson(jsonValue: JsonValue, options?: Partial): Params; + + static fromJsonString(jsonString: string, options?: Partial): Params; + + static equals(a: Params | PlainMessage | undefined, b: Params | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/query_pb.d.ts b/typescript/crosschain/query_pb.d.ts new file mode 100644 index 0000000000..0446c27b90 --- /dev/null +++ b/typescript/crosschain/query_pb.d.ts @@ -0,0 +1,1797 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/query.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { TSS } from "./tss_pb.js"; +import type { Params } from "./params_pb.js"; +import type { OutTxTracker } from "./out_tx_tracker_pb.js"; +import type { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination_pb.js"; +import type { InTxTracker } from "./in_tx_tracker_pb.js"; +import type { InTxHashToCctx } from "./in_tx_hash_to_cctx_pb.js"; +import type { CrossChainTx } from "./cross_chain_tx_pb.js"; +import type { GasPrice } from "./gas_price_pb.js"; +import type { ChainNonces } from "./chain_nonces_pb.js"; +import type { PendingNonces } from "./nonce_to_cctx_pb.js"; +import type { LastBlockHeight } from "./last_block_height_pb.js"; + +/** + * @generated from message zetachain.zetacore.crosschain.QueryTssHistoryRequest + */ +export declare class QueryTssHistoryRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryTssHistoryRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryTssHistoryRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryTssHistoryRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryTssHistoryRequest; + + static equals(a: QueryTssHistoryRequest | PlainMessage | undefined, b: QueryTssHistoryRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryTssHistoryResponse + */ +export declare class QueryTssHistoryResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.TSS tss_list = 1; + */ + tssList: TSS[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryTssHistoryResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryTssHistoryResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryTssHistoryResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryTssHistoryResponse; + + static equals(a: QueryTssHistoryResponse | PlainMessage | undefined, b: QueryTssHistoryResponse | PlainMessage | undefined): boolean; +} + +/** + * QueryParamsRequest is request type for the Query/Params RPC method. + * + * @generated from message zetachain.zetacore.crosschain.QueryParamsRequest + */ +export declare class QueryParamsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryParamsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsRequest; + + static equals(a: QueryParamsRequest | PlainMessage | undefined, b: QueryParamsRequest | PlainMessage | undefined): boolean; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + * + * @generated from message zetachain.zetacore.crosschain.QueryParamsResponse + */ +export declare class QueryParamsResponse extends Message { + /** + * params holds all the parameters of this module. + * + * @generated from field: zetachain.zetacore.crosschain.Params params = 1; + */ + params?: Params; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryParamsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsResponse; + + static equals(a: QueryParamsResponse | PlainMessage | undefined, b: QueryParamsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetOutTxTrackerRequest + */ +export declare class QueryGetOutTxTrackerRequest extends Message { + /** + * @generated from field: int64 chainID = 1; + */ + chainID: bigint; + + /** + * @generated from field: uint64 nonce = 2; + */ + nonce: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetOutTxTrackerRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetOutTxTrackerRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetOutTxTrackerRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetOutTxTrackerRequest; + + static equals(a: QueryGetOutTxTrackerRequest | PlainMessage | undefined, b: QueryGetOutTxTrackerRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetOutTxTrackerResponse + */ +export declare class QueryGetOutTxTrackerResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.OutTxTracker outTxTracker = 1; + */ + outTxTracker?: OutTxTracker; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetOutTxTrackerResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetOutTxTrackerResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetOutTxTrackerResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetOutTxTrackerResponse; + + static equals(a: QueryGetOutTxTrackerResponse | PlainMessage | undefined, b: QueryGetOutTxTrackerResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllOutTxTrackerRequest + */ +export declare class QueryAllOutTxTrackerRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllOutTxTrackerRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllOutTxTrackerRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllOutTxTrackerRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllOutTxTrackerRequest; + + static equals(a: QueryAllOutTxTrackerRequest | PlainMessage | undefined, b: QueryAllOutTxTrackerRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllOutTxTrackerResponse + */ +export declare class QueryAllOutTxTrackerResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.OutTxTracker outTxTracker = 1; + */ + outTxTracker: OutTxTracker[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllOutTxTrackerResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllOutTxTrackerResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllOutTxTrackerResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllOutTxTrackerResponse; + + static equals(a: QueryAllOutTxTrackerResponse | PlainMessage | undefined, b: QueryAllOutTxTrackerResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllOutTxTrackerByChainRequest + */ +export declare class QueryAllOutTxTrackerByChainRequest extends Message { + /** + * @generated from field: int64 chain = 1; + */ + chain: bigint; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 2; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllOutTxTrackerByChainRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllOutTxTrackerByChainRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllOutTxTrackerByChainRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllOutTxTrackerByChainRequest; + + static equals(a: QueryAllOutTxTrackerByChainRequest | PlainMessage | undefined, b: QueryAllOutTxTrackerByChainRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllOutTxTrackerByChainResponse + */ +export declare class QueryAllOutTxTrackerByChainResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.OutTxTracker outTxTracker = 1; + */ + outTxTracker: OutTxTracker[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllOutTxTrackerByChainResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllOutTxTrackerByChainResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllOutTxTrackerByChainResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllOutTxTrackerByChainResponse; + + static equals(a: QueryAllOutTxTrackerByChainResponse | PlainMessage | undefined, b: QueryAllOutTxTrackerByChainResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllInTxTrackerByChainRequest + */ +export declare class QueryAllInTxTrackerByChainRequest extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 2; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllInTxTrackerByChainRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllInTxTrackerByChainRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllInTxTrackerByChainRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllInTxTrackerByChainRequest; + + static equals(a: QueryAllInTxTrackerByChainRequest | PlainMessage | undefined, b: QueryAllInTxTrackerByChainRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllInTxTrackerByChainResponse + */ +export declare class QueryAllInTxTrackerByChainResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.InTxTracker inTxTracker = 1; + */ + inTxTracker: InTxTracker[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllInTxTrackerByChainResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllInTxTrackerByChainResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllInTxTrackerByChainResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllInTxTrackerByChainResponse; + + static equals(a: QueryAllInTxTrackerByChainResponse | PlainMessage | undefined, b: QueryAllInTxTrackerByChainResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllInTxTrackersRequest + */ +export declare class QueryAllInTxTrackersRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllInTxTrackersRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllInTxTrackersRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllInTxTrackersRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllInTxTrackersRequest; + + static equals(a: QueryAllInTxTrackersRequest | PlainMessage | undefined, b: QueryAllInTxTrackersRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllInTxTrackersResponse + */ +export declare class QueryAllInTxTrackersResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.InTxTracker inTxTracker = 1; + */ + inTxTracker: InTxTracker[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllInTxTrackersResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllInTxTrackersResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllInTxTrackersResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllInTxTrackersResponse; + + static equals(a: QueryAllInTxTrackersResponse | PlainMessage | undefined, b: QueryAllInTxTrackersResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetInTxHashToCctxRequest + */ +export declare class QueryGetInTxHashToCctxRequest extends Message { + /** + * @generated from field: string inTxHash = 1; + */ + inTxHash: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetInTxHashToCctxRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetInTxHashToCctxRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetInTxHashToCctxRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetInTxHashToCctxRequest; + + static equals(a: QueryGetInTxHashToCctxRequest | PlainMessage | undefined, b: QueryGetInTxHashToCctxRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetInTxHashToCctxResponse + */ +export declare class QueryGetInTxHashToCctxResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.InTxHashToCctx inTxHashToCctx = 1; + */ + inTxHashToCctx?: InTxHashToCctx; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetInTxHashToCctxResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetInTxHashToCctxResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetInTxHashToCctxResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetInTxHashToCctxResponse; + + static equals(a: QueryGetInTxHashToCctxResponse | PlainMessage | undefined, b: QueryGetInTxHashToCctxResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryInTxHashToCctxDataRequest + */ +export declare class QueryInTxHashToCctxDataRequest extends Message { + /** + * @generated from field: string inTxHash = 1; + */ + inTxHash: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryInTxHashToCctxDataRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryInTxHashToCctxDataRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryInTxHashToCctxDataRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryInTxHashToCctxDataRequest; + + static equals(a: QueryInTxHashToCctxDataRequest | PlainMessage | undefined, b: QueryInTxHashToCctxDataRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryInTxHashToCctxDataResponse + */ +export declare class QueryInTxHashToCctxDataResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.CrossChainTx CrossChainTxs = 1; + */ + CrossChainTxs: CrossChainTx[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryInTxHashToCctxDataResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryInTxHashToCctxDataResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryInTxHashToCctxDataResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryInTxHashToCctxDataResponse; + + static equals(a: QueryInTxHashToCctxDataResponse | PlainMessage | undefined, b: QueryInTxHashToCctxDataResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllInTxHashToCctxRequest + */ +export declare class QueryAllInTxHashToCctxRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllInTxHashToCctxRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllInTxHashToCctxRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllInTxHashToCctxRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllInTxHashToCctxRequest; + + static equals(a: QueryAllInTxHashToCctxRequest | PlainMessage | undefined, b: QueryAllInTxHashToCctxRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllInTxHashToCctxResponse + */ +export declare class QueryAllInTxHashToCctxResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.InTxHashToCctx inTxHashToCctx = 1; + */ + inTxHashToCctx: InTxHashToCctx[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllInTxHashToCctxResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllInTxHashToCctxResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllInTxHashToCctxResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllInTxHashToCctxResponse; + + static equals(a: QueryAllInTxHashToCctxResponse | PlainMessage | undefined, b: QueryAllInTxHashToCctxResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetTssAddressRequest + */ +export declare class QueryGetTssAddressRequest extends Message { + /** + * @generated from field: string tss_pub_key = 1; + */ + tssPubKey: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetTssAddressRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetTssAddressRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetTssAddressRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetTssAddressRequest; + + static equals(a: QueryGetTssAddressRequest | PlainMessage | undefined, b: QueryGetTssAddressRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetTssAddressResponse + */ +export declare class QueryGetTssAddressResponse extends Message { + /** + * @generated from field: string eth = 1; + */ + eth: string; + + /** + * @generated from field: string btc = 2; + */ + btc: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetTssAddressResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetTssAddressResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetTssAddressResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetTssAddressResponse; + + static equals(a: QueryGetTssAddressResponse | PlainMessage | undefined, b: QueryGetTssAddressResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetTSSRequest + */ +export declare class QueryGetTSSRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetTSSRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetTSSRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetTSSRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetTSSRequest; + + static equals(a: QueryGetTSSRequest | PlainMessage | undefined, b: QueryGetTSSRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetTSSResponse + */ +export declare class QueryGetTSSResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.TSS TSS = 1; + */ + TSS?: TSS; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetTSSResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetTSSResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetTSSResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetTSSResponse; + + static equals(a: QueryGetTSSResponse | PlainMessage | undefined, b: QueryGetTSSResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetGasPriceRequest + */ +export declare class QueryGetGasPriceRequest extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetGasPriceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetGasPriceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetGasPriceRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetGasPriceRequest; + + static equals(a: QueryGetGasPriceRequest | PlainMessage | undefined, b: QueryGetGasPriceRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetGasPriceResponse + */ +export declare class QueryGetGasPriceResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.GasPrice GasPrice = 1; + */ + GasPrice?: GasPrice; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetGasPriceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetGasPriceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetGasPriceResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetGasPriceResponse; + + static equals(a: QueryGetGasPriceResponse | PlainMessage | undefined, b: QueryGetGasPriceResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllGasPriceRequest + */ +export declare class QueryAllGasPriceRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllGasPriceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllGasPriceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllGasPriceRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllGasPriceRequest; + + static equals(a: QueryAllGasPriceRequest | PlainMessage | undefined, b: QueryAllGasPriceRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllGasPriceResponse + */ +export declare class QueryAllGasPriceResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.GasPrice GasPrice = 1; + */ + GasPrice: GasPrice[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllGasPriceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllGasPriceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllGasPriceResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllGasPriceResponse; + + static equals(a: QueryAllGasPriceResponse | PlainMessage | undefined, b: QueryAllGasPriceResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetChainNoncesRequest + */ +export declare class QueryGetChainNoncesRequest extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetChainNoncesRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetChainNoncesRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetChainNoncesRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetChainNoncesRequest; + + static equals(a: QueryGetChainNoncesRequest | PlainMessage | undefined, b: QueryGetChainNoncesRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetChainNoncesResponse + */ +export declare class QueryGetChainNoncesResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.ChainNonces ChainNonces = 1; + */ + ChainNonces?: ChainNonces; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetChainNoncesResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetChainNoncesResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetChainNoncesResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetChainNoncesResponse; + + static equals(a: QueryGetChainNoncesResponse | PlainMessage | undefined, b: QueryGetChainNoncesResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllChainNoncesRequest + */ +export declare class QueryAllChainNoncesRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllChainNoncesRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllChainNoncesRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllChainNoncesRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllChainNoncesRequest; + + static equals(a: QueryAllChainNoncesRequest | PlainMessage | undefined, b: QueryAllChainNoncesRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllChainNoncesResponse + */ +export declare class QueryAllChainNoncesResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.ChainNonces ChainNonces = 1; + */ + ChainNonces: ChainNonces[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllChainNoncesResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllChainNoncesResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllChainNoncesResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllChainNoncesResponse; + + static equals(a: QueryAllChainNoncesResponse | PlainMessage | undefined, b: QueryAllChainNoncesResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllPendingNoncesRequest + */ +export declare class QueryAllPendingNoncesRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllPendingNoncesRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllPendingNoncesRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllPendingNoncesRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllPendingNoncesRequest; + + static equals(a: QueryAllPendingNoncesRequest | PlainMessage | undefined, b: QueryAllPendingNoncesRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllPendingNoncesResponse + */ +export declare class QueryAllPendingNoncesResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.PendingNonces pending_nonces = 1; + */ + pendingNonces: PendingNonces[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllPendingNoncesResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllPendingNoncesResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllPendingNoncesResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllPendingNoncesResponse; + + static equals(a: QueryAllPendingNoncesResponse | PlainMessage | undefined, b: QueryAllPendingNoncesResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryPendingNoncesByChainRequest + */ +export declare class QueryPendingNoncesByChainRequest extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryPendingNoncesByChainRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryPendingNoncesByChainRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryPendingNoncesByChainRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryPendingNoncesByChainRequest; + + static equals(a: QueryPendingNoncesByChainRequest | PlainMessage | undefined, b: QueryPendingNoncesByChainRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryPendingNoncesByChainResponse + */ +export declare class QueryPendingNoncesByChainResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.PendingNonces pending_nonces = 1; + */ + pendingNonces?: PendingNonces; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryPendingNoncesByChainResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryPendingNoncesByChainResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryPendingNoncesByChainResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryPendingNoncesByChainResponse; + + static equals(a: QueryPendingNoncesByChainResponse | PlainMessage | undefined, b: QueryPendingNoncesByChainResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetLastBlockHeightRequest + */ +export declare class QueryGetLastBlockHeightRequest extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetLastBlockHeightRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetLastBlockHeightRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetLastBlockHeightRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetLastBlockHeightRequest; + + static equals(a: QueryGetLastBlockHeightRequest | PlainMessage | undefined, b: QueryGetLastBlockHeightRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetLastBlockHeightResponse + */ +export declare class QueryGetLastBlockHeightResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.LastBlockHeight LastBlockHeight = 1; + */ + LastBlockHeight?: LastBlockHeight; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetLastBlockHeightResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetLastBlockHeightResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetLastBlockHeightResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetLastBlockHeightResponse; + + static equals(a: QueryGetLastBlockHeightResponse | PlainMessage | undefined, b: QueryGetLastBlockHeightResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllLastBlockHeightRequest + */ +export declare class QueryAllLastBlockHeightRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllLastBlockHeightRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllLastBlockHeightRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllLastBlockHeightRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllLastBlockHeightRequest; + + static equals(a: QueryAllLastBlockHeightRequest | PlainMessage | undefined, b: QueryAllLastBlockHeightRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllLastBlockHeightResponse + */ +export declare class QueryAllLastBlockHeightResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.LastBlockHeight LastBlockHeight = 1; + */ + LastBlockHeight: LastBlockHeight[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllLastBlockHeightResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllLastBlockHeightResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllLastBlockHeightResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllLastBlockHeightResponse; + + static equals(a: QueryAllLastBlockHeightResponse | PlainMessage | undefined, b: QueryAllLastBlockHeightResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetCctxRequest + */ +export declare class QueryGetCctxRequest extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetCctxRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCctxRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCctxRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCctxRequest; + + static equals(a: QueryGetCctxRequest | PlainMessage | undefined, b: QueryGetCctxRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetCctxByNonceRequest + */ +export declare class QueryGetCctxByNonceRequest extends Message { + /** + * @generated from field: int64 chainID = 1; + */ + chainID: bigint; + + /** + * @generated from field: uint64 nonce = 2; + */ + nonce: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetCctxByNonceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCctxByNonceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCctxByNonceRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCctxByNonceRequest; + + static equals(a: QueryGetCctxByNonceRequest | PlainMessage | undefined, b: QueryGetCctxByNonceRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryGetCctxResponse + */ +export declare class QueryGetCctxResponse extends Message { + /** + * @generated from field: zetachain.zetacore.crosschain.CrossChainTx CrossChainTx = 1; + */ + CrossChainTx?: CrossChainTx; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryGetCctxResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCctxResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCctxResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCctxResponse; + + static equals(a: QueryGetCctxResponse | PlainMessage | undefined, b: QueryGetCctxResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllCctxRequest + */ +export declare class QueryAllCctxRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllCctxRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllCctxRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllCctxRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllCctxRequest; + + static equals(a: QueryAllCctxRequest | PlainMessage | undefined, b: QueryAllCctxRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllCctxResponse + */ +export declare class QueryAllCctxResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.CrossChainTx CrossChainTx = 1; + */ + CrossChainTx: CrossChainTx[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllCctxResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllCctxResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllCctxResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllCctxResponse; + + static equals(a: QueryAllCctxResponse | PlainMessage | undefined, b: QueryAllCctxResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllCctxPendingRequest + */ +export declare class QueryAllCctxPendingRequest extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 2; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllCctxPendingRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllCctxPendingRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllCctxPendingRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllCctxPendingRequest; + + static equals(a: QueryAllCctxPendingRequest | PlainMessage | undefined, b: QueryAllCctxPendingRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryAllCctxPendingResponse + */ +export declare class QueryAllCctxPendingResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.crosschain.CrossChainTx CrossChainTx = 1; + */ + CrossChainTx: CrossChainTx[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryAllCctxPendingResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllCctxPendingResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllCctxPendingResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllCctxPendingResponse; + + static equals(a: QueryAllCctxPendingResponse | PlainMessage | undefined, b: QueryAllCctxPendingResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryLastZetaHeightRequest + */ +export declare class QueryLastZetaHeightRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryLastZetaHeightRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryLastZetaHeightRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryLastZetaHeightRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryLastZetaHeightRequest; + + static equals(a: QueryLastZetaHeightRequest | PlainMessage | undefined, b: QueryLastZetaHeightRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryLastZetaHeightResponse + */ +export declare class QueryLastZetaHeightResponse extends Message { + /** + * @generated from field: int64 Height = 1; + */ + Height: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryLastZetaHeightResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryLastZetaHeightResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryLastZetaHeightResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryLastZetaHeightResponse; + + static equals(a: QueryLastZetaHeightResponse | PlainMessage | undefined, b: QueryLastZetaHeightResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryConvertGasToZetaRequest + */ +export declare class QueryConvertGasToZetaRequest extends Message { + /** + * @generated from field: int64 chainId = 1; + */ + chainId: bigint; + + /** + * @generated from field: string gasLimit = 2; + */ + gasLimit: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryConvertGasToZetaRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryConvertGasToZetaRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryConvertGasToZetaRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryConvertGasToZetaRequest; + + static equals(a: QueryConvertGasToZetaRequest | PlainMessage | undefined, b: QueryConvertGasToZetaRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryConvertGasToZetaResponse + */ +export declare class QueryConvertGasToZetaResponse extends Message { + /** + * @generated from field: string outboundGasInZeta = 1; + */ + outboundGasInZeta: string; + + /** + * @generated from field: string protocolFeeInZeta = 2; + */ + protocolFeeInZeta: string; + + /** + * @generated from field: uint64 ZetaBlockHeight = 3; + */ + ZetaBlockHeight: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryConvertGasToZetaResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryConvertGasToZetaResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryConvertGasToZetaResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryConvertGasToZetaResponse; + + static equals(a: QueryConvertGasToZetaResponse | PlainMessage | undefined, b: QueryConvertGasToZetaResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryMessagePassingProtocolFeeRequest + */ +export declare class QueryMessagePassingProtocolFeeRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryMessagePassingProtocolFeeRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryMessagePassingProtocolFeeRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryMessagePassingProtocolFeeRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryMessagePassingProtocolFeeRequest; + + static equals(a: QueryMessagePassingProtocolFeeRequest | PlainMessage | undefined, b: QueryMessagePassingProtocolFeeRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryMessagePassingProtocolFeeResponse + */ +export declare class QueryMessagePassingProtocolFeeResponse extends Message { + /** + * @generated from field: string feeInZeta = 1; + */ + feeInZeta: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryMessagePassingProtocolFeeResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryMessagePassingProtocolFeeResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryMessagePassingProtocolFeeResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryMessagePassingProtocolFeeResponse; + + static equals(a: QueryMessagePassingProtocolFeeResponse | PlainMessage | undefined, b: QueryMessagePassingProtocolFeeResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryZEVMGetTransactionReceiptRequest + */ +export declare class QueryZEVMGetTransactionReceiptRequest extends Message { + /** + * @generated from field: string hash = 1; + */ + hash: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryZEVMGetTransactionReceiptRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryZEVMGetTransactionReceiptRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryZEVMGetTransactionReceiptRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryZEVMGetTransactionReceiptRequest; + + static equals(a: QueryZEVMGetTransactionReceiptRequest | PlainMessage | undefined, b: QueryZEVMGetTransactionReceiptRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryZEVMGetTransactionReceiptResponse + */ +export declare class QueryZEVMGetTransactionReceiptResponse extends Message { + /** + * @generated from field: string block_hash = 1; + */ + blockHash: string; + + /** + * @generated from field: string block_number = 2; + */ + blockNumber: string; + + /** + * @generated from field: string contract_address = 3; + */ + contractAddress: string; + + /** + * @generated from field: string cumulative_gas_used = 4; + */ + cumulativeGasUsed: string; + + /** + * @generated from field: string from = 5; + */ + from: string; + + /** + * @generated from field: string gas_used = 6; + */ + gasUsed: string; + + /** + * @generated from field: string logs_bloom = 7; + */ + logsBloom: string; + + /** + * @generated from field: string status = 8; + */ + status: string; + + /** + * @generated from field: string to = 9; + */ + to: string; + + /** + * @generated from field: string transaction_hash = 10; + */ + transactionHash: string; + + /** + * @generated from field: string transaction_index = 11; + */ + transactionIndex: string; + + /** + * @generated from field: repeated zetachain.zetacore.crosschain.Log logs = 12; + */ + logs: Log[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryZEVMGetTransactionReceiptResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryZEVMGetTransactionReceiptResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryZEVMGetTransactionReceiptResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryZEVMGetTransactionReceiptResponse; + + static equals(a: QueryZEVMGetTransactionReceiptResponse | PlainMessage | undefined, b: QueryZEVMGetTransactionReceiptResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.Log + */ +export declare class Log extends Message { + /** + * @generated from field: string address = 1; + */ + address: string; + + /** + * @generated from field: repeated string topics = 2; + */ + topics: string[]; + + /** + * @generated from field: string data = 3; + */ + data: string; + + /** + * sythetic fields + * + * @generated from field: uint64 block_number = 4; + */ + blockNumber: bigint; + + /** + * @generated from field: string transaction_hash = 5; + */ + transactionHash: string; + + /** + * @generated from field: uint64 transaction_index = 6; + */ + transactionIndex: bigint; + + /** + * @generated from field: string block_hash = 7; + */ + blockHash: string; + + /** + * @generated from field: uint64 log_index = 8; + */ + logIndex: bigint; + + /** + * @generated from field: bool removed = 9; + */ + removed: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.Log"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Log; + + static fromJson(jsonValue: JsonValue, options?: Partial): Log; + + static fromJsonString(jsonString: string, options?: Partial): Log; + + static equals(a: Log | PlainMessage | undefined, b: Log | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryZEVMGetTransactionRequest + */ +export declare class QueryZEVMGetTransactionRequest extends Message { + /** + * @generated from field: string hash = 1; + */ + hash: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryZEVMGetTransactionRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryZEVMGetTransactionRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryZEVMGetTransactionRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryZEVMGetTransactionRequest; + + static equals(a: QueryZEVMGetTransactionRequest | PlainMessage | undefined, b: QueryZEVMGetTransactionRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryZEVMGetTransactionResponse + */ +export declare class QueryZEVMGetTransactionResponse extends Message { + /** + * @generated from field: string block_hash = 1; + */ + blockHash: string; + + /** + * @generated from field: string block_number = 2; + */ + blockNumber: string; + + /** + * @generated from field: string from = 3; + */ + from: string; + + /** + * @generated from field: string gas = 4; + */ + gas: string; + + /** + * @generated from field: string gas_price = 5; + */ + gasPrice: string; + + /** + * @generated from field: string hash = 6; + */ + hash: string; + + /** + * @generated from field: string input = 7; + */ + input: string; + + /** + * @generated from field: string nonce = 8; + */ + nonce: string; + + /** + * @generated from field: string to = 9; + */ + to: string; + + /** + * @generated from field: string transaction_index = 10; + */ + transactionIndex: string; + + /** + * @generated from field: string value = 11; + */ + value: string; + + /** + * @generated from field: string type = 12; + */ + type: string; + + /** + * @generated from field: repeated string access_list = 13; + */ + accessList: string[]; + + /** + * @generated from field: string chain_id = 14; + */ + chainId: string; + + /** + * @generated from field: string v = 15; + */ + v: string; + + /** + * @generated from field: string r = 16; + */ + r: string; + + /** + * @generated from field: string s = 17; + */ + s: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryZEVMGetTransactionResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryZEVMGetTransactionResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryZEVMGetTransactionResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryZEVMGetTransactionResponse; + + static equals(a: QueryZEVMGetTransactionResponse | PlainMessage | undefined, b: QueryZEVMGetTransactionResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryZEVMGetBlockByNumberRequest + */ +export declare class QueryZEVMGetBlockByNumberRequest extends Message { + /** + * @generated from field: uint64 height = 1; + */ + height: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryZEVMGetBlockByNumberRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryZEVMGetBlockByNumberRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryZEVMGetBlockByNumberRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryZEVMGetBlockByNumberRequest; + + static equals(a: QueryZEVMGetBlockByNumberRequest | PlainMessage | undefined, b: QueryZEVMGetBlockByNumberRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.QueryZEVMGetBlockByNumberResponse + */ +export declare class QueryZEVMGetBlockByNumberResponse extends Message { + /** + * @generated from field: string number = 1; + */ + number: string; + + /** + * @generated from field: string hash = 2; + */ + hash: string; + + /** + * @generated from field: string parent_hash = 3; + */ + parentHash: string; + + /** + * @generated from field: string nonce = 4; + */ + nonce: string; + + /** + * @generated from field: string sha3_uncles = 5; + */ + sha3Uncles: string; + + /** + * @generated from field: string logs_bloom = 6; + */ + logsBloom: string; + + /** + * @generated from field: string transactions_root = 7; + */ + transactionsRoot: string; + + /** + * @generated from field: string state_root = 8; + */ + stateRoot: string; + + /** + * @generated from field: string receipts_root = 9; + */ + receiptsRoot: string; + + /** + * @generated from field: string miner = 10; + */ + miner: string; + + /** + * @generated from field: string difficulty = 11; + */ + difficulty: string; + + /** + * @generated from field: string total_difficulty = 12; + */ + totalDifficulty: string; + + /** + * @generated from field: string extra_data = 13; + */ + extraData: string; + + /** + * @generated from field: string size = 14; + */ + size: string; + + /** + * @generated from field: string gas_limit = 15; + */ + gasLimit: string; + + /** + * @generated from field: string gas_used = 16; + */ + gasUsed: string; + + /** + * @generated from field: string timestamp = 17; + */ + timestamp: string; + + /** + * @generated from field: repeated string transactions = 18; + */ + transactions: string[]; + + /** + * @generated from field: repeated string uncles = 19; + */ + uncles: string[]; + + /** + * @generated from field: string base_fee_per_gas = 20; + */ + baseFeePerGas: string; + + /** + * @generated from field: string mix_hash = 21; + */ + mixHash: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.QueryZEVMGetBlockByNumberResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryZEVMGetBlockByNumberResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryZEVMGetBlockByNumberResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryZEVMGetBlockByNumberResponse; + + static equals(a: QueryZEVMGetBlockByNumberResponse | PlainMessage | undefined, b: QueryZEVMGetBlockByNumberResponse | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/tss_pb.d.ts b/typescript/crosschain/tss_pb.d.ts new file mode 100644 index 0000000000..13ef1fb435 --- /dev/null +++ b/typescript/crosschain/tss_pb.d.ts @@ -0,0 +1,52 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/tss.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.crosschain.TSS + */ +export declare class TSS extends Message { + /** + * @generated from field: string tss_pubkey = 3; + */ + tssPubkey: string; + + /** + * @generated from field: repeated string tss_participant_list = 4; + */ + tssParticipantList: string[]; + + /** + * @generated from field: repeated string operator_address_list = 5; + */ + operatorAddressList: string[]; + + /** + * @generated from field: int64 finalizedZetaHeight = 6; + */ + finalizedZetaHeight: bigint; + + /** + * @generated from field: int64 keyGenZetaHeight = 7; + */ + keyGenZetaHeight: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.TSS"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): TSS; + + static fromJson(jsonValue: JsonValue, options?: Partial): TSS; + + static fromJsonString(jsonString: string, options?: Partial): TSS; + + static equals(a: TSS | PlainMessage | undefined, b: TSS | PlainMessage | undefined): boolean; +} + diff --git a/typescript/crosschain/tx_pb.d.ts b/typescript/crosschain/tx_pb.d.ts new file mode 100644 index 0000000000..1e223c00da --- /dev/null +++ b/typescript/crosschain/tx_pb.d.ts @@ -0,0 +1,824 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file crosschain/tx.proto (package zetachain.zetacore.crosschain, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { CoinType, Proof, PubKeySet, ReceiveStatus } from "../common/common_pb.js"; + +/** + * @generated from message zetachain.zetacore.crosschain.MsgMigrateTssFunds + */ +export declare class MsgMigrateTssFunds extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: string amount = 3; + */ + amount: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgMigrateTssFunds"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgMigrateTssFunds; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgMigrateTssFunds; + + static fromJsonString(jsonString: string, options?: Partial): MsgMigrateTssFunds; + + static equals(a: MsgMigrateTssFunds | PlainMessage | undefined, b: MsgMigrateTssFunds | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgMigrateTssFundsResponse + */ +export declare class MsgMigrateTssFundsResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgMigrateTssFundsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgMigrateTssFundsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgMigrateTssFundsResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgMigrateTssFundsResponse; + + static equals(a: MsgMigrateTssFundsResponse | PlainMessage | undefined, b: MsgMigrateTssFundsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgAddToInTxTracker + */ +export declare class MsgAddToInTxTracker extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: string tx_hash = 3; + */ + txHash: string; + + /** + * @generated from field: common.CoinType coin_type = 4; + */ + coinType: CoinType; + + /** + * @generated from field: common.Proof proof = 5; + */ + proof?: Proof; + + /** + * @generated from field: string block_hash = 6; + */ + blockHash: string; + + /** + * @generated from field: int64 tx_index = 7; + */ + txIndex: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgAddToInTxTracker"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddToInTxTracker; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddToInTxTracker; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddToInTxTracker; + + static equals(a: MsgAddToInTxTracker | PlainMessage | undefined, b: MsgAddToInTxTracker | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgAddToInTxTrackerResponse + */ +export declare class MsgAddToInTxTrackerResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgAddToInTxTrackerResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddToInTxTrackerResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddToInTxTrackerResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddToInTxTrackerResponse; + + static equals(a: MsgAddToInTxTrackerResponse | PlainMessage | undefined, b: MsgAddToInTxTrackerResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgUpdateTssAddress + */ +export declare class MsgUpdateTssAddress extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string tss_pubkey = 2; + */ + tssPubkey: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgUpdateTssAddress"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateTssAddress; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateTssAddress; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateTssAddress; + + static equals(a: MsgUpdateTssAddress | PlainMessage | undefined, b: MsgUpdateTssAddress | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgUpdateTssAddressResponse + */ +export declare class MsgUpdateTssAddressResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgUpdateTssAddressResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateTssAddressResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateTssAddressResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateTssAddressResponse; + + static equals(a: MsgUpdateTssAddressResponse | PlainMessage | undefined, b: MsgUpdateTssAddressResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgWhitelistERC20 + */ +export declare class MsgWhitelistERC20 extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string erc20_address = 2; + */ + erc20Address: string; + + /** + * @generated from field: int64 chain_id = 3; + */ + chainId: bigint; + + /** + * @generated from field: string name = 4; + */ + name: string; + + /** + * @generated from field: string symbol = 5; + */ + symbol: string; + + /** + * @generated from field: uint32 decimals = 6; + */ + decimals: number; + + /** + * @generated from field: int64 gas_limit = 7; + */ + gasLimit: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgWhitelistERC20"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgWhitelistERC20; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgWhitelistERC20; + + static fromJsonString(jsonString: string, options?: Partial): MsgWhitelistERC20; + + static equals(a: MsgWhitelistERC20 | PlainMessage | undefined, b: MsgWhitelistERC20 | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgWhitelistERC20Response + */ +export declare class MsgWhitelistERC20Response extends Message { + /** + * @generated from field: string zrc20_address = 1; + */ + zrc20Address: string; + + /** + * @generated from field: string cctx_index = 2; + */ + cctxIndex: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgWhitelistERC20Response"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgWhitelistERC20Response; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgWhitelistERC20Response; + + static fromJsonString(jsonString: string, options?: Partial): MsgWhitelistERC20Response; + + static equals(a: MsgWhitelistERC20Response | PlainMessage | undefined, b: MsgWhitelistERC20Response | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgAddToOutTxTracker + */ +export declare class MsgAddToOutTxTracker extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: uint64 nonce = 3; + */ + nonce: bigint; + + /** + * @generated from field: string tx_hash = 4; + */ + txHash: string; + + /** + * @generated from field: common.Proof proof = 5; + */ + proof?: Proof; + + /** + * @generated from field: string block_hash = 6; + */ + blockHash: string; + + /** + * @generated from field: int64 tx_index = 7; + */ + txIndex: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgAddToOutTxTracker"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddToOutTxTracker; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddToOutTxTracker; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddToOutTxTracker; + + static equals(a: MsgAddToOutTxTracker | PlainMessage | undefined, b: MsgAddToOutTxTracker | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgAddToOutTxTrackerResponse + */ +export declare class MsgAddToOutTxTrackerResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgAddToOutTxTrackerResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddToOutTxTrackerResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddToOutTxTrackerResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddToOutTxTrackerResponse; + + static equals(a: MsgAddToOutTxTrackerResponse | PlainMessage | undefined, b: MsgAddToOutTxTrackerResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgRemoveFromOutTxTracker + */ +export declare class MsgRemoveFromOutTxTracker extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: uint64 nonce = 3; + */ + nonce: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgRemoveFromOutTxTracker"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgRemoveFromOutTxTracker; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgRemoveFromOutTxTracker; + + static fromJsonString(jsonString: string, options?: Partial): MsgRemoveFromOutTxTracker; + + static equals(a: MsgRemoveFromOutTxTracker | PlainMessage | undefined, b: MsgRemoveFromOutTxTracker | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgRemoveFromOutTxTrackerResponse + */ +export declare class MsgRemoveFromOutTxTrackerResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgRemoveFromOutTxTrackerResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgRemoveFromOutTxTrackerResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgRemoveFromOutTxTrackerResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgRemoveFromOutTxTrackerResponse; + + static equals(a: MsgRemoveFromOutTxTrackerResponse | PlainMessage | undefined, b: MsgRemoveFromOutTxTrackerResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgCreateTSSVoter + */ +export declare class MsgCreateTSSVoter extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string tss_pubkey = 2; + */ + tssPubkey: string; + + /** + * @generated from field: int64 keyGenZetaHeight = 3; + */ + keyGenZetaHeight: bigint; + + /** + * @generated from field: common.ReceiveStatus status = 4; + */ + status: ReceiveStatus; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgCreateTSSVoter"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgCreateTSSVoter; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgCreateTSSVoter; + + static fromJsonString(jsonString: string, options?: Partial): MsgCreateTSSVoter; + + static equals(a: MsgCreateTSSVoter | PlainMessage | undefined, b: MsgCreateTSSVoter | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgCreateTSSVoterResponse + */ +export declare class MsgCreateTSSVoterResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgCreateTSSVoterResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgCreateTSSVoterResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgCreateTSSVoterResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgCreateTSSVoterResponse; + + static equals(a: MsgCreateTSSVoterResponse | PlainMessage | undefined, b: MsgCreateTSSVoterResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgGasPriceVoter + */ +export declare class MsgGasPriceVoter extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: uint64 price = 3; + */ + price: bigint; + + /** + * @generated from field: uint64 block_number = 4; + */ + blockNumber: bigint; + + /** + * @generated from field: string supply = 5; + */ + supply: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgGasPriceVoter"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgGasPriceVoter; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgGasPriceVoter; + + static fromJsonString(jsonString: string, options?: Partial): MsgGasPriceVoter; + + static equals(a: MsgGasPriceVoter | PlainMessage | undefined, b: MsgGasPriceVoter | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgGasPriceVoterResponse + */ +export declare class MsgGasPriceVoterResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgGasPriceVoterResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgGasPriceVoterResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgGasPriceVoterResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgGasPriceVoterResponse; + + static equals(a: MsgGasPriceVoterResponse | PlainMessage | undefined, b: MsgGasPriceVoterResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgNonceVoter + */ +export declare class MsgNonceVoter extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: uint64 nonce = 3; + */ + nonce: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgNonceVoter"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgNonceVoter; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgNonceVoter; + + static fromJsonString(jsonString: string, options?: Partial): MsgNonceVoter; + + static equals(a: MsgNonceVoter | PlainMessage | undefined, b: MsgNonceVoter | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgNonceVoterResponse + */ +export declare class MsgNonceVoterResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgNonceVoterResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgNonceVoterResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgNonceVoterResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgNonceVoterResponse; + + static equals(a: MsgNonceVoterResponse | PlainMessage | undefined, b: MsgNonceVoterResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTx + */ +export declare class MsgVoteOnObservedOutboundTx extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string cctx_hash = 2; + */ + cctxHash: string; + + /** + * @generated from field: string observed_outTx_hash = 3; + */ + observedOutTxHash: string; + + /** + * @generated from field: uint64 observed_outTx_blockHeight = 4; + */ + observedOutTxBlockHeight: bigint; + + /** + * @generated from field: uint64 observed_outTx_gas_used = 10; + */ + observedOutTxGasUsed: bigint; + + /** + * @generated from field: string observed_outTx_effective_gas_price = 11; + */ + observedOutTxEffectiveGasPrice: string; + + /** + * @generated from field: uint64 observed_outTx_effective_gas_limit = 12; + */ + observedOutTxEffectiveGasLimit: bigint; + + /** + * @generated from field: string value_received = 5; + */ + valueReceived: string; + + /** + * @generated from field: common.ReceiveStatus status = 6; + */ + status: ReceiveStatus; + + /** + * @generated from field: int64 outTx_chain = 7; + */ + outTxChain: bigint; + + /** + * @generated from field: uint64 outTx_tss_nonce = 8; + */ + outTxTssNonce: bigint; + + /** + * @generated from field: common.CoinType coin_type = 9; + */ + coinType: CoinType; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTx"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteOnObservedOutboundTx; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteOnObservedOutboundTx; + + static fromJsonString(jsonString: string, options?: Partial): MsgVoteOnObservedOutboundTx; + + static equals(a: MsgVoteOnObservedOutboundTx | PlainMessage | undefined, b: MsgVoteOnObservedOutboundTx | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTxResponse + */ +export declare class MsgVoteOnObservedOutboundTxResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTxResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteOnObservedOutboundTxResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteOnObservedOutboundTxResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgVoteOnObservedOutboundTxResponse; + + static equals(a: MsgVoteOnObservedOutboundTxResponse | PlainMessage | undefined, b: MsgVoteOnObservedOutboundTxResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgVoteOnObservedInboundTx + */ +export declare class MsgVoteOnObservedInboundTx extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string sender = 2; + */ + sender: string; + + /** + * @generated from field: int64 sender_chain_id = 3; + */ + senderChainId: bigint; + + /** + * @generated from field: string receiver = 4; + */ + receiver: string; + + /** + * @generated from field: int64 receiver_chain = 5; + */ + receiverChain: bigint; + + /** + * string zeta_burnt = 6; + * + * @generated from field: string amount = 6; + */ + amount: string; + + /** + * string mMint = 7; + * + * @generated from field: string message = 8; + */ + message: string; + + /** + * @generated from field: string in_tx_hash = 9; + */ + inTxHash: string; + + /** + * @generated from field: uint64 in_block_height = 10; + */ + inBlockHeight: bigint; + + /** + * @generated from field: uint64 gas_limit = 11; + */ + gasLimit: bigint; + + /** + * @generated from field: common.CoinType coin_type = 12; + */ + coinType: CoinType; + + /** + * @generated from field: string tx_origin = 13; + */ + txOrigin: string; + + /** + * @generated from field: string asset = 14; + */ + asset: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgVoteOnObservedInboundTx"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteOnObservedInboundTx; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteOnObservedInboundTx; + + static fromJsonString(jsonString: string, options?: Partial): MsgVoteOnObservedInboundTx; + + static equals(a: MsgVoteOnObservedInboundTx | PlainMessage | undefined, b: MsgVoteOnObservedInboundTx | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgVoteOnObservedInboundTxResponse + */ +export declare class MsgVoteOnObservedInboundTxResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgVoteOnObservedInboundTxResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteOnObservedInboundTxResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteOnObservedInboundTxResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgVoteOnObservedInboundTxResponse; + + static equals(a: MsgVoteOnObservedInboundTxResponse | PlainMessage | undefined, b: MsgVoteOnObservedInboundTxResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgSetNodeKeys + */ +export declare class MsgSetNodeKeys extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: common.PubKeySet pubkeySet = 2; + */ + pubkeySet?: PubKeySet; + + /** + * @generated from field: string tss_signer_Address = 3; + */ + tssSignerAddress: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgSetNodeKeys"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgSetNodeKeys; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgSetNodeKeys; + + static fromJsonString(jsonString: string, options?: Partial): MsgSetNodeKeys; + + static equals(a: MsgSetNodeKeys | PlainMessage | undefined, b: MsgSetNodeKeys | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.crosschain.MsgSetNodeKeysResponse + */ +export declare class MsgSetNodeKeysResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.crosschain.MsgSetNodeKeysResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgSetNodeKeysResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgSetNodeKeysResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgSetNodeKeysResponse; + + static equals(a: MsgSetNodeKeysResponse | PlainMessage | undefined, b: MsgSetNodeKeysResponse | PlainMessage | undefined): boolean; +} + diff --git a/typescript/emissions/events_pb.d.ts b/typescript/emissions/events_pb.d.ts new file mode 100644 index 0000000000..d501c8ff9e --- /dev/null +++ b/typescript/emissions/events_pb.d.ts @@ -0,0 +1,140 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file emissions/events.proto (package zetachain.zetacore.emissions, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum zetachain.zetacore.emissions.EmissionType + */ +export declare enum EmissionType { + /** + * @generated from enum value: Slash = 0; + */ + Slash = 0, + + /** + * @generated from enum value: Rewards = 1; + */ + Rewards = 1, +} + +/** + * @generated from message zetachain.zetacore.emissions.ObserverEmission + */ +export declare class ObserverEmission extends Message { + /** + * @generated from field: zetachain.zetacore.emissions.EmissionType emission_type = 1; + */ + emissionType: EmissionType; + + /** + * @generated from field: string observer_address = 2; + */ + observerAddress: string; + + /** + * @generated from field: string amount = 3; + */ + amount: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.ObserverEmission"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ObserverEmission; + + static fromJson(jsonValue: JsonValue, options?: Partial): ObserverEmission; + + static fromJsonString(jsonString: string, options?: Partial): ObserverEmission; + + static equals(a: ObserverEmission | PlainMessage | undefined, b: ObserverEmission | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.EventObserverEmissions + */ +export declare class EventObserverEmissions extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: repeated zetachain.zetacore.emissions.ObserverEmission emissions = 2; + */ + emissions: ObserverEmission[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.EventObserverEmissions"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventObserverEmissions; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventObserverEmissions; + + static fromJsonString(jsonString: string, options?: Partial): EventObserverEmissions; + + static equals(a: EventObserverEmissions | PlainMessage | undefined, b: EventObserverEmissions | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.EventBlockEmissions + */ +export declare class EventBlockEmissions extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string bond_factor = 2; + */ + bondFactor: string; + + /** + * @generated from field: string reserves_factor = 3; + */ + reservesFactor: string; + + /** + * @generated from field: string duration_factor = 4; + */ + durationFactor: string; + + /** + * @generated from field: string validator_rewards_for_block = 5; + */ + validatorRewardsForBlock: string; + + /** + * @generated from field: string observer_rewards_for_block = 6; + */ + observerRewardsForBlock: string; + + /** + * @generated from field: string tss_rewards_for_block = 7; + */ + tssRewardsForBlock: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.EventBlockEmissions"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventBlockEmissions; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventBlockEmissions; + + static fromJsonString(jsonString: string, options?: Partial): EventBlockEmissions; + + static equals(a: EventBlockEmissions | PlainMessage | undefined, b: EventBlockEmissions | PlainMessage | undefined): boolean; +} + diff --git a/typescript/emissions/genesis_pb.d.ts b/typescript/emissions/genesis_pb.d.ts new file mode 100644 index 0000000000..d4116b9257 --- /dev/null +++ b/typescript/emissions/genesis_pb.d.ts @@ -0,0 +1,41 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file emissions/genesis.proto (package zetachain.zetacore.emissions, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Params } from "./params_pb.js"; +import type { WithdrawableEmissions } from "./withdrawable_emissions_pb.js"; + +/** + * GenesisState defines the emissions module's genesis state. + * + * @generated from message zetachain.zetacore.emissions.GenesisState + */ +export declare class GenesisState extends Message { + /** + * @generated from field: zetachain.zetacore.emissions.Params params = 1; + */ + params?: Params; + + /** + * @generated from field: repeated zetachain.zetacore.emissions.WithdrawableEmissions withdrawableEmissions = 2; + */ + withdrawableEmissions: WithdrawableEmissions[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.GenesisState"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): GenesisState; + + static fromJson(jsonValue: JsonValue, options?: Partial): GenesisState; + + static fromJsonString(jsonString: string, options?: Partial): GenesisState; + + static equals(a: GenesisState | PlainMessage | undefined, b: GenesisState | PlainMessage | undefined): boolean; +} + diff --git a/typescript/emissions/index.d.ts b/typescript/emissions/index.d.ts new file mode 100644 index 0000000000..81e140bbf8 --- /dev/null +++ b/typescript/emissions/index.d.ts @@ -0,0 +1,5 @@ +export * from "./events_pb"; +export * from "./genesis_pb"; +export * from "./params_pb"; +export * from "./query_pb"; +export * from "./withdrawable_emissions_pb"; diff --git a/typescript/emissions/params_pb.d.ts b/typescript/emissions/params_pb.d.ts new file mode 100644 index 0000000000..86bc27895e --- /dev/null +++ b/typescript/emissions/params_pb.d.ts @@ -0,0 +1,74 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file emissions/params.proto (package zetachain.zetacore.emissions, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * Params defines the parameters for the module. + * + * @generated from message zetachain.zetacore.emissions.Params + */ +export declare class Params extends Message { + /** + * @generated from field: string max_bond_factor = 1; + */ + maxBondFactor: string; + + /** + * @generated from field: string min_bond_factor = 2; + */ + minBondFactor: string; + + /** + * @generated from field: string avg_block_time = 3; + */ + avgBlockTime: string; + + /** + * @generated from field: string target_bond_ratio = 4; + */ + targetBondRatio: string; + + /** + * @generated from field: string validator_emission_percentage = 5; + */ + validatorEmissionPercentage: string; + + /** + * @generated from field: string observer_emission_percentage = 6; + */ + observerEmissionPercentage: string; + + /** + * @generated from field: string tss_signer_emission_percentage = 7; + */ + tssSignerEmissionPercentage: string; + + /** + * @generated from field: string duration_factor_constant = 8; + */ + durationFactorConstant: string; + + /** + * @generated from field: string observer_slash_amount = 9; + */ + observerSlashAmount: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.Params"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Params; + + static fromJson(jsonValue: JsonValue, options?: Partial): Params; + + static fromJsonString(jsonString: string, options?: Partial): Params; + + static equals(a: Params | PlainMessage | undefined, b: Params | PlainMessage | undefined): boolean; +} + diff --git a/typescript/emissions/query_pb.d.ts b/typescript/emissions/query_pb.d.ts new file mode 100644 index 0000000000..26b86ff16b --- /dev/null +++ b/typescript/emissions/query_pb.d.ts @@ -0,0 +1,212 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file emissions/query.proto (package zetachain.zetacore.emissions, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Params } from "./params_pb.js"; + +/** + * QueryParamsRequest is request type for the Query/Params RPC method. + * + * @generated from message zetachain.zetacore.emissions.QueryParamsRequest + */ +export declare class QueryParamsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryParamsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsRequest; + + static equals(a: QueryParamsRequest | PlainMessage | undefined, b: QueryParamsRequest | PlainMessage | undefined): boolean; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + * + * @generated from message zetachain.zetacore.emissions.QueryParamsResponse + */ +export declare class QueryParamsResponse extends Message { + /** + * params holds all the parameters of this module. + * + * @generated from field: zetachain.zetacore.emissions.Params params = 1; + */ + params?: Params; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryParamsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsResponse; + + static equals(a: QueryParamsResponse | PlainMessage | undefined, b: QueryParamsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.QueryListPoolAddressesRequest + */ +export declare class QueryListPoolAddressesRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryListPoolAddressesRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryListPoolAddressesRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryListPoolAddressesRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryListPoolAddressesRequest; + + static equals(a: QueryListPoolAddressesRequest | PlainMessage | undefined, b: QueryListPoolAddressesRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.QueryListPoolAddressesResponse + */ +export declare class QueryListPoolAddressesResponse extends Message { + /** + * @generated from field: string undistributed_observer_balances_address = 1; + */ + undistributedObserverBalancesAddress: string; + + /** + * @generated from field: string undistributed_tss_balances_address = 2; + */ + undistributedTssBalancesAddress: string; + + /** + * @generated from field: string emission_module_address = 3; + */ + emissionModuleAddress: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryListPoolAddressesResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryListPoolAddressesResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryListPoolAddressesResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryListPoolAddressesResponse; + + static equals(a: QueryListPoolAddressesResponse | PlainMessage | undefined, b: QueryListPoolAddressesResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.QueryGetEmissionsFactorsRequest + */ +export declare class QueryGetEmissionsFactorsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryGetEmissionsFactorsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetEmissionsFactorsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetEmissionsFactorsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetEmissionsFactorsRequest; + + static equals(a: QueryGetEmissionsFactorsRequest | PlainMessage | undefined, b: QueryGetEmissionsFactorsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.QueryGetEmissionsFactorsResponse + */ +export declare class QueryGetEmissionsFactorsResponse extends Message { + /** + * @generated from field: string reservesFactor = 1; + */ + reservesFactor: string; + + /** + * @generated from field: string bondFactor = 2; + */ + bondFactor: string; + + /** + * @generated from field: string durationFactor = 3; + */ + durationFactor: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryGetEmissionsFactorsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetEmissionsFactorsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetEmissionsFactorsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetEmissionsFactorsResponse; + + static equals(a: QueryGetEmissionsFactorsResponse | PlainMessage | undefined, b: QueryGetEmissionsFactorsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.QueryShowAvailableEmissionsRequest + */ +export declare class QueryShowAvailableEmissionsRequest extends Message { + /** + * @generated from field: string address = 1; + */ + address: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryShowAvailableEmissionsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryShowAvailableEmissionsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryShowAvailableEmissionsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryShowAvailableEmissionsRequest; + + static equals(a: QueryShowAvailableEmissionsRequest | PlainMessage | undefined, b: QueryShowAvailableEmissionsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.emissions.QueryShowAvailableEmissionsResponse + */ +export declare class QueryShowAvailableEmissionsResponse extends Message { + /** + * @generated from field: string amount = 1; + */ + amount: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.QueryShowAvailableEmissionsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryShowAvailableEmissionsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryShowAvailableEmissionsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryShowAvailableEmissionsResponse; + + static equals(a: QueryShowAvailableEmissionsResponse | PlainMessage | undefined, b: QueryShowAvailableEmissionsResponse | PlainMessage | undefined): boolean; +} + diff --git a/typescript/emissions/withdrawable_emissions_pb.d.ts b/typescript/emissions/withdrawable_emissions_pb.d.ts new file mode 100644 index 0000000000..6b85546b5d --- /dev/null +++ b/typescript/emissions/withdrawable_emissions_pb.d.ts @@ -0,0 +1,37 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file emissions/withdrawable_emissions.proto (package zetachain.zetacore.emissions, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.emissions.WithdrawableEmissions + */ +export declare class WithdrawableEmissions extends Message { + /** + * @generated from field: string address = 1; + */ + address: string; + + /** + * @generated from field: string amount = 2; + */ + amount: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.emissions.WithdrawableEmissions"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): WithdrawableEmissions; + + static fromJson(jsonValue: JsonValue, options?: Partial): WithdrawableEmissions; + + static fromJsonString(jsonString: string, options?: Partial): WithdrawableEmissions; + + static equals(a: WithdrawableEmissions | PlainMessage | undefined, b: WithdrawableEmissions | PlainMessage | undefined): boolean; +} + diff --git a/typescript/fungible/events_pb.d.ts b/typescript/fungible/events_pb.d.ts new file mode 100644 index 0000000000..c36e4eebd8 --- /dev/null +++ b/typescript/fungible/events_pb.d.ts @@ -0,0 +1,216 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file fungible/events.proto (package zetachain.zetacore.fungible, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { CoinType } from "../common/common_pb.js"; +import type { UpdatePausedStatusAction } from "./tx_pb.js"; + +/** + * @generated from message zetachain.zetacore.fungible.EventSystemContractUpdated + */ +export declare class EventSystemContractUpdated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string new_contract_address = 2; + */ + newContractAddress: string; + + /** + * @generated from field: string old_contract_address = 3; + */ + oldContractAddress: string; + + /** + * @generated from field: string signer = 4; + */ + signer: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.EventSystemContractUpdated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventSystemContractUpdated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventSystemContractUpdated; + + static fromJsonString(jsonString: string, options?: Partial): EventSystemContractUpdated; + + static equals(a: EventSystemContractUpdated | PlainMessage | undefined, b: EventSystemContractUpdated | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.EventZRC20Deployed + */ +export declare class EventZRC20Deployed extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: string contract = 3; + */ + contract: string; + + /** + * @generated from field: string name = 4; + */ + name: string; + + /** + * @generated from field: string symbol = 5; + */ + symbol: string; + + /** + * @generated from field: int64 decimals = 6; + */ + decimals: bigint; + + /** + * @generated from field: common.CoinType coin_type = 7; + */ + coinType: CoinType; + + /** + * @generated from field: string erc20 = 8; + */ + erc20: string; + + /** + * @generated from field: int64 gas_limit = 9; + */ + gasLimit: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.EventZRC20Deployed"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventZRC20Deployed; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventZRC20Deployed; + + static fromJsonString(jsonString: string, options?: Partial): EventZRC20Deployed; + + static equals(a: EventZRC20Deployed | PlainMessage | undefined, b: EventZRC20Deployed | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.EventZRC20WithdrawFeeUpdated + */ +export declare class EventZRC20WithdrawFeeUpdated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: common.CoinType coin_type = 3; + */ + coinType: CoinType; + + /** + * @generated from field: string zrc20_address = 4; + */ + zrc20Address: string; + + /** + * @generated from field: string old_withdraw_fee = 5; + */ + oldWithdrawFee: string; + + /** + * @generated from field: string new_withdraw_fee = 6; + */ + newWithdrawFee: string; + + /** + * @generated from field: string signer = 7; + */ + signer: string; + + /** + * @generated from field: string old_gas_limit = 8; + */ + oldGasLimit: string; + + /** + * @generated from field: string new_gas_limit = 9; + */ + newGasLimit: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.EventZRC20WithdrawFeeUpdated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventZRC20WithdrawFeeUpdated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventZRC20WithdrawFeeUpdated; + + static fromJsonString(jsonString: string, options?: Partial): EventZRC20WithdrawFeeUpdated; + + static equals(a: EventZRC20WithdrawFeeUpdated | PlainMessage | undefined, b: EventZRC20WithdrawFeeUpdated | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.EventZRC20PausedStatusUpdated + */ +export declare class EventZRC20PausedStatusUpdated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: repeated string zrc20_addresses = 2; + */ + zrc20Addresses: string[]; + + /** + * @generated from field: zetachain.zetacore.fungible.UpdatePausedStatusAction action = 3; + */ + action: UpdatePausedStatusAction; + + /** + * @generated from field: string signer = 4; + */ + signer: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.EventZRC20PausedStatusUpdated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventZRC20PausedStatusUpdated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventZRC20PausedStatusUpdated; + + static fromJsonString(jsonString: string, options?: Partial): EventZRC20PausedStatusUpdated; + + static equals(a: EventZRC20PausedStatusUpdated | PlainMessage | undefined, b: EventZRC20PausedStatusUpdated | PlainMessage | undefined): boolean; +} + diff --git a/typescript/fungible/foreign_coins_pb.d.ts b/typescript/fungible/foreign_coins_pb.d.ts new file mode 100644 index 0000000000..4c23a343a8 --- /dev/null +++ b/typescript/fungible/foreign_coins_pb.d.ts @@ -0,0 +1,82 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file fungible/foreign_coins.proto (package zetachain.zetacore.fungible, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { CoinType } from "../common/common_pb.js"; + +/** + * @generated from message zetachain.zetacore.fungible.ForeignCoins + */ +export declare class ForeignCoins extends Message { + /** + * string index = 1; + * + * index + * + * @generated from field: string zrc20_contract_address = 2; + */ + zrc20ContractAddress: string; + + /** + * @generated from field: string asset = 3; + */ + asset: string; + + /** + * @generated from field: int64 foreign_chain_id = 4; + */ + foreignChainId: bigint; + + /** + * @generated from field: uint32 decimals = 5; + */ + decimals: number; + + /** + * @generated from field: string name = 6; + */ + name: string; + + /** + * @generated from field: string symbol = 7; + */ + symbol: string; + + /** + * @generated from field: common.CoinType coin_type = 8; + */ + coinType: CoinType; + + /** + * @generated from field: uint64 gas_limit = 9; + */ + gasLimit: bigint; + + /** + * @generated from field: bool paused = 10; + */ + paused: boolean; + + /** + * @generated from field: string liquidity_cap = 11; + */ + liquidityCap: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.ForeignCoins"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ForeignCoins; + + static fromJson(jsonValue: JsonValue, options?: Partial): ForeignCoins; + + static fromJsonString(jsonString: string, options?: Partial): ForeignCoins; + + static equals(a: ForeignCoins | PlainMessage | undefined, b: ForeignCoins | PlainMessage | undefined): boolean; +} + diff --git a/typescript/fungible/genesis_pb.d.ts b/typescript/fungible/genesis_pb.d.ts new file mode 100644 index 0000000000..1a338d01c8 --- /dev/null +++ b/typescript/fungible/genesis_pb.d.ts @@ -0,0 +1,47 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file fungible/genesis.proto (package zetachain.zetacore.fungible, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Params } from "./params_pb.js"; +import type { ForeignCoins } from "./foreign_coins_pb.js"; +import type { SystemContract } from "./system_contract_pb.js"; + +/** + * GenesisState defines the fungible module's genesis state. + * + * @generated from message zetachain.zetacore.fungible.GenesisState + */ +export declare class GenesisState extends Message { + /** + * @generated from field: zetachain.zetacore.fungible.Params params = 1; + */ + params?: Params; + + /** + * @generated from field: repeated zetachain.zetacore.fungible.ForeignCoins foreignCoinsList = 2; + */ + foreignCoinsList: ForeignCoins[]; + + /** + * @generated from field: zetachain.zetacore.fungible.SystemContract systemContract = 3; + */ + systemContract?: SystemContract; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.GenesisState"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): GenesisState; + + static fromJson(jsonValue: JsonValue, options?: Partial): GenesisState; + + static fromJsonString(jsonString: string, options?: Partial): GenesisState; + + static equals(a: GenesisState | PlainMessage | undefined, b: GenesisState | PlainMessage | undefined): boolean; +} + diff --git a/typescript/fungible/index.d.ts b/typescript/fungible/index.d.ts new file mode 100644 index 0000000000..ca17377759 --- /dev/null +++ b/typescript/fungible/index.d.ts @@ -0,0 +1,7 @@ +export * from "./events_pb"; +export * from "./foreign_coins_pb"; +export * from "./genesis_pb"; +export * from "./params_pb"; +export * from "./query_pb"; +export * from "./system_contract_pb"; +export * from "./tx_pb"; diff --git a/typescript/fungible/params_pb.d.ts b/typescript/fungible/params_pb.d.ts new file mode 100644 index 0000000000..a9f83a1d01 --- /dev/null +++ b/typescript/fungible/params_pb.d.ts @@ -0,0 +1,29 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file fungible/params.proto (package zetachain.zetacore.fungible, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * Params defines the parameters for the module. + * + * @generated from message zetachain.zetacore.fungible.Params + */ +export declare class Params extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.Params"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Params; + + static fromJson(jsonValue: JsonValue, options?: Partial): Params; + + static fromJsonString(jsonString: string, options?: Partial): Params; + + static equals(a: Params | PlainMessage | undefined, b: Params | PlainMessage | undefined): boolean; +} + diff --git a/typescript/fungible/query_pb.d.ts b/typescript/fungible/query_pb.d.ts new file mode 100644 index 0000000000..4a604e405e --- /dev/null +++ b/typescript/fungible/query_pb.d.ts @@ -0,0 +1,373 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file fungible/query.proto (package zetachain.zetacore.fungible, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Params } from "./params_pb.js"; +import type { ForeignCoins } from "./foreign_coins_pb.js"; +import type { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination_pb.js"; +import type { SystemContract } from "./system_contract_pb.js"; + +/** + * QueryParamsRequest is request type for the Query/Params RPC method. + * + * @generated from message zetachain.zetacore.fungible.QueryParamsRequest + */ +export declare class QueryParamsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryParamsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsRequest; + + static equals(a: QueryParamsRequest | PlainMessage | undefined, b: QueryParamsRequest | PlainMessage | undefined): boolean; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + * + * @generated from message zetachain.zetacore.fungible.QueryParamsResponse + */ +export declare class QueryParamsResponse extends Message { + /** + * params holds all the parameters of this module. + * + * @generated from field: zetachain.zetacore.fungible.Params params = 1; + */ + params?: Params; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryParamsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsResponse; + + static equals(a: QueryParamsResponse | PlainMessage | undefined, b: QueryParamsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetForeignCoinsRequest + */ +export declare class QueryGetForeignCoinsRequest extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetForeignCoinsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetForeignCoinsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetForeignCoinsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetForeignCoinsRequest; + + static equals(a: QueryGetForeignCoinsRequest | PlainMessage | undefined, b: QueryGetForeignCoinsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetForeignCoinsResponse + */ +export declare class QueryGetForeignCoinsResponse extends Message { + /** + * @generated from field: zetachain.zetacore.fungible.ForeignCoins foreignCoins = 1; + */ + foreignCoins?: ForeignCoins; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetForeignCoinsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetForeignCoinsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetForeignCoinsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetForeignCoinsResponse; + + static equals(a: QueryGetForeignCoinsResponse | PlainMessage | undefined, b: QueryGetForeignCoinsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryAllForeignCoinsRequest + */ +export declare class QueryAllForeignCoinsRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryAllForeignCoinsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllForeignCoinsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllForeignCoinsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllForeignCoinsRequest; + + static equals(a: QueryAllForeignCoinsRequest | PlainMessage | undefined, b: QueryAllForeignCoinsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryAllForeignCoinsResponse + */ +export declare class QueryAllForeignCoinsResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.fungible.ForeignCoins foreignCoins = 1; + */ + foreignCoins: ForeignCoins[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryAllForeignCoinsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllForeignCoinsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllForeignCoinsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllForeignCoinsResponse; + + static equals(a: QueryAllForeignCoinsResponse | PlainMessage | undefined, b: QueryAllForeignCoinsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetSystemContractRequest + */ +export declare class QueryGetSystemContractRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetSystemContractRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetSystemContractRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetSystemContractRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetSystemContractRequest; + + static equals(a: QueryGetSystemContractRequest | PlainMessage | undefined, b: QueryGetSystemContractRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetSystemContractResponse + */ +export declare class QueryGetSystemContractResponse extends Message { + /** + * @generated from field: zetachain.zetacore.fungible.SystemContract SystemContract = 1; + */ + SystemContract?: SystemContract; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetSystemContractResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetSystemContractResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetSystemContractResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetSystemContractResponse; + + static equals(a: QueryGetSystemContractResponse | PlainMessage | undefined, b: QueryGetSystemContractResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetGasStabilityPoolAddress + */ +export declare class QueryGetGasStabilityPoolAddress extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetGasStabilityPoolAddress"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetGasStabilityPoolAddress; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetGasStabilityPoolAddress; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetGasStabilityPoolAddress; + + static equals(a: QueryGetGasStabilityPoolAddress | PlainMessage | undefined, b: QueryGetGasStabilityPoolAddress | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetGasStabilityPoolAddressResponse + */ +export declare class QueryGetGasStabilityPoolAddressResponse extends Message { + /** + * @generated from field: string cosmos_address = 1; + */ + cosmosAddress: string; + + /** + * @generated from field: string evm_address = 2; + */ + evmAddress: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetGasStabilityPoolAddressResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetGasStabilityPoolAddressResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetGasStabilityPoolAddressResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetGasStabilityPoolAddressResponse; + + static equals(a: QueryGetGasStabilityPoolAddressResponse | PlainMessage | undefined, b: QueryGetGasStabilityPoolAddressResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetGasStabilityPoolBalance + */ +export declare class QueryGetGasStabilityPoolBalance extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetGasStabilityPoolBalance"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetGasStabilityPoolBalance; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetGasStabilityPoolBalance; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetGasStabilityPoolBalance; + + static equals(a: QueryGetGasStabilityPoolBalance | PlainMessage | undefined, b: QueryGetGasStabilityPoolBalance | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryGetGasStabilityPoolBalanceResponse + */ +export declare class QueryGetGasStabilityPoolBalanceResponse extends Message { + /** + * @generated from field: string balance = 2; + */ + balance: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryGetGasStabilityPoolBalanceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetGasStabilityPoolBalanceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetGasStabilityPoolBalanceResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetGasStabilityPoolBalanceResponse; + + static equals(a: QueryGetGasStabilityPoolBalanceResponse | PlainMessage | undefined, b: QueryGetGasStabilityPoolBalanceResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalance + */ +export declare class QueryAllGasStabilityPoolBalance extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalance"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllGasStabilityPoolBalance; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllGasStabilityPoolBalance; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllGasStabilityPoolBalance; + + static equals(a: QueryAllGasStabilityPoolBalance | PlainMessage | undefined, b: QueryAllGasStabilityPoolBalance | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalanceResponse + */ +export declare class QueryAllGasStabilityPoolBalanceResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalanceResponse.Balance balances = 1; + */ + balances: QueryAllGasStabilityPoolBalanceResponse_Balance[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalanceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllGasStabilityPoolBalanceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllGasStabilityPoolBalanceResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllGasStabilityPoolBalanceResponse; + + static equals(a: QueryAllGasStabilityPoolBalanceResponse | PlainMessage | undefined, b: QueryAllGasStabilityPoolBalanceResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalanceResponse.Balance + */ +export declare class QueryAllGasStabilityPoolBalanceResponse_Balance extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: string balance = 2; + */ + balance: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.QueryAllGasStabilityPoolBalanceResponse.Balance"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllGasStabilityPoolBalanceResponse_Balance; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllGasStabilityPoolBalanceResponse_Balance; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllGasStabilityPoolBalanceResponse_Balance; + + static equals(a: QueryAllGasStabilityPoolBalanceResponse_Balance | PlainMessage | undefined, b: QueryAllGasStabilityPoolBalanceResponse_Balance | PlainMessage | undefined): boolean; +} + diff --git a/typescript/fungible/system_contract_pb.d.ts b/typescript/fungible/system_contract_pb.d.ts new file mode 100644 index 0000000000..1ee1dde43b --- /dev/null +++ b/typescript/fungible/system_contract_pb.d.ts @@ -0,0 +1,37 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file fungible/system_contract.proto (package zetachain.zetacore.fungible, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.fungible.SystemContract + */ +export declare class SystemContract extends Message { + /** + * @generated from field: string system_contract = 1; + */ + systemContract: string; + + /** + * @generated from field: string connector_zevm = 2; + */ + connectorZevm: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.SystemContract"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): SystemContract; + + static fromJson(jsonValue: JsonValue, options?: Partial): SystemContract; + + static fromJsonString(jsonString: string, options?: Partial): SystemContract; + + static equals(a: SystemContract | PlainMessage | undefined, b: SystemContract | PlainMessage | undefined): boolean; +} + diff --git a/typescript/fungible/tx_pb.d.ts b/typescript/fungible/tx_pb.d.ts new file mode 100644 index 0000000000..fcb7f77343 --- /dev/null +++ b/typescript/fungible/tx_pb.d.ts @@ -0,0 +1,427 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file fungible/tx.proto (package zetachain.zetacore.fungible, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { CoinType } from "../common/common_pb.js"; + +/** + * @generated from enum zetachain.zetacore.fungible.UpdatePausedStatusAction + */ +export declare enum UpdatePausedStatusAction { + /** + * @generated from enum value: PAUSE = 0; + */ + PAUSE = 0, + + /** + * @generated from enum value: UNPAUSE = 1; + */ + UNPAUSE = 1, +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateZRC20WithdrawFee + */ +export declare class MsgUpdateZRC20WithdrawFee extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * zrc20 address + * + * @generated from field: string zrc20_address = 2; + */ + zrc20Address: string; + + /** + * @generated from field: string new_withdraw_fee = 6; + */ + newWithdrawFee: string; + + /** + * @generated from field: string new_gas_limit = 7; + */ + newGasLimit: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateZRC20WithdrawFee"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateZRC20WithdrawFee; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateZRC20WithdrawFee; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateZRC20WithdrawFee; + + static equals(a: MsgUpdateZRC20WithdrawFee | PlainMessage | undefined, b: MsgUpdateZRC20WithdrawFee | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateZRC20WithdrawFeeResponse + */ +export declare class MsgUpdateZRC20WithdrawFeeResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateZRC20WithdrawFeeResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateZRC20WithdrawFeeResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateZRC20WithdrawFeeResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateZRC20WithdrawFeeResponse; + + static equals(a: MsgUpdateZRC20WithdrawFeeResponse | PlainMessage | undefined, b: MsgUpdateZRC20WithdrawFeeResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateSystemContract + */ +export declare class MsgUpdateSystemContract extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string new_system_contract_address = 2; + */ + newSystemContractAddress: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateSystemContract"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateSystemContract; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateSystemContract; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateSystemContract; + + static equals(a: MsgUpdateSystemContract | PlainMessage | undefined, b: MsgUpdateSystemContract | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateSystemContractResponse + */ +export declare class MsgUpdateSystemContractResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateSystemContractResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateSystemContractResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateSystemContractResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateSystemContractResponse; + + static equals(a: MsgUpdateSystemContractResponse | PlainMessage | undefined, b: MsgUpdateSystemContractResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgDeployFungibleCoinZRC20 + */ +export declare class MsgDeployFungibleCoinZRC20 extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string ERC20 = 2; + */ + ERC20: string; + + /** + * @generated from field: int64 foreign_chain_id = 3; + */ + foreignChainId: bigint; + + /** + * @generated from field: uint32 decimals = 4; + */ + decimals: number; + + /** + * @generated from field: string name = 5; + */ + name: string; + + /** + * @generated from field: string symbol = 6; + */ + symbol: string; + + /** + * @generated from field: common.CoinType coin_type = 7; + */ + coinType: CoinType; + + /** + * @generated from field: int64 gas_limit = 8; + */ + gasLimit: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgDeployFungibleCoinZRC20"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgDeployFungibleCoinZRC20; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgDeployFungibleCoinZRC20; + + static fromJsonString(jsonString: string, options?: Partial): MsgDeployFungibleCoinZRC20; + + static equals(a: MsgDeployFungibleCoinZRC20 | PlainMessage | undefined, b: MsgDeployFungibleCoinZRC20 | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgDeployFungibleCoinZRC20Response + */ +export declare class MsgDeployFungibleCoinZRC20Response extends Message { + /** + * @generated from field: string address = 1; + */ + address: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgDeployFungibleCoinZRC20Response"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgDeployFungibleCoinZRC20Response; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgDeployFungibleCoinZRC20Response; + + static fromJsonString(jsonString: string, options?: Partial): MsgDeployFungibleCoinZRC20Response; + + static equals(a: MsgDeployFungibleCoinZRC20Response | PlainMessage | undefined, b: MsgDeployFungibleCoinZRC20Response | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgRemoveForeignCoin + */ +export declare class MsgRemoveForeignCoin extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string name = 2; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgRemoveForeignCoin"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgRemoveForeignCoin; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgRemoveForeignCoin; + + static fromJsonString(jsonString: string, options?: Partial): MsgRemoveForeignCoin; + + static equals(a: MsgRemoveForeignCoin | PlainMessage | undefined, b: MsgRemoveForeignCoin | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgRemoveForeignCoinResponse + */ +export declare class MsgRemoveForeignCoinResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgRemoveForeignCoinResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgRemoveForeignCoinResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgRemoveForeignCoinResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgRemoveForeignCoinResponse; + + static equals(a: MsgRemoveForeignCoinResponse | PlainMessage | undefined, b: MsgRemoveForeignCoinResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateContractBytecode + */ +export declare class MsgUpdateContractBytecode extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string contract_address = 2; + */ + contractAddress: string; + + /** + * @generated from field: string new_bytecode_address = 3; + */ + newBytecodeAddress: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateContractBytecode"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateContractBytecode; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateContractBytecode; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateContractBytecode; + + static equals(a: MsgUpdateContractBytecode | PlainMessage | undefined, b: MsgUpdateContractBytecode | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateContractBytecodeResponse + */ +export declare class MsgUpdateContractBytecodeResponse extends Message { + /** + * @generated from field: bytes new_bytecode_hash = 1; + */ + newBytecodeHash: Uint8Array; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateContractBytecodeResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateContractBytecodeResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateContractBytecodeResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateContractBytecodeResponse; + + static equals(a: MsgUpdateContractBytecodeResponse | PlainMessage | undefined, b: MsgUpdateContractBytecodeResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateZRC20PausedStatus + */ +export declare class MsgUpdateZRC20PausedStatus extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: repeated string zrc20_addresses = 2; + */ + zrc20Addresses: string[]; + + /** + * @generated from field: zetachain.zetacore.fungible.UpdatePausedStatusAction action = 3; + */ + action: UpdatePausedStatusAction; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateZRC20PausedStatus"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateZRC20PausedStatus; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateZRC20PausedStatus; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateZRC20PausedStatus; + + static equals(a: MsgUpdateZRC20PausedStatus | PlainMessage | undefined, b: MsgUpdateZRC20PausedStatus | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateZRC20PausedStatusResponse + */ +export declare class MsgUpdateZRC20PausedStatusResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateZRC20PausedStatusResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateZRC20PausedStatusResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateZRC20PausedStatusResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateZRC20PausedStatusResponse; + + static equals(a: MsgUpdateZRC20PausedStatusResponse | PlainMessage | undefined, b: MsgUpdateZRC20PausedStatusResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateZRC20LiquidityCap + */ +export declare class MsgUpdateZRC20LiquidityCap extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string zrc20_address = 2; + */ + zrc20Address: string; + + /** + * @generated from field: string liquidity_cap = 3; + */ + liquidityCap: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateZRC20LiquidityCap"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateZRC20LiquidityCap; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateZRC20LiquidityCap; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateZRC20LiquidityCap; + + static equals(a: MsgUpdateZRC20LiquidityCap | PlainMessage | undefined, b: MsgUpdateZRC20LiquidityCap | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.fungible.MsgUpdateZRC20LiquidityCapResponse + */ +export declare class MsgUpdateZRC20LiquidityCapResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.fungible.MsgUpdateZRC20LiquidityCapResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateZRC20LiquidityCapResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateZRC20LiquidityCapResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateZRC20LiquidityCapResponse; + + static equals(a: MsgUpdateZRC20LiquidityCapResponse | PlainMessage | undefined, b: MsgUpdateZRC20LiquidityCapResponse | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/ballot_pb.d.ts b/typescript/observer/ballot_pb.d.ts new file mode 100644 index 0000000000..100a1a0f1d --- /dev/null +++ b/typescript/observer/ballot_pb.d.ts @@ -0,0 +1,139 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/ballot.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { ObservationType } from "./observer_pb.js"; + +/** + * @generated from enum zetachain.zetacore.observer.VoteType + */ +export declare enum VoteType { + /** + * @generated from enum value: SuccessObservation = 0; + */ + SuccessObservation = 0, + + /** + * Failure observation means , the the message that this voter is observing failed / reverted . It does not mean it was unable to observe. + * + * @generated from enum value: FailureObservation = 1; + */ + FailureObservation = 1, + + /** + * @generated from enum value: NotYetVoted = 2; + */ + NotYetVoted = 2, +} + +/** + * @generated from enum zetachain.zetacore.observer.BallotStatus + */ +export declare enum BallotStatus { + /** + * @generated from enum value: BallotFinalized_SuccessObservation = 0; + */ + BallotFinalized_SuccessObservation = 0, + + /** + * @generated from enum value: BallotFinalized_FailureObservation = 1; + */ + BallotFinalized_FailureObservation = 1, + + /** + * @generated from enum value: BallotInProgress = 2; + */ + BallotInProgress = 2, +} + +/** + * @generated from message zetachain.zetacore.observer.Ballot + */ +export declare class Ballot extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + /** + * @generated from field: string ballot_identifier = 2; + */ + ballotIdentifier: string; + + /** + * @generated from field: repeated string voter_list = 3; + */ + voterList: string[]; + + /** + * @generated from field: repeated zetachain.zetacore.observer.VoteType votes = 4; + */ + votes: VoteType[]; + + /** + * @generated from field: zetachain.zetacore.observer.ObservationType observation_type = 5; + */ + observationType: ObservationType; + + /** + * @generated from field: string ballot_threshold = 6; + */ + ballotThreshold: string; + + /** + * @generated from field: zetachain.zetacore.observer.BallotStatus ballot_status = 7; + */ + ballotStatus: BallotStatus; + + /** + * @generated from field: int64 ballot_creation_height = 8; + */ + ballotCreationHeight: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.Ballot"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Ballot; + + static fromJson(jsonValue: JsonValue, options?: Partial): Ballot; + + static fromJsonString(jsonString: string, options?: Partial): Ballot; + + static equals(a: Ballot | PlainMessage | undefined, b: Ballot | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.BallotListForHeight + */ +export declare class BallotListForHeight extends Message { + /** + * @generated from field: int64 height = 1; + */ + height: bigint; + + /** + * @generated from field: repeated string ballots_index_list = 2; + */ + ballotsIndexList: string[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.BallotListForHeight"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): BallotListForHeight; + + static fromJson(jsonValue: JsonValue, options?: Partial): BallotListForHeight; + + static fromJsonString(jsonString: string, options?: Partial): BallotListForHeight; + + static equals(a: BallotListForHeight | PlainMessage | undefined, b: BallotListForHeight | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/blame_pb.d.ts b/typescript/observer/blame_pb.d.ts new file mode 100644 index 0000000000..3a9403cd95 --- /dev/null +++ b/typescript/observer/blame_pb.d.ts @@ -0,0 +1,76 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/blame.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.observer.Node + */ +export declare class Node extends Message { + /** + * @generated from field: string pub_key = 1; + */ + pubKey: string; + + /** + * @generated from field: bytes blame_data = 2; + */ + blameData: Uint8Array; + + /** + * @generated from field: bytes blame_signature = 3; + */ + blameSignature: Uint8Array; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.Node"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Node; + + static fromJson(jsonValue: JsonValue, options?: Partial): Node; + + static fromJsonString(jsonString: string, options?: Partial): Node; + + static equals(a: Node | PlainMessage | undefined, b: Node | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.Blame + */ +export declare class Blame extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + /** + * @generated from field: string failure_reason = 2; + */ + failureReason: string; + + /** + * @generated from field: repeated zetachain.zetacore.observer.Node nodes = 3; + */ + nodes: Node[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.Blame"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Blame; + + static fromJson(jsonValue: JsonValue, options?: Partial): Blame; + + static fromJsonString(jsonString: string, options?: Partial): Blame; + + static equals(a: Blame | PlainMessage | undefined, b: Blame | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/crosschain_flags_pb.d.ts b/typescript/observer/crosschain_flags_pb.d.ts new file mode 100644 index 0000000000..00cbc58b2e --- /dev/null +++ b/typescript/observer/crosschain_flags_pb.d.ts @@ -0,0 +1,152 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/crosschain_flags.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, Duration, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from message zetachain.zetacore.observer.GasPriceIncreaseFlags + */ +export declare class GasPriceIncreaseFlags extends Message { + /** + * @generated from field: int64 epochLength = 1; + */ + epochLength: bigint; + + /** + * @generated from field: google.protobuf.Duration retryInterval = 2; + */ + retryInterval?: Duration; + + /** + * @generated from field: uint32 gasPriceIncreasePercent = 3; + */ + gasPriceIncreasePercent: number; + + /** + * Maximum gas price increase in percent of the median gas price + * Default is used if 0 + * + * @generated from field: uint32 gasPriceIncreaseMax = 4; + */ + gasPriceIncreaseMax: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.GasPriceIncreaseFlags"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): GasPriceIncreaseFlags; + + static fromJson(jsonValue: JsonValue, options?: Partial): GasPriceIncreaseFlags; + + static fromJsonString(jsonString: string, options?: Partial): GasPriceIncreaseFlags; + + static equals(a: GasPriceIncreaseFlags | PlainMessage | undefined, b: GasPriceIncreaseFlags | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.BlockHeaderVerificationFlags + */ +export declare class BlockHeaderVerificationFlags extends Message { + /** + * @generated from field: bool isEthTypeChainEnabled = 1; + */ + isEthTypeChainEnabled: boolean; + + /** + * @generated from field: bool isBtcTypeChainEnabled = 2; + */ + isBtcTypeChainEnabled: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.BlockHeaderVerificationFlags"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): BlockHeaderVerificationFlags; + + static fromJson(jsonValue: JsonValue, options?: Partial): BlockHeaderVerificationFlags; + + static fromJsonString(jsonString: string, options?: Partial): BlockHeaderVerificationFlags; + + static equals(a: BlockHeaderVerificationFlags | PlainMessage | undefined, b: BlockHeaderVerificationFlags | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.CrosschainFlags + */ +export declare class CrosschainFlags extends Message { + /** + * @generated from field: bool isInboundEnabled = 1; + */ + isInboundEnabled: boolean; + + /** + * @generated from field: bool isOutboundEnabled = 2; + */ + isOutboundEnabled: boolean; + + /** + * @generated from field: zetachain.zetacore.observer.GasPriceIncreaseFlags gasPriceIncreaseFlags = 3; + */ + gasPriceIncreaseFlags?: GasPriceIncreaseFlags; + + /** + * @generated from field: zetachain.zetacore.observer.BlockHeaderVerificationFlags blockHeaderVerificationFlags = 4; + */ + blockHeaderVerificationFlags?: BlockHeaderVerificationFlags; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.CrosschainFlags"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): CrosschainFlags; + + static fromJson(jsonValue: JsonValue, options?: Partial): CrosschainFlags; + + static fromJsonString(jsonString: string, options?: Partial): CrosschainFlags; + + static equals(a: CrosschainFlags | PlainMessage | undefined, b: CrosschainFlags | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.LegacyCrosschainFlags + */ +export declare class LegacyCrosschainFlags extends Message { + /** + * @generated from field: bool isInboundEnabled = 1; + */ + isInboundEnabled: boolean; + + /** + * @generated from field: bool isOutboundEnabled = 2; + */ + isOutboundEnabled: boolean; + + /** + * @generated from field: zetachain.zetacore.observer.GasPriceIncreaseFlags gasPriceIncreaseFlags = 3; + */ + gasPriceIncreaseFlags?: GasPriceIncreaseFlags; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.LegacyCrosschainFlags"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): LegacyCrosschainFlags; + + static fromJson(jsonValue: JsonValue, options?: Partial): LegacyCrosschainFlags; + + static fromJsonString(jsonString: string, options?: Partial): LegacyCrosschainFlags; + + static equals(a: LegacyCrosschainFlags | PlainMessage | undefined, b: LegacyCrosschainFlags | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/events_pb.d.ts b/typescript/observer/events_pb.d.ts new file mode 100644 index 0000000000..cadd85f653 --- /dev/null +++ b/typescript/observer/events_pb.d.ts @@ -0,0 +1,180 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/events.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { BlockHeaderVerificationFlags, GasPriceIncreaseFlags } from "./crosschain_flags_pb.js"; + +/** + * @generated from message zetachain.zetacore.observer.EventBallotCreated + */ +export declare class EventBallotCreated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string ballot_identifier = 2; + */ + ballotIdentifier: string; + + /** + * @generated from field: string observation_hash = 3; + */ + observationHash: string; + + /** + * @generated from field: string observation_chain = 4; + */ + observationChain: string; + + /** + * @generated from field: string ballot_type = 5; + */ + ballotType: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.EventBallotCreated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventBallotCreated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventBallotCreated; + + static fromJsonString(jsonString: string, options?: Partial): EventBallotCreated; + + static equals(a: EventBallotCreated | PlainMessage | undefined, b: EventBallotCreated | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.EventKeygenBlockUpdated + */ +export declare class EventKeygenBlockUpdated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string keygen_block = 2; + */ + keygenBlock: string; + + /** + * @generated from field: string keygen_pubkeys = 3; + */ + keygenPubkeys: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.EventKeygenBlockUpdated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventKeygenBlockUpdated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventKeygenBlockUpdated; + + static fromJsonString(jsonString: string, options?: Partial): EventKeygenBlockUpdated; + + static equals(a: EventKeygenBlockUpdated | PlainMessage | undefined, b: EventKeygenBlockUpdated | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.EventNewObserverAdded + */ +export declare class EventNewObserverAdded extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: string observer_address = 2; + */ + observerAddress: string; + + /** + * @generated from field: string zetaclient_grantee_address = 3; + */ + zetaclientGranteeAddress: string; + + /** + * @generated from field: string zetaclient_grantee_pubkey = 4; + */ + zetaclientGranteePubkey: string; + + /** + * @generated from field: uint64 observer_last_block_count = 5; + */ + observerLastBlockCount: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.EventNewObserverAdded"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventNewObserverAdded; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventNewObserverAdded; + + static fromJsonString(jsonString: string, options?: Partial): EventNewObserverAdded; + + static equals(a: EventNewObserverAdded | PlainMessage | undefined, b: EventNewObserverAdded | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.EventCrosschainFlagsUpdated + */ +export declare class EventCrosschainFlagsUpdated extends Message { + /** + * @generated from field: string msg_type_url = 1; + */ + msgTypeUrl: string; + + /** + * @generated from field: bool isInboundEnabled = 2; + */ + isInboundEnabled: boolean; + + /** + * @generated from field: bool isOutboundEnabled = 3; + */ + isOutboundEnabled: boolean; + + /** + * @generated from field: zetachain.zetacore.observer.GasPriceIncreaseFlags gasPriceIncreaseFlags = 4; + */ + gasPriceIncreaseFlags?: GasPriceIncreaseFlags; + + /** + * @generated from field: string signer = 5; + */ + signer: string; + + /** + * @generated from field: zetachain.zetacore.observer.BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6; + */ + blockHeaderVerificationFlags?: BlockHeaderVerificationFlags; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.EventCrosschainFlagsUpdated"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): EventCrosschainFlagsUpdated; + + static fromJson(jsonValue: JsonValue, options?: Partial): EventCrosschainFlagsUpdated; + + static fromJsonString(jsonString: string, options?: Partial): EventCrosschainFlagsUpdated; + + static equals(a: EventCrosschainFlagsUpdated | PlainMessage | undefined, b: EventCrosschainFlagsUpdated | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/genesis_pb.d.ts b/typescript/observer/genesis_pb.d.ts new file mode 100644 index 0000000000..7040539619 --- /dev/null +++ b/typescript/observer/genesis_pb.d.ts @@ -0,0 +1,73 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/genesis.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Ballot } from "./ballot_pb.js"; +import type { LastObserverCount, ObserverMapper } from "./observer_pb.js"; +import type { NodeAccount } from "./node_account_pb.js"; +import type { CrosschainFlags } from "./crosschain_flags_pb.js"; +import type { CoreParamsList, Params } from "./params_pb.js"; +import type { Keygen } from "./keygen_pb.js"; + +/** + * @generated from message zetachain.zetacore.observer.GenesisState + */ +export declare class GenesisState extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.Ballot ballots = 1; + */ + ballots: Ballot[]; + + /** + * @generated from field: repeated zetachain.zetacore.observer.ObserverMapper observers = 2; + */ + observers: ObserverMapper[]; + + /** + * @generated from field: repeated zetachain.zetacore.observer.NodeAccount nodeAccountList = 3; + */ + nodeAccountList: NodeAccount[]; + + /** + * @generated from field: zetachain.zetacore.observer.CrosschainFlags crosschain_flags = 4; + */ + crosschainFlags?: CrosschainFlags; + + /** + * @generated from field: zetachain.zetacore.observer.Params params = 5; + */ + params?: Params; + + /** + * @generated from field: zetachain.zetacore.observer.Keygen keygen = 6; + */ + keygen?: Keygen; + + /** + * @generated from field: zetachain.zetacore.observer.LastObserverCount last_observer_count = 7; + */ + lastObserverCount?: LastObserverCount; + + /** + * @generated from field: zetachain.zetacore.observer.CoreParamsList core_params_list = 8; + */ + coreParamsList?: CoreParamsList; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.GenesisState"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): GenesisState; + + static fromJson(jsonValue: JsonValue, options?: Partial): GenesisState; + + static fromJsonString(jsonString: string, options?: Partial): GenesisState; + + static equals(a: GenesisState | PlainMessage | undefined, b: GenesisState | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/index.d.ts b/typescript/observer/index.d.ts new file mode 100644 index 0000000000..25d306ae01 --- /dev/null +++ b/typescript/observer/index.d.ts @@ -0,0 +1,11 @@ +export * from "./ballot_pb"; +export * from "./blame_pb"; +export * from "./crosschain_flags_pb"; +export * from "./events_pb"; +export * from "./genesis_pb"; +export * from "./keygen_pb"; +export * from "./node_account_pb"; +export * from "./observer_pb"; +export * from "./params_pb"; +export * from "./query_pb"; +export * from "./tx_pb"; diff --git a/typescript/observer/keygen_pb.d.ts b/typescript/observer/keygen_pb.d.ts new file mode 100644 index 0000000000..e3179201c0 --- /dev/null +++ b/typescript/observer/keygen_pb.d.ts @@ -0,0 +1,66 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/keygen.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum zetachain.zetacore.observer.KeygenStatus + */ +export declare enum KeygenStatus { + /** + * @generated from enum value: PendingKeygen = 0; + */ + PendingKeygen = 0, + + /** + * @generated from enum value: KeyGenSuccess = 1; + */ + KeyGenSuccess = 1, + + /** + * @generated from enum value: KeyGenFailed = 3; + */ + KeyGenFailed = 3, +} + +/** + * @generated from message zetachain.zetacore.observer.Keygen + */ +export declare class Keygen extends Message { + /** + * 0--to generate key; 1--generated; 2--error + * + * @generated from field: zetachain.zetacore.observer.KeygenStatus status = 2; + */ + status: KeygenStatus; + + /** + * @generated from field: repeated string granteePubkeys = 3; + */ + granteePubkeys: string[]; + + /** + * the blocknum that the key needs to be generated + * + * @generated from field: int64 blockNumber = 4; + */ + blockNumber: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.Keygen"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Keygen; + + static fromJson(jsonValue: JsonValue, options?: Partial): Keygen; + + static fromJsonString(jsonString: string, options?: Partial): Keygen; + + static equals(a: Keygen | PlainMessage | undefined, b: Keygen | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/node_account_pb.d.ts b/typescript/observer/node_account_pb.d.ts new file mode 100644 index 0000000000..240e4b424a --- /dev/null +++ b/typescript/observer/node_account_pb.d.ts @@ -0,0 +1,83 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/node_account.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { PubKeySet } from "../common/common_pb.js"; + +/** + * @generated from enum zetachain.zetacore.observer.NodeStatus + */ +export declare enum NodeStatus { + /** + * @generated from enum value: Unknown = 0; + */ + Unknown = 0, + + /** + * @generated from enum value: Whitelisted = 1; + */ + Whitelisted = 1, + + /** + * @generated from enum value: Standby = 2; + */ + Standby = 2, + + /** + * @generated from enum value: Ready = 3; + */ + Ready = 3, + + /** + * @generated from enum value: Active = 4; + */ + Active = 4, + + /** + * @generated from enum value: Disabled = 5; + */ + Disabled = 5, +} + +/** + * @generated from message zetachain.zetacore.observer.NodeAccount + */ +export declare class NodeAccount extends Message { + /** + * @generated from field: string operator = 1; + */ + operator: string; + + /** + * @generated from field: string granteeAddress = 2; + */ + granteeAddress: string; + + /** + * @generated from field: common.PubKeySet granteePubkey = 3; + */ + granteePubkey?: PubKeySet; + + /** + * @generated from field: zetachain.zetacore.observer.NodeStatus nodeStatus = 4; + */ + nodeStatus: NodeStatus; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.NodeAccount"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): NodeAccount; + + static fromJson(jsonValue: JsonValue, options?: Partial): NodeAccount; + + static fromJsonString(jsonString: string, options?: Partial): NodeAccount; + + static equals(a: NodeAccount | PlainMessage | undefined, b: NodeAccount | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/observer_pb.d.ts b/typescript/observer/observer_pb.d.ts new file mode 100644 index 0000000000..60f70c21cb --- /dev/null +++ b/typescript/observer/observer_pb.d.ts @@ -0,0 +1,102 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/observer.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Chain } from "../common/common_pb.js"; + +/** + * @generated from enum zetachain.zetacore.observer.ObservationType + */ +export declare enum ObservationType { + /** + * @generated from enum value: EmptyObserverType = 0; + */ + EmptyObserverType = 0, + + /** + * @generated from enum value: InBoundTx = 1; + */ + InBoundTx = 1, + + /** + * @generated from enum value: OutBoundTx = 2; + */ + OutBoundTx = 2, + + /** + * @generated from enum value: TSSKeyGen = 3; + */ + TSSKeyGen = 3, + + /** + * @generated from enum value: TSSKeySign = 4; + */ + TSSKeySign = 4, +} + +/** + * @generated from message zetachain.zetacore.observer.ObserverMapper + */ +export declare class ObserverMapper extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + /** + * @generated from field: common.Chain observer_chain = 2; + */ + observerChain?: Chain; + + /** + * @generated from field: repeated string observer_list = 4; + */ + observerList: string[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.ObserverMapper"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ObserverMapper; + + static fromJson(jsonValue: JsonValue, options?: Partial): ObserverMapper; + + static fromJsonString(jsonString: string, options?: Partial): ObserverMapper; + + static equals(a: ObserverMapper | PlainMessage | undefined, b: ObserverMapper | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.LastObserverCount + */ +export declare class LastObserverCount extends Message { + /** + * @generated from field: uint64 count = 1; + */ + count: bigint; + + /** + * @generated from field: int64 last_change_height = 2; + */ + lastChangeHeight: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.LastObserverCount"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): LastObserverCount; + + static fromJson(jsonValue: JsonValue, options?: Partial): LastObserverCount; + + static fromJsonString(jsonString: string, options?: Partial): LastObserverCount; + + static equals(a: LastObserverCount | PlainMessage | undefined, b: LastObserverCount | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/params_pb.d.ts b/typescript/observer/params_pb.d.ts new file mode 100644 index 0000000000..e4f67dc239 --- /dev/null +++ b/typescript/observer/params_pb.d.ts @@ -0,0 +1,226 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/params.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { Chain } from "../common/common_pb.js"; + +/** + * @generated from enum zetachain.zetacore.observer.Policy_Type + */ +export declare enum Policy_Type { + /** + * @generated from enum value: group1 = 0; + */ + group1 = 0, + + /** + * @generated from enum value: group2 = 1; + */ + group2 = 1, +} + +/** + * @generated from message zetachain.zetacore.observer.CoreParamsList + */ +export declare class CoreParamsList extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.CoreParams core_params = 1; + */ + coreParams: CoreParams[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.CoreParamsList"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): CoreParamsList; + + static fromJson(jsonValue: JsonValue, options?: Partial): CoreParamsList; + + static fromJsonString(jsonString: string, options?: Partial): CoreParamsList; + + static equals(a: CoreParamsList | PlainMessage | undefined, b: CoreParamsList | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.CoreParams + */ +export declare class CoreParams extends Message { + /** + * @generated from field: uint64 confirmation_count = 1; + */ + confirmationCount: bigint; + + /** + * @generated from field: uint64 gas_price_ticker = 2; + */ + gasPriceTicker: bigint; + + /** + * @generated from field: uint64 in_tx_ticker = 3; + */ + inTxTicker: bigint; + + /** + * @generated from field: uint64 out_tx_ticker = 4; + */ + outTxTicker: bigint; + + /** + * @generated from field: uint64 watch_utxo_ticker = 5; + */ + watchUtxoTicker: bigint; + + /** + * @generated from field: string zeta_token_contract_address = 8; + */ + zetaTokenContractAddress: string; + + /** + * @generated from field: string connector_contract_address = 9; + */ + connectorContractAddress: string; + + /** + * @generated from field: string erc20_custody_contract_address = 10; + */ + erc20CustodyContractAddress: string; + + /** + * @generated from field: int64 chain_id = 11; + */ + chainId: bigint; + + /** + * @generated from field: int64 outbound_tx_schedule_interval = 12; + */ + outboundTxScheduleInterval: bigint; + + /** + * @generated from field: int64 outbound_tx_schedule_lookahead = 13; + */ + outboundTxScheduleLookahead: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.CoreParams"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): CoreParams; + + static fromJson(jsonValue: JsonValue, options?: Partial): CoreParams; + + static fromJsonString(jsonString: string, options?: Partial): CoreParams; + + static equals(a: CoreParams | PlainMessage | undefined, b: CoreParams | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.ObserverParams + */ +export declare class ObserverParams extends Message { + /** + * @generated from field: common.Chain chain = 1; + */ + chain?: Chain; + + /** + * @generated from field: string ballot_threshold = 3; + */ + ballotThreshold: string; + + /** + * @generated from field: string min_observer_delegation = 4; + */ + minObserverDelegation: string; + + /** + * @generated from field: bool is_supported = 5; + */ + isSupported: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.ObserverParams"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ObserverParams; + + static fromJson(jsonValue: JsonValue, options?: Partial): ObserverParams; + + static fromJsonString(jsonString: string, options?: Partial): ObserverParams; + + static equals(a: ObserverParams | PlainMessage | undefined, b: ObserverParams | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.Admin_Policy + */ +export declare class Admin_Policy extends Message { + /** + * @generated from field: zetachain.zetacore.observer.Policy_Type policy_type = 1; + */ + policyType: Policy_Type; + + /** + * @generated from field: string address = 2; + */ + address: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.Admin_Policy"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Admin_Policy; + + static fromJson(jsonValue: JsonValue, options?: Partial): Admin_Policy; + + static fromJsonString(jsonString: string, options?: Partial): Admin_Policy; + + static equals(a: Admin_Policy | PlainMessage | undefined, b: Admin_Policy | PlainMessage | undefined): boolean; +} + +/** + * Params defines the parameters for the module. + * + * @generated from message zetachain.zetacore.observer.Params + */ +export declare class Params extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.ObserverParams observer_params = 1; + */ + observerParams: ObserverParams[]; + + /** + * @generated from field: repeated zetachain.zetacore.observer.Admin_Policy admin_policy = 2; + */ + adminPolicy: Admin_Policy[]; + + /** + * @generated from field: int64 ballot_maturity_blocks = 3; + */ + ballotMaturityBlocks: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.Params"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Params; + + static fromJson(jsonValue: JsonValue, options?: Partial): Params; + + static fromJsonString(jsonString: string, options?: Partial): Params; + + static equals(a: Params | PlainMessage | undefined, b: Params | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/query_pb.d.ts b/typescript/observer/query_pb.d.ts new file mode 100644 index 0000000000..95880ba59e --- /dev/null +++ b/typescript/observer/query_pb.d.ts @@ -0,0 +1,924 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/query.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { BlockHeader, Chain, Proof } from "../common/common_pb.js"; +import type { CoreParams, CoreParamsList, Params } from "./params_pb.js"; +import type { BallotStatus, VoteType } from "./ballot_pb.js"; +import type { LastObserverCount, ObservationType, ObserverMapper } from "./observer_pb.js"; +import type { NodeAccount } from "./node_account_pb.js"; +import type { PageRequest, PageResponse } from "../cosmos/base/query/v1beta1/pagination_pb.js"; +import type { CrosschainFlags } from "./crosschain_flags_pb.js"; +import type { Keygen } from "./keygen_pb.js"; +import type { Blame } from "./blame_pb.js"; + +/** + * @generated from message zetachain.zetacore.observer.QueryProveRequest + */ +export declare class QueryProveRequest extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: string tx_hash = 2; + */ + txHash: string; + + /** + * @generated from field: common.Proof proof = 3; + */ + proof?: Proof; + + /** + * @generated from field: string block_hash = 4; + */ + blockHash: string; + + /** + * @generated from field: int64 tx_index = 5; + */ + txIndex: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryProveRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryProveRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryProveRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryProveRequest; + + static equals(a: QueryProveRequest | PlainMessage | undefined, b: QueryProveRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryProveResponse + */ +export declare class QueryProveResponse extends Message { + /** + * @generated from field: bool valid = 1; + */ + valid: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryProveResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryProveResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryProveResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryProveResponse; + + static equals(a: QueryProveResponse | PlainMessage | undefined, b: QueryProveResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryParamsRequest + */ +export declare class QueryParamsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryParamsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsRequest; + + static equals(a: QueryParamsRequest | PlainMessage | undefined, b: QueryParamsRequest | PlainMessage | undefined): boolean; +} + +/** + * QueryParamsResponse is response type for the Query/Params RPC method. + * + * @generated from message zetachain.zetacore.observer.QueryParamsResponse + */ +export declare class QueryParamsResponse extends Message { + /** + * params holds all the parameters of this module. + * + * @generated from field: zetachain.zetacore.observer.Params params = 1; + */ + params?: Params; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryParamsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryParamsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryParamsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryParamsResponse; + + static equals(a: QueryParamsResponse | PlainMessage | undefined, b: QueryParamsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryBallotByIdentifierRequest + */ +export declare class QueryBallotByIdentifierRequest extends Message { + /** + * @generated from field: string ballot_identifier = 1; + */ + ballotIdentifier: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryBallotByIdentifierRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryBallotByIdentifierRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryBallotByIdentifierRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryBallotByIdentifierRequest; + + static equals(a: QueryBallotByIdentifierRequest | PlainMessage | undefined, b: QueryBallotByIdentifierRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.VoterList + */ +export declare class VoterList extends Message { + /** + * @generated from field: string voter_address = 1; + */ + voterAddress: string; + + /** + * @generated from field: zetachain.zetacore.observer.VoteType vote_type = 2; + */ + voteType: VoteType; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.VoterList"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): VoterList; + + static fromJson(jsonValue: JsonValue, options?: Partial): VoterList; + + static fromJsonString(jsonString: string, options?: Partial): VoterList; + + static equals(a: VoterList | PlainMessage | undefined, b: VoterList | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryBallotByIdentifierResponse + */ +export declare class QueryBallotByIdentifierResponse extends Message { + /** + * @generated from field: string ballot_identifier = 1; + */ + ballotIdentifier: string; + + /** + * @generated from field: repeated zetachain.zetacore.observer.VoterList voters = 2; + */ + voters: VoterList[]; + + /** + * @generated from field: zetachain.zetacore.observer.ObservationType observation_type = 3; + */ + observationType: ObservationType; + + /** + * @generated from field: zetachain.zetacore.observer.BallotStatus ballot_status = 4; + */ + ballotStatus: BallotStatus; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryBallotByIdentifierResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryBallotByIdentifierResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryBallotByIdentifierResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryBallotByIdentifierResponse; + + static equals(a: QueryBallotByIdentifierResponse | PlainMessage | undefined, b: QueryBallotByIdentifierResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryObserversByChainRequest + */ +export declare class QueryObserversByChainRequest extends Message { + /** + * @generated from field: string observation_chain = 1; + */ + observationChain: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryObserversByChainRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryObserversByChainRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryObserversByChainRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryObserversByChainRequest; + + static equals(a: QueryObserversByChainRequest | PlainMessage | undefined, b: QueryObserversByChainRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryObserversByChainResponse + */ +export declare class QueryObserversByChainResponse extends Message { + /** + * @generated from field: repeated string observers = 1; + */ + observers: string[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryObserversByChainResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryObserversByChainResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryObserversByChainResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryObserversByChainResponse; + + static equals(a: QueryObserversByChainResponse | PlainMessage | undefined, b: QueryObserversByChainResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllObserverMappersRequest + */ +export declare class QueryAllObserverMappersRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllObserverMappersRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllObserverMappersRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllObserverMappersRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllObserverMappersRequest; + + static equals(a: QueryAllObserverMappersRequest | PlainMessage | undefined, b: QueryAllObserverMappersRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllObserverMappersResponse + */ +export declare class QueryAllObserverMappersResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.ObserverMapper observer_mappers = 1; + */ + observerMappers: ObserverMapper[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllObserverMappersResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllObserverMappersResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllObserverMappersResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllObserverMappersResponse; + + static equals(a: QueryAllObserverMappersResponse | PlainMessage | undefined, b: QueryAllObserverMappersResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QuerySupportedChains + */ +export declare class QuerySupportedChains extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QuerySupportedChains"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QuerySupportedChains; + + static fromJson(jsonValue: JsonValue, options?: Partial): QuerySupportedChains; + + static fromJsonString(jsonString: string, options?: Partial): QuerySupportedChains; + + static equals(a: QuerySupportedChains | PlainMessage | undefined, b: QuerySupportedChains | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QuerySupportedChainsResponse + */ +export declare class QuerySupportedChainsResponse extends Message { + /** + * @generated from field: repeated common.Chain chains = 1; + */ + chains: Chain[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QuerySupportedChainsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QuerySupportedChainsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QuerySupportedChainsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QuerySupportedChainsResponse; + + static equals(a: QuerySupportedChainsResponse | PlainMessage | undefined, b: QuerySupportedChainsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetCoreParamsForChainRequest + */ +export declare class QueryGetCoreParamsForChainRequest extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetCoreParamsForChainRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCoreParamsForChainRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCoreParamsForChainRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCoreParamsForChainRequest; + + static equals(a: QueryGetCoreParamsForChainRequest | PlainMessage | undefined, b: QueryGetCoreParamsForChainRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetCoreParamsForChainResponse + */ +export declare class QueryGetCoreParamsForChainResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.CoreParams core_params = 1; + */ + coreParams?: CoreParams; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetCoreParamsForChainResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCoreParamsForChainResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCoreParamsForChainResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCoreParamsForChainResponse; + + static equals(a: QueryGetCoreParamsForChainResponse | PlainMessage | undefined, b: QueryGetCoreParamsForChainResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetCoreParamsRequest + */ +export declare class QueryGetCoreParamsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetCoreParamsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCoreParamsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCoreParamsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCoreParamsRequest; + + static equals(a: QueryGetCoreParamsRequest | PlainMessage | undefined, b: QueryGetCoreParamsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetCoreParamsResponse + */ +export declare class QueryGetCoreParamsResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.CoreParamsList core_params = 1; + */ + coreParams?: CoreParamsList; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetCoreParamsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCoreParamsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCoreParamsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCoreParamsResponse; + + static equals(a: QueryGetCoreParamsResponse | PlainMessage | undefined, b: QueryGetCoreParamsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetNodeAccountRequest + */ +export declare class QueryGetNodeAccountRequest extends Message { + /** + * @generated from field: string index = 1; + */ + index: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetNodeAccountRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetNodeAccountRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetNodeAccountRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetNodeAccountRequest; + + static equals(a: QueryGetNodeAccountRequest | PlainMessage | undefined, b: QueryGetNodeAccountRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetNodeAccountResponse + */ +export declare class QueryGetNodeAccountResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.NodeAccount node_account = 1; + */ + nodeAccount?: NodeAccount; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetNodeAccountResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetNodeAccountResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetNodeAccountResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetNodeAccountResponse; + + static equals(a: QueryGetNodeAccountResponse | PlainMessage | undefined, b: QueryGetNodeAccountResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllNodeAccountRequest + */ +export declare class QueryAllNodeAccountRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllNodeAccountRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllNodeAccountRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllNodeAccountRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllNodeAccountRequest; + + static equals(a: QueryAllNodeAccountRequest | PlainMessage | undefined, b: QueryAllNodeAccountRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllNodeAccountResponse + */ +export declare class QueryAllNodeAccountResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.NodeAccount NodeAccount = 1; + */ + NodeAccount: NodeAccount[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllNodeAccountResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllNodeAccountResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllNodeAccountResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllNodeAccountResponse; + + static equals(a: QueryAllNodeAccountResponse | PlainMessage | undefined, b: QueryAllNodeAccountResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetCrosschainFlagsRequest + */ +export declare class QueryGetCrosschainFlagsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetCrosschainFlagsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCrosschainFlagsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCrosschainFlagsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCrosschainFlagsRequest; + + static equals(a: QueryGetCrosschainFlagsRequest | PlainMessage | undefined, b: QueryGetCrosschainFlagsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetCrosschainFlagsResponse + */ +export declare class QueryGetCrosschainFlagsResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.CrosschainFlags crosschain_flags = 1; + */ + crosschainFlags?: CrosschainFlags; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetCrosschainFlagsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetCrosschainFlagsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetCrosschainFlagsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetCrosschainFlagsResponse; + + static equals(a: QueryGetCrosschainFlagsResponse | PlainMessage | undefined, b: QueryGetCrosschainFlagsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetKeygenRequest + */ +export declare class QueryGetKeygenRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetKeygenRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetKeygenRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetKeygenRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetKeygenRequest; + + static equals(a: QueryGetKeygenRequest | PlainMessage | undefined, b: QueryGetKeygenRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetKeygenResponse + */ +export declare class QueryGetKeygenResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.Keygen keygen = 1; + */ + keygen?: Keygen; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetKeygenResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetKeygenResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetKeygenResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetKeygenResponse; + + static equals(a: QueryGetKeygenResponse | PlainMessage | undefined, b: QueryGetKeygenResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryShowObserverCountRequest + */ +export declare class QueryShowObserverCountRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryShowObserverCountRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryShowObserverCountRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryShowObserverCountRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryShowObserverCountRequest; + + static equals(a: QueryShowObserverCountRequest | PlainMessage | undefined, b: QueryShowObserverCountRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryShowObserverCountResponse + */ +export declare class QueryShowObserverCountResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.LastObserverCount last_observer_count = 1; + */ + lastObserverCount?: LastObserverCount; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryShowObserverCountResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryShowObserverCountResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryShowObserverCountResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryShowObserverCountResponse; + + static equals(a: QueryShowObserverCountResponse | PlainMessage | undefined, b: QueryShowObserverCountResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryBlameByIdentifierRequest + */ +export declare class QueryBlameByIdentifierRequest extends Message { + /** + * @generated from field: string blame_identifier = 1; + */ + blameIdentifier: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryBlameByIdentifierRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryBlameByIdentifierRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryBlameByIdentifierRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryBlameByIdentifierRequest; + + static equals(a: QueryBlameByIdentifierRequest | PlainMessage | undefined, b: QueryBlameByIdentifierRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryBlameByIdentifierResponse + */ +export declare class QueryBlameByIdentifierResponse extends Message { + /** + * @generated from field: zetachain.zetacore.observer.Blame blame_info = 1; + */ + blameInfo?: Blame; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryBlameByIdentifierResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryBlameByIdentifierResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryBlameByIdentifierResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryBlameByIdentifierResponse; + + static equals(a: QueryBlameByIdentifierResponse | PlainMessage | undefined, b: QueryBlameByIdentifierResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllBlameRecordsRequest + */ +export declare class QueryAllBlameRecordsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllBlameRecordsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllBlameRecordsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllBlameRecordsRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllBlameRecordsRequest; + + static equals(a: QueryAllBlameRecordsRequest | PlainMessage | undefined, b: QueryAllBlameRecordsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllBlameRecordsResponse + */ +export declare class QueryAllBlameRecordsResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.Blame blame_info = 1; + */ + blameInfo: Blame[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllBlameRecordsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllBlameRecordsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllBlameRecordsResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllBlameRecordsResponse; + + static equals(a: QueryAllBlameRecordsResponse | PlainMessage | undefined, b: QueryAllBlameRecordsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryBlameByChainAndNonceRequest + */ +export declare class QueryBlameByChainAndNonceRequest extends Message { + /** + * @generated from field: int64 chain_id = 1; + */ + chainId: bigint; + + /** + * @generated from field: int64 nonce = 2; + */ + nonce: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryBlameByChainAndNonceRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryBlameByChainAndNonceRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryBlameByChainAndNonceRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryBlameByChainAndNonceRequest; + + static equals(a: QueryBlameByChainAndNonceRequest | PlainMessage | undefined, b: QueryBlameByChainAndNonceRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryBlameByChainAndNonceResponse + */ +export declare class QueryBlameByChainAndNonceResponse extends Message { + /** + * @generated from field: repeated zetachain.zetacore.observer.Blame blame_info = 1; + */ + blameInfo: Blame[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryBlameByChainAndNonceResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryBlameByChainAndNonceResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryBlameByChainAndNonceResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryBlameByChainAndNonceResponse; + + static equals(a: QueryBlameByChainAndNonceResponse | PlainMessage | undefined, b: QueryBlameByChainAndNonceResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllBlockHeaderRequest + */ +export declare class QueryAllBlockHeaderRequest extends Message { + /** + * @generated from field: cosmos.base.query.v1beta1.PageRequest pagination = 1; + */ + pagination?: PageRequest; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllBlockHeaderRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllBlockHeaderRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllBlockHeaderRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllBlockHeaderRequest; + + static equals(a: QueryAllBlockHeaderRequest | PlainMessage | undefined, b: QueryAllBlockHeaderRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryAllBlockHeaderResponse + */ +export declare class QueryAllBlockHeaderResponse extends Message { + /** + * @generated from field: repeated common.BlockHeader block_headers = 1; + */ + blockHeaders: BlockHeader[]; + + /** + * @generated from field: cosmos.base.query.v1beta1.PageResponse pagination = 2; + */ + pagination?: PageResponse; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryAllBlockHeaderResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryAllBlockHeaderResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryAllBlockHeaderResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryAllBlockHeaderResponse; + + static equals(a: QueryAllBlockHeaderResponse | PlainMessage | undefined, b: QueryAllBlockHeaderResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetBlockHeaderByHashRequest + */ +export declare class QueryGetBlockHeaderByHashRequest extends Message { + /** + * @generated from field: bytes block_hash = 1; + */ + blockHash: Uint8Array; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetBlockHeaderByHashRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetBlockHeaderByHashRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetBlockHeaderByHashRequest; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetBlockHeaderByHashRequest; + + static equals(a: QueryGetBlockHeaderByHashRequest | PlainMessage | undefined, b: QueryGetBlockHeaderByHashRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.QueryGetBlockHeaderByHashResponse + */ +export declare class QueryGetBlockHeaderByHashResponse extends Message { + /** + * @generated from field: common.BlockHeader block_header = 1; + */ + blockHeader?: BlockHeader; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.QueryGetBlockHeaderByHashResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): QueryGetBlockHeaderByHashResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): QueryGetBlockHeaderByHashResponse; + + static fromJsonString(jsonString: string, options?: Partial): QueryGetBlockHeaderByHashResponse; + + static equals(a: QueryGetBlockHeaderByHashResponse | PlainMessage | undefined, b: QueryGetBlockHeaderByHashResponse | PlainMessage | undefined): boolean; +} + diff --git a/typescript/observer/tx_pb.d.ts b/typescript/observer/tx_pb.d.ts new file mode 100644 index 0000000000..c1933dd04f --- /dev/null +++ b/typescript/observer/tx_pb.d.ts @@ -0,0 +1,345 @@ +// @generated by protoc-gen-es v1.3.0 with parameter "target=dts" +// @generated from file observer/tx.proto (package zetachain.zetacore.observer, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { HeaderData } from "../common/common_pb.js"; +import type { CoreParams } from "./params_pb.js"; +import type { Blame } from "./blame_pb.js"; +import type { BlockHeaderVerificationFlags, GasPriceIncreaseFlags } from "./crosschain_flags_pb.js"; + +/** + * @generated from message zetachain.zetacore.observer.MsgAddBlockHeader + */ +export declare class MsgAddBlockHeader extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: bytes block_hash = 3; + */ + blockHash: Uint8Array; + + /** + * @generated from field: int64 height = 4; + */ + height: bigint; + + /** + * @generated from field: common.HeaderData header = 5; + */ + header?: HeaderData; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgAddBlockHeader"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddBlockHeader; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddBlockHeader; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddBlockHeader; + + static equals(a: MsgAddBlockHeader | PlainMessage | undefined, b: MsgAddBlockHeader | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgAddBlockHeaderResponse + */ +export declare class MsgAddBlockHeaderResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgAddBlockHeaderResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddBlockHeaderResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddBlockHeaderResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddBlockHeaderResponse; + + static equals(a: MsgAddBlockHeaderResponse | PlainMessage | undefined, b: MsgAddBlockHeaderResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgUpdateCoreParams + */ +export declare class MsgUpdateCoreParams extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: zetachain.zetacore.observer.CoreParams coreParams = 2; + */ + coreParams?: CoreParams; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgUpdateCoreParams"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateCoreParams; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateCoreParams; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateCoreParams; + + static equals(a: MsgUpdateCoreParams | PlainMessage | undefined, b: MsgUpdateCoreParams | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgUpdateCoreParamsResponse + */ +export declare class MsgUpdateCoreParamsResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgUpdateCoreParamsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateCoreParamsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateCoreParamsResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateCoreParamsResponse; + + static equals(a: MsgUpdateCoreParamsResponse | PlainMessage | undefined, b: MsgUpdateCoreParamsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgAddObserver + */ +export declare class MsgAddObserver extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string observer_address = 2; + */ + observerAddress: string; + + /** + * @generated from field: string zetaclient_grantee_pubkey = 3; + */ + zetaclientGranteePubkey: string; + + /** + * @generated from field: bool add_node_account_only = 4; + */ + addNodeAccountOnly: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgAddObserver"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddObserver; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddObserver; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddObserver; + + static equals(a: MsgAddObserver | PlainMessage | undefined, b: MsgAddObserver | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgAddObserverResponse + */ +export declare class MsgAddObserverResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgAddObserverResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddObserverResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddObserverResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddObserverResponse; + + static equals(a: MsgAddObserverResponse | PlainMessage | undefined, b: MsgAddObserverResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgAddBlameVote + */ +export declare class MsgAddBlameVote extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 chain_id = 2; + */ + chainId: bigint; + + /** + * @generated from field: zetachain.zetacore.observer.Blame blame_info = 3; + */ + blameInfo?: Blame; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgAddBlameVote"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddBlameVote; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddBlameVote; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddBlameVote; + + static equals(a: MsgAddBlameVote | PlainMessage | undefined, b: MsgAddBlameVote | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgAddBlameVoteResponse + */ +export declare class MsgAddBlameVoteResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgAddBlameVoteResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgAddBlameVoteResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgAddBlameVoteResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgAddBlameVoteResponse; + + static equals(a: MsgAddBlameVoteResponse | PlainMessage | undefined, b: MsgAddBlameVoteResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgUpdateCrosschainFlags + */ +export declare class MsgUpdateCrosschainFlags extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: bool isInboundEnabled = 3; + */ + isInboundEnabled: boolean; + + /** + * @generated from field: bool isOutboundEnabled = 4; + */ + isOutboundEnabled: boolean; + + /** + * @generated from field: zetachain.zetacore.observer.GasPriceIncreaseFlags gasPriceIncreaseFlags = 5; + */ + gasPriceIncreaseFlags?: GasPriceIncreaseFlags; + + /** + * @generated from field: zetachain.zetacore.observer.BlockHeaderVerificationFlags blockHeaderVerificationFlags = 6; + */ + blockHeaderVerificationFlags?: BlockHeaderVerificationFlags; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgUpdateCrosschainFlags"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateCrosschainFlags; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateCrosschainFlags; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateCrosschainFlags; + + static equals(a: MsgUpdateCrosschainFlags | PlainMessage | undefined, b: MsgUpdateCrosschainFlags | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgUpdateCrosschainFlagsResponse + */ +export declare class MsgUpdateCrosschainFlagsResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgUpdateCrosschainFlagsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateCrosschainFlagsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateCrosschainFlagsResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateCrosschainFlagsResponse; + + static equals(a: MsgUpdateCrosschainFlagsResponse | PlainMessage | undefined, b: MsgUpdateCrosschainFlagsResponse | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgUpdateKeygen + */ +export declare class MsgUpdateKeygen extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: int64 block = 2; + */ + block: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgUpdateKeygen"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateKeygen; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateKeygen; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateKeygen; + + static equals(a: MsgUpdateKeygen | PlainMessage | undefined, b: MsgUpdateKeygen | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgUpdateKeygenResponse + */ +export declare class MsgUpdateKeygenResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgUpdateKeygenResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgUpdateKeygenResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgUpdateKeygenResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgUpdateKeygenResponse; + + static equals(a: MsgUpdateKeygenResponse | PlainMessage | undefined, b: MsgUpdateKeygenResponse | PlainMessage | undefined): boolean; +} + diff --git a/typescript/package.json b/typescript/package.json new file mode 100644 index 0000000000..369d5cbb82 --- /dev/null +++ b/typescript/package.json @@ -0,0 +1,9 @@ +{ + "name": "@zetachain/blockchain-types", + "version": "0.0.0-set-on-publish", + "description": "", + "main": "", + "keywords": [], + "author": "ZetaChain", + "license": "MIT" +} From 9c97563d41b32d1745c11df738631086b56dba5b Mon Sep 17 00:00:00 2001 From: Tanmay Date: Tue, 31 Oct 2023 16:48:31 -0400 Subject: [PATCH 20/26] fix: use supported chains from zetacore instead of default chain list (#1344) * use supported chains from zetacore instead of default chain list * use thread safe GetChainsEnabled --------- Co-authored-by: Lucas Bertrand --- zetaclient/zetacore_observer.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/zetaclient/zetacore_observer.go b/zetaclient/zetacore_observer.go index 9e722ebff5..fa5b8c7c46 100644 --- a/zetaclient/zetacore_observer.go +++ b/zetaclient/zetacore_observer.go @@ -73,6 +73,10 @@ func NewCoreObserver( return &co } +func (co *CoreObserver) Config() *config.Config { + return co.cfg +} + func (co *CoreObserver) GetPromCounter(name string) (prom.Counter, error) { cnt, found := metrics.Counters[name] if !found { @@ -129,12 +133,12 @@ func (co *CoreObserver) startSendScheduler() { } //logger.Info().Dur("elapsed", time.Since(tStart)).Msgf("GetAllPendingCctx %d", len(sendList)) - supportedChains := GetSupportedChains() + supportedChains := co.Config().GetEnabledChains() for _, c := range supportedChains { - if c == nil || c.ChainId == common.ZetaChain().ChainId { + if c.ChainId == common.ZetaChain().ChainId { continue } - signer := co.signerMap[*c] + signer := co.signerMap[c] cctxList, err := co.bridge.GetAllPendingCctx(c.ChainId) if err != nil { @@ -151,7 +155,7 @@ func (co *CoreObserver) startSendScheduler() { co.logger.ZetaChainWatcher.Error().Err(err).Msgf("GetTargetChain fail, Chain ID: %s", c.ChainName) continue } - res, err := co.bridge.GetAllOutTxTrackerByChain(*c, Ascending) + res, err := co.bridge.GetAllOutTxTrackerByChain(c, Ascending) if err != nil { co.logger.ZetaChainWatcher.Warn().Err(err).Msgf("failed to GetAllOutTxTrackerByChain for chain %s", c.ChainName.String()) continue From 3ada931d4504a9d95da6b5743c5497d2c676093c Mon Sep 17 00:00:00 2001 From: Grant Zukel <80433392+gzukel@users.noreply.github.com> Date: Tue, 31 Oct 2023 15:17:45 -0600 Subject: [PATCH 21/26] fix: Clean up Docker for Release, Modify Pipeline with Release Logic, Fix Binary Links / Version from recent Change.fix (#1357) * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * update binary names * udpated * udpated * updated release pipeline flow * updated * updated * updating readme with comments on PR --------- Co-authored-by: Lucas Bertrand --- .github/workflows/publish-release.yml | 89 +++++++++++++++++---------- .github/workflows/rc-release.yml | 35 +++-------- Dockerfile-release | 40 ++++++++++++ readme.md | 21 +++++++ 4 files changed, 129 insertions(+), 56 deletions(-) create mode 100644 Dockerfile-release diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 773ff28c4d..a8338b7335 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -1,19 +1,25 @@ name: Publish Release on: - push: - tags: - - "v*.*.*" - + pull_request: + types: + - closed + branches: + - 'main' + workflow_dispatch: + inputs: + version: + description: 'Version for manual hotfix release.' + required: false + default: '' + concurrency: group: publish-release cancel-in-progress: false -env: - GITHUB_REF_NAME: "$(echo ${{ github.ref_name }} | tr '//' '-')" - jobs: pre-release-checks: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -21,6 +27,16 @@ jobs: with: fetch-depth: 0 + - name: Set Version from the PR title. + if: github.event_name == 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.pull_request.title }}" >> ${GITHUB_ENV} + + - name: Set Version for Hotfix Release from Input. + if: github.event_name != 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV} + - name: Major Version in Upgrade Handler Must Match Tag run: | UPGRADE_HANDLER_MAJOR_VERSION=$(cat app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"' | cut -d '.' -f1) @@ -34,6 +50,7 @@ jobs: echo "The major version found in 'releaseVersion' in app/setup_handlers.go matches this tagged release - Moving Forward!" publish-release: + if: github.event.pull_request.merged == true runs-on: buildjet-4vcpu-ubuntu-2004 timeout-minutes: 60 needs: @@ -41,6 +58,21 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Echo Release Notes from PR Message. + if: github.event_name == 'pull_request' + run: | + echo -e "${{ github.event.head_commit.message }}" > Release.txt + + - name: Set Version from the PR title. + if: github.event_name == 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.pull_request.title }}" >> ${GITHUB_ENV} + + - name: Set Version for Hotfix Release from Input. + if: github.event_name != 'pull_request' + run: | + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV} + - name: Set CPU Architecture shell: bash run: | @@ -62,7 +94,15 @@ jobs: skip_aws_cli: "true" skip_docker_compose: "true" - - name: Create GitHub Release + - name: Create GitHub Release on Pull Request + if: github.event_name == 'pull_request' + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + files: Release.txt + + - name: Create GitHub Release Hot Fix + if: github.event_name != 'pull_request' uses: softprops/action-gh-release@v1 with: token: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} @@ -75,17 +115,17 @@ jobs: touch .release-env make release - ## TODO - Will add in later after optimizing docker images - # - name: Build, tag, and push docker images - # uses: ./.github/actions/build-docker-images - # with: - # DOCKER_FILENAME: Dockerfile - # REPOSITORY_NAME: zeta-node - # IMAGE_TAG: ${{ env.TAG_NAME }} - # GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} - # GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + - name: Build, tag, and push docker images + uses: ./.github/actions/build-docker-images + with: + DOCKER_FILENAME: Dockerfile-relese + REPOSITORY_NAME: zeta-node + IMAGE_TAG: ${{ env.GITHUB_TAG_MAJOR_VERSION }} + GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} + GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} build-alpine: + if: github.event.pull_request.merged == true runs-on: ["ubuntu-latest"] timeout-minutes: 30 concurrency: @@ -175,6 +215,7 @@ jobs: run: rm -rf * announce-release: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest timeout-minutes: 10 needs: @@ -213,20 +254,6 @@ jobs: See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - # - name: "SEND:DISCORD:MESSAGE" - # if: steps.determine_release_type.outputs.RELEASE_TYPE == 'minor' - # uses: gzukel/CosmosComposites/send_discord_message@main - # with: - # discord_token: "${{ secrets.DISCORD_TOKEN }}" - # discord_channel_id: "${{ secrets.DISCORD_CHANNEL_ID }}" - # discord_message: | - # Hey <@&1122981184255840306>! A new version of the zetachain node has been released. - - # Minor Version Upgrade (e.g. v5.0.x to v5.1.x) can be applied without a governance proposal. - # Please review the release notes for any specific upgrade instructions or considerations. - - # See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - - name: Clean Up Workspace if: always() shell: bash diff --git a/.github/workflows/rc-release.yml b/.github/workflows/rc-release.yml index f18a7d58f5..e31e9bb3af 100644 --- a/.github/workflows/rc-release.yml +++ b/.github/workflows/rc-release.yml @@ -1,4 +1,4 @@ -name: Publish Release +name: Publish Release Candidate Release on: push: @@ -6,7 +6,7 @@ on: - "v*.*.*-rc" concurrency: - group: publish-release + group: publish-rc-release cancel-in-progress: false env: @@ -75,15 +75,14 @@ jobs: touch .release-env make release - ## TODO - Will add in later after optimizing docker images - # - name: Build, tag, and push docker images - # uses: ./.github/actions/build-docker-images - # with: - # DOCKER_FILENAME: Dockerfile - # REPOSITORY_NAME: zeta-node - # IMAGE_TAG: ${{ env.TAG_NAME }} - # GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} - # GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} + - name: Build, tag, and push docker images + uses: ./.github/actions/build-docker-images + with: + DOCKER_FILENAME: Dockerfile-relese + REPOSITORY_NAME: zeta-node + IMAGE_TAG: ${{ env.GITHUB_TAG_MAJOR_VERSION }} + GHCR_USERNAME: ${{ secrets.PAT_GITHUB_SERVICE_ACCT_USERNAME }} + GHCR_TOKEN: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }} build-alpine: runs-on: ["ubuntu-latest"] @@ -213,20 +212,6 @@ jobs: See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - # - name: "SEND:DISCORD:MESSAGE" - # if: steps.determine_release_type.outputs.RELEASE_TYPE == 'minor' - # uses: gzukel/CosmosComposites/send_discord_message@main - # with: - # discord_token: "${{ secrets.DISCORD_TOKEN }}" - # discord_channel_id: "${{ secrets.DISCORD_CHANNEL_ID }}" - # discord_message: | - # Hey <@&1122981184255840306>! A new version of the zetachain node has been released. - - # Minor Version Upgrade (e.g. v5.0.x to v5.1.x) can be applied without a governance proposal. - # Please review the release notes for any specific upgrade instructions or considerations. - - # See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }} - - name: Clean Up Workspace if: always() shell: bash diff --git a/Dockerfile-release b/Dockerfile-release new file mode 100644 index 0000000000..8e33cb0529 --- /dev/null +++ b/Dockerfile-release @@ -0,0 +1,40 @@ +FROM golang:1.20-alpine as builder + +ENV GOPATH /go +ENV GOOS=linux +ENV CGO_ENABLED=1 + +WORKDIR /go/delivery/zeta-node + +RUN apk update && \ + apk --no-cache add git make build-base jq openssh libusb-dev linux-headers bash curl tmux + +COPY go.mod . +COPY go.sum . + +RUN --mount=type=cache,target=/root/.cache/go-build \ + go mod download + +COPY . . + +RUN --mount=type=cache,target=/root/.cache/go-build \ + make install + +RUN cp /go/bin/zetaclientd /usr/local/bin +RUN cp /go/bin/zetacored /usr/local/bin +RUN cp /go/bin/smoketest /usr/local/bin + +#BUILD MAIN BINARY IMAGE +FROM golang:1.20-alpine + +RUN apk --no-cache add jq bash curl wget nano tmux + +COPY --chmod=765 --from=builder /usr/local/bin/zetaclientd /usr/local/bin/zetaclientd +COPY --chmod=765 --from=builder /usr/local/bin/zetacored /usr/local/bin/zetacored + +WORKDIR /root/zetachain/ + +EXPOSE 26657 +EXPOSE 26656 +EXPOSE 1317 +EXPOSE 9090 diff --git a/readme.md b/readme.md index d4139da5d8..083e9c755b 100644 --- a/readme.md +++ b/readme.md @@ -80,3 +80,24 @@ to [run the smoke test](./contrib/localnet/README.md). [Twitter](https://twitter.com/zetablockchain) | [Discord](https://discord.com/invite/zetachain) | [Telegram](https://t.me/zetachainofficial) | [Website](https://zetachain.com) + +## Creating a Release for Mainnet +Creating a release for mainnet is a straightforward process. Here are the steps to follow: + +### Steps + - Step 1. Open a Pull Request (PR): Begin by opening a PR from the release candidate branch (e.g., vx.x.x-rc) to the main branch. + - Step 2. Testing and Validation: Allow the automated tests, including smoke tests, linting, and upgrade path testing, to run. Ensure that these tests pass successfully. + - Step 3. Approval Process: Obtain the necessary approvals from relevant stakeholders or team members. + - Step 4. Merging PR: Once all requirements have been met and the PR has received the required approvals, merge the PR. The automation will then be triggered to proceed with the release. + +By following these steps, you can efficiently create a release for Mainnet, ensuring that the code has been thoroughly tested and validated before deployment. + +## Creating a Release for Testnet +Creating a release for testnet is a straightforward process. Here are the steps to follow: + +### Steps + - Step 1. Create the release candidate branch with the following format (e.g., vx.x.x-rc) ex. v11.0.0-rc. + - Step 2. Once a RC branch is created the automation will kickoff to build and upload the release and its binaries. + +By following these steps, you can efficiently create a release candidate for testnet for QA and validation. In the future we will make this automatically deploy to testnet when a -rc branch is created. +Currently, raising the proposal to deploy to testnet is a manual process via GitHub Action pipeline located in the infrastructure repo. \ No newline at end of file From 6567637545769a01a8406fd8fc9ad4427b7cb725 Mon Sep 17 00:00:00 2001 From: Luke Ma <867273263@qq.com> Date: Wed, 1 Nov 2023 07:51:37 +0800 Subject: [PATCH 22/26] fix: remove duplicate sorting (#1346) Co-authored-by: Lucas Bertrand --- zetaclient/evm_client.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/zetaclient/evm_client.go b/zetaclient/evm_client.go index 3a9dc30411..cc68008983 100644 --- a/zetaclient/evm_client.go +++ b/zetaclient/evm_client.go @@ -7,7 +7,6 @@ import ( "math" "math/big" "os" - "sort" "strconv" "sync" "sync/atomic" @@ -558,9 +557,6 @@ func (ob *EVMChainClient) observeOutTx() { if err != nil { continue } - sort.Slice(trackers, func(i, j int) bool { - return trackers[i].Nonce < trackers[j].Nonce - }) outTimeout := time.After(time.Duration(timeoutNonce) * time.Second) TRACKERLOOP: // Skip old gabbage trackers as we spent too much time on querying them From af8c8a173771e7a416d41d2b505f7a2818047bb6 Mon Sep 17 00:00:00 2001 From: kevinssgh <79858682+kevinssgh@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:29:52 -0400 Subject: [PATCH 23/26] refactor: TSS lib patch (#1351) * patch for tss-lib * update go-tss and tss-lib * update go-tss to tagged version * removed empty lines from imports * ran make generate --- cmd/zetaclientd/keygen_tss.go | 6 ++-- cmd/zetaclientd/main.go | 2 +- cmd/zetaclientd/p2p_diagnostics.go | 2 +- cmd/zetaclientd/start.go | 2 +- .../localnet/orchestrator/smoketest/main.go | 4 +-- contrib/localnet/scripts/genesis.sh | 2 +- .../scripts/start-zetaclientd-genesis.sh | 6 +++- go.mod | 11 +++---- go.sum | 29 ++++++++++++------- x/observer/client/cli/tx_add_blame_vote.go | 2 +- x/observer/types/utils.go | 2 +- zetaclient/interfaces.go | 2 +- zetaclient/tss_signer.go | 10 +++---- zetaclient/tx.go | 3 +- 14 files changed, 48 insertions(+), 35 deletions(-) diff --git a/cmd/zetaclientd/keygen_tss.go b/cmd/zetaclientd/keygen_tss.go index 5f76d7d512..f30070cb62 100644 --- a/cmd/zetaclientd/keygen_tss.go +++ b/cmd/zetaclientd/keygen_tss.go @@ -10,15 +10,15 @@ import ( "github.com/rs/zerolog" "github.com/tendermint/crypto/sha3" "github.com/tendermint/tendermint/crypto/secp256k1" + tsscommon "github.com/zeta-chain/go-tss/common" + "github.com/zeta-chain/go-tss/keygen" + "github.com/zeta-chain/go-tss/p2p" "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" observerTypes "github.com/zeta-chain/zetacore/x/observer/types" mc "github.com/zeta-chain/zetacore/zetaclient" "github.com/zeta-chain/zetacore/zetaclient/config" "github.com/zeta-chain/zetacore/zetaclient/metrics" - tsscommon "gitlab.com/thorchain/tss/go-tss/common" - "gitlab.com/thorchain/tss/go-tss/keygen" - "gitlab.com/thorchain/tss/go-tss/p2p" ) func GenerateTss(logger zerolog.Logger, cfg *config.Config, zetaBridge *mc.ZetaCoreBridge, peers p2p.AddrList, priKey secp256k1.PrivKey, ts *mc.TelemetryServer, tssHistoricalList []types.TSS, metrics *metrics.Metrics) (*mc.TSS, error) { diff --git a/cmd/zetaclientd/main.go b/cmd/zetaclientd/main.go index a51fb40d82..e6b195f783 100644 --- a/cmd/zetaclientd/main.go +++ b/cmd/zetaclientd/main.go @@ -1,10 +1,10 @@ package main import ( - ecdsakeygen "github.com/binance-chain/tss-lib/ecdsa/keygen" "github.com/cosmos/cosmos-sdk/server" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" "github.com/rs/zerolog" + ecdsakeygen "github.com/zeta-chain/tss-lib/ecdsa/keygen" "github.com/zeta-chain/zetacore/zetaclient/config" "github.com/zeta-chain/zetacore/cmd" diff --git a/cmd/zetaclientd/p2p_diagnostics.go b/cmd/zetaclientd/p2p_diagnostics.go index a33c0257cf..5253e9cb4f 100644 --- a/cmd/zetaclientd/p2p_diagnostics.go +++ b/cmd/zetaclientd/p2p_diagnostics.go @@ -19,10 +19,10 @@ import ( maddr "github.com/multiformats/go-multiaddr" "github.com/rs/zerolog" "github.com/tendermint/tendermint/crypto/secp256k1" + "github.com/zeta-chain/go-tss/p2p" "github.com/zeta-chain/zetacore/common/cosmos" mc "github.com/zeta-chain/zetacore/zetaclient" "github.com/zeta-chain/zetacore/zetaclient/config" - "gitlab.com/thorchain/tss/go-tss/p2p" ) func RunDiagnostics(startLogger zerolog.Logger, peers p2p.AddrList, bridgePk cryptotypes.PrivKey, cfg *config.Config) error { diff --git a/cmd/zetaclientd/start.go b/cmd/zetaclientd/start.go index 7bfbb91f54..230bda49c3 100644 --- a/cmd/zetaclientd/start.go +++ b/cmd/zetaclientd/start.go @@ -17,13 +17,13 @@ import ( "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/tendermint/tendermint/crypto/secp256k1" + "github.com/zeta-chain/go-tss/p2p" "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/x/crosschain/types" observerTypes "github.com/zeta-chain/zetacore/x/observer/types" mc "github.com/zeta-chain/zetacore/zetaclient" "github.com/zeta-chain/zetacore/zetaclient/config" metrics2 "github.com/zeta-chain/zetacore/zetaclient/metrics" - "gitlab.com/thorchain/tss/go-tss/p2p" ) type Multiaddr = core.Multiaddr diff --git a/contrib/localnet/orchestrator/smoketest/main.go b/contrib/localnet/orchestrator/smoketest/main.go index 7d01a5cadf..b8ac580408 100644 --- a/contrib/localnet/orchestrator/smoketest/main.go +++ b/contrib/localnet/orchestrator/smoketest/main.go @@ -155,7 +155,7 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) { observerClient := observertypes.NewQueryClient(grpcConn) //Wait for Genesis - time.Sleep(20 * time.Second) + time.Sleep(30 * time.Second) // initialize client to send messages to ZetaChain zetaTxServer, err := NewZetaTxServer( @@ -175,7 +175,7 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) { fmt.Printf("cctxClient.LastZetaHeight error: %s", err) continue } - if response.Height >= 30 { + if response.Height >= 60 { break } fmt.Printf("Last ZetaHeight: %d\n", response.Height) diff --git a/contrib/localnet/scripts/genesis.sh b/contrib/localnet/scripts/genesis.sh index 242dc8a56d..79e85bc58c 100755 --- a/contrib/localnet/scripts/genesis.sh +++ b/contrib/localnet/scripts/genesis.sh @@ -79,7 +79,7 @@ then # 2. Add the observers, authorizations, required params and accounts to the genesis.json zetacored collect-observer-info - zetacored add-observer-list + zetacored add-observer-list --keygen-block 55 cat $HOME/.zetacored/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json cat $HOME/.zetacored/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json cat $HOME/.zetacored/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json diff --git a/contrib/localnet/scripts/start-zetaclientd-genesis.sh b/contrib/localnet/scripts/start-zetaclientd-genesis.sh index c3e7eaece8..3f3504652a 100755 --- a/contrib/localnet/scripts/start-zetaclientd-genesis.sh +++ b/contrib/localnet/scripts/start-zetaclientd-genesis.sh @@ -26,7 +26,11 @@ else num=$(echo $HOSTNAME | tr -dc '0-9') node="zetacore$num" MYIP=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) - SEED=$(curl --retry 10 --retry-delay 5 --retry-connrefused -s zetaclient0:8123/p2p) + SEED="" + while [ -z "$SEED" ] + do + SEED=$(curl --retry 10 --retry-delay 5 --retry-connrefused -s zetaclient0:8123/p2p) + done rm ~/.tss/* zetaclientd init --peer /ip4/172.20.0.21/tcp/6668/p2p/"$SEED" --zetacore-url "$node" --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --log-level 0 zetaclientd start diff --git a/go.mod b/go.mod index 0d6bbafa53..2c5e8c79f1 100644 --- a/go.mod +++ b/go.mod @@ -31,7 +31,6 @@ require ( cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-rc.0 github.com/99designs/keyring v1.2.1 - github.com/binance-chain/tss-lib v1.3.2 github.com/btcsuite/btcd v0.23.4 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 @@ -41,8 +40,9 @@ require ( github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 + github.com/zeta-chain/go-tss v0.1.0 github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20230816152528-db7d2bf9144b - gitlab.com/thorchain/tss/go-tss v0.0.0-00010101000000-000000000000 + github.com/zeta-chain/tss-lib v0.1.7 google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc gopkg.in/yaml.v2 v2.4.0 ) @@ -57,6 +57,8 @@ require ( require ( github.com/DataDog/zstd v1.5.2 // indirect + github.com/agl/ed25519 v0.0.0-20200225211852-fd4d107ace12 // indirect + github.com/bnb-chain/tss-lib v1.5.0 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cockroachdb/errors v1.9.1 // indirect @@ -65,6 +67,7 @@ require ( github.com/cockroachdb/redact v1.1.3 // indirect github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0 // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect @@ -315,7 +318,7 @@ require ( ) replace ( - github.com/binance-chain/tss-lib => gitlab.com/thorchain/tss/tss-lib v0.0.0-20201118045712-70b2cb4bf916 + github.com/agl/ed25519 => github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.22.3 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 @@ -326,8 +329,6 @@ replace ( // use cometbft github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.28 github.com/tendermint/tm-db => github.com/BlockPILabs/cosmos-db v0.0.3 - gitlab.com/thorchain/tss/go-tss => github.com/brewmaster012/go-tss v0.0.0-20230724230849-ce080275bbad - ) replace github.com/cometbft/cometbft-db => github.com/notional-labs/cometbft-db v0.0.0-20230321185329-6dc7c0ca6345 diff --git a/go.sum b/go.sum index 8745f3e5b3..78d4bd4639 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxo bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M= +bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -608,8 +609,6 @@ github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/agl/ed25519 v0.0.0-20200225211852-fd4d107ace12/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/kingpin v2.2.6+incompatible/go.mod h1:59OFYbFVLKQKq+mqrL6Rw5bR0c3ACQaawgXx0QYndlE= @@ -703,6 +702,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43 h1:Vkf7rtHx8uHx8gDfkQaCdVfc+gfrF9v6sR6xJy7RXNg= +github.com/binance-chain/edwards25519 v0.0.0-20200305024217-f36fc4b53d43/go.mod h1:TnVqVdGEK8b6erOMkcyYGWzCQMw7HEMCOw3BgFYCFWs= github.com/binance-chain/ledger-cosmos-go v0.9.9-binance.1/go.mod h1:FI6WAujuiBpoSavYreux2zTKyrUkngXDlRJczxsDK5M= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= @@ -716,6 +717,8 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= +github.com/bnb-chain/tss-lib v1.5.0 h1:fuP69k0c4K9kaWCrG+FPH4GDdGZpMRhLyAaA+TyGn0w= +github.com/bnb-chain/tss-lib v1.5.0/go.mod h1:o3zAAo7A88ZJnCE1qpjy1hTqPn+GPQlxRsj8soz14UU= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U= github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6abzXN4Pg= @@ -725,8 +728,6 @@ github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2 github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= -github.com/brewmaster012/go-tss v0.0.0-20230724230849-ce080275bbad h1:/Jqi03d/vQ9SXDjubEKYGpv2usH5Ejjrmrdv405UFNo= -github.com/brewmaster012/go-tss v0.0.0-20230724230849-ce080275bbad/go.mod h1:RYOe4ihG8KkoQQhW6ljiyxyW6F3CoZA3ozyyEb5HVmI= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/btcsuite/btcd v0.22.3 h1:kYNaWFvOw6xvqP0vR20RP1Zq1DVMBxEO8QN5d1/EfNg= github.com/btcsuite/btcd v0.22.3/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= @@ -749,7 +750,9 @@ github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pY github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 h1:R8vQdOQdZ9Y3SkEwmHoWBmX1DNXhXZqlTpq6s4tyJGc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= @@ -1068,6 +1071,7 @@ github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsP github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= +github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0 h1:E5KszxGgpjpmW8vN811G6rBAZg0/S/DftdGqN4FW5x4= github.com/decred/dcrd/dcrec/edwards/v2 v2.0.0/go.mod h1:d0H8xGMWbiIQP7gN3v2rByWUcuZPm9YsgmnfoxgbINc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= @@ -1809,11 +1813,9 @@ github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8 github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= -github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= +github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= -github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= -github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= github.com/ipfs/go-log/v2 v2.1.3/go.mod h1:/8d0SH3Su5Ooc31QlL1WysJhvyOTDCjcCZ9Axpmri6g= github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= @@ -2404,6 +2406,7 @@ github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnz github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1 h1:BCmzIS3n71sGfHB5NMNDB3lHYPz8fWSkCAErHed//qc= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= @@ -2921,6 +2924,7 @@ github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0 h1:GDDkbFiaK8jsSD github.com/warpfork/go-wish v0.0.0-20220906213052-39a1cc7a02d0/go.mod h1:x6AKhvSSexNrVSrViXSHUEbICjmGXhtgABaHIySUSGw= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= +github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= @@ -2957,8 +2961,12 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= +github.com/zeta-chain/go-tss v0.1.0 h1:3sqSQGOW42j516xihIXDx+YjAYMWbCryEt14cufHb+g= +github.com/zeta-chain/go-tss v0.1.0/go.mod h1:pXgFOVodqkNxbjLe6N0Lx8FFjNTDST3C9H8J1/8LNXk= github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20230816152528-db7d2bf9144b h1:aZRt5BtXdoDdyrUKwcv3B7mS30m/B854cjKjmnXBE5A= github.com/zeta-chain/protocol-contracts v1.0.2-athens3.0.20230816152528-db7d2bf9144b/go.mod h1:v79f+eY6PMpmLv188FAubst4XV2Mm8mUmx1OgmdFG3c= +github.com/zeta-chain/tss-lib v0.1.7 h1:NkIaK7qIeb2B8z85PW0wnAaEP87ZUvgA/V3el7Kf5Tk= +github.com/zeta-chain/tss-lib v0.1.7/go.mod h1:E1GSdTmOJSq+GVLUEKvTcM/4uqY0MJ3fvs8cqhWwS8Y= github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/hid v0.9.1/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= @@ -2968,8 +2976,6 @@ github.com/zondax/ledger-go v0.14.1/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2f gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= gitlab.com/thorchain/binance-sdk v1.2.3-0.20210117202539-d569b6b9ba5d h1:GGPSI9gU22zW75m1YO7ZEMFtVEI5NgyK4g17CIXFjqI= gitlab.com/thorchain/binance-sdk v1.2.3-0.20210117202539-d569b6b9ba5d/go.mod h1:SW01IZMpqlPNPdhHnn99qnJNvg8ll/agyyW7p85npwY= -gitlab.com/thorchain/tss/tss-lib v0.0.0-20201118045712-70b2cb4bf916 h1:rM3TjCVZzn3cYQV1L8KuvwXOZ5yvMdB2C5YyExI/m9Y= -gitlab.com/thorchain/tss/tss-lib v0.0.0-20201118045712-70b2cb4bf916/go.mod h1:i7bv+PuILDZmCiU3mtZXgOfgQkWLdLngByT2KDfyzpE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -3091,8 +3097,6 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= @@ -3103,6 +3107,7 @@ go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1 gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -3235,6 +3240,7 @@ golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -3414,6 +3420,7 @@ golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812073006-9eafafc0a87e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/x/observer/client/cli/tx_add_blame_vote.go b/x/observer/client/cli/tx_add_blame_vote.go index e9597d26f0..802fda3edd 100644 --- a/x/observer/client/cli/tx_add_blame_vote.go +++ b/x/observer/client/cli/tx_add_blame_vote.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" + "github.com/zeta-chain/go-tss/blame" "github.com/zeta-chain/zetacore/x/observer/types" - "gitlab.com/thorchain/tss/go-tss/blame" ) func CmdAddBlameVote() *cobra.Command { diff --git a/x/observer/types/utils.go b/x/observer/types/utils.go index 009b419168..c83fb11b67 100644 --- a/x/observer/types/utils.go +++ b/x/observer/types/utils.go @@ -1,6 +1,6 @@ package types -import "gitlab.com/thorchain/tss/go-tss/blame" +import "github.com/zeta-chain/go-tss/blame" func ConvertNodes(n []blame.Node) (nodes []*Node) { for _, node := range n { diff --git a/zetaclient/interfaces.go b/zetaclient/interfaces.go index 8abe50eb86..b2f17d9c90 100644 --- a/zetaclient/interfaces.go +++ b/zetaclient/interfaces.go @@ -13,10 +13,10 @@ import ( ethtypes "github.com/ethereum/go-ethereum/core/types" "github.com/prometheus/client_golang/prometheus" "github.com/rs/zerolog" + "github.com/zeta-chain/go-tss/blame" "github.com/zeta-chain/zetacore/common" crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" - "gitlab.com/thorchain/tss/go-tss/blame" ) // ChainClient is the interface for chain clients diff --git a/zetaclient/tss_signer.go b/zetaclient/tss_signer.go index e98854b8cf..1291a95d15 100644 --- a/zetaclient/tss_signer.go +++ b/zetaclient/tss_signer.go @@ -12,7 +12,6 @@ import ( "strings" "time" - "github.com/binance-chain/tss-lib/ecdsa/keygen" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcutil" ethcommon "github.com/ethereum/go-ethereum/common" @@ -21,16 +20,17 @@ import ( "github.com/rs/zerolog" "github.com/rs/zerolog/log" tmcrypto "github.com/tendermint/tendermint/crypto" + thorcommon "github.com/zeta-chain/go-tss/common" + "github.com/zeta-chain/go-tss/keysign" + "github.com/zeta-chain/go-tss/p2p" + "github.com/zeta-chain/go-tss/tss" + "github.com/zeta-chain/tss-lib/ecdsa/keygen" "github.com/zeta-chain/zetacore/common" zcommon "github.com/zeta-chain/zetacore/common/cosmos" "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" "github.com/zeta-chain/zetacore/zetaclient/config" "github.com/zeta-chain/zetacore/zetaclient/metrics" - thorcommon "gitlab.com/thorchain/tss/go-tss/common" - "gitlab.com/thorchain/tss/go-tss/keysign" - "gitlab.com/thorchain/tss/go-tss/p2p" - "gitlab.com/thorchain/tss/go-tss/tss" ) type TSSKey struct { diff --git a/zetaclient/tx.go b/zetaclient/tx.go index daaf7fd412..d5d9c89571 100644 --- a/zetaclient/tx.go +++ b/zetaclient/tx.go @@ -8,11 +8,12 @@ import ( "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" + + "github.com/zeta-chain/go-tss/blame" "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" - "gitlab.com/thorchain/tss/go-tss/blame" ) const ( From 5403c8eeef2e021ed73933f8da603a6a62ae4a93 Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Fri, 3 Nov 2023 10:04:51 -0500 Subject: [PATCH 24/26] fix(`common`)!: bitcoin address validation to verify networks (#1364) * fix bitcoin address validation to verify networks * fix import order --- common/address_test.go | 3 +++ common/chain.go | 5 +++- common/chain_test.go | 55 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 common/chain_test.go diff --git a/common/address_test.go b/common/address_test.go index 2d0afc1982..17bfe5ce86 100644 --- a/common/address_test.go +++ b/common/address_test.go @@ -1,3 +1,6 @@ +//go:build TESTNET +// +build TESTNET + package common import ( diff --git a/common/chain.go b/common/chain.go index 010e899258..2ef7116ede 100644 --- a/common/chain.go +++ b/common/chain.go @@ -60,10 +60,13 @@ func (chain Chain) EncodeAddress(b []byte) (string, error) { if err != nil { return "", err } - _, err = btcutil.DecodeAddress(addrStr, chainParams) + addr, err := btcutil.DecodeAddress(addrStr, chainParams) if err != nil { return "", err } + if !addr.IsForNet(chainParams) { + return "", fmt.Errorf("address is not for network %s", chainParams.Name) + } return addrStr, nil } return "", fmt.Errorf("chain (%d) not supported", chain.ChainId) diff --git a/common/chain_test.go b/common/chain_test.go new file mode 100644 index 0000000000..28ab1be701 --- /dev/null +++ b/common/chain_test.go @@ -0,0 +1,55 @@ +package common + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestChain_EncodeAddress(t *testing.T) { + type fields struct { + ChainName ChainName + ChainId int32 + } + + tests := []struct { + name string + chain Chain + b []byte + want string + wantErr bool + }{ + { + name: "should error if b is not a valid address on the network", + chain: Chain{ + ChainName: ChainName_btc_testnet, + ChainId: 18332, + }, + b: []byte("bc1qk0cc73p8m7hswn8y2q080xa4e5pxapnqgp7h9c"), + want: "", + wantErr: true, + }, + { + name: "should pass if b is a valid address on the network", + chain: Chain{ + ChainName: ChainName_btc_mainnet, + ChainId: 8332, + }, + b: []byte("bc1qk0cc73p8m7hswn8y2q080xa4e5pxapnqgp7h9c"), + want: "bc1qk0cc73p8m7hswn8y2q080xa4e5pxapnqgp7h9c", + wantErr: false, + }, + } + + for _, tc := range tests { + tc := tc + t.Run(tc.name, func(t *testing.T) { + s, err := tc.chain.EncodeAddress(tc.b) + if tc.wantErr { + require.Error(t, err) + return + } + require.Equal(t, tc.want, s) + }) + } +} From 4cffc49f00a457dd351d007d35c387b26d816c6c Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Fri, 3 Nov 2023 11:21:02 -0700 Subject: [PATCH 25/26] refactor: add more extensive check for reverted contract (#1214) * add method check error revert * add new contract revert check * fix evm deposit * add more evm testrs * reverter contract * smoke tests * increase smoketest time limit * fix reverter contract * test DepositZRC20AndCallContract * remove comments * include reason in tx reverts * check revert reason smoke test * fix checked message --- .../localnet/orchestrator/smoketest/main.go | 3 + .../smoketest/test_deposit_eth.go | 116 ++++++++++ x/crosschain/keeper/evm_deposit.go | 17 +- x/fungible/keeper/evm.go | 10 +- x/fungible/keeper/evm_test.go | 204 +++++++++++++++++- x/fungible/types/evm.go | 18 ++ x/fungible/types/evm_test.go | 22 ++ 7 files changed, 375 insertions(+), 15 deletions(-) create mode 100644 x/fungible/types/evm.go create mode 100644 x/fungible/types/evm_test.go diff --git a/contrib/localnet/orchestrator/smoketest/main.go b/contrib/localnet/orchestrator/smoketest/main.go index b8ac580408..167c5bbda8 100644 --- a/contrib/localnet/orchestrator/smoketest/main.go +++ b/contrib/localnet/orchestrator/smoketest/main.go @@ -312,6 +312,9 @@ func LocalSmokeTest(_ *cobra.Command, _ []string) { smokeTest.TestUpdateBytecode() smokeTest.CheckZRC20ReserveAndSupply() + smokeTest.TestEtherDepositAndCall() + smokeTest.CheckZRC20ReserveAndSupply() + smokeTest.TestDepositEtherLiquidityCap() smokeTest.CheckZRC20ReserveAndSupply() diff --git a/contrib/localnet/orchestrator/smoketest/test_deposit_eth.go b/contrib/localnet/orchestrator/smoketest/test_deposit_eth.go index b9da61416c..a792957410 100644 --- a/contrib/localnet/orchestrator/smoketest/test_deposit_eth.go +++ b/contrib/localnet/orchestrator/smoketest/test_deposit_eth.go @@ -7,6 +7,7 @@ import ( "context" "fmt" "math/big" + "strings" "time" "cosmossdk.io/math" @@ -17,6 +18,7 @@ import ( zrc20 "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/zrc20.sol" "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/common/ethereum" + testcontract "github.com/zeta-chain/zetacore/testutil/contracts" "github.com/zeta-chain/zetacore/x/crosschain/types" fungibletypes "github.com/zeta-chain/zetacore/x/fungible/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" @@ -174,6 +176,120 @@ func (sm *SmokeTest) TestDepositEtherIntoZRC20() { sm.wg.Wait() } +// TestEtherDepositAndCall tests deposit of ethers calling a example contract +func (sm *SmokeTest) TestEtherDepositAndCall() { + startTime := time.Now() + defer func() { + fmt.Printf("test finishes in %s\n", time.Since(startTime)) + }() + LoudPrintf("Deposit ZRC20 into ZEVM and call a contract\n") + + fmt.Println("Deploying example contract") + exampleAddr, _, exampleContract, err := testcontract.DeployExample(sm.zevmAuth, sm.zevmClient) + if err != nil { + panic(err) + } + fmt.Println("Example contract deployed") + + // preparing tx + goerliClient := sm.goerliClient + value := big.NewInt(1e18) + gasLimit := uint64(23000) + gasPrice, err := goerliClient.SuggestGasPrice(context.Background()) + if err != nil { + panic(err) + } + nonce, err := goerliClient.PendingNonceAt(context.Background(), DeployerAddress) + if err != nil { + panic(err) + } + + data := append(exampleAddr.Bytes(), []byte("hello sailors")...) + tx := ethtypes.NewTransaction(nonce, TSSAddress, value, gasLimit, gasPrice, data) + chainID, err := goerliClient.NetworkID(context.Background()) + if err != nil { + panic(err) + } + deployerPrivkey, err := crypto.HexToECDSA(DeployerPrivateKey) + if err != nil { + panic(err) + } + signedTx, err := ethtypes.SignTx(tx, ethtypes.NewEIP155Signer(chainID), deployerPrivkey) + if err != nil { + panic(err) + } + + fmt.Println("Sending a cross-chain call to example contract") + err = goerliClient.SendTransaction(context.Background(), signedTx) + if err != nil { + panic(err) + } + receipt := MustWaitForTxReceipt(sm.goerliClient, signedTx) + if receipt.Status == 0 { + panic("tx failed") + } + cctx := WaitCctxMinedByInTxHash(signedTx.Hash().Hex(), sm.cctxClient) + if cctx.CctxStatus.Status != types.CctxStatus_OutboundMined { + panic(fmt.Sprintf("expected cctx status to be mined; got %s", cctx.CctxStatus.Status)) + } + + // Checking example contract has been called, bar value should be set to amount + bar, err := exampleContract.Bar(&bind.CallOpts{}) + if err != nil { + panic(err) + } + if bar.Cmp(value) != 0 { + panic(fmt.Sprintf("cross-chain call failed bar value %s should be equal to amount %s", bar.String(), value.String())) + } + fmt.Println("Cross-chain call succeeded") + + fmt.Println("Deploying reverter contract") + reverterAddr, _, _, err := testcontract.DeployReverter(sm.zevmAuth, sm.zevmClient) + if err != nil { + panic(err) + } + fmt.Println("Example reverter deployed") + + // preparing tx for reverter + gasPrice, err = goerliClient.SuggestGasPrice(context.Background()) + if err != nil { + panic(err) + } + nonce, err = goerliClient.PendingNonceAt(context.Background(), DeployerAddress) + if err != nil { + panic(err) + } + + data = append(reverterAddr.Bytes(), []byte("hello sailors")...) + tx = ethtypes.NewTransaction(nonce, TSSAddress, value, gasLimit, gasPrice, data) + signedTx, err = ethtypes.SignTx(tx, ethtypes.NewEIP155Signer(chainID), deployerPrivkey) + if err != nil { + panic(err) + } + + fmt.Println("Sending a cross-chain call to reverter contract") + err = goerliClient.SendTransaction(context.Background(), signedTx) + if err != nil { + panic(err) + } + + receipt = MustWaitForTxReceipt(sm.goerliClient, signedTx) + if receipt.Status == 0 { + panic("tx failed") + } + cctx = WaitCctxMinedByInTxHash(signedTx.Hash().Hex(), sm.cctxClient) + if cctx.CctxStatus.Status != types.CctxStatus_Reverted { + panic(fmt.Sprintf("expected cctx status to be reverted; got %s", cctx.CctxStatus.Status)) + } + fmt.Println("Cross-chain call to reverter reverted") + + // check the status message contains revert error hash in case of revert + // 0xbfb4ebcf is the hash of "Foo()" + if !strings.Contains(cctx.CctxStatus.StatusMessage, "0xbfb4ebcf") { + panic(fmt.Sprintf("expected cctx status message to contain revert reason; got %s", cctx.CctxStatus.StatusMessage)) + } +} + func (sm *SmokeTest) TestDepositAndCallRefund() { startTime := time.Now() defer func() { diff --git a/x/crosschain/keeper/evm_deposit.go b/x/crosschain/keeper/evm_deposit.go index cf5e8f952a..9391f7c485 100644 --- a/x/crosschain/keeper/evm_deposit.go +++ b/x/crosschain/keeper/evm_deposit.go @@ -66,17 +66,12 @@ func (k Keeper) HandleEVMDeposit( msg.CoinType, msg.Asset, ) - if err != nil { - isContractReverted := false - - // consider the contract as reverted if foreign coin liquidity cap is reached or calling a non-contract address - if (evmTxResponse != nil && evmTxResponse.Failed()) || - errors.Is(err, fungibletypes.ErrForeignCoinCapReached) || - errors.Is(err, fungibletypes.ErrCallNonContract) { - isContractReverted = true - } - - return isContractReverted, err + if fungibletypes.IsContractReverted(evmTxResponse, err) || + errors.Is(err, fungibletypes.ErrForeignCoinCapReached) || + errors.Is(err, fungibletypes.ErrCallNonContract) { + return true, err + } else if err != nil { + return false, err } // non-empty msg.Message means this is a contract call; therefore the logs should be processed. diff --git a/x/fungible/keeper/evm.go b/x/fungible/keeper/evm.go index 8606804bea..f0683deb60 100644 --- a/x/fungible/keeper/evm.go +++ b/x/fungible/keeper/evm.go @@ -571,7 +571,15 @@ func (k Keeper) CallEVM( k.Logger(ctx).Debug("calling EVM", "from", from, "contract", contract, "value", value, "method", method) resp, err := k.CallEVMWithData(ctx, from, &contract, data, commit, noEthereumTxEvent, value, gasLimit) if err != nil { - return resp, cosmoserrors.Wrapf(err, "contract call failed: method '%s', contract '%s'", method, contract) + errMes := fmt.Sprintf("contract call failed: method '%s', contract '%s'", method, contract.Hex()) + + // if it is a revert error then add the revert reason to the error message + revertErr, ok := err.(*evmtypes.RevertError) + if ok { + errMes = fmt.Sprintf("%s, reason: %v", errMes, revertErr.ErrorData()) + } + + return resp, cosmoserrors.Wrapf(err, errMes) } return resp, nil } diff --git a/x/fungible/keeper/evm_test.go b/x/fungible/keeper/evm_test.go index 2d5be1e8a8..80bd42a2f3 100644 --- a/x/fungible/keeper/evm_test.go +++ b/x/fungible/keeper/evm_test.go @@ -12,7 +12,7 @@ import ( evmtypes "github.com/evmos/ethermint/x/evm/types" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - + "github.com/zeta-chain/protocol-contracts/pkg/contracts/zevm/systemcontract.sol" zetacommon "github.com/zeta-chain/zetacore/common" "github.com/zeta-chain/zetacore/server/config" "github.com/zeta-chain/zetacore/testutil/contracts" @@ -113,8 +113,6 @@ func TestKeeper_DeployZRC20Contract(t *testing.T) { _ = k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) chainID := getValidChainID(t) - - // deploy the system contracts deploySystemContracts(t, ctx, k, sdkk.EvmKeeper) addr, err := k.DeployZRC20Contract( @@ -220,7 +218,207 @@ func TestKeeper_DeploySystemContract(t *testing.T) { }) } +func TestKeeper_DepositZRC20AndCallContract(t *testing.T) { + t.Run("should deposit and call the contract", func(t *testing.T) { + k, ctx, sdkk, _ := testkeeper.FungibleKeeper(t) + _ = k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + + chainID := getValidChainID(t) + deploySystemContracts(t, ctx, k, sdkk.EvmKeeper) + zrc20 := setupGasCoin(t, ctx, k, sdkk.EvmKeeper, chainID, "foobar", "FOOBAR") + + example, err := k.DeployContract(ctx, contracts.ExampleMetaData) + require.NoError(t, err) + assertContractDeployment(t, sdkk.EvmKeeper, ctx, example) + + res, err := k.DepositZRC20AndCallContract( + ctx, + systemcontract.ZContext{ + Origin: sample.EthAddress().Bytes(), + Sender: sample.EthAddress(), + ChainID: big.NewInt(chainID), + }, + zrc20, + example, + big.NewInt(42), + []byte(""), + ) + require.NoError(t, err) + require.False(t, types.IsContractReverted(res, err)) + balance, err := k.BalanceOfZRC4(ctx, zrc20, example) + require.NoError(t, err) + require.Equal(t, int64(42), balance.Int64()) + + // check onCrossChainCall has been called + exampleABI, err := contracts.ExampleMetaData.GetAbi() + require.NoError(t, err) + res, err = k.CallEVM( + ctx, + *exampleABI, + types.ModuleAddressEVM, + example, + big.NewInt(0), + nil, + false, + false, + "bar", + ) + unpacked, err := exampleABI.Unpack("bar", res.Ret) + require.NoError(t, err) + require.NotZero(t, len(unpacked)) + bar, ok := unpacked[0].(*big.Int) + require.True(t, ok) + require.Equal(t, big.NewInt(42), bar) + }) + + t.Run("should return a revert error when the underlying contract call revert", func(t *testing.T) { + k, ctx, sdkk, _ := testkeeper.FungibleKeeper(t) + _ = k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + + chainID := getValidChainID(t) + deploySystemContracts(t, ctx, k, sdkk.EvmKeeper) + zrc20 := setupGasCoin(t, ctx, k, sdkk.EvmKeeper, chainID, "foobar", "FOOBAR") + + // Deploy reverter + reverter, err := k.DeployContract(ctx, contracts.ReverterMetaData) + require.NoError(t, err) + assertContractDeployment(t, sdkk.EvmKeeper, ctx, reverter) + + res, err := k.DepositZRC20AndCallContract( + ctx, + systemcontract.ZContext{ + Origin: sample.EthAddress().Bytes(), + Sender: sample.EthAddress(), + ChainID: big.NewInt(chainID), + }, + zrc20, + reverter, + big.NewInt(42), + []byte(""), + ) + require.True(t, types.IsContractReverted(res, err)) + balance, err := k.BalanceOfZRC4(ctx, zrc20, reverter) + require.NoError(t, err) + require.Zero(t, balance.Int64()) + }) + + t.Run("should revert if the underlying contract doesn't exist", func(t *testing.T) { + k, ctx, sdkk, _ := testkeeper.FungibleKeeper(t) + _ = k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + + chainID := getValidChainID(t) + deploySystemContracts(t, ctx, k, sdkk.EvmKeeper) + zrc20 := setupGasCoin(t, ctx, k, sdkk.EvmKeeper, chainID, "foobar", "FOOBAR") + + res, err := k.DepositZRC20AndCallContract( + ctx, + systemcontract.ZContext{ + Origin: sample.EthAddress().Bytes(), + Sender: sample.EthAddress(), + ChainID: big.NewInt(chainID), + }, + zrc20, + sample.EthAddress(), + big.NewInt(42), + []byte(""), + ) + require.True(t, types.IsContractReverted(res, err)) + }) +} + func TestKeeper_CallEVMWithData(t *testing.T) { + t.Run("should return a revert error when the contract call revert", func(t *testing.T) { + k, ctx, sdkk, _ := testkeeper.FungibleKeeper(t) + _ = k.GetAuthKeeper().GetModuleAccount(ctx, types.ModuleName) + + // Deploy example + contract, err := k.DeployContract(ctx, contracts.ExampleMetaData) + require.NoError(t, err) + assertContractDeployment(t, sdkk.EvmKeeper, ctx, contract) + abi, err := contracts.ExampleMetaData.GetAbi() + require.NoError(t, err) + + // doRevert make contract reverted + res, err := k.CallEVM( + ctx, + *abi, + types.ModuleAddressEVM, + contract, + big.NewInt(0), + nil, + true, + false, + "doRevert", + ) + require.Nil(t, res) + require.True(t, types.IsContractReverted(res, err)) + + // check reason is included for revert error + // 0xbfb4ebcf is the hash of "Foo()" + require.Contains(t, err.Error(), "reason: 0xbfb4ebcf") + + res, err = k.CallEVM( + ctx, + *abi, + types.ModuleAddressEVM, + contract, + big.NewInt(0), + nil, + true, + false, + "doRevertWithMessage", + ) + require.Nil(t, res) + require.True(t, types.IsContractReverted(res, err)) + + res, err = k.CallEVM( + ctx, + *abi, + types.ModuleAddressEVM, + contract, + big.NewInt(0), + nil, + true, + false, + "doRevertWithRequire", + ) + require.Nil(t, res) + require.True(t, types.IsContractReverted(res, err)) + + // Not a revert error if another type of error + res, err = k.CallEVM( + ctx, + *abi, + types.ModuleAddressEVM, + contract, + big.NewInt(0), + nil, + true, + false, + "doNotExist", + ) + require.Nil(t, res) + require.Error(t, err) + require.False(t, types.IsContractReverted(res, err)) + require.NotContains(t, err.Error(), "reason:") + + // No revert with successfull call + res, err = k.CallEVM( + ctx, + *abi, + types.ModuleAddressEVM, + contract, + big.NewInt(0), + nil, + true, + false, + "doSucceed", + ) + require.NotNil(t, res) + require.NoError(t, err) + require.False(t, types.IsContractReverted(res, err)) + }) + t.Run("apply new message without gas limit estimates gas", func(t *testing.T) { k, ctx := testkeeper.FungibleKeeperAllMocks(t) diff --git a/x/fungible/types/evm.go b/x/fungible/types/evm.go new file mode 100644 index 0000000000..cf466f137c --- /dev/null +++ b/x/fungible/types/evm.go @@ -0,0 +1,18 @@ +package types + +import ( + "strings" + + "github.com/ethereum/go-ethereum/core/vm" + evmtypes "github.com/evmos/ethermint/x/evm/types" +) + +// IsRevertError checks if an error is a evm revert error +func IsRevertError(err error) bool { + return err != nil && strings.Contains(err.Error(), vm.ErrExecutionReverted.Error()) +} + +// IsContractReverted checks if the contract execution is reverted +func IsContractReverted(res *evmtypes.MsgEthereumTxResponse, err error) bool { + return IsRevertError(err) || (res != nil && res.Failed()) +} diff --git a/x/fungible/types/evm_test.go b/x/fungible/types/evm_test.go new file mode 100644 index 0000000000..0be4d916da --- /dev/null +++ b/x/fungible/types/evm_test.go @@ -0,0 +1,22 @@ +package types_test + +import ( + "errors" + "fmt" + "testing" + + "github.com/ethereum/go-ethereum/core/vm" + evmtypes "github.com/evmos/ethermint/x/evm/types" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/x/fungible/types" +) + +func TestIsContractReverted(t *testing.T) { + require.True(t, types.IsContractReverted(nil, vm.ErrExecutionReverted)) + require.True(t, types.IsContractReverted(nil, fmt.Errorf("foo : %s", vm.ErrExecutionReverted.Error()))) + require.True(t, types.IsContractReverted(&evmtypes.MsgEthereumTxResponse{VmError: "foo"}, nil)) + + require.False(t, types.IsContractReverted(nil, nil)) + require.False(t, types.IsContractReverted(nil, errors.New("foo"))) + require.False(t, types.IsContractReverted(&evmtypes.MsgEthereumTxResponse{VmError: ""}, nil)) +} From e8161c57d512c5fa5cef3ba952631f0e92a7cce1 Mon Sep 17 00:00:00 2001 From: Lucas Bertrand Date: Fri, 3 Nov 2023 15:51:29 -0700 Subject: [PATCH 26/26] refactor(`zetaclient`): use keyring backend file for hotkey (#1323) * add error for get context * add password input * use keyring file * check smoketest * fixes for os info script * add keyring backend file to the genesis script * add exit on zetacore0 * add logs for zetaclient * update logs * remove password from config * keyring backend in config * add keyring backend in zetaclient cmd * refactor smoke test * fix script * gofmt * fix lint * fix unit test * try another sleep value * command desc * make docs * try removing sleep * try adding back sleep --- .github/workflows/build.yml | 1 + cmd/zetaclientd/aux.go | 7 +- cmd/zetaclientd/init.go | 4 +- cmd/zetacored/get_pubkey.go | 13 +-- cmd/zetacored/root.go | 2 +- contrib/localnet/docker-compose.yml | 12 ++- .../localnet/orchestrator/smoketest/main.go | 6 +- contrib/localnet/scripts/genesis.sh | 4 + contrib/localnet/scripts/os-info.sh | 30 +++++-- .../scripts/start-zetaclientd-genesis.sh | 10 ++- docs/cli/zetacored/zetacored.md | 2 +- docs/cli/zetacored/zetacored_get-pubkey.md | 4 +- .../types/message_set_node_keys_test.go | 2 +- zetaclient/broadcast.go | 28 ++++-- zetaclient/config/config.go | 18 +++- zetaclient/config/types.go | 66 +++++++++----- zetaclient/keys.go | 85 ++++++++++++++----- zetaclient/keys_test.go | 4 +- zetaclient/zetacore_bridge.go | 23 +++-- 19 files changed, 234 insertions(+), 87 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6872086e09..2dec37e1e6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,6 +125,7 @@ jobs: echo "Smoke Test Failed" exit 1 fi + sleep 10 - name: Stop Private Network if: always() diff --git a/cmd/zetaclientd/aux.go b/cmd/zetaclientd/aux.go index 44f3d6a9bc..af79383a3e 100644 --- a/cmd/zetaclientd/aux.go +++ b/cmd/zetaclientd/aux.go @@ -17,19 +17,24 @@ func CreateAuthzSigner(granter string, grantee sdk.AccAddress) { func CreateZetaBridge(cfg *config.Config) (*zetaclient.ZetaCoreBridge, error) { chainIP := cfg.ZetaCoreURL + kb, _, err := zetaclient.GetKeyringKeybase(cfg) if err != nil { return nil, err } + granterAddreess, err := cosmos.AccAddressFromBech32(cfg.AuthzGranter) if err != nil { return nil, err } - k := zetaclient.NewKeysWithKeybase(kb, granterAddreess, cfg.AuthzHotkey, cfg.SignerPass) + + k := zetaclient.NewKeysWithKeybase(kb, granterAddreess, cfg.AuthzHotkey) + bridge, err := zetaclient.NewZetaCoreBridge(k, chainIP, cfg.AuthzHotkey, cfg.ChainID) if err != nil { return nil, err } + return bridge, nil } diff --git a/cmd/zetaclientd/init.go b/cmd/zetaclientd/init.go index 8db8b18386..95f3d9ca86 100644 --- a/cmd/zetaclientd/init.go +++ b/cmd/zetaclientd/init.go @@ -31,6 +31,7 @@ type initArguments struct { p2pDiagnosticTicker uint64 TssPath string TestTssKeysign bool + KeyringBackend string } func init() { @@ -52,7 +53,7 @@ func init() { InitCmd.Flags().Uint64Var(&initArgs.configUpdateTicker, "config-update-ticker", 5, "config update ticker (default: 0 means no ticker)") InitCmd.Flags().StringVar(&initArgs.TssPath, "tss-path", "~/.tss", "path to tss location") InitCmd.Flags().BoolVar(&initArgs.TestTssKeysign, "test-tss", false, "set to to true to run a check for TSS keysign on startup") - + InitCmd.Flags().StringVar(&initArgs.KeyringBackend, "keyring-backend", string(config.KeyringBackendTest), "keyring backend to use (test, file)") } func Initialize(_ *cobra.Command, _ []string) error { @@ -87,6 +88,7 @@ func Initialize(_ *cobra.Command, _ []string) error { configData.TssPath = initArgs.TssPath configData.P2PDiagnosticTicker = initArgs.p2pDiagnosticTicker configData.ConfigUpdateTicker = initArgs.configUpdateTicker + configData.KeyringBackend = config.KeyringBackend(initArgs.KeyringBackend) //Save config file return config.Save(&configData, rootArgs.zetaCoreHome) diff --git a/cmd/zetacored/get_pubkey.go b/cmd/zetacored/get_pubkey.go index 77165cb531..a924c199af 100644 --- a/cmd/zetacored/get_pubkey.go +++ b/cmd/zetacored/get_pubkey.go @@ -10,18 +10,19 @@ import ( "github.com/zeta-chain/zetacore/common/cosmos" ) -func AddTssToGenesisCmd() *cobra.Command { +func GetPubKeyCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "get-pubkey [tssKeyName] [Password]", - Short: "Get you node account", + Use: "get-pubkey [tssKeyName] [password]", + Short: "Get the node account public key", Args: cobra.MinimumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx := client.GetClientContextFromCmd(cmd) tssKeyName := args[0] - if len(args) == 1 { - args = append(args, "") + password := "" + if len(args) > 1 { + password = args[1] } - pubKeySet, err := GetPubKeySet(clientCtx, tssKeyName, args[1]) + pubKeySet, err := GetPubKeySet(clientCtx, tssKeyName, password) if err != nil { return err } diff --git a/cmd/zetacored/root.go b/cmd/zetacored/root.go index 468c163e9f..6abf556bc6 100644 --- a/cmd/zetacored/root.go +++ b/cmd/zetacored/root.go @@ -128,7 +128,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig appparams.EncodingConfig genutilcli.ValidateGenesisCmd(app.ModuleBasics), AddGenesisAccountCmd(app.DefaultNodeHome), AddObserverAccountsCmd(), - AddTssToGenesisCmd(), + GetPubKeyCmd(), CollectObserverInfoCmd(), AddrConversionCmd(), tmcli.NewCompletionCmd(rootCmd, true), diff --git a/contrib/localnet/docker-compose.yml b/contrib/localnet/docker-compose.yml index 4448fe3a6d..2656fba9ef 100644 --- a/contrib/localnet/docker-compose.yml +++ b/contrib/localnet/docker-compose.yml @@ -34,7 +34,9 @@ services: mynetwork: ipv4_address: 172.20.0.11 entrypoint: ["/root/genesis.sh", "2"] - + environment: + - HOTKEY_BACKEND=file + - HOTKEY_PASSWORD=password # test purposes only zetacore1: image: zetanode:latest @@ -47,7 +49,9 @@ services: mynetwork: ipv4_address: 172.20.0.12 entrypoint: ["/root/genesis.sh", "2"] - + environment: + - HOTKEY_BACKEND=file + - HOTKEY_PASSWORD=password # test purposes only zetaclient0: image: zetanode:latest @@ -62,6 +66,8 @@ services: entrypoint: /root/start-zetaclientd-genesis.sh environment: - ETHDEV_ENDPOINT=http://eth:8545 + - HOTKEY_BACKEND=file + - HOTKEY_PASSWORD=password # test purposes only zetaclient1: image: zetanode:latest @@ -76,6 +82,8 @@ services: entrypoint: /root/start-zetaclientd-genesis.sh environment: - ETHDEV_ENDPOINT=http://eth:8545 + - HOTKEY_BACKEND=file + - HOTKEY_PASSWORD=password # test purposes only eth: image: ethereum/client-go:v1.10.26 diff --git a/contrib/localnet/orchestrator/smoketest/main.go b/contrib/localnet/orchestrator/smoketest/main.go index 167c5bbda8..f10c6b5a68 100644 --- a/contrib/localnet/orchestrator/smoketest/main.go +++ b/contrib/localnet/orchestrator/smoketest/main.go @@ -43,9 +43,9 @@ var ( ERC20CustodyAddr = "0xD28D6A0b8189305551a0A8bd247a6ECa9CE781Ca" UniswapV2FactoryAddr = "0x9fd96203f7b22bCF72d9DCb40ff98302376cE09c" UniswapV2RouterAddr = "0x2ca7d64A7EFE2D62A725E2B35Cf7230D6677FfEe" - //SystemContractAddr = "0x91d18e54DAf4F677cB28167158d6dd21F6aB3921" - //ZEVMSwapAppAddr = "0x65a45c57636f9BcCeD4fe193A602008578BcA90b" - HexToAddress = ethcommon.HexToAddress + HexToAddress = ethcommon.HexToAddress + //SystemContractAddr = "0x91d18e54DAf4F677cB28167158d6dd21F6aB3921" + //ZEVMSwapAppAddr = "0x65a45c57636f9BcCeD4fe193A602008578BcA90b" // FungibleAdminMnemonic is the mnemonic for the admin account of the fungible module //nolint:gosec - disable nosec because this is a test account diff --git a/contrib/localnet/scripts/genesis.sh b/contrib/localnet/scripts/genesis.sh index 79e85bc58c..b9d3209588 100755 --- a/contrib/localnet/scripts/genesis.sh +++ b/contrib/localnet/scripts/genesis.sh @@ -65,6 +65,8 @@ then # Misc : Copying the keyring to the client nodes so that they can sign the transactions ssh zetaclient0 mkdir -p ~/.zetacored/keyring-test/ scp ~/.zetacored/keyring-test/* zetaclient0:~/.zetacored/keyring-test/ + ssh zetaclient0 mkdir -p ~/.zetacored/keyring-file/ + scp ~/.zetacored/keyring-file/* zetaclient0:~/.zetacored/keyring-file/ # 1. Accumulate all the os_info files from other nodes on zetcacore0 and create a genesis.json for NODE in "${NODELIST[@]}"; do @@ -132,6 +134,8 @@ then # Misc : Copying the keyring to the client nodes so that they can sign the transactions ssh zetaclient"$INDEX" mkdir -p ~/.zetacored/keyring-test/ scp ~/.zetacored/keyring-test/* "zetaclient$INDEX":~/.zetacored/keyring-test/ + ssh zetaclient"$INDEX" mkdir -p ~/.zetacored/keyring-file/ + scp ~/.zetacored/keyring-file/* "zetaclient$INDEX":~/.zetacored/keyring-file/ pp=$(cat $HOME/.zetacored/config/gentx/peer/*.json | jq '.body.memo' ) pps=${pp:1:58} diff --git a/contrib/localnet/scripts/os-info.sh b/contrib/localnet/scripts/os-info.sh index 36c311de68..734b1a2f82 100644 --- a/contrib/localnet/scripts/os-info.sh +++ b/contrib/localnet/scripts/os-info.sh @@ -1,16 +1,34 @@ #!/bin/bash -KEYRING="test" +KEYRING_TEST="test" +KEYRING_FILE="file" HOSTNAME=$(hostname) -zetacored keys add operator --algo=secp256k1 --keyring-backend=$KEYRING -zetacored keys add hotkey --algo=secp256k1 --keyring-backend=$KEYRING -operator_address=$(zetacored keys show operator -a --keyring-backend=$KEYRING) -hotkey_address=$(zetacored keys show hotkey -a --keyring-backend=$KEYRING) -pubkey=$(zetacored get-pubkey hotkey|sed -e 's/secp256k1:"\(.*\)"/\1/' | sed 's/ //g' ) +# Operator key +zetacored keys add operator --algo=secp256k1 --keyring-backend=$KEYRING_TEST +operator_address=$(zetacored keys show operator -a --keyring-backend=$KEYRING_TEST) + +# Hotkey key depending on the keyring-backend +if [ "$HOTKEY_BACKEND" == "$KEYRING_FILE" ]; then + printf "%s\n%s\n" "$HOTKEY_PASSWORD" "$HOTKEY_PASSWORD" | zetacored keys add hotkey --algo=secp256k1 --keyring-backend=$KEYRING_FILE + hotkey_address=$(printf "%s\n%s\n" "$HOTKEY_PASSWORD" "$HOTKEY_PASSWORD" | zetacored keys show hotkey -a --keyring-backend=$KEYRING_FILE) + + # Get hotkey pubkey, the command use keyring-backend in the cosmos config + zetacored config keyring-backend "$KEYRING_FILE" + pubkey=$(printf "%s\n%s\n" "$HOTKEY_PASSWORD" "$HOTKEY_PASSWORD" | zetacored get-pubkey hotkey | sed -e 's/secp256k1:"\(.*\)"/\1/' |sed 's/ //g' ) + zetacored config keyring-backend "$KEYRING_TEST" +else + zetacored keys add hotkey --algo=secp256k1 --keyring-backend=$KEYRING + hotkey_address=$(zetacored keys show hotkey -a --keyring-backend=$KEYRING) + pubkey=$(zetacored get-pubkey hotkey|sed -e 's/secp256k1:"\(.*\)"/\1/' | sed 's/ //g' ) +fi + is_observer="y" + echo "operator_address: $operator_address" echo "hotkey_address: $hotkey_address" echo "pubkey: $pubkey" mkdir ~/.zetacored/os_info + +# set key in file jq -n --arg is_observer "$is_observer" --arg operator_address "$operator_address" --arg hotkey_address "$hotkey_address" --arg pubkey "$pubkey" '{"IsObserver":$is_observer,"ObserverAddress":$operator_address,"ZetaClientGranteeAddress":$hotkey_address,"ZetaClientGranteePubKey":$pubkey}' > ~/.zetacored/os_info/os.json diff --git a/contrib/localnet/scripts/start-zetaclientd-genesis.sh b/contrib/localnet/scripts/start-zetaclientd-genesis.sh index 3f3504652a..ec1b9f305c 100755 --- a/contrib/localnet/scripts/start-zetaclientd-genesis.sh +++ b/contrib/localnet/scripts/start-zetaclientd-genesis.sh @@ -4,6 +4,12 @@ HOSTNAME=$(hostname) +# read HOTKEY_BACKEND env var for hotkey keyring backend and set default to test +BACKEND="test" +if [ "$HOTKEY_BACKEND" == "file" ]; then + BACKEND="file" +fi + cp /root/preparams/PreParams_$HOSTNAME.json /root/preParams.json num=$(echo $HOSTNAME | tr -dc '0-9') node="zetacore$num" @@ -20,7 +26,7 @@ if [ $HOSTNAME == "zetaclient0" ] then rm ~/.tss/* MYIP=$(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) - zetaclientd init --zetacore-url zetacore0 --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" + zetaclientd init --zetacore-url zetacore0 --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --keyring-backend "$BACKEND" zetaclientd start else num=$(echo $HOSTNAME | tr -dc '0-9') @@ -32,6 +38,6 @@ else SEED=$(curl --retry 10 --retry-delay 5 --retry-connrefused -s zetaclient0:8123/p2p) done rm ~/.tss/* - zetaclientd init --peer /ip4/172.20.0.21/tcp/6668/p2p/"$SEED" --zetacore-url "$node" --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --log-level 0 + zetaclientd init --peer /ip4/172.20.0.21/tcp/6668/p2p/"$SEED" --zetacore-url "$node" --chain-id athens_101-1 --operator "$operatorAddress" --log-format=text --public-ip "$MYIP" --log-level 0 --keyring-backend "$BACKEND" zetaclientd start fi diff --git a/docs/cli/zetacored/zetacored.md b/docs/cli/zetacored/zetacored.md index d4a602ec91..72e3c72a76 100644 --- a/docs/cli/zetacored/zetacored.md +++ b/docs/cli/zetacored/zetacored.md @@ -25,7 +25,7 @@ Zetacore Daemon (server) * [zetacored docs](zetacored_docs.md) - Generate markdown documentation for zetacored * [zetacored export](zetacored_export.md) - Export state to JSON * [zetacored gentx](zetacored_gentx.md) - Generate a genesis tx carrying a self delegation -* [zetacored get-pubkey](zetacored_get-pubkey.md) - Get you node account +* [zetacored get-pubkey](zetacored_get-pubkey.md) - Get the node account public key * [zetacored index-eth-tx](zetacored_index-eth-tx.md) - Index historical eth txs * [zetacored init](zetacored_init.md) - Initialize private validator, p2p, genesis, and application configuration files * [zetacored keys](zetacored_keys.md) - Manage your application's keys diff --git a/docs/cli/zetacored/zetacored_get-pubkey.md b/docs/cli/zetacored/zetacored_get-pubkey.md index c0b35505a1..5a47530f2e 100644 --- a/docs/cli/zetacored/zetacored_get-pubkey.md +++ b/docs/cli/zetacored/zetacored_get-pubkey.md @@ -1,9 +1,9 @@ # get-pubkey -Get you node account +Get the node account public key ``` -zetacored get-pubkey [tssKeyName] [Password] [flags] +zetacored get-pubkey [tssKeyName] [password] [flags] ``` ### Options diff --git a/x/crosschain/types/message_set_node_keys_test.go b/x/crosschain/types/message_set_node_keys_test.go index caddf48817..b98194cd0c 100644 --- a/x/crosschain/types/message_set_node_keys_test.go +++ b/x/crosschain/types/message_set_node_keys_test.go @@ -28,7 +28,7 @@ func TestMsgSetNodeKeys_ValidateBasic(t *testing.T) { _, err := kb.NewAccount(mc.GetGranteeKeyName("signerName"), testdata.TestMnemonic, "", path, hd.Secp256k1) require.NoError(t, err) granterAddress := sdk.AccAddress(crypto.AddressHash([]byte("granterAddress"))) - k := mc.NewKeysWithKeybase(kb, granterAddress, "signerName", "") + k := mc.NewKeysWithKeybase(kb, granterAddress, "signerName") pubKeySet, err := k.GetPubKeySet() assert.NoError(t, err) addr, err := k.GetSignerInfo().GetAddress() diff --git a/zetaclient/broadcast.go b/zetaclient/broadcast.go index c41333811e..cf6e6e5682 100644 --- a/zetaclient/broadcast.go +++ b/zetaclient/broadcast.go @@ -42,7 +42,10 @@ func (b *ZetaCoreBridge) Broadcast(gaslimit uint64, authzWrappedMsg sdktypes.Msg flags := flag.NewFlagSet("zetacore", 0) - ctx := b.GetContext() + ctx, err := b.GetContext() + if err != nil { + return "", err + } factory := clienttx.NewFactoryCLI(ctx, flags) factory = factory.WithAccountNumber(b.accountNumber[authzSigner.KeyType]) factory = factory.WithSequence(b.seqNumber[authzSigner.KeyType]) @@ -107,13 +110,23 @@ func (b *ZetaCoreBridge) Broadcast(gaslimit uint64, authzWrappedMsg sdktypes.Msg } // GetContext return a valid context with all relevant values set -func (b *ZetaCoreBridge) GetContext() client.Context { +func (b *ZetaCoreBridge) GetContext() (client.Context, error) { ctx := client.Context{} addr, err := b.keys.GetSignerInfo().GetAddress() if err != nil { - // TODO : Handle error b.logger.Error().Err(err).Msg("fail to get address from key") + return ctx, err + } + + // if password is needed, set it as input + password, err := b.keys.GetHotkeyPassword() + if err != nil { + return ctx, err } + if password != "" { + ctx = ctx.WithInput(strings.NewReader(fmt.Sprintf("%[1]s\n%[1]s\n", password))) + } + ctx = ctx.WithKeyring(b.keys.GetKeybase()) ctx = ctx.WithChainID(b.zetaChainID) ctx = ctx.WithHomeDir(b.cfg.ChainHomeFolder) @@ -131,13 +144,12 @@ func (b *ZetaCoreBridge) GetContext() client.Context { if !strings.HasPrefix(b.cfg.ChainHost, "http") { remote = fmt.Sprintf("tcp://%s", remote) } - //fmt.Println("ctx.remote ", remote) ctx = ctx.WithNodeURI(remote) - client, err := rpchttp.New(remote, "/websocket") + wsClient, err := rpchttp.New(remote, "/websocket") if err != nil { - panic(err) + return ctx, err } - ctx = ctx.WithClient(client) - return ctx + ctx = ctx.WithClient(wsClient) + return ctx, nil } diff --git a/zetaclient/config/config.go b/zetaclient/config/config.go index 9c2b36790c..6b1fc1ec30 100644 --- a/zetaclient/config/config.go +++ b/zetaclient/config/config.go @@ -2,6 +2,7 @@ package config import ( "encoding/json" + "fmt" "os" "path/filepath" "strings" @@ -10,6 +11,7 @@ import ( const filename string = "zetaclient_config.json" const folder string = "config" +// Save saves ZetaClient config func Save(config *Config, path string) error { folderPath := filepath.Join(path, folder) err := os.MkdirAll(folderPath, os.ModePerm) @@ -30,13 +32,17 @@ func Save(config *Config, path string) error { return nil } +// Load loads ZetaClient config from a filepath func Load(path string) (*Config, error) { + // retrieve file file := filepath.Join(path, folder, filename) file, err := filepath.Abs(file) if err != nil { return nil, err } file = filepath.Clean(file) + + // read config cfg := NewConfig() input, err := os.ReadFile(file) if err != nil { @@ -46,11 +52,21 @@ func Load(path string) (*Config, error) { if err != nil { return nil, err } + + // read keyring backend and use test by default + if cfg.KeyringBackend == KeyringBackendUndefined { + cfg.KeyringBackend = KeyringBackendTest + } + if cfg.KeyringBackend != KeyringBackendFile && cfg.KeyringBackend != KeyringBackendTest { + return nil, fmt.Errorf("invalid keyring backend %s", cfg.KeyringBackend) + } + + // fields sanitization cfg.TssPath = GetPath(cfg.TssPath) cfg.PreParamsPath = GetPath(cfg.PreParamsPath) cfg.CurrentTssPubkey = "" cfg.ZetaCoreHome = path - cfg.SignerPass = "password" + return cfg, nil } diff --git a/zetaclient/config/types.go b/zetaclient/config/types.go index 8b731d49b5..33d3763d8c 100644 --- a/zetaclient/config/types.go +++ b/zetaclient/config/types.go @@ -13,6 +13,15 @@ import ( observertypes "github.com/zeta-chain/zetacore/x/observer/types" ) +// KeyringBackend is the type of keyring backend to use for the hotkey +type KeyringBackend string + +const ( + KeyringBackendUndefined KeyringBackend = "" + KeyringBackendTest KeyringBackend = "test" + KeyringBackendFile KeyringBackend = "file" +) + type ClientConfiguration struct { ChainHost string `json:"chain_host" mapstructure:"chain_host"` ChainRPC string `json:"chain_rpc" mapstructure:"chain_rpc"` @@ -37,26 +46,28 @@ type BTCConfig struct { RPCParams string // "regtest", "mainnet", "testnet3" } +// Config is the config for ZetaClient // TODO: use snake case for json fields +// https://github.com/zeta-chain/node/issues/1020 type Config struct { - Peer string `json:"Peer"` - PublicIP string `json:"PublicIP"` - LogFormat string `json:"LogFormat"` - LogLevel int8 `json:"LogLevel"` - LogSampler bool `json:"LogSampler"` - PreParamsPath string `json:"PreParamsPath"` - ZetaCoreHome string `json:"ZetaCoreHome"` - ChainID string `json:"ChainID"` - ZetaCoreURL string `json:"ZetaCoreURL"` - AuthzGranter string `json:"AuthzGranter"` - AuthzHotkey string `json:"AuthzHotkey"` - P2PDiagnostic bool `json:"P2PDiagnostic"` - ConfigUpdateTicker uint64 `json:"ConfigUpdateTicker"` - P2PDiagnosticTicker uint64 `json:"P2PDiagnosticTicker"` - TssPath string `json:"TssPath"` - TestTssKeysign bool `json:"TestTssKeysign"` - CurrentTssPubkey string `json:"CurrentTssPubkey"` - SignerPass string `json:"SignerPass"` + Peer string `json:"Peer"` + PublicIP string `json:"PublicIP"` + LogFormat string `json:"LogFormat"` + LogLevel int8 `json:"LogLevel"` + LogSampler bool `json:"LogSampler"` + PreParamsPath string `json:"PreParamsPath"` + ZetaCoreHome string `json:"ZetaCoreHome"` + ChainID string `json:"ChainID"` + ZetaCoreURL string `json:"ZetaCoreURL"` + AuthzGranter string `json:"AuthzGranter"` + AuthzHotkey string `json:"AuthzHotkey"` + P2PDiagnostic bool `json:"P2PDiagnostic"` + ConfigUpdateTicker uint64 `json:"ConfigUpdateTicker"` + P2PDiagnosticTicker uint64 `json:"P2PDiagnosticTicker"` + TssPath string `json:"TssPath"` + TestTssKeysign bool `json:"TestTssKeysign"` + CurrentTssPubkey string `json:"CurrentTssPubkey"` + KeyringBackend KeyringBackend `json:"KeyringBackend"` // chain specific fields are updatable at runtime and shared across threads cfgLock *sync.RWMutex `json:"-"` @@ -137,8 +148,22 @@ func (c *Config) GetBTCConfig() (common.Chain, BTCConfig, bool) { return *chain, *c.BitcoinConfig, true } -// This is the ONLY function that writes to core params -func (c *Config) UpdateCoreParams(keygen *observertypes.Keygen, newChains []common.Chain, evmCoreParams map[int64]*observertypes.CoreParams, btcCoreParams *observertypes.CoreParams, init bool, logger zerolog.Logger) { +func (c *Config) GetKeyringBackend() KeyringBackend { + c.cfgLock.RLock() + defer c.cfgLock.RUnlock() + return c.KeyringBackend +} + +// UpdateCoreParams updates core params for all chains +// this must be the ONLY function that writes to core params +func (c *Config) UpdateCoreParams( + keygen *observertypes.Keygen, + newChains []common.Chain, + evmCoreParams map[int64]*observertypes.CoreParams, + btcCoreParams *observertypes.CoreParams, + init bool, + logger zerolog.Logger, +) { c.cfgLock.Lock() defer c.cfgLock.Unlock() @@ -194,6 +219,7 @@ func (c *Config) Clone() *Config { P2PDiagnosticTicker: c.P2PDiagnosticTicker, TssPath: c.TssPath, TestTssKeysign: c.TestTssKeysign, + KeyringBackend: c.KeyringBackend, cfgLock: &sync.RWMutex{}, Keygen: c.GetKeygen(), diff --git a/zetaclient/keys.go b/zetaclient/keys.go index af45452275..06289d7c72 100644 --- a/zetaclient/keys.go +++ b/zetaclient/keys.go @@ -2,6 +2,7 @@ package zetaclient import ( "bytes" + "errors" "fmt" "io" "os" @@ -19,19 +20,20 @@ import ( "github.com/zeta-chain/zetacore/zetaclient/config" ) +// HotkeyPasswordEnvVar is the environment variable used to retrieve the password for the hotkey +const HotkeyPasswordEnvVar = "HOTKEY_PASSWORD" + // Keys manages all the keys used by zeta client type Keys struct { signerName string - password string // TODO this is a bad way , need to fix it kb ckeys.Keyring OperatorAddress sdk.AccAddress } // NewKeysWithKeybase create a new instance of Keys -func NewKeysWithKeybase(kb ckeys.Keyring, granterAddress sdk.AccAddress, granteeName, password string) *Keys { +func NewKeysWithKeybase(kb ckeys.Keyring, granterAddress sdk.AccAddress, granteeName string) *Keys { return &Keys{ signerName: granteeName, - password: password, kb: kb, OperatorAddress: granterAddress, } @@ -45,54 +47,66 @@ func GetGranteeKeyName(signerName string) string { func GetKeyringKeybase(cfg *config.Config) (ckeys.Keyring, string, error) { granteeName := cfg.AuthzHotkey chainHomeFolder := cfg.ZetaCoreHome - password := cfg.SignerPass logger := log.Logger.With().Str("module", "GetKeyringKeybase").Logger() if len(granteeName) == 0 { return nil, "", fmt.Errorf("signer name is empty") } - if len(password) == 0 { - return nil, "", fmt.Errorf("password is empty") + + // read password from env if using keyring backend file + buf := bytes.NewBufferString("") + if cfg.KeyringBackend == config.KeyringBackendFile { + password, err := getHotkeyPassword() + if err != nil { + return nil, "", err + } + buf.WriteString(password) + buf.WriteByte('\n') // the library used by keyring is using ReadLine , which expect a new line + buf.WriteString(password) + buf.WriteByte('\n') } - buf := bytes.NewBufferString(password) - // the library used by keyring is using ReadLine , which expect a new line - buf.WriteByte('\n') - buf.WriteString(password) - buf.WriteByte('\n') - kb, err := getKeybase(chainHomeFolder, buf) + kb, err := getKeybase(chainHomeFolder, buf, cfg.KeyringBackend) if err != nil { return nil, "", fmt.Errorf("fail to get keybase,err:%w", err) } + oldStdIn := os.Stdin defer func() { os.Stdin = oldStdIn }() os.Stdin = nil + logger.Debug().Msgf("Checking for Hotkey Key: %s \nFolder %s\nBackend %s", granteeName, chainHomeFolder, kb.Backend()) rc, err := kb.Key(granteeName) if err != nil { - return nil, "", fmt.Errorf("key not presnt with name (%s): %w", granteeName, err) + return nil, "", fmt.Errorf("key not in backend %s present with name (%s): %w", kb.Backend(), granteeName, err) } + pubkeyBech32, err := common.GetPubkeyBech32FromRecord(rc) if err != nil { return nil, "", fmt.Errorf("fail to get pubkey from record,err:%w", err) } + return kb, pubkeyBech32, nil } // getKeybase will create an instance of Keybase -func getKeybase(zetaCoreHome string, reader io.Reader) (ckeys.Keyring, error) { +func getKeybase(zetaCoreHome string, reader io.Reader, keyringBackend config.KeyringBackend) (ckeys.Keyring, error) { cliDir := zetaCoreHome if len(zetaCoreHome) == 0 { return nil, fmt.Errorf("zetaCoreHome is empty") } - //FIXME: BackendTest is used for convenient testing with Starport generated accouts. - // Change to BackendFile with password! - registry := codectypes.NewInterfaceRegistry() cryptocodec.RegisterInterfaces(registry) cdc := codec.NewProtoCodec(registry) - return ckeys.New(sdk.KeyringServiceName(), ckeys.BackendTest, cliDir, reader, cdc) + + // create a new keybase based on the selected backend + backend := ckeys.BackendTest + if keyringBackend == config.KeyringBackendFile { + backend = ckeys.BackendFile + } + + return ckeys.New(sdk.KeyringServiceName(), backend, cliDir, reader, cdc) } // GetSignerInfo return signer info @@ -124,13 +138,17 @@ func (k *Keys) GetAddress() sdk.AccAddress { // GetPrivateKey return the private key func (k *Keys) GetPrivateKey() (cryptotypes.PrivKey, error) { - // return k.kb.ExportPrivateKeyObject(k.signerName) + password, err := k.GetHotkeyPassword() + if err != nil { + return nil, err + } + signer := GetGranteeKeyName(k.signerName) - privKeyArmor, err := k.kb.ExportPrivKeyArmor(signer, k.password) + privKeyArmor, err := k.kb.ExportPrivKeyArmor(signer, password) if err != nil { return nil, err } - priKey, _, err := crypto.UnarmorDecryptPrivKey(privKeyArmor, k.password) + priKey, _, err := crypto.UnarmorDecryptPrivKey(privKeyArmor, password) if err != nil { return nil, fmt.Errorf("fail to unarmor private key: %w", err) } @@ -164,3 +182,28 @@ func (k *Keys) GetPubKeySet() (common.PubKeySet, error) { pubkeySet.Secp256k1 = pubkey return pubkeySet, nil } + +// GetHotkeyPassword returns the password to be used +// returns empty if no password is needed +func (k *Keys) GetHotkeyPassword() (string, error) { + if k.GetKeybase().Backend() == ckeys.BackendFile { + return getHotkeyPassword() + } + return "", nil +} + +// getHotkeyPassword retrieves the HOTKEY_PASSWORD environment variable +// and returns an error if it's not defined or shorter than 8 characters. +func getHotkeyPassword() (string, error) { + password := os.Getenv(HotkeyPasswordEnvVar) + + if password == "" { + return "", errors.New("HOTKEY_PASSWORD environment variable is not defined, use --keyring-backend-test to use the test keyring") + } + + if len(password) < 8 { + return "", errors.New("HOTKEY_PASSWORD should be at least 8 characters long") + } + + return password, nil +} diff --git a/zetaclient/keys_test.go b/zetaclient/keys_test.go index c9b1584614..a2bd2fdcd5 100644 --- a/zetaclient/keys_test.go +++ b/zetaclient/keys_test.go @@ -79,7 +79,6 @@ func (ks *KeysSuite) TestGetKeyringKeybase(c *C) { cfg := &config.Config{ AuthzHotkey: "bob", ZetaCoreHome: "/Users/test/.zetacored/", - SignerPass: "", } _, _, err := GetKeyringKeybase(cfg) c.Assert(err, NotNil) @@ -100,14 +99,13 @@ func (ks *KeysSuite) TestNewKeys(c *C) { cfg := &config.Config{ AuthzHotkey: signerNameForTest, ZetaCoreHome: folder, - SignerPass: signerPasswordForTest, } k, _, err := GetKeyringKeybase(cfg) c.Assert(err, IsNil) c.Assert(k, NotNil) granter := cosmos.AccAddress(crypto.AddressHash([]byte("granter"))) - ki := NewKeysWithKeybase(k, granter, signerNameForTest, signerPasswordForTest) + ki := NewKeysWithKeybase(k, granter, signerNameForTest) kInfo := ki.GetSignerInfo() c.Assert(kInfo, NotNil) //c.Assert(kInfo.G, Equals, signerNameForTest) diff --git a/zetaclient/zetacore_bridge.go b/zetaclient/zetacore_bridge.go index a5af9285c1..682ff6a633 100644 --- a/zetaclient/zetacore_bridge.go +++ b/zetaclient/zetacore_bridge.go @@ -114,13 +114,20 @@ func (b *ZetaCoreBridge) Stop() { // GetAccountNumberAndSequenceNumber We do not use multiple KeyType for now , but this can be optionally used in the future to seprate TSS signer from Zetaclient GRantee func (b *ZetaCoreBridge) GetAccountNumberAndSequenceNumber(_ common.KeyType) (uint64, uint64, error) { - ctx := b.GetContext() + ctx, err := b.GetContext() + if err != nil { + return 0, 0, err + } address := b.keys.GetAddress() return ctx.AccountRetriever.GetAccountNumberSequence(ctx, address) } func (b *ZetaCoreBridge) SetAccountNumber(keyType common.KeyType) { - ctx := b.GetContext() + ctx, err := b.GetContext() + if err != nil { + b.logger.Error().Err(err).Msg("fail to get context") + return + } address := b.keys.GetAddress() accN, seq, err := ctx.AccountRetriever.GetAccountNumberSequence(ctx, address) if err != nil { @@ -176,15 +183,15 @@ func (b *ZetaCoreBridge) UpdateConfigFromCore(cfg *config.Config, init bool) err var newBTCParams *observertypes.CoreParams // check and update core params for each chain - for _, params := range coreParams { - err := config.ValidateCoreParams(params) + for _, coreParam := range coreParams { + err := config.ValidateCoreParams(coreParam) if err != nil { - b.logger.Debug().Err(err).Msgf("Invalid core params for chain %s", common.GetChainFromChainID(params.ChainId).ChainName) + b.logger.Debug().Err(err).Msgf("Invalid core params for chain %s", common.GetChainFromChainID(coreParam.ChainId).ChainName) } - if common.IsBitcoinChain(params.ChainId) { - newBTCParams = params + if common.IsBitcoinChain(coreParam.ChainId) { + newBTCParams = coreParam } else { - newEVMParams[params.ChainId] = params + newEVMParams[coreParam.ChainId] = coreParam } }