diff --git a/app/ante/ante.go b/app/ante/ante.go index 54f5ac6f5a..ef38309429 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -172,7 +172,7 @@ func IsSystemTx(tx sdk.Tx, isAuthorizedSigner func(string) bool) bool { *cctxtypes.MsgVoteOnObservedInboundTx, *cctxtypes.MsgVoteOnObservedOutboundTx, *cctxtypes.MsgAddToOutTxTracker, - *cctxtypes.MsgCreateTSSVoter, + *observertypes.MsgVoteTSS, *observertypes.MsgAddBlockHeader, *observertypes.MsgAddBlameVote: signers := innerMsg.GetSigners() diff --git a/app/ante/ante_test.go b/app/ante/ante_test.go index 146e50c6ae..f013784285 100644 --- a/app/ante/ante_test.go +++ b/app/ante/ante_test.go @@ -36,7 +36,7 @@ func TestIsSystemTx(t *testing.T) { // *cctxtypes.MsgVoteOnObservedInboundTx, // *cctxtypes.MsgVoteOnObservedOutboundTx, // *cctxtypes.MsgAddToOutTxTracker, - // *cctxtypes.MsgCreateTSSVoter, + // *observertypes.MsgVoteTSS, // *observertypes.MsgAddBlockHeader, // *observertypes.MsgAddBlameVote: buildTxFromMsg := func(msg sdk.Msg) sdk.Tx { @@ -64,8 +64,8 @@ func TestIsSystemTx(t *testing.T) { wantIs bool }{ { - "MsgCreateTSSVoter", - buildTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{ + "MsgVoteTSS", + buildTxFromMsg(&observertypes.MsgVoteTSS{ Creator: sample.AccAddress(), TssPubkey: "pubkey1234", }), @@ -73,8 +73,8 @@ func TestIsSystemTx(t *testing.T) { false, }, { - "MsgCreateTSSVoter", - buildTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{ + "MsgVoteTSS", + buildTxFromMsg(&observertypes.MsgVoteTSS{ Creator: sample.AccAddress(), TssPubkey: "pubkey1234", }), @@ -82,8 +82,8 @@ func TestIsSystemTx(t *testing.T) { true, }, { - "MsgExec{MsgCreateTSSVoter}", - buildAuthzTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{ + "MsgExec{MsgVoteTSS}", + buildAuthzTxFromMsg(&observertypes.MsgVoteTSS{ Creator: sample.AccAddress(), TssPubkey: "pubkey1234", }), @@ -169,8 +169,8 @@ func TestIsSystemTx(t *testing.T) { true, }, { - "MsgCreateTSSVoter", - buildTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{ + "MsgVoteTSS", + buildTxFromMsg(&observertypes.MsgVoteTSS{ Creator: sample.AccAddress(), }), isAuthorized, @@ -178,8 +178,8 @@ func TestIsSystemTx(t *testing.T) { true, }, { - "MsgExec{MsgCreateTSSVoter}", - buildAuthzTxFromMsg(&crosschaintypes.MsgCreateTSSVoter{ + "MsgExec{MsgVoteTSS}", + buildAuthzTxFromMsg(&observertypes.MsgVoteTSS{ Creator: sample.AccAddress(), }), isAuthorized, diff --git a/changelog.md b/changelog.md index 04181421f9..055e9f9283 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,9 @@ * The `Policies` query of the `authority` module must be used to get the current admin policies. * `PolicyType_group1` has been renamed into `PolicyType_groupEmergency` and `PolicyType_group2` has been renamed into `PolicyType_groupAdmin`. +* `MsgCreateTSSVoter` message in the `crosschain` module has been moved to the `observer` module and renamed to `MsgVoteTSS`. + * The structure of the message remains the same. + ### Refactor * [1511](https://github.com/zeta-chain/node/pull/1511) - move ballot voting logic from `crosschain` to `observer` @@ -21,9 +24,9 @@ * [1914](https://github.com/zeta-chain/node/pull/1914) - move crosschain flags to core context in zetaclient * [1948](https://github.com/zeta-chain/node/pull/1948) - remove deprecated GetTSSAddress query in crosschain module * [1936](https://github.com/zeta-chain/node/pull/1936) - refactor common package into subpackages and rename to pkg +* [1966](https://github.com/zeta-chain/node/pull/1966) - move TSS vote message from crosschain to observer * [1853](https://github.com/zeta-chain/node/pull/1853) - refactor vote inbound tx and vote outbound tx - ### Features * [1789](https://github.com/zeta-chain/node/issues/1789) - block cross-chain transactions that involve restricted addresses diff --git a/cmd/zetaclientd/debug.go b/cmd/zetaclientd/debug.go index 76450875cb..32cb32c772 100644 --- a/cmd/zetaclientd/debug.go +++ b/cmd/zetaclientd/debug.go @@ -8,25 +8,24 @@ import ( "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/onrik/ethrpc" + "github.com/rs/zerolog" + "github.com/spf13/cobra" "github.com/zeta-chain/zetacore/pkg/chains" "github.com/zeta-chain/zetacore/pkg/coin" + "github.com/zeta-chain/zetacore/testutil/sample" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" "github.com/zeta-chain/zetacore/zetaclient/bitcoin" + "github.com/zeta-chain/zetacore/zetaclient/config" corecontext "github.com/zeta-chain/zetacore/zetaclient/core_context" "github.com/zeta-chain/zetacore/zetaclient/evm" "github.com/zeta-chain/zetacore/zetaclient/keys" "github.com/zeta-chain/zetacore/zetaclient/metrics" "github.com/zeta-chain/zetacore/zetaclient/zetabridge" - - "github.com/btcsuite/btcd/rpcclient" - sdk "github.com/cosmos/cosmos-sdk/types" - ethcommon "github.com/ethereum/go-ethereum/common" - "github.com/rs/zerolog" - "github.com/spf13/cobra" - "github.com/zeta-chain/zetacore/testutil/sample" - observertypes "github.com/zeta-chain/zetacore/x/observer/types" - "github.com/zeta-chain/zetacore/zetaclient/config" ) var debugArgs = debugArguments{} diff --git a/codecov.yml b/codecov.yml index 93d974911b..1a9ba2063d 100644 --- a/codecov.yml +++ b/codecov.yml @@ -38,7 +38,7 @@ flags: - "common/" ignore: - - "x/**/client/" + - "x/**/client/**/*" - "x/**/keeper/keeper.go" - "x/**/keeper/msg_server.go" - "x/**/keeper/grpc_query_params.go" @@ -50,7 +50,7 @@ ignore: - "x/**/types/expected_keepers.go" - "x/**/module.go" - "x/**/module_simulation.go" - - "x/**/simulation/" + - "x/**/simulation/**/*" - "**/*.proto" - "**/*.md" - "**/*.yml" @@ -58,16 +58,16 @@ ignore: - "**/*.pb.go" - "**/*.pb.gw.go" - "**/*.json" - - ".github/" - - "app/" - - "cmd/" - - "contrib/" - - "docs/" - - "rpc/" - - "proto/" - - "scripts/" - - "server/" - - "testutil/" - - "testutils/" - - "errors/" - - "typescript/" \ No newline at end of file + - ".github/**/*" + - "app/**/*" + - "cmd/**/*" + - "contrib/**/*" + - "docs/**/*" + - "rpc/**/*" + - "proto/**/*" + - "scripts/**/*" + - "server/**/*" + - "testutil/**/*" + - "testutils/**/*" + - "errors/**/*" + - "typescript/**/*" \ No newline at end of file diff --git a/docs/cli/zetacored/zetacored_tx_crosschain.md b/docs/cli/zetacored/zetacored_tx_crosschain.md index 5e61146b17..40582875aa 100644 --- a/docs/cli/zetacored/zetacored_tx_crosschain.md +++ b/docs/cli/zetacored/zetacored_tx_crosschain.md @@ -29,7 +29,6 @@ zetacored tx crosschain [flags] * [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 diff --git a/docs/cli/zetacored/zetacored_tx_observer.md b/docs/cli/zetacored/zetacored_tx_observer.md index de1145c512..ec0e245fe0 100644 --- a/docs/cli/zetacored/zetacored_tx_observer.md +++ b/docs/cli/zetacored/zetacored_tx_observer.md @@ -34,4 +34,5 @@ zetacored tx observer [flags] * [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 * [zetacored tx observer update-observer](zetacored_tx_observer_update-observer.md) - Broadcast message add-observer +* [zetacored tx observer vote-tss](zetacored_tx_observer_vote-tss.md) - Vote for a new TSS creation diff --git a/docs/cli/zetacored/zetacored_tx_crosschain_create-tss-voter.md b/docs/cli/zetacored/zetacored_tx_observer_vote-tss.md similarity index 91% rename from docs/cli/zetacored/zetacored_tx_crosschain_create-tss-voter.md rename to docs/cli/zetacored/zetacored_tx_observer_vote-tss.md index b6932a3cd8..388c8c3793 100644 --- a/docs/cli/zetacored/zetacored_tx_crosschain_create-tss-voter.md +++ b/docs/cli/zetacored/zetacored_tx_observer_vote-tss.md @@ -1,9 +1,9 @@ -# tx crosschain create-tss-voter +# tx observer vote-tss -Create a new TSSVoter +Vote for a new TSS creation ``` -zetacored tx crosschain create-tss-voter [pubkey] [keygenBlock] [status] [flags] +zetacored tx observer vote-tss [pubkey] [keygen-block] [status] [flags] ``` ### Options @@ -21,7 +21,7 @@ zetacored tx crosschain create-tss-voter [pubkey] [keygenBlock] [status] [flags] --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 + -h, --help help for vote-tss --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 @@ -48,5 +48,5 @@ zetacored tx crosschain create-tss-voter [pubkey] [keygenBlock] [status] [flags] ### SEE ALSO -* [zetacored tx crosschain](zetacored_tx_crosschain.md) - crosschain transactions subcommands +* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands diff --git a/docs/openapi/openapi.swagger.yaml b/docs/openapi/openapi.swagger.yaml index 1c59768854..2dd9812b64 100644 --- a/docs/openapi/openapi.swagger.yaml +++ b/docs/openapi/openapi.swagger.yaml @@ -53701,8 +53701,6 @@ definitions: is_removed: type: boolean title: if the tx was removed from the tracker due to no pending cctx - crosschainMsgCreateTSSVoterResponse: - type: object crosschainMsgGasPriceVoterResponse: type: object crosschainMsgMigrateTssFundsResponse: @@ -54324,6 +54322,15 @@ definitions: type: object observerMsgUpdateObserverResponse: type: object + observerMsgVoteTSSResponse: + type: object + properties: + ballot_created: + type: boolean + vote_finalized: + type: boolean + keygen_success: + type: boolean observerNode: type: object properties: diff --git a/docs/spec/crosschain/messages.md b/docs/spec/crosschain/messages.md index 506ca0f94c..e64f4bb99a 100644 --- a/docs/spec/crosschain/messages.md +++ b/docs/spec/crosschain/messages.md @@ -236,28 +236,6 @@ message MsgMigrateTssFunds { } ``` -## MsgCreateTSSVoter - -CreateTSSVoter votes on creating a TSS key and recording the information about it (public -key, participant and operator addresses, finalized and keygen heights). - -If the vote passes, the information about the TSS key is recorded on chain -and the status of the keygen is set to "success". - -Fails if the keygen does not exist, the keygen has been already -completed, or the keygen has failed. - -Only node accounts are authorized to broadcast this message. - -```proto -message MsgCreateTSSVoter { - string creator = 1; - string tss_pubkey = 2; - int64 keyGenZetaHeight = 3; - chains.ReceiveStatus status = 4; -} -``` - ## MsgAbortStuckCCTX AbortStuckCCTX aborts a stuck CCTX diff --git a/docs/spec/crosschain/overview.md b/docs/spec/crosschain/overview.md index 32e1035e41..e2c1780922 100644 --- a/docs/spec/crosschain/overview.md +++ b/docs/spec/crosschain/overview.md @@ -69,8 +69,8 @@ status is changed to final. ## Permissions | Message | Admin policy account | Observer validator | -| --------------------------- | -------------------- | ------------------ | -| MsgCreateTSSVoter | | ✅ | +|-----------------------------| -------------------- | ------------------ | +| MsgVoteTSS | | ✅ | | MsgGasPriceVoter | | ✅ | | MsgVoteOnObservedOutboundTx | | ✅ | | MsgVoteOnObservedInboundTx | | ✅ | diff --git a/docs/spec/observer/messages.md b/docs/spec/observer/messages.md index c2a6039dbe..82c6423757 100644 --- a/docs/spec/observer/messages.md +++ b/docs/spec/observer/messages.md @@ -122,3 +122,25 @@ message MsgResetChainNonces { } ``` +## MsgVoteTSS + +VoteTSS votes on creating a TSS key and recording the information about it (public +key, participant and operator addresses, finalized and keygen heights). + +If the vote passes, the information about the TSS key is recorded on chain +and the status of the keygen is set to "success". + +Fails if the keygen does not exist, the keygen has been already +completed, or the keygen has failed. + +Only node accounts are authorized to broadcast this message. + +```proto +message MsgVoteTSS { + string creator = 1; + string tss_pubkey = 2; + int64 keygen_zeta_height = 3; + chains.ReceiveStatus status = 4; +} +``` + diff --git a/pkg/chains/status.go b/pkg/chains/status.go new file mode 100644 index 0000000000..25140267f7 --- /dev/null +++ b/pkg/chains/status.go @@ -0,0 +1,18 @@ +package chains + +import "errors" + +// ReceiveStatusFromString returns a ReceiveStatus from a string using in CLI +// 0 for success, 1 for failed +// TODO: remove "receive" naming ans use outbound +// https://github.com/zeta-chain/node/issues/1797 +func ReceiveStatusFromString(str string) (ReceiveStatus, error) { + switch str { + case "0": + return ReceiveStatus_Success, nil + case "1": + return ReceiveStatus_Failed, nil + default: + return ReceiveStatus(0), errors.New("wrong status, must be 0 for success or 1 for failed") + } +} diff --git a/pkg/chains/status_test.go b/pkg/chains/status_test.go new file mode 100644 index 0000000000..65f5e7e319 --- /dev/null +++ b/pkg/chains/status_test.go @@ -0,0 +1,47 @@ +package chains_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/pkg/chains" +) + +func TestReceiveStatusFromString(t *testing.T) { + tests := []struct { + name string + str string + want chains.ReceiveStatus + wantErr bool + }{ + { + name: "success", + str: "0", + want: chains.ReceiveStatus_Success, + wantErr: false, + }, + { + name: "failed", + str: "1", + want: chains.ReceiveStatus_Failed, + wantErr: false, + }, + { + name: "wrong status", + str: "2", + want: chains.ReceiveStatus(0), + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := chains.ReceiveStatusFromString(tt.str) + if tt.wantErr { + require.Error(t, err) + } else if got != tt.want { + require.NoError(t, err) + require.Equal(t, tt.want, got) + } + }) + } +} diff --git a/proto/crosschain/tx.proto b/proto/crosschain/tx.proto index d6e4fc093b..7e668d6325 100644 --- a/proto/crosschain/tx.proto +++ b/proto/crosschain/tx.proto @@ -20,21 +20,11 @@ service Msg { rpc WhitelistERC20(MsgWhitelistERC20) returns (MsgWhitelistERC20Response); rpc UpdateTssAddress(MsgUpdateTssAddress) returns (MsgUpdateTssAddressResponse); rpc MigrateTssFunds(MsgMigrateTssFunds) returns (MsgMigrateTssFundsResponse); - rpc CreateTSSVoter(MsgCreateTSSVoter) returns (MsgCreateTSSVoterResponse); rpc AbortStuckCCTX(MsgAbortStuckCCTX) returns (MsgAbortStuckCCTXResponse); rpc RefundAbortedCCTX(MsgRefundAbortedCCTX) returns (MsgRefundAbortedCCTXResponse); } -message MsgCreateTSSVoter { - string creator = 1; - string tss_pubkey = 2; - int64 keyGenZetaHeight = 3; - chains.ReceiveStatus status = 4; -} - -message MsgCreateTSSVoterResponse {} - message MsgMigrateTssFunds { string creator = 1; int64 chain_id = 2; @@ -43,6 +33,7 @@ message MsgMigrateTssFunds { (gogoproto.nullable) = false ]; } + message MsgMigrateTssFundsResponse {} message MsgUpdateTssAddress { diff --git a/proto/observer/tx.proto b/proto/observer/tx.proto index 8245827f16..f6b9424b97 100644 --- a/proto/observer/tx.proto +++ b/proto/observer/tx.proto @@ -8,6 +8,7 @@ import "observer/observer.proto"; import "observer/params.proto"; import "observer/pending_nonces.proto"; import "observer/tss.proto"; +import "pkg/chains/chains.proto"; import "pkg/proofs/proofs.proto"; option go_package = "github.com/zeta-chain/zetacore/x/observer/types"; @@ -23,6 +24,7 @@ service Msg { rpc UpdateKeygen(MsgUpdateKeygen) returns (MsgUpdateKeygenResponse); rpc AddBlockHeader(MsgAddBlockHeader) returns (MsgAddBlockHeaderResponse); rpc ResetChainNonces(MsgResetChainNonces) returns (MsgResetChainNoncesResponse); + rpc VoteTSS(MsgVoteTSS) returns (MsgVoteTSSResponse); } message MsgUpdateObserver { @@ -98,3 +100,16 @@ message MsgResetChainNonces { } message MsgResetChainNoncesResponse {} + +message MsgVoteTSS { + string creator = 1; + string tss_pubkey = 2; + int64 keygen_zeta_height = 3; + chains.ReceiveStatus status = 4; +} + +message MsgVoteTSSResponse { + bool ballot_created = 1; + bool vote_finalized = 2; + bool keygen_success = 3; +} diff --git a/testutil/sample/observer.go b/testutil/sample/observer.go index c90036ff07..7d9d54c646 100644 --- a/testutil/sample/observer.go +++ b/testutil/sample/observer.go @@ -41,10 +41,8 @@ func ObserverSet(n int) types.ObserverSet { } func NodeAccount() *types.NodeAccount { - operator := AccAddress() - return &types.NodeAccount{ - Operator: operator, + Operator: AccAddress(), GranteeAddress: AccAddress(), GranteePubkey: PubKeySet(), NodeStatus: types.NodeStatus_Active, diff --git a/typescript/crosschain/tx_pb.d.ts b/typescript/crosschain/tx_pb.d.ts index b1900d7c66..eec35c2dc8 100644 --- a/typescript/crosschain/tx_pb.d.ts +++ b/typescript/crosschain/tx_pb.d.ts @@ -5,67 +5,9 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3 } from "@bufbuild/protobuf"; -import type { ReceiveStatus } from "../pkg/chains/chains_pb.js"; import type { CoinType } from "../pkg/coin/coin_pb.js"; import type { Proof } from "../pkg/proofs/proofs_pb.js"; - -/** - * @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: chains.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; -} +import type { ReceiveStatus } from "../pkg/chains/chains_pb.js"; /** * @generated from message zetachain.zetacore.crosschain.MsgMigrateTssFunds diff --git a/typescript/observer/tx_pb.d.ts b/typescript/observer/tx_pb.d.ts index 4418e5569e..21fe737462 100644 --- a/typescript/observer/tx_pb.d.ts +++ b/typescript/observer/tx_pb.d.ts @@ -10,6 +10,7 @@ import type { HeaderData } from "../pkg/proofs/proofs_pb.js"; import type { ChainParams } from "./params_pb.js"; import type { Blame } from "./blame_pb.js"; import type { BlockHeaderVerificationFlags, GasPriceIncreaseFlags } from "./crosschain_flags_pb.js"; +import type { ReceiveStatus } from "../pkg/chains/chains_pb.js"; /** * @generated from message zetachain.zetacore.observer.MsgUpdateObserver @@ -508,3 +509,76 @@ export declare class MsgResetChainNoncesResponse extends Message | undefined, b: MsgResetChainNoncesResponse | PlainMessage | undefined): boolean; } +/** + * @generated from message zetachain.zetacore.observer.MsgVoteTSS + */ +export declare class MsgVoteTSS extends Message { + /** + * @generated from field: string creator = 1; + */ + creator: string; + + /** + * @generated from field: string tss_pubkey = 2; + */ + tssPubkey: string; + + /** + * @generated from field: int64 keygen_zeta_height = 3; + */ + keygenZetaHeight: bigint; + + /** + * @generated from field: chains.ReceiveStatus status = 4; + */ + status: ReceiveStatus; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgVoteTSS"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteTSS; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteTSS; + + static fromJsonString(jsonString: string, options?: Partial): MsgVoteTSS; + + static equals(a: MsgVoteTSS | PlainMessage | undefined, b: MsgVoteTSS | PlainMessage | undefined): boolean; +} + +/** + * @generated from message zetachain.zetacore.observer.MsgVoteTSSResponse + */ +export declare class MsgVoteTSSResponse extends Message { + /** + * @generated from field: bool ballot_created = 1; + */ + ballotCreated: boolean; + + /** + * @generated from field: bool vote_finalized = 2; + */ + voteFinalized: boolean; + + /** + * @generated from field: bool keygen_success = 3; + */ + keygenSuccess: boolean; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "zetachain.zetacore.observer.MsgVoteTSSResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): MsgVoteTSSResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): MsgVoteTSSResponse; + + static fromJsonString(jsonString: string, options?: Partial): MsgVoteTSSResponse; + + static equals(a: MsgVoteTSSResponse | PlainMessage | undefined, b: MsgVoteTSSResponse | PlainMessage | undefined): boolean; +} + diff --git a/x/crosschain/client/cli/cli_cctx.go b/x/crosschain/client/cli/cli_cctx.go index 92fed899d3..87991442d1 100644 --- a/x/crosschain/client/cli/cli_cctx.go +++ b/x/crosschain/client/cli/cli_cctx.go @@ -225,13 +225,9 @@ func CmdCCTXOutboundVoter() *cobra.Command { argsMMint := args[6] - var status chains.ReceiveStatus - if args[7] == "0" { - status = chains.ReceiveStatus_Success - } else if args[7] == "1" { - status = chains.ReceiveStatus_Failed - } else { - return fmt.Errorf("wrong status") + status, err := chains.ReceiveStatusFromString(args[7]) + if err != nil { + return err } chain, err := strconv.ParseInt(args[8], 10, 64) diff --git a/x/crosschain/client/cli/cli_tss.go b/x/crosschain/client/cli/cli_tss.go index 7c85ea8b72..9b9d551ca8 100644 --- a/x/crosschain/client/cli/cli_tss.go +++ b/x/crosschain/client/cli/cli_tss.go @@ -1,7 +1,6 @@ package cli import ( - "fmt" "strconv" "cosmossdk.io/math" @@ -10,49 +9,9 @@ import ( "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cast" "github.com/spf13/cobra" - "github.com/zeta-chain/zetacore/pkg/chains" "github.com/zeta-chain/zetacore/x/crosschain/types" ) -func CmdCreateTSSVoter() *cobra.Command { - cmd := &cobra.Command{ - Use: "create-tss-voter [pubkey] [keygenBlock] [status]", - Short: "Create a new TSSVoter", - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - - argsPubkey, err := cast.ToStringE(args[0]) - if err != nil { - return err - } - keygenBlock, err := strconv.ParseInt(args[1], 10, 64) - if err != nil { - return err - } - var status chains.ReceiveStatus - if args[2] == "0" { - status = chains.ReceiveStatus_Success - } else if args[2] == "1" { - status = chains.ReceiveStatus_Failed - } else { - return fmt.Errorf("wrong status") - } - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgCreateTSSVoter(clientCtx.GetFromAddress().String(), argsPubkey, keygenBlock, status) - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - func CmdUpdateTss() *cobra.Command { cmd := &cobra.Command{ Use: "update-tss-address [pubkey]", diff --git a/x/crosschain/client/cli/tx.go b/x/crosschain/client/cli/tx.go index bb9831fb31..c82c55f8fd 100644 --- a/x/crosschain/client/cli/tx.go +++ b/x/crosschain/client/cli/tx.go @@ -22,7 +22,6 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand( CmdAddToWatchList(), - CmdCreateTSSVoter(), CmdGasPriceVoter(), CmdCCTXOutboundVoter(), CmdCCTXInboundVoter(), diff --git a/x/crosschain/keeper/msg_server_tss_voter.go b/x/crosschain/keeper/msg_server_tss_voter.go deleted file mode 100644 index a3782729b1..0000000000 --- a/x/crosschain/keeper/msg_server_tss_voter.go +++ /dev/null @@ -1,120 +0,0 @@ -package keeper - -import ( - "context" - "fmt" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - math2 "github.com/ethereum/go-ethereum/common/math" - "github.com/zeta-chain/zetacore/pkg/chains" - "github.com/zeta-chain/zetacore/x/crosschain/types" - "github.com/zeta-chain/zetacore/x/observer/keeper" - observertypes "github.com/zeta-chain/zetacore/x/observer/types" -) - -// MESSAGES - -// CreateTSSVoter votes on creating a TSS key and recording the information about it (public -// key, participant and operator addresses, finalized and keygen heights). -// -// If the vote passes, the information about the TSS key is recorded on chain -// and the status of the keygen is set to "success". -// -// Fails if the keygen does not exist, the keygen has been already -// completed, or the keygen has failed. -// -// Only node accounts are authorized to broadcast this message. -func (k msgServer) CreateTSSVoter(goCtx context.Context, msg *types.MsgCreateTSSVoter) (*types.MsgCreateTSSVoterResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - if !k.IsAuthorizedNodeAccount(ctx, msg.Creator) { - return nil, errorsmod.Wrap(sdkerrors.ErrorInvalidSigner, fmt.Sprintf("signer %s does not have a node account set", msg.Creator)) - } - // No need to create a ballot if keygen does not exist - keygen, found := k.zetaObserverKeeper.GetKeygen(ctx) - if !found { - return &types.MsgCreateTSSVoterResponse{}, observertypes.ErrKeygenNotFound - } - // USE a separate transaction to update KEYGEN status to pending when trying to change the TSS address - if keygen.Status == observertypes.KeygenStatus_KeyGenSuccess { - return &types.MsgCreateTSSVoterResponse{}, observertypes.ErrKeygenCompleted - } - index := msg.Digest() - // Add votes and Set Ballot - // GetBallot checks against the supported chains list before querying for Ballot - // TODO : https://github.com/zeta-chain/node/issues/896 - ballot, found := k.zetaObserverKeeper.GetBallot(ctx, index) - if !found { - var voterList []string - - for _, nodeAccount := range k.zetaObserverKeeper.GetAllNodeAccount(ctx) { - voterList = append(voterList, nodeAccount.Operator) - } - ballot = observertypes.Ballot{ - Index: "", - BallotIdentifier: index, - VoterList: voterList, - Votes: observertypes.CreateVotes(len(voterList)), - ObservationType: observertypes.ObservationType_TSSKeyGen, - BallotThreshold: sdk.MustNewDecFromStr("1.00"), - BallotStatus: observertypes.BallotStatus_BallotInProgress, - BallotCreationHeight: ctx.BlockHeight(), - } - k.zetaObserverKeeper.AddBallotToList(ctx, ballot) - } - var err error - if msg.Status == chains.ReceiveStatus_Success { - ballot, err = k.zetaObserverKeeper.AddVoteToBallot(ctx, ballot, msg.Creator, observertypes.VoteType_SuccessObservation) - if err != nil { - return &types.MsgCreateTSSVoterResponse{}, err - } - } else if msg.Status == chains.ReceiveStatus_Failed { - ballot, err = k.zetaObserverKeeper.AddVoteToBallot(ctx, ballot, msg.Creator, observertypes.VoteType_FailureObservation) - if err != nil { - return &types.MsgCreateTSSVoterResponse{}, err - } - } - if !found { - keeper.EmitEventBallotCreated(ctx, ballot, msg.TssPubkey, "Common-TSS-For-All-Chain") - } - - ballot, isFinalized := k.zetaObserverKeeper.CheckIfFinalizingVote(ctx, ballot) - if !isFinalized { - // Return nil here to add vote to ballot and commit state - return &types.MsgCreateTSSVoterResponse{}, nil - } - // Set TSS only on success, set Keygen either way. - // Keygen block can be updated using a policy transaction if keygen fails - if ballot.BallotStatus != observertypes.BallotStatus_BallotFinalized_FailureObservation { - tss := observertypes.TSS{ - TssPubkey: msg.TssPubkey, - TssParticipantList: keygen.GetGranteePubkeys(), - OperatorAddressList: ballot.VoterList, - FinalizedZetaHeight: ctx.BlockHeight(), - KeyGenZetaHeight: msg.KeyGenZetaHeight, - } - // Set TSS history only, current TSS is updated via admin transaction - // In Case this is the first TSS address update both current and history - tssList := k.zetaObserverKeeper.GetAllTSS(ctx) - if len(tssList) == 0 { - k.GetObserverKeeper().SetTssAndUpdateNonce(ctx, tss) - } - k.zetaObserverKeeper.SetTSSHistory(ctx, tss) - keygen.Status = observertypes.KeygenStatus_KeyGenSuccess - keygen.BlockNumber = ctx.BlockHeight() - - } else if ballot.BallotStatus == observertypes.BallotStatus_BallotFinalized_FailureObservation { - keygen.Status = observertypes.KeygenStatus_KeyGenFailed - keygen.BlockNumber = math2.MaxInt64 - } - k.zetaObserverKeeper.SetKeygen(ctx, keygen) - return &types.MsgCreateTSSVoterResponse{}, nil -} - -// IsAuthorizedNodeAccount checks whether a signer is authorized to sign , by checking their address against the observer mapper which contains the observer list for the chain and type -func (k Keeper) IsAuthorizedNodeAccount(ctx sdk.Context, address string) bool { - _, found := k.zetaObserverKeeper.GetNodeAccount(ctx, address) - return found -} diff --git a/x/crosschain/types/authz.go b/x/crosschain/types/authz.go index 7733a34d7a..6ee58171ff 100644 --- a/x/crosschain/types/authz.go +++ b/x/crosschain/types/authz.go @@ -11,8 +11,8 @@ func GetAllAuthzZetaclientTxTypes() []string { sdk.MsgTypeURL(&MsgGasPriceVoter{}), sdk.MsgTypeURL(&MsgVoteOnObservedInboundTx{}), sdk.MsgTypeURL(&MsgVoteOnObservedOutboundTx{}), - sdk.MsgTypeURL(&MsgCreateTSSVoter{}), sdk.MsgTypeURL(&MsgAddToOutTxTracker{}), + sdk.MsgTypeURL(&observertypes.MsgVoteTSS{}), sdk.MsgTypeURL(&observertypes.MsgAddBlameVote{}), sdk.MsgTypeURL(&observertypes.MsgAddBlockHeader{}), } diff --git a/x/crosschain/types/authz_test.go b/x/crosschain/types/authz_test.go index 9846949636..7c615d7c6b 100644 --- a/x/crosschain/types/authz_test.go +++ b/x/crosschain/types/authz_test.go @@ -11,8 +11,8 @@ func TestGetAllAuthzZetaclientTxTypes(t *testing.T) { require.Equal(t, []string{"/zetachain.zetacore.crosschain.MsgGasPriceVoter", "/zetachain.zetacore.crosschain.MsgVoteOnObservedInboundTx", "/zetachain.zetacore.crosschain.MsgVoteOnObservedOutboundTx", - "/zetachain.zetacore.crosschain.MsgCreateTSSVoter", "/zetachain.zetacore.crosschain.MsgAddToOutTxTracker", + "/zetachain.zetacore.observer.MsgVoteTSS", "/zetachain.zetacore.observer.MsgAddBlameVote", "/zetachain.zetacore.observer.MsgAddBlockHeader"}, crosschaintypes.GetAllAuthzZetaclientTxTypes()) diff --git a/x/crosschain/types/codec.go b/x/crosschain/types/codec.go index fb3d51db0a..7fcbc0cc0c 100644 --- a/x/crosschain/types/codec.go +++ b/x/crosschain/types/codec.go @@ -11,7 +11,6 @@ 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(&MsgVoteOnObservedOutboundTx{}, "crosschain/VoteOnObservedOutboundTx", nil) cdc.RegisterConcrete(&MsgVoteOnObservedInboundTx{}, "crosschain/VoteOnObservedInboundTx", nil) @@ -26,7 +25,6 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgAddToOutTxTracker{}, &MsgAddToInTxTracker{}, &MsgRemoveFromOutTxTracker{}, - &MsgCreateTSSVoter{}, &MsgGasPriceVoter{}, &MsgVoteOnObservedOutboundTx{}, &MsgVoteOnObservedInboundTx{}, diff --git a/x/crosschain/types/message_tss_voter.go b/x/crosschain/types/message_tss_voter.go deleted file mode 100644 index dc9abc4ccb..0000000000 --- a/x/crosschain/types/message_tss_voter.go +++ /dev/null @@ -1,57 +0,0 @@ -package types - -import ( - "fmt" - - cosmoserrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/zeta-chain/zetacore/pkg/chains" -) - -const TypeMsgCreateTSSVoter = "CreateTSSVoter" - -var _ sdk.Msg = &MsgCreateTSSVoter{} - -func NewMsgCreateTSSVoter(creator string, pubkey string, keygenZetaHeight int64, status chains.ReceiveStatus) *MsgCreateTSSVoter { - return &MsgCreateTSSVoter{ - Creator: creator, - TssPubkey: pubkey, - KeyGenZetaHeight: keygenZetaHeight, - Status: status, - } -} - -func (msg *MsgCreateTSSVoter) Route() string { - return RouterKey -} - -func (msg *MsgCreateTSSVoter) Type() string { - return TypeMsgCreateTSSVoter -} - -func (msg *MsgCreateTSSVoter) GetSigners() []sdk.AccAddress { - creator, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - panic(err) - } - return []sdk.AccAddress{creator} -} - -func (msg *MsgCreateTSSVoter) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(msg) - return sdk.MustSortJSON(bz) -} - -func (msg *MsgCreateTSSVoter) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Creator) - if err != nil { - return cosmoserrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) - } - return nil -} - -func (msg *MsgCreateTSSVoter) Digest() string { - // We support only 1 keygen at a particular height - return fmt.Sprintf("%d-%s", msg.KeyGenZetaHeight, "tss-keygen") -} diff --git a/x/crosschain/types/message_tss_voter_test.go b/x/crosschain/types/message_tss_voter_test.go deleted file mode 100644 index 8c87c0e552..0000000000 --- a/x/crosschain/types/message_tss_voter_test.go +++ /dev/null @@ -1,97 +0,0 @@ -package types_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/stretchr/testify/require" - "github.com/zeta-chain/zetacore/pkg/chains" - "github.com/zeta-chain/zetacore/testutil/sample" - - "github.com/zeta-chain/zetacore/x/crosschain/types" -) - -func TestMsgCreateTSSVoter_ValidateBasic(t *testing.T) { - tests := []struct { - name string - msg *types.MsgCreateTSSVoter - err error - }{ - { - name: "valid message", - msg: types.NewMsgCreateTSSVoter(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Created), - }, - { - name: "invalid creator address", - msg: types.NewMsgCreateTSSVoter("invalid", "pubkey", 1, chains.ReceiveStatus_Created), - err: sdkerrors.ErrInvalidAddress, - }, - } - - 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) - } else { - require.NoError(t, err) - } - }) - } -} - -func TestMsgCreateTSSVoter_GetSigners(t *testing.T) { - signer := sample.AccAddress() - tests := []struct { - name string - msg *types.MsgCreateTSSVoter - panics bool - }{ - { - name: "valid signer", - msg: types.NewMsgCreateTSSVoter(signer, "pubkey", 1, chains.ReceiveStatus_Created), - panics: false, - }, - { - name: "invalid signer", - msg: types.NewMsgCreateTSSVoter("invalid", "pubkey", 1, chains.ReceiveStatus_Created), - panics: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if !tt.panics { - signers := tt.msg.GetSigners() - require.Equal(t, []sdk.AccAddress{sdk.MustAccAddressFromBech32(signer)}, signers) - } else { - require.Panics(t, func() { - tt.msg.GetSigners() - }) - } - }) - } -} - -func TestMsgCreateTSSVoter_Type(t *testing.T) { - msg := types.NewMsgCreateTSSVoter(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Created) - require.Equal(t, types.TypeMsgCreateTSSVoter, msg.Type()) -} - -func TestMsgCreateTSSVoter_Route(t *testing.T) { - msg := types.NewMsgCreateTSSVoter(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Created) - require.Equal(t, types.RouterKey, msg.Route()) -} - -func TestMsgCreateTSSVoter_GetSignBytes(t *testing.T) { - msg := types.NewMsgCreateTSSVoter(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Created) - require.NotPanics(t, func() { - msg.GetSignBytes() - }) -} - -func TestMsgCreateTSSVoter_Digest(t *testing.T) { - msg := types.NewMsgCreateTSSVoter(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Created) - require.Equal(t, "1-tss-keygen", msg.Digest()) -} diff --git a/x/crosschain/types/tx.pb.go b/x/crosschain/types/tx.pb.go index c8338b386b..076bcecaec 100644 --- a/x/crosschain/types/tx.pb.go +++ b/x/crosschain/types/tx.pb.go @@ -33,110 +33,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type MsgCreateTSSVoter 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"` - KeyGenZetaHeight int64 `protobuf:"varint,3,opt,name=keyGenZetaHeight,proto3" json:"keyGenZetaHeight,omitempty"` - Status chains.ReceiveStatus `protobuf:"varint,4,opt,name=status,proto3,enum=chains.ReceiveStatus" json:"status,omitempty"` -} - -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{0} -} -func (m *MsgCreateTSSVoter) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateTSSVoter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateTSSVoter.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 *MsgCreateTSSVoter) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateTSSVoter.Merge(m, src) -} -func (m *MsgCreateTSSVoter) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateTSSVoter) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateTSSVoter.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateTSSVoter proto.InternalMessageInfo - -func (m *MsgCreateTSSVoter) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *MsgCreateTSSVoter) GetTssPubkey() string { - if m != nil { - return m.TssPubkey - } - return "" -} - -func (m *MsgCreateTSSVoter) GetKeyGenZetaHeight() int64 { - if m != nil { - return m.KeyGenZetaHeight - } - return 0 -} - -func (m *MsgCreateTSSVoter) GetStatus() chains.ReceiveStatus { - if m != nil { - return m.Status - } - return chains.ReceiveStatus_Created -} - -type MsgCreateTSSVoterResponse struct { -} - -func (m *MsgCreateTSSVoterResponse) Reset() { *m = MsgCreateTSSVoterResponse{} } -func (m *MsgCreateTSSVoterResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateTSSVoterResponse) ProtoMessage() {} -func (*MsgCreateTSSVoterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{1} -} -func (m *MsgCreateTSSVoterResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateTSSVoterResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateTSSVoterResponse.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 *MsgCreateTSSVoterResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateTSSVoterResponse.Merge(m, src) -} -func (m *MsgCreateTSSVoterResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateTSSVoterResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateTSSVoterResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateTSSVoterResponse proto.InternalMessageInfo - type MsgMigrateTssFunds 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"` @@ -147,7 +43,7 @@ func (m *MsgMigrateTssFunds) Reset() { *m = MsgMigrateTssFunds{} } func (m *MsgMigrateTssFunds) String() string { return proto.CompactTextString(m) } func (*MsgMigrateTssFunds) ProtoMessage() {} func (*MsgMigrateTssFunds) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{2} + return fileDescriptor_81d6d611190b7635, []int{0} } func (m *MsgMigrateTssFunds) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -197,7 +93,7 @@ func (m *MsgMigrateTssFundsResponse) Reset() { *m = MsgMigrateTssFundsRe func (m *MsgMigrateTssFundsResponse) String() string { return proto.CompactTextString(m) } func (*MsgMigrateTssFundsResponse) ProtoMessage() {} func (*MsgMigrateTssFundsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{3} + return fileDescriptor_81d6d611190b7635, []int{1} } func (m *MsgMigrateTssFundsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -235,7 +131,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{4} + return fileDescriptor_81d6d611190b7635, []int{2} } func (m *MsgUpdateTssAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -285,7 +181,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{5} + return fileDescriptor_81d6d611190b7635, []int{3} } func (m *MsgUpdateTssAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -328,7 +224,7 @@ 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{6} + return fileDescriptor_81d6d611190b7635, []int{4} } func (m *MsgAddToInTxTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -413,7 +309,7 @@ func (m *MsgAddToInTxTrackerResponse) Reset() { *m = MsgAddToInTxTracker func (m *MsgAddToInTxTrackerResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddToInTxTrackerResponse) ProtoMessage() {} func (*MsgAddToInTxTrackerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{7} + return fileDescriptor_81d6d611190b7635, []int{5} } func (m *MsgAddToInTxTrackerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -456,7 +352,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{8} + return fileDescriptor_81d6d611190b7635, []int{6} } func (m *MsgWhitelistERC20) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,7 +439,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{9} + return fileDescriptor_81d6d611190b7635, []int{7} } func (m *MsgWhitelistERC20Response) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -600,7 +496,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{10} + return fileDescriptor_81d6d611190b7635, []int{8} } func (m *MsgAddToOutTxTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -686,7 +582,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{11} + return fileDescriptor_81d6d611190b7635, []int{9} } func (m *MsgAddToOutTxTrackerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -732,7 +628,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{12} + return fileDescriptor_81d6d611190b7635, []int{10} } func (m *MsgRemoveFromOutTxTracker) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -789,7 +685,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{13} + return fileDescriptor_81d6d611190b7635, []int{11} } func (m *MsgRemoveFromOutTxTrackerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -830,7 +726,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{14} + return fileDescriptor_81d6d611190b7635, []int{12} } func (m *MsgGasPriceVoter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -901,7 +797,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{15} + return fileDescriptor_81d6d611190b7635, []int{13} } func (m *MsgGasPriceVoterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -949,7 +845,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{14} } func (m *MsgVoteOnObservedOutboundTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1055,7 +951,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{15} } func (m *MsgVoteOnObservedOutboundTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1108,7 +1004,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{16} } func (m *MsgVoteOnObservedInboundTx) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1235,7 +1131,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{17} } func (m *MsgVoteOnObservedInboundTxResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1273,7 +1169,7 @@ func (m *MsgAbortStuckCCTX) Reset() { *m = MsgAbortStuckCCTX{} } func (m *MsgAbortStuckCCTX) String() string { return proto.CompactTextString(m) } func (*MsgAbortStuckCCTX) ProtoMessage() {} func (*MsgAbortStuckCCTX) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{20} + return fileDescriptor_81d6d611190b7635, []int{18} } func (m *MsgAbortStuckCCTX) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1323,7 +1219,7 @@ func (m *MsgAbortStuckCCTXResponse) Reset() { *m = MsgAbortStuckCCTXResp func (m *MsgAbortStuckCCTXResponse) String() string { return proto.CompactTextString(m) } func (*MsgAbortStuckCCTXResponse) ProtoMessage() {} func (*MsgAbortStuckCCTXResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{21} + return fileDescriptor_81d6d611190b7635, []int{19} } func (m *MsgAbortStuckCCTXResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1362,7 +1258,7 @@ func (m *MsgRefundAbortedCCTX) Reset() { *m = MsgRefundAbortedCCTX{} } func (m *MsgRefundAbortedCCTX) String() string { return proto.CompactTextString(m) } func (*MsgRefundAbortedCCTX) ProtoMessage() {} func (*MsgRefundAbortedCCTX) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{22} + return fileDescriptor_81d6d611190b7635, []int{20} } func (m *MsgRefundAbortedCCTX) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1419,7 +1315,7 @@ func (m *MsgRefundAbortedCCTXResponse) Reset() { *m = MsgRefundAbortedCC func (m *MsgRefundAbortedCCTXResponse) String() string { return proto.CompactTextString(m) } func (*MsgRefundAbortedCCTXResponse) ProtoMessage() {} func (*MsgRefundAbortedCCTXResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_81d6d611190b7635, []int{23} + return fileDescriptor_81d6d611190b7635, []int{21} } func (m *MsgRefundAbortedCCTXResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1449,8 +1345,6 @@ func (m *MsgRefundAbortedCCTXResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRefundAbortedCCTXResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgCreateTSSVoter)(nil), "zetachain.zetacore.crosschain.MsgCreateTSSVoter") - proto.RegisterType((*MsgCreateTSSVoterResponse)(nil), "zetachain.zetacore.crosschain.MsgCreateTSSVoterResponse") proto.RegisterType((*MsgMigrateTssFunds)(nil), "zetachain.zetacore.crosschain.MsgMigrateTssFunds") proto.RegisterType((*MsgMigrateTssFundsResponse)(nil), "zetachain.zetacore.crosschain.MsgMigrateTssFundsResponse") proto.RegisterType((*MsgUpdateTssAddress)(nil), "zetachain.zetacore.crosschain.MsgUpdateTssAddress") @@ -1478,102 +1372,98 @@ func init() { func init() { proto.RegisterFile("crosschain/tx.proto", fileDescriptor_81d6d611190b7635) } var fileDescriptor_81d6d611190b7635 = []byte{ - // 1517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x18, 0xdd, 0x4e, 0x1b, 0x47, - 0x97, 0xfd, 0x00, 0x63, 0x1f, 0x30, 0x24, 0x0b, 0x09, 0xce, 0x12, 0x0c, 0x59, 0xbe, 0xa4, 0xa8, - 0x55, 0xec, 0x84, 0xa8, 0x6a, 0x92, 0xb6, 0x52, 0x01, 0x25, 0x84, 0x36, 0x84, 0x68, 0x71, 0xda, - 0x2a, 0x37, 0xd6, 0x7a, 0x77, 0x58, 0x56, 0xd8, 0x3b, 0xd6, 0xce, 0xd8, 0xb2, 0x51, 0xa5, 0x56, - 0x95, 0x7a, 0x5f, 0x55, 0x95, 0x5a, 0xf5, 0x05, 0xfa, 0x2a, 0xb9, 0x8c, 0x7a, 0xd3, 0x9f, 0x8b, - 0xa8, 0x0a, 0x0f, 0x50, 0xa9, 0x4f, 0x50, 0xcd, 0x99, 0xf1, 0xe2, 0xb5, 0xf1, 0x0f, 0x44, 0xb9, - 0xb1, 0xf7, 0x9c, 0x99, 0xf3, 0xff, 0xbb, 0x0b, 0xb3, 0x4e, 0x48, 0x19, 0x73, 0x0e, 0x6c, 0x3f, - 0xc8, 0xf3, 0x46, 0xae, 0x1a, 0x52, 0x4e, 0xf5, 0xc5, 0x23, 0xc2, 0x6d, 0xc4, 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c4, 0xb8, 0x77, 0x66, 0x92, 0xf6, 0x18, 0x74, 0x7c, - 0x99, 0x19, 0x22, 0x06, 0x71, 0x8a, 0x61, 0x62, 0x70, 0xfa, 0x47, 0x15, 0x21, 0xbd, 0x63, 0xbe, - 0x0c, 0x21, 0x3d, 0x4e, 0x31, 0x8c, 0xf4, 0xd3, 0xa7, 0x0e, 0x76, 0xf5, 0xee, 0x99, 0x73, 0x67, - 0x98, 0x4e, 0xd4, 0x41, 0x34, 0x4c, 0x57, 0xef, 0x39, 0x65, 0x36, 0x3e, 0x7b, 0xf1, 0x3a, 0xab, - 0xbd, 0x7c, 0x9d, 0xd5, 0xfe, 0x7e, 0x9d, 0xd5, 0xbe, 0x3f, 0xce, 0x8e, 0xbc, 0x3c, 0xce, 0x8e, - 0xfc, 0x71, 0x9c, 0x1d, 0x79, 0x7e, 0xbb, 0x6d, 0xaf, 0x11, 0x6c, 0x6f, 0xca, 0xef, 0x7a, 0x2d, - 0x09, 0xf9, 0x46, 0xbe, 0xfd, 0x6b, 0x9f, 0x58, 0x73, 0x4a, 0x09, 0xfc, 0xea, 0x76, 0xe7, 0xbf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0xaa, 0x5d, 0x39, 0x08, 0x14, 0x00, 0x00, + // 1451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x18, 0x5d, 0x6b, 0xdb, 0x56, + 0x3b, 0x7a, 0x93, 0x38, 0xf6, 0x93, 0xd8, 0x69, 0x95, 0xb4, 0x71, 0x95, 0xc6, 0x49, 0x95, 0xb7, + 0x7d, 0x03, 0x2f, 0xb5, 0x5b, 0x97, 0x97, 0xb7, 0xed, 0x36, 0x58, 0x12, 0xfa, 0x91, 0xad, 0x69, + 0x8a, 0xea, 0x6e, 0x63, 0x37, 0x42, 0x96, 0x4e, 0x64, 0x11, 0x5b, 0xc7, 0xe8, 0x1c, 0x05, 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32, 0x2d, 0xf6, 0xdf, 0x0a, 0x80, 0xc7, 0xcc, 0x80, 0x34, 0xe8, 0x21, 0x71, 0xd0, 0xca, 0xb4, + 0x91, 0xf1, 0x98, 0x21, 0x10, 0xfa, 0x3e, 0xfa, 0x5e, 0x40, 0x0f, 0x03, 0xda, 0x78, 0x47, 0xee, + 0xd1, 0xd7, 0xe1, 0xda, 0x40, 0x39, 0x71, 0x76, 0xff, 0xa8, 0xc0, 0x85, 0x5d, 0xe6, 0x3e, 0xb2, + 0xd8, 0xb3, 0xc0, 0xb3, 0xc9, 0x27, 0x94, 0x9f, 0x43, 0x89, 0x66, 0xc4, 0xa2, 0xa3, 0x04, 0x02, + 0xea, 0x35, 0x98, 0x13, 0x5e, 0xf6, 0xc3, 0x46, 0x95, 0x04, 0x18, 0xa8, 0x29, 0x63, 0x16, 0x71, + 0x4f, 0x11, 0x85, 0xc9, 0x1d, 0x36, 0x9b, 0xf5, 0x76, 0x9c, 0xdc, 0x08, 0xe9, 0x1a, 0xe4, 0x7b, + 0x35, 0x8b, 0xd5, 0xfe, 0x65, 0x1a, 0x8b, 0x36, 0x42, 0xee, 0xf9, 0x7b, 0x55, 0x46, 0x82, 0x43, + 0xe2, 0xec, 0x85, 0xbc, 0x4a, 0x43, 0xdf, 0xa9, 0xb4, 0x86, 0x58, 0xb0, 0x0c, 0x98, 0xa5, 0x22, + 0xea, 0x22, 0x6d, 0xd3, 0x11, 0x02, 0x83, 0x5e, 0x84, 0x05, 0x2a, 0x99, 0x99, 0x34, 0x72, 0x57, + 0x77, 0xef, 0xba, 0x48, 0x8f, 0xe5, 0x54, 0xc4, 0xfd, 0xf7, 0x41, 0xeb, 0xb9, 0x2f, 0x12, 0x88, + 0x78, 0x6e, 0x8d, 0x4b, 0x5b, 0xf3, 0x09, 0xb2, 0xad, 0xe3, 0x73, 0xf5, 0x7f, 0xb0, 0xd4, 0x43, + 0x1d, 0x15, 0x6c, 0xc8, 0x88, 0x93, 0x07, 0x24, 0x5d,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x1f, 0xfa, 0x0e, 0x5e, 0x21, 0xce, 0xb9, 0xa4, 0x89, 0x7c, + 0x8a, 0xb8, 0xc5, 0x9b, 0x88, 0xe8, 0xc4, 0x59, 0x81, 0x95, 0xab, 0x88, 0x5e, 0xc0, 0x79, 0xdc, + 0x27, 0xb7, 0xa3, 0x57, 0xf9, 0xcf, 0x59, 0x98, 0xdc, 0x65, 0xae, 0xfa, 0x8d, 0x02, 0x17, 0xfb, + 0x17, 0x92, 0x3b, 0xc5, 0xa1, 0xef, 0x23, 0xc5, 0x93, 0x46, 0xbd, 0xf6, 0xde, 0x19, 0x88, 0xe2, + 0xfd, 0xe0, 0x6b, 0x05, 0x2e, 0xf4, 0xed, 0xd7, 0xe5, 0x31, 0x39, 0x76, 0xd1, 0x68, 0xf7, 0x4f, + 0x4f, 0x13, 0x2b, 0xf1, 0xbd, 0x02, 0x97, 0x07, 0xec, 0x20, 0x77, 0x47, 0xb3, 0x3d, 0x99, 0x52, + 0xfb, 0xf0, 0xac, 0x94, 0xb1, 0x5a, 0x6d, 0xc8, 0x26, 0x77, 0x91, 0xd2, 0x68, 0x96, 0x09, 0x02, + 0xed, 0xff, 0xa7, 0x24, 0x88, 0x45, 0xff, 0xa4, 0x40, 0x7e, 0xe0, 0x42, 0x31, 0x86, 0xab, 0x07, + 0xd1, 0x6a, 0x5b, 0x67, 0xa7, 0x8d, 0x95, 0xfb, 0x41, 0x81, 0xa5, 0x41, 0xcd, 0xfe, 0xde, 0x69, + 0xf9, 0xc7, 0xa4, 0xda, 0xe6, 0x99, 0x49, 0x63, 0xcd, 0xbe, 0x80, 0x5c, 0xcf, 0xbb, 0xd1, 0xad, + 0xd1, 0x4c, 0x93, 0x14, 0xda, 0xdd, 0xd3, 0x52, 0x24, 0x6a, 0xa9, 0xef, 0xdd, 0x78, 0x8c, 0x5a, + 0xea, 0xa5, 0x19, 0xa7, 0x96, 0x06, 0xbd, 0x33, 0xab, 0x5f, 0xc2, 0x7c, 0xef, 0x17, 0x85, 0xdb, + 0xa3, 0xd9, 0xf5, 0x90, 0x68, 0xf7, 0x4e, 0x4d, 0xd2, 0x1d, 0x83, 0x9e, 0x0e, 0x3f, 0x46, 0x0c, + 0x92, 0x14, 0xe3, 0xc4, 0xe0, 0xe4, 0xbe, 0x8f, 0x7d, 0xb5, 0xbf, 0xeb, 0xdf, 0x19, 0xa7, 0x17, + 0xf4, 0x10, 0x8d, 0xd3, 0x57, 0x07, 0xf6, 0xf9, 0xad, 0x8f, 0x5f, 0xbe, 0x29, 0x28, 0xaf, 0xde, + 0x14, 0x94, 0x3f, 0xde, 0x14, 0x94, 0x6f, 0xdf, 0x16, 0x26, 0x5e, 0xbd, 0x2d, 0x4c, 0xfc, 0xfa, + 0xb6, 0x30, 0xf1, 0xf9, 0xed, 0xae, 0xcd, 0x22, 0x62, 0x7b, 0x53, 0x7c, 0x92, 0xea, 0x48, 0x28, + 0xb5, 0x4a, 0xdd, 0x1f, 0xaa, 0xa2, 0x45, 0xa3, 0x9a, 0xc2, 0x0f, 0x46, 0x77, 0xfe, 0x09, 0x00, + 0x00, 0xff, 0xff, 0xef, 0x61, 0xc8, 0xd2, 0xc3, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1597,7 +1487,6 @@ type MsgClient interface { WhitelistERC20(ctx context.Context, in *MsgWhitelistERC20, opts ...grpc.CallOption) (*MsgWhitelistERC20Response, error) UpdateTssAddress(ctx context.Context, in *MsgUpdateTssAddress, opts ...grpc.CallOption) (*MsgUpdateTssAddressResponse, error) MigrateTssFunds(ctx context.Context, in *MsgMigrateTssFunds, opts ...grpc.CallOption) (*MsgMigrateTssFundsResponse, error) - CreateTSSVoter(ctx context.Context, in *MsgCreateTSSVoter, opts ...grpc.CallOption) (*MsgCreateTSSVoterResponse, error) AbortStuckCCTX(ctx context.Context, in *MsgAbortStuckCCTX, opts ...grpc.CallOption) (*MsgAbortStuckCCTXResponse, error) RefundAbortedCCTX(ctx context.Context, in *MsgRefundAbortedCCTX, opts ...grpc.CallOption) (*MsgRefundAbortedCCTXResponse, error) } @@ -1691,15 +1580,6 @@ func (c *msgClient) MigrateTssFunds(ctx context.Context, in *MsgMigrateTssFunds, return out, nil } -func (c *msgClient) CreateTSSVoter(ctx context.Context, in *MsgCreateTSSVoter, opts ...grpc.CallOption) (*MsgCreateTSSVoterResponse, error) { - out := new(MsgCreateTSSVoterResponse) - err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Msg/CreateTSSVoter", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *msgClient) AbortStuckCCTX(ctx context.Context, in *MsgAbortStuckCCTX, opts ...grpc.CallOption) (*MsgAbortStuckCCTXResponse, error) { out := new(MsgAbortStuckCCTXResponse) err := c.cc.Invoke(ctx, "/zetachain.zetacore.crosschain.Msg/AbortStuckCCTX", in, out, opts...) @@ -1729,7 +1609,6 @@ type MsgServer interface { WhitelistERC20(context.Context, *MsgWhitelistERC20) (*MsgWhitelistERC20Response, error) UpdateTssAddress(context.Context, *MsgUpdateTssAddress) (*MsgUpdateTssAddressResponse, error) MigrateTssFunds(context.Context, *MsgMigrateTssFunds) (*MsgMigrateTssFundsResponse, error) - CreateTSSVoter(context.Context, *MsgCreateTSSVoter) (*MsgCreateTSSVoterResponse, error) AbortStuckCCTX(context.Context, *MsgAbortStuckCCTX) (*MsgAbortStuckCCTXResponse, error) RefundAbortedCCTX(context.Context, *MsgRefundAbortedCCTX) (*MsgRefundAbortedCCTXResponse, error) } @@ -1765,9 +1644,6 @@ func (*UnimplementedMsgServer) UpdateTssAddress(ctx context.Context, req *MsgUpd func (*UnimplementedMsgServer) MigrateTssFunds(ctx context.Context, req *MsgMigrateTssFunds) (*MsgMigrateTssFundsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MigrateTssFunds not implemented") } -func (*UnimplementedMsgServer) CreateTSSVoter(ctx context.Context, req *MsgCreateTSSVoter) (*MsgCreateTSSVoterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateTSSVoter not implemented") -} func (*UnimplementedMsgServer) AbortStuckCCTX(ctx context.Context, req *MsgAbortStuckCCTX) (*MsgAbortStuckCCTXResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AbortStuckCCTX not implemented") } @@ -1941,24 +1817,6 @@ func _Msg_MigrateTssFunds_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } -func _Msg_CreateTSSVoter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateTSSVoter) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateTSSVoter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/zetachain.zetacore.crosschain.Msg/CreateTSSVoter", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateTSSVoter(ctx, req.(*MsgCreateTSSVoter)) - } - return interceptor(ctx, in, info, handler) -} - func _Msg_AbortStuckCCTX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgAbortStuckCCTX) if err := dec(in); err != nil { @@ -2035,10 +1893,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "MigrateTssFunds", Handler: _Msg_MigrateTssFunds_Handler, }, - { - MethodName: "CreateTSSVoter", - Handler: _Msg_CreateTSSVoter_Handler, - }, { MethodName: "AbortStuckCCTX", Handler: _Msg_AbortStuckCCTX_Handler, @@ -2052,76 +1906,6 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "crosschain/tx.proto", } -func (m *MsgCreateTSSVoter) 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 *MsgCreateTSSVoter) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateTSSVoter) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Status != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x20 - } - if m.KeyGenZetaHeight != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.KeyGenZetaHeight)) - i-- - dAtA[i] = 0x18 - } - if len(m.TssPubkey) > 0 { - i -= len(m.TssPubkey) - copy(dAtA[i:], m.TssPubkey) - i = encodeVarintTx(dAtA, i, uint64(len(m.TssPubkey))) - i-- - dAtA[i] = 0x12 - } - 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 *MsgCreateTSSVoterResponse) 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 *MsgCreateTSSVoterResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateTSSVoterResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *MsgMigrateTssFunds) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3084,38 +2868,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgCreateTSSVoter) 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.TssPubkey) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.KeyGenZetaHeight != 0 { - n += 1 + sovTx(uint64(m.KeyGenZetaHeight)) - } - if m.Status != 0 { - n += 1 + sovTx(uint64(m.Status)) - } - return n -} - -func (m *MsgCreateTSSVoterResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *MsgMigrateTssFunds) Size() (n int) { if m == nil { return 0 @@ -3555,208 +3307,6 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgCreateTSSVoter) 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: MsgCreateTSSVoter: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateTSSVoter: 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 != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TssPubkey", 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.TssPubkey = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field KeyGenZetaHeight", wireType) - } - m.KeyGenZetaHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.KeyGenZetaHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= chains.ReceiveStatus(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 *MsgCreateTSSVoterResponse) 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: MsgCreateTSSVoterResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateTSSVoterResponse: 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 *MsgMigrateTssFunds) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/observer/client/cli/tx.go b/x/observer/client/cli/tx.go index f581f878b9..9d65f09b70 100644 --- a/x/observer/client/cli/tx.go +++ b/x/observer/client/cli/tx.go @@ -30,6 +30,7 @@ func GetTxCmd() *cobra.Command { CmdUpdateObserver(), CmdEncode(), CmdResetChainNonces(), + CmdVoteTSS(), ) return cmd diff --git a/x/observer/client/cli/tx_vote_tss.go b/x/observer/client/cli/tx_vote_tss.go new file mode 100644 index 0000000000..2c2b837513 --- /dev/null +++ b/x/observer/client/cli/tx_vote_tss.go @@ -0,0 +1,51 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +func CmdVoteTSS() *cobra.Command { + cmd := &cobra.Command{ + Use: "vote-tss [pubkey] [keygen-block] [status]", + Short: "Vote for a new TSS creation", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) error { + + argsPubkey, err := cast.ToStringE(args[0]) + if err != nil { + return err + } + + keygenBlock, err := strconv.ParseInt(args[1], 10, 64) + if err != nil { + return err + } + + status, err := chains.ReceiveStatusFromString(args[2]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgVoteTSS(clientCtx.GetFromAddress().String(), argsPubkey, keygenBlock, status) + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/observer/keeper/msg_server_vote_tss.go b/x/observer/keeper/msg_server_vote_tss.go new file mode 100644 index 0000000000..87c7e0b31f --- /dev/null +++ b/x/observer/keeper/msg_server_vote_tss.go @@ -0,0 +1,127 @@ +package keeper + +import ( + "context" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/ethereum/go-ethereum/common/math" + "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +// VoteTSS votes on creating a TSS key and recording the information about it (public +// key, participant and operator addresses, finalized and keygen heights). +// +// If the vote passes, the information about the TSS key is recorded on chain +// and the status of the keygen is set to "success". +// +// Fails if the keygen does not exist, the keygen has been already +// completed, or the keygen has failed. +// +// Only node accounts are authorized to broadcast this message. +func (k msgServer) VoteTSS(goCtx context.Context, msg *types.MsgVoteTSS) (*types.MsgVoteTSSResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // checks whether a signer is authorized to sign , by checking their address against the observer mapper which contains the observer list for the chain and type + _, found := k.GetNodeAccount(ctx, msg.Creator) + if !found { + return nil, errorsmod.Wrap(sdkerrors.ErrorInvalidSigner, fmt.Sprintf("signer %s does not have a node account set", msg.Creator)) + } + // no need to create a ballot if keygen does not exist + keygen, found := k.GetKeygen(ctx) + if !found { + return &types.MsgVoteTSSResponse{}, types.ErrKeygenNotFound + } + // use a separate transaction to update KEYGEN status to pending when trying to change the TSS address + if keygen.Status == types.KeygenStatus_KeyGenSuccess { + return &types.MsgVoteTSSResponse{}, types.ErrKeygenCompleted + } + + // add votes and set Ballot + // GetBallot checks against the supported chains list before querying for Ballot + // TODO : https://github.com/zeta-chain/node/issues/896 + ballotCreated := false + index := msg.Digest() + ballot, found := k.GetBallot(ctx, index) + if !found { + + // if ballot does not exist, create a new ballot + var voterList []string + + for _, nodeAccount := range k.GetAllNodeAccount(ctx) { + voterList = append(voterList, nodeAccount.Operator) + } + ballot = types.Ballot{ + Index: "", + BallotIdentifier: index, + VoterList: voterList, + Votes: types.CreateVotes(len(voterList)), + ObservationType: types.ObservationType_TSSKeyGen, + BallotThreshold: sdk.MustNewDecFromStr("1.00"), + BallotStatus: types.BallotStatus_BallotInProgress, + BallotCreationHeight: ctx.BlockHeight(), + } + k.AddBallotToList(ctx, ballot) + + EmitEventBallotCreated(ctx, ballot, msg.TssPubkey, "Common-TSS-For-All-Chain") + ballotCreated = true + } + + // vote the ballot + var err error + vote := types.VoteType_SuccessObservation + if msg.Status == chains.ReceiveStatus_Failed { + vote = types.VoteType_FailureObservation + } + ballot, err = k.AddVoteToBallot(ctx, ballot, msg.Creator, vote) + if err != nil { + return &types.MsgVoteTSSResponse{}, err + } + + // returns here if the ballot is not finalized + ballot, isFinalized := k.CheckIfFinalizingVote(ctx, ballot) + if !isFinalized { + return &types.MsgVoteTSSResponse{ + VoteFinalized: false, + BallotCreated: ballotCreated, + KeygenSuccess: false, + }, nil + } + + // set TSS only on success, set Keygen either way. + // keygen block can be updated using a policy transaction if keygen fails + keygenSuccess := false + if ballot.BallotStatus == types.BallotStatus_BallotFinalized_FailureObservation { + keygen.Status = types.KeygenStatus_KeyGenFailed + keygen.BlockNumber = math.MaxInt64 + } else { + tss := types.TSS{ + TssPubkey: msg.TssPubkey, + TssParticipantList: keygen.GetGranteePubkeys(), + OperatorAddressList: ballot.VoterList, + FinalizedZetaHeight: ctx.BlockHeight(), + KeyGenZetaHeight: msg.KeygenZetaHeight, + } + // set TSS history only, current TSS is updated via admin transaction + // in Case this is the first TSS address update both current and history + tssList := k.GetAllTSS(ctx) + if len(tssList) == 0 { + k.SetTssAndUpdateNonce(ctx, tss) + } + k.SetTSSHistory(ctx, tss) + keygen.Status = types.KeygenStatus_KeyGenSuccess + keygen.BlockNumber = ctx.BlockHeight() + keygenSuccess = true + } + + k.SetKeygen(ctx, keygen) + + return &types.MsgVoteTSSResponse{ + VoteFinalized: true, + BallotCreated: ballotCreated, + KeygenSuccess: keygenSuccess, + }, nil +} diff --git a/x/observer/keeper/msg_server_vote_tss_test.go b/x/observer/keeper/msg_server_vote_tss_test.go new file mode 100644 index 0000000000..f7ef851bf9 --- /dev/null +++ b/x/observer/keeper/msg_server_vote_tss_test.go @@ -0,0 +1,241 @@ +package keeper_test + +import ( + "math" + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/pkg/chains" + 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_VoteTSS(t *testing.T) { + t.Run("fail if node account not found", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + srv := keeper.NewMsgServerImpl(*k) + + _, err := srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: sample.AccAddress(), + TssPubkey: sample.Tss().TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.ErrorIs(t, err, sdkerrors.ErrorInvalidSigner) + }) + + t.Run("fail if keygen is not found", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + srv := keeper.NewMsgServerImpl(*k) + + // setup state + nodeAcc := sample.NodeAccount() + k.SetNodeAccount(ctx, *nodeAcc) + + _, err := srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc.Operator, + TssPubkey: sample.Tss().TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.ErrorIs(t, err, types.ErrKeygenNotFound) + }) + + t.Run("fail if keygen already completed ", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + srv := keeper.NewMsgServerImpl(*k) + + // setup state + nodeAcc := sample.NodeAccount() + keygen := sample.Keygen(t) + keygen.Status = types.KeygenStatus_KeyGenSuccess + k.SetNodeAccount(ctx, *nodeAcc) + k.SetKeygen(ctx, *keygen) + + _, err := srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc.Operator, + TssPubkey: sample.Tss().TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.ErrorIs(t, err, types.ErrKeygenCompleted) + }) + + t.Run("can create a new ballot, vote success and finalize", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + ctx = ctx.WithBlockHeight(42) + srv := keeper.NewMsgServerImpl(*k) + + // setup state + nodeAcc := sample.NodeAccount() + keygen := sample.Keygen(t) + keygen.Status = types.KeygenStatus_PendingKeygen + k.SetNodeAccount(ctx, *nodeAcc) + k.SetKeygen(ctx, *keygen) + + // there is a single node account, so the ballot will be created and finalized in a single vote + res, err := srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc.Operator, + TssPubkey: sample.Tss().TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.NoError(t, err) + + // check response + require.True(t, res.BallotCreated) + require.True(t, res.VoteFinalized) + require.True(t, res.KeygenSuccess) + + // check keygen updated + newKeygen, found := k.GetKeygen(ctx) + require.True(t, found) + require.EqualValues(t, types.KeygenStatus_KeyGenSuccess, newKeygen.Status) + require.EqualValues(t, ctx.BlockHeight(), newKeygen.BlockNumber) + }) + + t.Run("can create a new ballot, vote failure and finalize", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + ctx = ctx.WithBlockHeight(42) + srv := keeper.NewMsgServerImpl(*k) + + // setup state + nodeAcc := sample.NodeAccount() + keygen := sample.Keygen(t) + keygen.Status = types.KeygenStatus_PendingKeygen + k.SetNodeAccount(ctx, *nodeAcc) + k.SetKeygen(ctx, *keygen) + + // there is a single node account, so the ballot will be created and finalized in a single vote + res, err := srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc.Operator, + TssPubkey: sample.Tss().TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Failed, + }) + require.NoError(t, err) + + // check response + require.True(t, res.BallotCreated) + require.True(t, res.VoteFinalized) + require.False(t, res.KeygenSuccess) + + // check keygen updated + newKeygen, found := k.GetKeygen(ctx) + require.True(t, found) + require.EqualValues(t, types.KeygenStatus_KeyGenFailed, newKeygen.Status) + require.EqualValues(t, math.MaxInt64, newKeygen.BlockNumber) + }) + + t.Run("can create a new ballot, vote without finalizing, then add vote and finalizing", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + ctx = ctx.WithBlockHeight(42) + srv := keeper.NewMsgServerImpl(*k) + + // setup state with 3 node accounts + nodeAcc1 := sample.NodeAccount() + nodeAcc2 := sample.NodeAccount() + nodeAcc3 := sample.NodeAccount() + keygen := sample.Keygen(t) + keygen.Status = types.KeygenStatus_PendingKeygen + tss := sample.Tss() + k.SetNodeAccount(ctx, *nodeAcc1) + k.SetNodeAccount(ctx, *nodeAcc2) + k.SetNodeAccount(ctx, *nodeAcc3) + k.SetKeygen(ctx, *keygen) + + // 1st vote: created ballot, but not finalized + res, err := srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc1.Operator, + TssPubkey: tss.TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.NoError(t, err) + + // check response + require.True(t, res.BallotCreated) + require.False(t, res.VoteFinalized) + require.False(t, res.KeygenSuccess) + + // check keygen not updated + newKeygen, found := k.GetKeygen(ctx) + require.True(t, found) + require.EqualValues(t, types.KeygenStatus_PendingKeygen, newKeygen.Status) + + // 2nd vote: already created ballot, and not finalized + res, err = srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc2.Operator, + TssPubkey: tss.TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.NoError(t, err) + + // check response + require.False(t, res.BallotCreated) + require.False(t, res.VoteFinalized) + require.False(t, res.KeygenSuccess) + + // check keygen not updated + newKeygen, found = k.GetKeygen(ctx) + require.True(t, found) + require.EqualValues(t, types.KeygenStatus_PendingKeygen, newKeygen.Status) + + // 3rd vote: finalize the ballot + res, err = srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc3.Operator, + TssPubkey: tss.TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.NoError(t, err) + + // check response + require.False(t, res.BallotCreated) + require.True(t, res.VoteFinalized) + require.True(t, res.KeygenSuccess) + + // check keygen not updated + newKeygen, found = k.GetKeygen(ctx) + require.True(t, found) + require.EqualValues(t, types.KeygenStatus_KeyGenSuccess, newKeygen.Status) + require.EqualValues(t, ctx.BlockHeight(), newKeygen.BlockNumber) + }) + + t.Run("fail if voting fails", func(t *testing.T) { + k, ctx, _, _ := keepertest.ObserverKeeper(t) + ctx = ctx.WithBlockHeight(42) + srv := keeper.NewMsgServerImpl(*k) + + // setup state with two node accounts to not finalize the ballot + nodeAcc := sample.NodeAccount() + keygen := sample.Keygen(t) + keygen.Status = types.KeygenStatus_PendingKeygen + k.SetNodeAccount(ctx, *nodeAcc) + k.SetNodeAccount(ctx, *sample.NodeAccount()) + k.SetKeygen(ctx, *keygen) + + // add a first vote + res, err := srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc.Operator, + TssPubkey: sample.Tss().TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.NoError(t, err) + require.False(t, res.VoteFinalized) + + // vote again: voting should fail + _, err = srv.VoteTSS(ctx, &types.MsgVoteTSS{ + Creator: nodeAcc.Operator, + TssPubkey: sample.Tss().TssPubkey, + KeygenZetaHeight: 42, + Status: chains.ReceiveStatus_Success, + }) + require.ErrorIs(t, err, types.ErrUnableToAddVote) + }) +} diff --git a/x/observer/keeper/utils.go b/x/observer/keeper/utils.go index 5209e3218d..322d45387f 100644 --- a/x/observer/keeper/utils.go +++ b/x/observer/keeper/utils.go @@ -13,9 +13,9 @@ func (k Keeper) AddVoteToBallot(ctx sdk.Context, ballot types.Ballot, address st if err != nil { return ballot, err } - ctx.Logger().Info(fmt.Sprintf("Vote Added | Voter :%s, ballot idetifier %s", address, ballot.BallotIdentifier)) + ctx.Logger().Info(fmt.Sprintf("Vote Added | Voter :%s, ballot identifier %s", address, ballot.BallotIdentifier)) k.SetBallot(ctx, &ballot) - return ballot, err + return ballot, nil } // CheckIfFinalizingVote checks if the ballot is finalized in this block and if it is, it sets the ballot in the store diff --git a/x/observer/types/ballot.go b/x/observer/types/ballot.go index 10f21119d1..811a1b7688 100644 --- a/x/observer/types/ballot.go +++ b/x/observer/types/ballot.go @@ -3,13 +3,13 @@ package types import ( "fmt" + cosmoserrors "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/errors" ) func (m Ballot) AddVote(address string, vote VoteType) (Ballot, error) { if m.HasVoted(address) { - return m, errors.Wrap(ErrUnableToAddVote, fmt.Sprintf(" Voter : %s | Ballot :%s | Already Voted", address, m.String())) + return m, cosmoserrors.Wrap(ErrUnableToAddVote, fmt.Sprintf(" Voter : %s | Ballot :%s | Already Voted", address, m.String())) } // `index` is the index of the `address` in the `VoterList` // `index` is used to set the vote in the `Votes` array diff --git a/x/observer/types/codec.go b/x/observer/types/codec.go index af6e7d87a5..c729bb3a84 100644 --- a/x/observer/types/codec.go +++ b/x/observer/types/codec.go @@ -11,12 +11,13 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgAddObserver{}, "observer/AddObserver", nil) cdc.RegisterConcrete(&MsgUpdateChainParams{}, "observer/UpdateChainParams", nil) cdc.RegisterConcrete(&MsgRemoveChainParams{}, "observer/RemoveChainParams", 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) + cdc.RegisterConcrete(&MsgAddBlameVote{}, "observer/AddBlameVote", nil) + cdc.RegisterConcrete(&MsgUpdateCrosschainFlags{}, "observer/UpdateCrosschainFlags", nil) + cdc.RegisterConcrete(&MsgUpdateKeygen{}, "observer/UpdateKeygen", nil) + cdc.RegisterConcrete(&MsgAddBlockHeader{}, "observer/AddBlockHeader", nil) cdc.RegisterConcrete(&MsgUpdateObserver{}, "observer/UpdateObserver", nil) cdc.RegisterConcrete(&MsgResetChainNonces{}, "observer/ResetChainNonces", nil) + cdc.RegisterConcrete(&MsgVoteTSS{}, "observer/VoteTSS", nil) } func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { @@ -30,6 +31,7 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgAddBlockHeader{}, &MsgUpdateObserver{}, &MsgResetChainNonces{}, + &MsgVoteTSS{}, ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/observer/types/message_vote_tss.go b/x/observer/types/message_vote_tss.go new file mode 100644 index 0000000000..bbd8a73e65 --- /dev/null +++ b/x/observer/types/message_vote_tss.go @@ -0,0 +1,63 @@ +package types + +import ( + "fmt" + + cosmoserrors "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/zeta-chain/zetacore/pkg/chains" +) + +const TypeMsgVoteTSS = "VoteTSS" + +var _ sdk.Msg = &MsgVoteTSS{} + +func NewMsgVoteTSS(creator string, pubkey string, keygenZetaHeight int64, status chains.ReceiveStatus) *MsgVoteTSS { + return &MsgVoteTSS{ + Creator: creator, + TssPubkey: pubkey, + KeygenZetaHeight: keygenZetaHeight, + Status: status, + } +} + +func (msg *MsgVoteTSS) Route() string { + return RouterKey +} + +func (msg *MsgVoteTSS) Type() string { + return TypeMsgVoteTSS +} + +func (msg *MsgVoteTSS) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgVoteTSS) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgVoteTSS) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return cosmoserrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + + // either success or observation failure + if msg.Status != chains.ReceiveStatus_Success && msg.Status != chains.ReceiveStatus_Failed { + return cosmoserrors.Wrapf(sdkerrors.ErrInvalidRequest, "invalid status: %s", msg.Status) + } + + return nil +} + +func (msg *MsgVoteTSS) Digest() string { + // We support only 1 keygen at a particular height + return fmt.Sprintf("%d-%s", msg.KeygenZetaHeight, "tss-keygen") +} diff --git a/x/observer/types/message_vote_tss_test.go b/x/observer/types/message_vote_tss_test.go new file mode 100644 index 0000000000..fb8d92323b --- /dev/null +++ b/x/observer/types/message_vote_tss_test.go @@ -0,0 +1,105 @@ +package types_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/testutil/sample" + "github.com/zeta-chain/zetacore/x/observer/types" +) + +func TestMsgVoteTSS_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg *types.MsgVoteTSS + err error + }{ + { + name: "valid message", + msg: types.NewMsgVoteTSS(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Success), + }, + { + name: "valid message with receive status failed", + msg: types.NewMsgVoteTSS(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Failed), + }, + { + name: "invalid creator address", + msg: types.NewMsgVoteTSS("invalid", "pubkey", 1, chains.ReceiveStatus_Success), + err: sdkerrors.ErrInvalidAddress, + }, + { + name: "invalid observation status", + msg: types.NewMsgVoteTSS(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Created), + err: sdkerrors.ErrInvalidRequest, + }, + } + + 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) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestMsgVoteTSS_GetSigners(t *testing.T) { + signer := sample.AccAddress() + tests := []struct { + name string + msg *types.MsgVoteTSS + panics bool + }{ + { + name: "valid signer", + msg: types.NewMsgVoteTSS(signer, "pubkey", 1, chains.ReceiveStatus_Success), + panics: false, + }, + { + name: "invalid signer", + msg: types.NewMsgVoteTSS("invalid", "pubkey", 1, chains.ReceiveStatus_Success), + panics: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if !tt.panics { + signers := tt.msg.GetSigners() + require.Equal(t, []sdk.AccAddress{sdk.MustAccAddressFromBech32(signer)}, signers) + } else { + require.Panics(t, func() { + tt.msg.GetSigners() + }) + } + }) + } +} + +func TestMsgVoteTSS_Type(t *testing.T) { + msg := types.NewMsgVoteTSS(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Success) + require.Equal(t, types.TypeMsgVoteTSS, msg.Type()) +} + +func TestMsgVoteTSS_Route(t *testing.T) { + msg := types.NewMsgVoteTSS(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Success) + require.Equal(t, types.RouterKey, msg.Route()) +} + +func TestMsgVoteTSS_GetSignBytes(t *testing.T) { + msg := types.NewMsgVoteTSS(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Success) + require.NotPanics(t, func() { + msg.GetSignBytes() + }) +} + +func TestMsgVoteTSS_Digest(t *testing.T) { + msg := types.NewMsgVoteTSS(sample.AccAddress(), "pubkey", 1, chains.ReceiveStatus_Success) + require.Equal(t, "1-tss-keygen", msg.Digest()) +} diff --git a/x/observer/types/tx.pb.go b/x/observer/types/tx.pb.go index fef0e1ec4a..3c423aba9c 100644 --- a/x/observer/types/tx.pb.go +++ b/x/observer/types/tx.pb.go @@ -13,6 +13,7 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + chains "github.com/zeta-chain/zetacore/pkg/chains" proofs "github.com/zeta-chain/zetacore/pkg/proofs" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -926,6 +927,134 @@ func (m *MsgResetChainNoncesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgResetChainNoncesResponse proto.InternalMessageInfo +type MsgVoteTSS 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"` + KeygenZetaHeight int64 `protobuf:"varint,3,opt,name=keygen_zeta_height,json=keygenZetaHeight,proto3" json:"keygen_zeta_height,omitempty"` + Status chains.ReceiveStatus `protobuf:"varint,4,opt,name=status,proto3,enum=chains.ReceiveStatus" json:"status,omitempty"` +} + +func (m *MsgVoteTSS) Reset() { *m = MsgVoteTSS{} } +func (m *MsgVoteTSS) String() string { return proto.CompactTextString(m) } +func (*MsgVoteTSS) ProtoMessage() {} +func (*MsgVoteTSS) Descriptor() ([]byte, []int) { + return fileDescriptor_1bcd40fa296a2b1d, []int{18} +} +func (m *MsgVoteTSS) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteTSS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteTSS.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 *MsgVoteTSS) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteTSS.Merge(m, src) +} +func (m *MsgVoteTSS) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteTSS) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteTSS.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteTSS proto.InternalMessageInfo + +func (m *MsgVoteTSS) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgVoteTSS) GetTssPubkey() string { + if m != nil { + return m.TssPubkey + } + return "" +} + +func (m *MsgVoteTSS) GetKeygenZetaHeight() int64 { + if m != nil { + return m.KeygenZetaHeight + } + return 0 +} + +func (m *MsgVoteTSS) GetStatus() chains.ReceiveStatus { + if m != nil { + return m.Status + } + return chains.ReceiveStatus_Created +} + +type MsgVoteTSSResponse struct { + BallotCreated bool `protobuf:"varint,1,opt,name=ballot_created,json=ballotCreated,proto3" json:"ballot_created,omitempty"` + VoteFinalized bool `protobuf:"varint,2,opt,name=vote_finalized,json=voteFinalized,proto3" json:"vote_finalized,omitempty"` + KeygenSuccess bool `protobuf:"varint,3,opt,name=keygen_success,json=keygenSuccess,proto3" json:"keygen_success,omitempty"` +} + +func (m *MsgVoteTSSResponse) Reset() { *m = MsgVoteTSSResponse{} } +func (m *MsgVoteTSSResponse) String() string { return proto.CompactTextString(m) } +func (*MsgVoteTSSResponse) ProtoMessage() {} +func (*MsgVoteTSSResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1bcd40fa296a2b1d, []int{19} +} +func (m *MsgVoteTSSResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgVoteTSSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgVoteTSSResponse.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 *MsgVoteTSSResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgVoteTSSResponse.Merge(m, src) +} +func (m *MsgVoteTSSResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgVoteTSSResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgVoteTSSResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgVoteTSSResponse proto.InternalMessageInfo + +func (m *MsgVoteTSSResponse) GetBallotCreated() bool { + if m != nil { + return m.BallotCreated + } + return false +} + +func (m *MsgVoteTSSResponse) GetVoteFinalized() bool { + if m != nil { + return m.VoteFinalized + } + return false +} + +func (m *MsgVoteTSSResponse) GetKeygenSuccess() bool { + if m != nil { + return m.KeygenSuccess + } + return false +} + func init() { proto.RegisterType((*MsgUpdateObserver)(nil), "zetachain.zetacore.observer.MsgUpdateObserver") proto.RegisterType((*MsgUpdateObserverResponse)(nil), "zetachain.zetacore.observer.MsgUpdateObserverResponse") @@ -945,76 +1074,89 @@ func init() { proto.RegisterType((*MsgUpdateKeygenResponse)(nil), "zetachain.zetacore.observer.MsgUpdateKeygenResponse") proto.RegisterType((*MsgResetChainNonces)(nil), "zetachain.zetacore.observer.MsgResetChainNonces") proto.RegisterType((*MsgResetChainNoncesResponse)(nil), "zetachain.zetacore.observer.MsgResetChainNoncesResponse") + proto.RegisterType((*MsgVoteTSS)(nil), "zetachain.zetacore.observer.MsgVoteTSS") + proto.RegisterType((*MsgVoteTSSResponse)(nil), "zetachain.zetacore.observer.MsgVoteTSSResponse") } func init() { proto.RegisterFile("observer/tx.proto", fileDescriptor_1bcd40fa296a2b1d) } var fileDescriptor_1bcd40fa296a2b1d = []byte{ - // 1024 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x4d, 0x6f, 0xe3, 0x44, - 0x18, 0xae, 0x37, 0xfb, 0xd1, 0xbe, 0xe9, 0xf6, 0x63, 0x48, 0xb7, 0x69, 0xba, 0xcd, 0x56, 0x3e, - 0xa0, 0x00, 0x25, 0x69, 0xb3, 0x80, 0x58, 0x24, 0x0e, 0x2d, 0x1f, 0x6d, 0x58, 0x76, 0x5b, 0x59, - 0xa2, 0x07, 0x2e, 0xd6, 0xc4, 0x33, 0xb1, 0xad, 0x3a, 0x33, 0x91, 0xc7, 0xd9, 0x36, 0x08, 0x90, - 0xf8, 0x01, 0x08, 0x7e, 0x00, 0x7f, 0x82, 0xff, 0xc0, 0x61, 0x8f, 0x7b, 0xe4, 0x84, 0x50, 0x7b, - 0x82, 0x3f, 0xc0, 0x15, 0x79, 0x6c, 0x4f, 0xe2, 0x7c, 0x38, 0x49, 0x4f, 0xcd, 0xcc, 0xfb, 0xbc, - 0xcf, 0xfb, 0x31, 0xcf, 0xbc, 0xe3, 0xc2, 0x3a, 0x6f, 0x0a, 0xea, 0xbf, 0xa2, 0x7e, 0x2d, 0xb8, - 0xaa, 0x76, 0x7c, 0x1e, 0x70, 0xb4, 0xfd, 0x1d, 0x0d, 0xb0, 0xe5, 0x60, 0x97, 0x55, 0xe5, 0x2f, - 0xee, 0xd3, 0x6a, 0x82, 0x2a, 0x15, 0x6c, 0x6e, 0x73, 0x89, 0xab, 0x85, 0xbf, 0x22, 0x97, 0x52, - 0x41, 0xb1, 0x34, 0x3d, 0xdc, 0xa6, 0xf1, 0xee, 0x13, 0xb5, 0x6b, 0xf9, 0x5c, 0x08, 0x49, 0x69, - 0xb6, 0x3c, 0x6c, 0x8b, 0x18, 0xb0, 0xa9, 0x00, 0xc9, 0x8f, 0xd8, 0xb0, 0xa1, 0x0c, 0x1d, 0xec, - 0xe3, 0x76, 0x82, 0xdf, 0xe9, 0x6f, 0x53, 0x46, 0x5c, 0x66, 0x9b, 0x8c, 0x33, 0x8b, 0x26, 0x66, - 0xd4, 0xaf, 0x45, 0xa8, 0x10, 0x9d, 0x0b, 0xbb, 0xd6, 0xf1, 0x39, 0x6f, 0x89, 0xf8, 0x4f, 0x64, - 0xd0, 0xff, 0xd1, 0x60, 0xfd, 0x85, 0xb0, 0xbf, 0xe9, 0x10, 0x1c, 0xd0, 0xd3, 0xd8, 0x11, 0x15, - 0xe1, 0x81, 0xe5, 0x53, 0x1c, 0x70, 0xbf, 0xa8, 0xed, 0x6a, 0x95, 0x25, 0x23, 0x59, 0xa2, 0x7d, - 0x28, 0x70, 0x8f, 0x98, 0x49, 0x08, 0x13, 0x13, 0xe2, 0x53, 0x21, 0x8a, 0x77, 0x24, 0x0c, 0x71, - 0x8f, 0x24, 0x24, 0x87, 0x91, 0x25, 0xf4, 0x60, 0xf4, 0x72, 0xd4, 0x23, 0x17, 0x79, 0x30, 0x7a, - 0x39, 0xec, 0x71, 0x0e, 0x0f, 0xbb, 0x32, 0x1f, 0xd3, 0xa7, 0x58, 0x70, 0x56, 0xbc, 0xbb, 0xab, - 0x55, 0x56, 0xea, 0x07, 0xd5, 0x8c, 0x13, 0xa9, 0x26, 0x24, 0x51, 0x25, 0x86, 0x74, 0x34, 0x96, - 0xbb, 0x03, 0x2b, 0x7d, 0x1b, 0xb6, 0x46, 0x4a, 0x35, 0xa8, 0xe8, 0x70, 0x26, 0xa8, 0xfe, 0x7b, - 0xd4, 0x88, 0x43, 0x42, 0x8e, 0x3c, 0x6e, 0x5d, 0x9c, 0x50, 0x4c, 0x32, 0x1b, 0xb1, 0x05, 0x8b, - 0xd1, 0x49, 0xba, 0x44, 0x16, 0x9f, 0x33, 0x1e, 0xc8, 0x75, 0x83, 0xa0, 0x1d, 0x80, 0x66, 0xc8, - 0x61, 0x3a, 0x58, 0x38, 0xb2, 0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 0x6e, 0x83, 0x3d, 0x48, 0xcd, 0x85, 0xbd, 0xd9, 0xe8, 0x22, - 0xf4, 0xf4, 0x1e, 0x8c, 0x1b, 0x18, 0xa1, 0xf2, 0x87, 0x3e, 0xc9, 0xaa, 0x33, 0xf5, 0x52, 0xe1, - 0xa7, 0x2b, 0x7f, 0xfc, 0xf7, 0x13, 0xfa, 0x11, 0xd6, 0x46, 0xc6, 0xd4, 0xfe, 0x74, 0x01, 0xa5, - 0x3d, 0x4a, 0x1f, 0xcf, 0xeb, 0x91, 0xc4, 0x3f, 0x6a, 0xbc, 0xbe, 0x2e, 0x6b, 0x6f, 0xae, 0xcb, - 0xda, 0xdf, 0xd7, 0x65, 0xed, 0xd7, 0x9b, 0xf2, 0xc2, 0x9b, 0x9b, 0xf2, 0xc2, 0x9f, 0x37, 0xe5, - 0x85, 0x6f, 0x6b, 0xb6, 0x1b, 0x38, 0xdd, 0x66, 0xd5, 0xe2, 0xed, 0x5a, 0xc8, 0xf9, 0xbe, 0xa4, - 0xaf, 0x25, 0xf4, 0xb5, 0xab, 0x5a, 0xff, 0x3f, 0x80, 0x5e, 0x87, 0x8a, 0xe6, 0x7d, 0xf9, 0xad, - 0xff, 0xf4, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc5, 0x1a, 0xf7, 0xc9, 0xe6, 0x0c, 0x00, 0x00, + // 1186 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcd, 0x72, 0xe3, 0x44, + 0x10, 0x8e, 0x36, 0xbb, 0x89, 0xd3, 0xf9, 0x17, 0xc9, 0xc6, 0x71, 0x36, 0xde, 0x94, 0xaa, 0x80, + 0x00, 0x59, 0x3b, 0xf1, 0x02, 0xc5, 0x52, 0xc5, 0x21, 0x59, 0xd8, 0x24, 0x2c, 0xd9, 0xa4, 0x14, + 0xc8, 0x61, 0x2f, 0xaa, 0xb1, 0x34, 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, 0xa9, 0x51, 0x6b, 0x11, 0x16, 0xae, + 0x10, 0xd2, 0x64, 0xff, 0xbb, 0x03, 0xf9, 0x56, 0x6f, 0xe8, 0x59, 0xf9, 0x2c, 0x19, 0x95, 0x19, + 0xac, 0xdf, 0x87, 0x99, 0x90, 0xed, 0x92, 0x2a, 0x6d, 0x12, 0xef, 0x0b, 0x82, 0xaa, 0x11, 0xf6, + 0x04, 0xc1, 0x9c, 0xdd, 0x25, 0x37, 0xd7, 0x60, 0x36, 0x64, 0xfb, 0x4d, 0xde, 0x01, 0x96, 0x85, + 0xed, 0x56, 0x98, 0x01, 0xcc, 0xfb, 0x88, 0x1d, 0xc4, 0xa1, 0x8b, 0x77, 0x49, 0x12, 0x8e, 0x61, + 0x41, 0x46, 0xdd, 0xc3, 0x4a, 0x66, 0xfe, 0xdb, 0xbd, 0x2c, 0xed, 0xde, 0x0e, 0xcd, 0xef, 0xe0, + 0x41, 0xb5, 0x75, 0x55, 0x8f, 0x70, 0x1c, 0xd6, 0x42, 0x17, 0xf1, 0x90, 0xca, 0xec, 0xf3, 0x23, + 0x22, 0xe0, 0x93, 0x3e, 0x05, 0xbf, 0xde, 0x81, 0x9d, 0xe9, 0xde, 0xb2, 0x60, 0xe5, 0xba, 0xc2, + 0xeb, 0xd3, 0xd9, 0x14, 0x9d, 0x24, 0x31, 0xcf, 0xf1, 0xb9, 0x8f, 0x49, 0xc6, 0x99, 0xcc, 0xc1, + 0x3d, 0x11, 0x50, 0xb5, 0x91, 0x7c, 0x51, 0x67, 0xdf, 0xee, 0x42, 0x7b, 0xff, 0xd5, 0x80, 0xb7, + 0xc4, 0x55, 0x65, 0x98, 0x8b, 0x9b, 0xfa, 0x42, 0xac, 0xb4, 0xdb, 0x35, 0xeb, 0x3b, 0x30, 0x2d, + 0x55, 0x62, 0x2f, 0x3a, 0x11, 0x3d, 0x15, 0x0d, 0x31, 0x6c, 0x4f, 0xba, 0xda, 0xf5, 0x57, 0xf4, + 0xd4, 0x5c, 0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7a, 0x39, 0x71, 0xf5, + 0x48, 0x78, 0x2d, 0xa7, 0x5e, 0xcb, 0x67, 0xe5, 0xd6, 0x1f, 0xb6, 0xf3, 0x06, 0x66, 0xd5, 0x11, + 0xf1, 0x0f, 0xec, 0xf1, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xdb, 0x8d, 0x3c, 0x01, 0x95, 0x0e, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1038,6 +1180,7 @@ type MsgClient interface { UpdateKeygen(ctx context.Context, in *MsgUpdateKeygen, opts ...grpc.CallOption) (*MsgUpdateKeygenResponse, error) AddBlockHeader(ctx context.Context, in *MsgAddBlockHeader, opts ...grpc.CallOption) (*MsgAddBlockHeaderResponse, error) ResetChainNonces(ctx context.Context, in *MsgResetChainNonces, opts ...grpc.CallOption) (*MsgResetChainNoncesResponse, error) + VoteTSS(ctx context.Context, in *MsgVoteTSS, opts ...grpc.CallOption) (*MsgVoteTSSResponse, error) } type msgClient struct { @@ -1129,6 +1272,15 @@ func (c *msgClient) ResetChainNonces(ctx context.Context, in *MsgResetChainNonce return out, nil } +func (c *msgClient) VoteTSS(ctx context.Context, in *MsgVoteTSS, opts ...grpc.CallOption) (*MsgVoteTSSResponse, error) { + out := new(MsgVoteTSSResponse) + err := c.cc.Invoke(ctx, "/zetachain.zetacore.observer.Msg/VoteTSS", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { AddObserver(context.Context, *MsgAddObserver) (*MsgAddObserverResponse, error) @@ -1140,6 +1292,7 @@ type MsgServer interface { UpdateKeygen(context.Context, *MsgUpdateKeygen) (*MsgUpdateKeygenResponse, error) AddBlockHeader(context.Context, *MsgAddBlockHeader) (*MsgAddBlockHeaderResponse, error) ResetChainNonces(context.Context, *MsgResetChainNonces) (*MsgResetChainNoncesResponse, error) + VoteTSS(context.Context, *MsgVoteTSS) (*MsgVoteTSSResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1173,6 +1326,9 @@ func (*UnimplementedMsgServer) AddBlockHeader(ctx context.Context, req *MsgAddBl func (*UnimplementedMsgServer) ResetChainNonces(ctx context.Context, req *MsgResetChainNonces) (*MsgResetChainNoncesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ResetChainNonces not implemented") } +func (*UnimplementedMsgServer) VoteTSS(ctx context.Context, req *MsgVoteTSS) (*MsgVoteTSSResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VoteTSS not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1340,6 +1496,24 @@ func _Msg_ResetChainNonces_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Msg_VoteTSS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgVoteTSS) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).VoteTSS(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zetachain.zetacore.observer.Msg/VoteTSS", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).VoteTSS(ctx, req.(*MsgVoteTSS)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "zetachain.zetacore.observer.Msg", HandlerType: (*MsgServer)(nil), @@ -1380,6 +1554,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "ResetChainNonces", Handler: _Msg_ResetChainNonces_Handler, }, + { + MethodName: "VoteTSS", + Handler: _Msg_VoteTSS_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "observer/tx.proto", @@ -2028,6 +2206,106 @@ func (m *MsgResetChainNoncesResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *MsgVoteTSS) 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 *MsgVoteTSS) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteTSS) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x20 + } + if m.KeygenZetaHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.KeygenZetaHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.TssPubkey) > 0 { + i -= len(m.TssPubkey) + copy(dAtA[i:], m.TssPubkey) + i = encodeVarintTx(dAtA, i, uint64(len(m.TssPubkey))) + i-- + dAtA[i] = 0x12 + } + 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 *MsgVoteTSSResponse) 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 *MsgVoteTSSResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgVoteTSSResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.KeygenSuccess { + i-- + if m.KeygenSuccess { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.VoteFinalized { + i-- + if m.VoteFinalized { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if m.BallotCreated { + i-- + if m.BallotCreated { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2309,6 +2587,47 @@ func (m *MsgResetChainNoncesResponse) Size() (n int) { return n } +func (m *MsgVoteTSS) 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.TssPubkey) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.KeygenZetaHeight != 0 { + n += 1 + sovTx(uint64(m.KeygenZetaHeight)) + } + if m.Status != 0 { + n += 1 + sovTx(uint64(m.Status)) + } + return n +} + +func (m *MsgVoteTSSResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BallotCreated { + n += 2 + } + if m.VoteFinalized { + n += 2 + } + if m.KeygenSuccess { + n += 2 + } + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4070,6 +4389,268 @@ func (m *MsgResetChainNoncesResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgVoteTSS) 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: MsgVoteTSS: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteTSS: 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 != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TssPubkey", 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.TssPubkey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeygenZetaHeight", wireType) + } + m.KeygenZetaHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.KeygenZetaHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= chains.ReceiveStatus(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 *MsgVoteTSSResponse) 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: MsgVoteTSSResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgVoteTSSResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field BallotCreated", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.BallotCreated = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VoteFinalized", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.VoteFinalized = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field KeygenSuccess", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.KeygenSuccess = bool(v != 0) + 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/zetaclient/bitcoin/bitcoin_client.go b/zetaclient/bitcoin/bitcoin_client.go index 8f9c1f9463..2fe823811b 100644 --- a/zetaclient/bitcoin/bitcoin_client.go +++ b/zetaclient/bitcoin/bitcoin_client.go @@ -13,20 +13,6 @@ import ( "sync/atomic" "time" - "github.com/zeta-chain/zetacore/pkg/chains" - "github.com/zeta-chain/zetacore/pkg/coin" - "github.com/zeta-chain/zetacore/pkg/constant" - "github.com/zeta-chain/zetacore/pkg/proofs" - corecontext "github.com/zeta-chain/zetacore/zetaclient/core_context" - - appcontext "github.com/zeta-chain/zetacore/zetaclient/app_context" - clientcommon "github.com/zeta-chain/zetacore/zetaclient/common" - "github.com/zeta-chain/zetacore/zetaclient/compliance" - "github.com/zeta-chain/zetacore/zetaclient/config" - "github.com/zeta-chain/zetacore/zetaclient/interfaces" - "github.com/zeta-chain/zetacore/zetaclient/metrics" - "github.com/zeta-chain/zetacore/zetaclient/zetabridge" - cosmosmath "cosmossdk.io/math" "github.com/btcsuite/btcd/btcjson" "github.com/btcsuite/btcd/chaincfg" @@ -38,9 +24,21 @@ import ( lru "github.com/hashicorp/golang-lru" "github.com/pkg/errors" "github.com/rs/zerolog" + "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/pkg/coin" + "github.com/zeta-chain/zetacore/pkg/constant" + "github.com/zeta-chain/zetacore/pkg/proofs" "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" + appcontext "github.com/zeta-chain/zetacore/zetaclient/app_context" + clientcommon "github.com/zeta-chain/zetacore/zetaclient/common" + "github.com/zeta-chain/zetacore/zetaclient/compliance" + "github.com/zeta-chain/zetacore/zetaclient/config" + corecontext "github.com/zeta-chain/zetacore/zetaclient/core_context" + "github.com/zeta-chain/zetacore/zetaclient/interfaces" + "github.com/zeta-chain/zetacore/zetaclient/metrics" clienttypes "github.com/zeta-chain/zetacore/zetaclient/types" + "github.com/zeta-chain/zetacore/zetaclient/zetabridge" "gorm.io/driver/sqlite" "gorm.io/gorm" "gorm.io/gorm/logger" diff --git a/zetaclient/evm/evm_client.go b/zetaclient/evm/evm_client.go index 672c6b65b0..84fbd19e83 100644 --- a/zetaclient/evm/evm_client.go +++ b/zetaclient/evm/evm_client.go @@ -13,20 +13,7 @@ import ( "sync/atomic" "time" - "github.com/zeta-chain/zetacore/pkg/chains" - "github.com/zeta-chain/zetacore/pkg/coin" - "github.com/zeta-chain/zetacore/pkg/proofs" - appcontext "github.com/zeta-chain/zetacore/zetaclient/app_context" - corecontext "github.com/zeta-chain/zetacore/zetaclient/core_context" - - "github.com/zeta-chain/zetacore/zetaclient/interfaces" - "github.com/zeta-chain/zetacore/zetaclient/metrics" - "github.com/zeta-chain/zetacore/zetaclient/zetabridge" - "github.com/ethereum/go-ethereum" - "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/zeta.non-eth.sol" - zetaconnectoreth "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/zetaconnector.eth.sol" - "github.com/ethereum/go-ethereum/accounts/abi/bind" ethcommon "github.com/ethereum/go-ethereum/common" ethtypes "github.com/ethereum/go-ethereum/core/types" @@ -38,13 +25,23 @@ import ( "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/zeta.non-eth.sol" + zetaconnectoreth "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/zetaconnector.eth.sol" "github.com/zeta-chain/protocol-contracts/pkg/contracts/evm/zetaconnector.non-eth.sol" + "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/pkg/coin" + "github.com/zeta-chain/zetacore/pkg/proofs" crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types" observertypes "github.com/zeta-chain/zetacore/x/observer/types" + appcontext "github.com/zeta-chain/zetacore/zetaclient/app_context" clientcommon "github.com/zeta-chain/zetacore/zetaclient/common" "github.com/zeta-chain/zetacore/zetaclient/compliance" "github.com/zeta-chain/zetacore/zetaclient/config" + corecontext "github.com/zeta-chain/zetacore/zetaclient/core_context" + "github.com/zeta-chain/zetacore/zetaclient/interfaces" + "github.com/zeta-chain/zetacore/zetaclient/metrics" clienttypes "github.com/zeta-chain/zetacore/zetaclient/types" + "github.com/zeta-chain/zetacore/zetaclient/zetabridge" "gorm.io/driver/sqlite" "gorm.io/gorm" ) diff --git a/zetaclient/zetabridge/tx.go b/zetaclient/zetabridge/tx.go index 1c604af4ef..90e44b16f5 100644 --- a/zetaclient/zetabridge/tx.go +++ b/zetaclient/zetabridge/tx.go @@ -7,19 +7,18 @@ import ( "time" "cosmossdk.io/math" - "github.com/zeta-chain/zetacore/pkg/coin" - "github.com/zeta-chain/zetacore/pkg/proofs" - appcontext "github.com/zeta-chain/zetacore/zetaclient/app_context" - authz2 "github.com/zeta-chain/zetacore/zetaclient/authz" - clientcommon "github.com/zeta-chain/zetacore/zetaclient/common" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/authz" "github.com/pkg/errors" "github.com/zeta-chain/go-tss/blame" "github.com/zeta-chain/zetacore/pkg/chains" + "github.com/zeta-chain/zetacore/pkg/coin" + "github.com/zeta-chain/zetacore/pkg/proofs" "github.com/zeta-chain/zetacore/x/crosschain/types" - observerTypes "github.com/zeta-chain/zetacore/x/observer/types" + observertypes "github.com/zeta-chain/zetacore/x/observer/types" + appcontext "github.com/zeta-chain/zetacore/zetaclient/app_context" + clientauthz "github.com/zeta-chain/zetacore/zetaclient/authz" + clientcommon "github.com/zeta-chain/zetacore/zetaclient/common" ) // GasPriceMultiplier returns the gas price multiplier for the given chain @@ -32,15 +31,15 @@ func GasPriceMultiplier(chainID int64) (float64, error) { return 0, fmt.Errorf("cannot get gas price multiplier for unknown chain %d", chainID) } -func (b *ZetaCoreBridge) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, authz2.Signer, error) { +func (b *ZetaCoreBridge) WrapMessageWithAuthz(msg sdk.Msg) (sdk.Msg, clientauthz.Signer, error) { msgURL := sdk.MsgTypeURL(msg) // verify message validity if err := msg.ValidateBasic(); err != nil { - return nil, authz2.Signer{}, fmt.Errorf("%s invalid msg | %s", msgURL, err.Error()) + return nil, clientauthz.Signer{}, fmt.Errorf("%s invalid msg | %s", msgURL, err.Error()) } - authzSigner := authz2.GetSigner(msgURL) + authzSigner := clientauthz.GetSigner(msgURL) authzMessage := authz.NewMsgExec(authzSigner.GranteeAddress, []sdk.Msg{msg}) return &authzMessage, authzSigner, nil } @@ -107,7 +106,7 @@ func (b *ZetaCoreBridge) AddTxHashToOutTxTracker( func (b *ZetaCoreBridge) SetTSS(tssPubkey string, keyGenZetaHeight int64, status chains.ReceiveStatus) (string, error) { signerAddress := b.keys.GetOperatorAddress().String() - msg := types.NewMsgCreateTSSVoter(signerAddress, tssPubkey, keyGenZetaHeight, status) + msg := observertypes.NewMsgVoteTSS(signerAddress, tssPubkey, keyGenZetaHeight, status) authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) if err != nil { @@ -148,12 +147,12 @@ func (b *ZetaCoreBridge) CoreContextUpdater(appContext *appcontext.AppContext) { func (b *ZetaCoreBridge) PostBlameData(blame *blame.Blame, chainID int64, index string) (string, error) { signerAddress := b.keys.GetOperatorAddress().String() - zetaBlame := observerTypes.Blame{ + zetaBlame := observertypes.Blame{ Index: index, FailureReason: blame.FailReason, - Nodes: observerTypes.ConvertNodes(blame.BlameNodes), + Nodes: observertypes.ConvertNodes(blame.BlameNodes), } - msg := observerTypes.NewMsgAddBlameVoteMsg(signerAddress, chainID, zetaBlame) + msg := observertypes.NewMsgAddBlameVoteMsg(signerAddress, chainID, zetaBlame) authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) if err != nil { @@ -176,7 +175,7 @@ func (b *ZetaCoreBridge) PostBlameData(blame *blame.Blame, chainID int64, index func (b *ZetaCoreBridge) PostAddBlockHeader(chainID int64, blockHash []byte, height int64, header proofs.HeaderData) (string, error) { signerAddress := b.keys.GetOperatorAddress().String() - msg := observerTypes.NewMsgAddBlockHeader(signerAddress, chainID, blockHash, height, header) + msg := observertypes.NewMsgAddBlockHeader(signerAddress, chainID, blockHash, height, header) authzMsg, authzSigner, err := b.WrapMessageWithAuthz(msg) if err != nil {