From 489899268a173146ab8c55025823728791268379 Mon Sep 17 00:00:00 2001 From: Fangyu Gai Date: Wed, 4 Dec 2024 18:12:30 +0800 Subject: [PATCH 1/4] remove register-finality-provider --- .../cmd/fpd/daemon/daemon_commands.go | 63 +- finality-provider/cmd/fpd/daemon/tx_test.go | 3 +- finality-provider/cmd/fpd/main.go | 5 +- .../proto/finality_providers.pb.go | 883 +++++++----------- .../proto/finality_providers.proto | 74 +- .../proto/finality_providers_grpc.pb.go | 41 - finality-provider/service/app.go | 207 ++-- finality-provider/service/app_test.go | 229 ++--- finality-provider/service/client/rpcclient.go | 17 +- finality-provider/service/event_loops.go | 63 +- finality-provider/service/fp_instance_test.go | 29 +- finality-provider/service/fp_store_adapter.go | 30 +- finality-provider/service/rpcserver.go | 18 +- finality-provider/store/fpstore.go | 14 +- finality-provider/store/fpstore_test.go | 30 +- finality-provider/store/storedfp.go | 21 +- finality-provider/store/storedfp_test.go | 8 +- itest/test_manager.go | 4 +- testutil/datagen.go | 49 +- 19 files changed, 600 insertions(+), 1188 deletions(-) diff --git a/finality-provider/cmd/fpd/daemon/daemon_commands.go b/finality-provider/cmd/fpd/daemon/daemon_commands.go index 64a576a2..2b251a11 100644 --- a/finality-provider/cmd/fpd/daemon/daemon_commands.go +++ b/finality-provider/cmd/fpd/daemon/daemon_commands.go @@ -81,18 +81,17 @@ func CommandCreateFP() *cobra.Command { f := cmd.Flags() f.String(fpdDaemonAddressFlag, defaultFpdDaemonAddress, "The RPC server address of fpd") - f.String(keyNameFlag, "", "The unique name of the finality provider key") + f.String(keyNameFlag, "", "The unique key name of the finality provider's Babylon account") f.String(sdkflags.FlagHome, fpcfg.DefaultFpdDir, "The application home directory") f.String(chainIDFlag, "", "The identifier of the consumer chain") f.String(passphraseFlag, "", "The pass phrase used to encrypt the keys") - f.String(hdPathFlag, "", "The hd path used to derive the private key") f.String(commissionRateFlag, "0.05", "The commission rate for the finality provider, e.g., 0.05") f.String(monikerFlag, "", "A human-readable name for the finality provider") f.String(identityFlag, "", "An optional identity signature (ex. UPort or Keybase)") f.String(websiteFlag, "", "An optional website link") f.String(securityContactFlag, "", "An email for security contact") f.String(detailsFlag, "", "Other optional details") - f.String(fpEotsPkFlag, "", "The hex string of the EOTS public key") + f.String(fpEotsPkFlag, "", "The hex string of the finality provider's EOTS public key") // make flags required if err := cmd.MarkFlagRequired(chainIDFlag); err != nil { @@ -168,11 +167,6 @@ func runCommandCreateFP(ctx client.Context, cmd *cobra.Command, _ []string) erro return fmt.Errorf("failed to read flag %s: %w", passphraseFlag, err) } - hdPath, err := flags.GetString(hdPathFlag) - if err != nil { - return fmt.Errorf("failed to read flag %s: %w", hdPathFlag, err) - } - eotsPkHex, err := flags.GetString(fpEotsPkFlag) if err != nil { return fmt.Errorf("failed to read flag %s: %w", fpEotsPkFlag, err) @@ -188,7 +182,6 @@ func runCommandCreateFP(ctx client.Context, cmd *cobra.Command, _ []string) erro chainID, eotsPkHex, passphrase, - hdPath, description, &commissionRate, ) @@ -353,58 +346,6 @@ func runCommandInfoFP(cmd *cobra.Command, args []string) error { return nil } -// CommandRegisterFP returns the register-finality-provider command by connecting to the fpd daemon. -func CommandRegisterFP() *cobra.Command { - var cmd = &cobra.Command{ - Use: "register-finality-provider [fp-eots-pk-hex]", - Aliases: []string{"rfp"}, - Short: "Register a created finality provider to Babylon.", - Example: fmt.Sprintf(`fpd register-finality-provider --daemon-address %s`, defaultFpdDaemonAddress), - Args: cobra.ExactArgs(1), - RunE: runCommandRegisterFP, - } - f := cmd.Flags() - f.String(fpdDaemonAddressFlag, defaultFpdDaemonAddress, "The RPC server address of fpd") - f.String(passphraseFlag, "", "The pass phrase used to encrypt the keys") - return cmd -} - -func runCommandRegisterFP(cmd *cobra.Command, args []string) error { - fpPk, err := types.NewBIP340PubKeyFromHex(args[0]) - if err != nil { - return err - } - - flags := cmd.Flags() - daemonAddress, err := flags.GetString(fpdDaemonAddressFlag) - if err != nil { - return fmt.Errorf("failed to read flag %s: %w", fpdDaemonAddressFlag, err) - } - - client, cleanUp, err := dc.NewFinalityProviderServiceGRpcClient(daemonAddress) - if err != nil { - return err - } - defer func() { - if err := cleanUp(); err != nil { - fmt.Printf("Failed to clean up grpc client: %v\n", err) - } - }() - - passphrase, err := flags.GetString(passphraseFlag) - if err != nil { - return fmt.Errorf("failed to read flag %s: %w", passphraseFlag, err) - } - - res, err := client.RegisterFinalityProvider(context.Background(), fpPk, passphrase) - if err != nil { - return err - } - printRespJSON(res) - - return nil -} - // CommandAddFinalitySig returns the add-finality-sig command by connecting to the fpd daemon. func CommandAddFinalitySig() *cobra.Command { var cmd = &cobra.Command{ diff --git a/finality-provider/cmd/fpd/daemon/tx_test.go b/finality-provider/cmd/fpd/daemon/tx_test.go index 52f81c86..b2f7530b 100644 --- a/finality-provider/cmd/fpd/daemon/tx_test.go +++ b/finality-provider/cmd/fpd/daemon/tx_test.go @@ -23,6 +23,7 @@ import ( bbn "github.com/babylonlabs-io/babylon/types" btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" "github.com/babylonlabs-io/finality-provider/finality-provider/cmd/fpd/daemon" fpcfg "github.com/babylonlabs-io/finality-provider/finality-provider/config" @@ -115,7 +116,7 @@ func rootCmd(outputBuff *bytes.Buffer) *cobra.Command { cmd.AddCommand( daemon.CommandInit(), daemon.CommandStart(), daemon.CommandKeys(), daemon.CommandGetDaemonInfo(), daemon.CommandCreateFP(), daemon.CommandLsFP(), - daemon.CommandInfoFP(), daemon.CommandRegisterFP(), daemon.CommandAddFinalitySig(), + daemon.CommandInfoFP(), daemon.CommandAddFinalitySig(), daemon.CommandExportFP(), daemon.CommandTxs(), ) diff --git a/finality-provider/cmd/fpd/main.go b/finality-provider/cmd/fpd/main.go index 8f101e93..46efc580 100644 --- a/finality-provider/cmd/fpd/main.go +++ b/finality-provider/cmd/fpd/main.go @@ -2,9 +2,10 @@ package main import ( "fmt" - "github.com/babylonlabs-io/finality-provider/version" "os" + "github.com/babylonlabs-io/finality-provider/version" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cobra" @@ -33,7 +34,7 @@ func main() { cmd.AddCommand( daemon.CommandInit(), daemon.CommandStart(), daemon.CommandKeys(), daemon.CommandGetDaemonInfo(), daemon.CommandCreateFP(), daemon.CommandLsFP(), - daemon.CommandInfoFP(), daemon.CommandRegisterFP(), daemon.CommandAddFinalitySig(), + daemon.CommandInfoFP(), daemon.CommandAddFinalitySig(), daemon.CommandExportFP(), daemon.CommandTxs(), daemon.CommandUnjailFP(), daemon.CommandEditFinalityDescription(), version.CommandVersion("fpd"), daemon.CommandCommitPubRand(), diff --git a/finality-provider/proto/finality_providers.pb.go b/finality-provider/proto/finality_providers.pb.go index de665a82..fa9de0f6 100644 --- a/finality-provider/proto/finality_providers.pb.go +++ b/finality-provider/proto/finality_providers.pb.go @@ -24,55 +24,54 @@ const ( ) // FinalityProviderStatus is the status of a finality provider -// a FinalityProvider object has 4 states: -// - Created - created and managed by finality provider client, not registered to -// the consumer chain yet +// a FinalityProvider object has 5 states: // - Registered - created and registered to the consumer chain, but not voting yet (No // delegated stake) -// - Active - created and registered to the consumer chain with stake to vote -// - Inactive - created and registered to the consumer chain with no stake to vote. +// - Inactive - the finality provider does not have voting power to vote +// - Active - the finality provider has voting power to vote // Finality Provider was already active. +// - Slashed - the finality provider looses all the voting power forever due to double voting +// - Jailed - the finality provider temporarily looses the voting power due to being sluggish // -// Valid State Transactions: -// - Created -> Registered -// - Registered -> Active -// - Active -> Inactive -// - Inactive -> Active +// Possible State Transactions: +// - Registered -> Inactive +// - Inactive -> Active +// - Active -> Inactive +// - Active -> Slashed +// - Active -> Jailed +// - Jailed -> Active +// - Jailed -> Inactive type FinalityProviderStatus int32 const ( - // CREATED defines a finality provider that is awaiting registration - FinalityProviderStatus_CREATED FinalityProviderStatus = 0 // REGISTERED defines a finality provider that has been registered // to the consumer chain but has no delegated stake - FinalityProviderStatus_REGISTERED FinalityProviderStatus = 1 + FinalityProviderStatus_REGISTERED FinalityProviderStatus = 0 // ACTIVE defines a finality provider that is delegated to vote - FinalityProviderStatus_ACTIVE FinalityProviderStatus = 2 + FinalityProviderStatus_ACTIVE FinalityProviderStatus = 1 // INACTIVE defines a finality provider whose delegations are reduced to zero but not slashed - FinalityProviderStatus_INACTIVE FinalityProviderStatus = 3 + FinalityProviderStatus_INACTIVE FinalityProviderStatus = 2 // SLASHED defines a finality provider that has been slashed - FinalityProviderStatus_SLASHED FinalityProviderStatus = 4 + FinalityProviderStatus_SLASHED FinalityProviderStatus = 3 // JAILED defines a finality provider that has been jailed - FinalityProviderStatus_JAILED FinalityProviderStatus = 5 + FinalityProviderStatus_JAILED FinalityProviderStatus = 4 ) // Enum value maps for FinalityProviderStatus. var ( FinalityProviderStatus_name = map[int32]string{ - 0: "CREATED", - 1: "REGISTERED", - 2: "ACTIVE", - 3: "INACTIVE", - 4: "SLASHED", - 5: "JAILED", + 0: "REGISTERED", + 1: "ACTIVE", + 2: "INACTIVE", + 3: "SLASHED", + 4: "JAILED", } FinalityProviderStatus_value = map[string]int32{ - "CREATED": 0, - "REGISTERED": 1, - "ACTIVE": 2, - "INACTIVE": 3, - "SLASHED": 4, - "JAILED": 5, + "REGISTERED": 0, + "ACTIVE": 1, + "INACTIVE": 2, + "SLASHED": 3, + "JAILED": 4, } ) @@ -197,18 +196,16 @@ type CreateFinalityProviderRequest struct { KeyName string `protobuf:"bytes,1,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"` // passphrase is used to encrypt the keys Passphrase string `protobuf:"bytes,2,opt,name=passphrase,proto3" json:"passphrase,omitempty"` - // hd_path is the hd path for private key derivation - HdPath string `protobuf:"bytes,3,opt,name=hd_path,json=hdPath,proto3" json:"hd_path,omitempty"` // chain_id is the identifier of the consumer chain that the finality provider is connected to - ChainId string `protobuf:"bytes,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // description defines the description terms for the finality provider - Description []byte `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` + Description []byte `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` // commission defines the commission rate for the finality provider - Commission string `protobuf:"bytes,6,opt,name=commission,proto3" json:"commission,omitempty"` + Commission string `protobuf:"bytes,5,opt,name=commission,proto3" json:"commission,omitempty"` // eots_pk_hex it is the optional EOTS public key and used to ask for // the key record from the EOTS manager for the corresponding EOTS public key. // If this property is not set, it will create a new EOTS key. - EotsPkHex string `protobuf:"bytes,7,opt,name=eots_pk_hex,json=eotsPkHex,proto3" json:"eots_pk_hex,omitempty"` + EotsPkHex string `protobuf:"bytes,6,opt,name=eots_pk_hex,json=eotsPkHex,proto3" json:"eots_pk_hex,omitempty"` } func (x *CreateFinalityProviderRequest) Reset() { @@ -257,13 +254,6 @@ func (x *CreateFinalityProviderRequest) GetPassphrase() string { return "" } -func (x *CreateFinalityProviderRequest) GetHdPath() string { - if x != nil { - return x.HdPath - } - return "" -} - func (x *CreateFinalityProviderRequest) GetChainId() string { if x != nil { return x.ChainId @@ -298,6 +288,8 @@ type CreateFinalityProviderResponse struct { unknownFields protoimpl.UnknownFields FinalityProvider *FinalityProviderInfo `protobuf:"bytes,1,opt,name=finality_provider,json=finalityProvider,proto3" json:"finality_provider,omitempty"` + // hash of the successful finality provider creation transaction + TxHash string `protobuf:"bytes,2,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` } func (x *CreateFinalityProviderResponse) Reset() { @@ -339,105 +331,7 @@ func (x *CreateFinalityProviderResponse) GetFinalityProvider() *FinalityProvider return nil } -type RegisterFinalityProviderRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // btc_pk is hex string of the BTC secp256k1 public key of the finality provider encoded in BIP-340 spec - BtcPk string `protobuf:"bytes,1,opt,name=btc_pk,json=btcPk,proto3" json:"btc_pk,omitempty"` - // passphrase is used to encrypt the keys - Passphrase string `protobuf:"bytes,2,opt,name=passphrase,proto3" json:"passphrase,omitempty"` -} - -func (x *RegisterFinalityProviderRequest) Reset() { - *x = RegisterFinalityProviderRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterFinalityProviderRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterFinalityProviderRequest) ProtoMessage() {} - -func (x *RegisterFinalityProviderRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterFinalityProviderRequest.ProtoReflect.Descriptor instead. -func (*RegisterFinalityProviderRequest) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{4} -} - -func (x *RegisterFinalityProviderRequest) GetBtcPk() string { - if x != nil { - return x.BtcPk - } - return "" -} - -func (x *RegisterFinalityProviderRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - -type RegisterFinalityProviderResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // hash of the successful chain registration transaction - TxHash string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` -} - -func (x *RegisterFinalityProviderResponse) Reset() { - *x = RegisterFinalityProviderResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegisterFinalityProviderResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterFinalityProviderResponse) ProtoMessage() {} - -func (x *RegisterFinalityProviderResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegisterFinalityProviderResponse.ProtoReflect.Descriptor instead. -func (*RegisterFinalityProviderResponse) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{5} -} - -func (x *RegisterFinalityProviderResponse) GetTxHash() string { +func (x *CreateFinalityProviderResponse) GetTxHash() string { if x != nil { return x.TxHash } @@ -460,7 +354,7 @@ type AddFinalitySignatureRequest struct { func (x *AddFinalitySignatureRequest) Reset() { *x = AddFinalitySignatureRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[6] + mi := &file_finality_providers_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -473,7 +367,7 @@ func (x *AddFinalitySignatureRequest) String() string { func (*AddFinalitySignatureRequest) ProtoMessage() {} func (x *AddFinalitySignatureRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[6] + mi := &file_finality_providers_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -486,7 +380,7 @@ func (x *AddFinalitySignatureRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddFinalitySignatureRequest.ProtoReflect.Descriptor instead. func (*AddFinalitySignatureRequest) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{6} + return file_finality_providers_proto_rawDescGZIP(), []int{4} } func (x *AddFinalitySignatureRequest) GetBtcPk() string { @@ -526,7 +420,7 @@ type AddFinalitySignatureResponse struct { func (x *AddFinalitySignatureResponse) Reset() { *x = AddFinalitySignatureResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[7] + mi := &file_finality_providers_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -539,7 +433,7 @@ func (x *AddFinalitySignatureResponse) String() string { func (*AddFinalitySignatureResponse) ProtoMessage() {} func (x *AddFinalitySignatureResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[7] + mi := &file_finality_providers_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -552,7 +446,7 @@ func (x *AddFinalitySignatureResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddFinalitySignatureResponse.ProtoReflect.Descriptor instead. func (*AddFinalitySignatureResponse) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{7} + return file_finality_providers_proto_rawDescGZIP(), []int{5} } func (x *AddFinalitySignatureResponse) GetTxHash() string { @@ -588,7 +482,7 @@ type UnjailFinalityProviderRequest struct { func (x *UnjailFinalityProviderRequest) Reset() { *x = UnjailFinalityProviderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[8] + mi := &file_finality_providers_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -601,7 +495,7 @@ func (x *UnjailFinalityProviderRequest) String() string { func (*UnjailFinalityProviderRequest) ProtoMessage() {} func (x *UnjailFinalityProviderRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[8] + mi := &file_finality_providers_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -614,7 +508,7 @@ func (x *UnjailFinalityProviderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnjailFinalityProviderRequest.ProtoReflect.Descriptor instead. func (*UnjailFinalityProviderRequest) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{8} + return file_finality_providers_proto_rawDescGZIP(), []int{6} } func (x *UnjailFinalityProviderRequest) GetBtcPk() string { @@ -636,7 +530,7 @@ type UnjailFinalityProviderResponse struct { func (x *UnjailFinalityProviderResponse) Reset() { *x = UnjailFinalityProviderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[9] + mi := &file_finality_providers_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -649,7 +543,7 @@ func (x *UnjailFinalityProviderResponse) String() string { func (*UnjailFinalityProviderResponse) ProtoMessage() {} func (x *UnjailFinalityProviderResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[9] + mi := &file_finality_providers_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -662,7 +556,7 @@ func (x *UnjailFinalityProviderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnjailFinalityProviderResponse.ProtoReflect.Descriptor instead. func (*UnjailFinalityProviderResponse) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{9} + return file_finality_providers_proto_rawDescGZIP(), []int{7} } func (x *UnjailFinalityProviderResponse) GetTxHash() string { @@ -684,7 +578,7 @@ type QueryFinalityProviderRequest struct { func (x *QueryFinalityProviderRequest) Reset() { *x = QueryFinalityProviderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[10] + mi := &file_finality_providers_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -697,7 +591,7 @@ func (x *QueryFinalityProviderRequest) String() string { func (*QueryFinalityProviderRequest) ProtoMessage() {} func (x *QueryFinalityProviderRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[10] + mi := &file_finality_providers_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -710,7 +604,7 @@ func (x *QueryFinalityProviderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryFinalityProviderRequest.ProtoReflect.Descriptor instead. func (*QueryFinalityProviderRequest) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{10} + return file_finality_providers_proto_rawDescGZIP(), []int{8} } func (x *QueryFinalityProviderRequest) GetBtcPk() string { @@ -731,7 +625,7 @@ type QueryFinalityProviderResponse struct { func (x *QueryFinalityProviderResponse) Reset() { *x = QueryFinalityProviderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[11] + mi := &file_finality_providers_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -744,7 +638,7 @@ func (x *QueryFinalityProviderResponse) String() string { func (*QueryFinalityProviderResponse) ProtoMessage() {} func (x *QueryFinalityProviderResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[11] + mi := &file_finality_providers_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -757,7 +651,7 @@ func (x *QueryFinalityProviderResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryFinalityProviderResponse.ProtoReflect.Descriptor instead. func (*QueryFinalityProviderResponse) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{11} + return file_finality_providers_proto_rawDescGZIP(), []int{9} } func (x *QueryFinalityProviderResponse) GetFinalityProvider() *FinalityProviderInfo { @@ -776,7 +670,7 @@ type QueryFinalityProviderListRequest struct { func (x *QueryFinalityProviderListRequest) Reset() { *x = QueryFinalityProviderListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[12] + mi := &file_finality_providers_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -789,7 +683,7 @@ func (x *QueryFinalityProviderListRequest) String() string { func (*QueryFinalityProviderListRequest) ProtoMessage() {} func (x *QueryFinalityProviderListRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[12] + mi := &file_finality_providers_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -802,7 +696,7 @@ func (x *QueryFinalityProviderListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryFinalityProviderListRequest.ProtoReflect.Descriptor instead. func (*QueryFinalityProviderListRequest) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{12} + return file_finality_providers_proto_rawDescGZIP(), []int{10} } type QueryFinalityProviderListResponse struct { @@ -816,7 +710,7 @@ type QueryFinalityProviderListResponse struct { func (x *QueryFinalityProviderListResponse) Reset() { *x = QueryFinalityProviderListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[13] + mi := &file_finality_providers_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -829,7 +723,7 @@ func (x *QueryFinalityProviderListResponse) String() string { func (*QueryFinalityProviderListResponse) ProtoMessage() {} func (x *QueryFinalityProviderListResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[13] + mi := &file_finality_providers_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -842,7 +736,7 @@ func (x *QueryFinalityProviderListResponse) ProtoReflect() protoreflect.Message // Deprecated: Use QueryFinalityProviderListResponse.ProtoReflect.Descriptor instead. func (*QueryFinalityProviderListResponse) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{13} + return file_finality_providers_proto_rawDescGZIP(), []int{11} } func (x *QueryFinalityProviderListResponse) GetFinalityProviders() []*FinalityProviderInfo { @@ -866,22 +760,18 @@ type FinalityProvider struct { Description []byte `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // commission defines the commission rate for the finality provider Commission string `protobuf:"bytes,4,opt,name=commission,proto3" json:"commission,omitempty"` - // pop is the proof of possession of chain_pk and btc_pk - Pop *ProofOfPossession `protobuf:"bytes,5,opt,name=pop,proto3" json:"pop,omitempty"` - // key_name is the identifier of the keyring - KeyName string `protobuf:"bytes,6,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"` // chain_id is the identifier of the consumer chain that the finality provider connected to - ChainId string `protobuf:"bytes,7,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,5,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // last_voted_height defines the height of the last voted chain block - LastVotedHeight uint64 `protobuf:"varint,8,opt,name=last_voted_height,json=lastVotedHeight,proto3" json:"last_voted_height,omitempty"` + LastVotedHeight uint64 `protobuf:"varint,6,opt,name=last_voted_height,json=lastVotedHeight,proto3" json:"last_voted_height,omitempty"` // status defines the current finality provider status - Status FinalityProviderStatus `protobuf:"varint,9,opt,name=status,proto3,enum=proto.FinalityProviderStatus" json:"status,omitempty"` + Status FinalityProviderStatus `protobuf:"varint,7,opt,name=status,proto3,enum=proto.FinalityProviderStatus" json:"status,omitempty"` } func (x *FinalityProvider) Reset() { *x = FinalityProvider{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[14] + mi := &file_finality_providers_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -894,7 +784,7 @@ func (x *FinalityProvider) String() string { func (*FinalityProvider) ProtoMessage() {} func (x *FinalityProvider) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[14] + mi := &file_finality_providers_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -907,7 +797,7 @@ func (x *FinalityProvider) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalityProvider.ProtoReflect.Descriptor instead. func (*FinalityProvider) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{14} + return file_finality_providers_proto_rawDescGZIP(), []int{12} } func (x *FinalityProvider) GetFpAddr() string { @@ -938,20 +828,6 @@ func (x *FinalityProvider) GetCommission() string { return "" } -func (x *FinalityProvider) GetPop() *ProofOfPossession { - if x != nil { - return x.Pop - } - return nil -} - -func (x *FinalityProvider) GetKeyName() string { - if x != nil { - return x.KeyName - } - return "" -} - func (x *FinalityProvider) GetChainId() string { if x != nil { return x.ChainId @@ -970,7 +846,7 @@ func (x *FinalityProvider) GetStatus() FinalityProviderStatus { if x != nil { return x.Status } - return FinalityProviderStatus_CREATED + return FinalityProviderStatus_REGISTERED } // FinalityProviderInfo is the basic information of a finality provider mainly for external usage @@ -998,7 +874,7 @@ type FinalityProviderInfo struct { func (x *FinalityProviderInfo) Reset() { *x = FinalityProviderInfo{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[15] + mi := &file_finality_providers_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1011,7 +887,7 @@ func (x *FinalityProviderInfo) String() string { func (*FinalityProviderInfo) ProtoMessage() {} func (x *FinalityProviderInfo) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[15] + mi := &file_finality_providers_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1024,7 +900,7 @@ func (x *FinalityProviderInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use FinalityProviderInfo.ProtoReflect.Descriptor instead. func (*FinalityProviderInfo) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{15} + return file_finality_providers_proto_rawDescGZIP(), []int{13} } func (x *FinalityProviderInfo) GetFpAddr() string { @@ -1092,7 +968,7 @@ type Description struct { func (x *Description) Reset() { *x = Description{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[16] + mi := &file_finality_providers_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1105,7 +981,7 @@ func (x *Description) String() string { func (*Description) ProtoMessage() {} func (x *Description) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[16] + mi := &file_finality_providers_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1118,7 +994,7 @@ func (x *Description) ProtoReflect() protoreflect.Message { // Deprecated: Use Description.ProtoReflect.Descriptor instead. func (*Description) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{16} + return file_finality_providers_proto_rawDescGZIP(), []int{14} } func (x *Description) GetMoniker() string { @@ -1172,7 +1048,7 @@ type ProofOfPossession struct { func (x *ProofOfPossession) Reset() { *x = ProofOfPossession{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[17] + mi := &file_finality_providers_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1185,7 +1061,7 @@ func (x *ProofOfPossession) String() string { func (*ProofOfPossession) ProtoMessage() {} func (x *ProofOfPossession) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[17] + mi := &file_finality_providers_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1198,7 +1074,7 @@ func (x *ProofOfPossession) ProtoReflect() protoreflect.Message { // Deprecated: Use ProofOfPossession.ProtoReflect.Descriptor instead. func (*ProofOfPossession) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{17} + return file_finality_providers_proto_rawDescGZIP(), []int{15} } func (x *ProofOfPossession) GetBtcSig() []byte { @@ -1220,7 +1096,7 @@ type SchnorrRandPair struct { func (x *SchnorrRandPair) Reset() { *x = SchnorrRandPair{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[18] + mi := &file_finality_providers_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1233,7 +1109,7 @@ func (x *SchnorrRandPair) String() string { func (*SchnorrRandPair) ProtoMessage() {} func (x *SchnorrRandPair) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[18] + mi := &file_finality_providers_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1246,7 +1122,7 @@ func (x *SchnorrRandPair) ProtoReflect() protoreflect.Message { // Deprecated: Use SchnorrRandPair.ProtoReflect.Descriptor instead. func (*SchnorrRandPair) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{18} + return file_finality_providers_proto_rawDescGZIP(), []int{16} } func (x *SchnorrRandPair) GetPubRand() []byte { @@ -1281,7 +1157,7 @@ type SignMessageFromChainKeyRequest struct { func (x *SignMessageFromChainKeyRequest) Reset() { *x = SignMessageFromChainKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[19] + mi := &file_finality_providers_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1294,7 +1170,7 @@ func (x *SignMessageFromChainKeyRequest) String() string { func (*SignMessageFromChainKeyRequest) ProtoMessage() {} func (x *SignMessageFromChainKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[19] + mi := &file_finality_providers_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1307,7 +1183,7 @@ func (x *SignMessageFromChainKeyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignMessageFromChainKeyRequest.ProtoReflect.Descriptor instead. func (*SignMessageFromChainKeyRequest) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{19} + return file_finality_providers_proto_rawDescGZIP(), []int{17} } func (x *SignMessageFromChainKeyRequest) GetMsgToSign() []byte { @@ -1350,7 +1226,7 @@ type SignMessageFromChainKeyResponse struct { func (x *SignMessageFromChainKeyResponse) Reset() { *x = SignMessageFromChainKeyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[20] + mi := &file_finality_providers_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1363,7 +1239,7 @@ func (x *SignMessageFromChainKeyResponse) String() string { func (*SignMessageFromChainKeyResponse) ProtoMessage() {} func (x *SignMessageFromChainKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[20] + mi := &file_finality_providers_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1376,7 +1252,7 @@ func (x *SignMessageFromChainKeyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SignMessageFromChainKeyResponse.ProtoReflect.Descriptor instead. func (*SignMessageFromChainKeyResponse) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{20} + return file_finality_providers_proto_rawDescGZIP(), []int{18} } func (x *SignMessageFromChainKeyResponse) GetSignature() []byte { @@ -1403,7 +1279,7 @@ type EditFinalityProviderRequest struct { func (x *EditFinalityProviderRequest) Reset() { *x = EditFinalityProviderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[21] + mi := &file_finality_providers_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1416,7 +1292,7 @@ func (x *EditFinalityProviderRequest) String() string { func (*EditFinalityProviderRequest) ProtoMessage() {} func (x *EditFinalityProviderRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[21] + mi := &file_finality_providers_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1429,7 +1305,7 @@ func (x *EditFinalityProviderRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EditFinalityProviderRequest.ProtoReflect.Descriptor instead. func (*EditFinalityProviderRequest) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{21} + return file_finality_providers_proto_rawDescGZIP(), []int{19} } func (x *EditFinalityProviderRequest) GetBtcPk() string { @@ -1463,7 +1339,7 @@ type EmptyResponse struct { func (x *EmptyResponse) Reset() { *x = EmptyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[22] + mi := &file_finality_providers_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1476,7 +1352,7 @@ func (x *EmptyResponse) String() string { func (*EmptyResponse) ProtoMessage() {} func (x *EmptyResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[22] + mi := &file_finality_providers_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1489,7 +1365,7 @@ func (x *EmptyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead. func (*EmptyResponse) Descriptor() ([]byte, []int) { - return file_finality_providers_proto_rawDescGZIP(), []int{22} + return file_finality_providers_proto_rawDescGZIP(), []int{20} } var File_finality_providers_proto protoreflect.FileDescriptor @@ -1506,244 +1382,222 @@ var file_finality_providers_proto_rawDesc = []byte{ 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x95, 0x02, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfc, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, - 0x72, 0x61, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x64, 0x50, 0x61, 0x74, 0x68, 0x12, 0x19, 0x0a, - 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, - 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, - 0x44, 0x65, 0x63, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x1e, 0x0a, 0x0b, 0x65, 0x6f, 0x74, 0x73, 0x5f, 0x70, 0x6b, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6f, 0x74, 0x73, 0x50, 0x6b, 0x48, 0x65, 0x78, 0x22, - 0x6a, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, - 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x48, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x58, 0x0a, 0x1f, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, + 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, + 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, + 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6f, 0x74, 0x73, 0x5f, 0x70, + 0x6b, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x6f, 0x74, + 0x73, 0x50, 0x6b, 0x48, 0x65, 0x78, 0x22, 0x83, 0x01, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x11, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x67, 0x0a, 0x1b, + 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x74, 0x63, + 0x50, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, + 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, + 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, 0x83, 0x01, 0x0a, 0x1c, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, + 0x28, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x6b, 0x5f, + 0x68, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x72, 0x61, + 0x63, 0x74, 0x65, 0x64, 0x53, 0x6b, 0x48, 0x65, 0x78, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x6f, 0x63, + 0x61, 0x6c, 0x5f, 0x73, 0x6b, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x6b, 0x48, 0x65, 0x78, 0x22, 0x36, 0x0a, 0x1d, 0x55, + 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x74, + 0x63, 0x50, 0x6b, 0x22, 0x39, 0x0a, 0x1e, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, 0x35, + 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x62, 0x74, 0x63, 0x50, 0x6b, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, - 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, - 0x68, 0x72, 0x61, 0x73, 0x65, 0x22, 0x3b, 0x0a, 0x20, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, - 0x73, 0x68, 0x22, 0x67, 0x0a, 0x1b, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, - 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x62, 0x74, 0x63, 0x50, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x22, 0x83, 0x01, 0x0a, 0x1c, - 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, - 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, - 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x28, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x65, 0x64, 0x5f, 0x73, 0x6b, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0e, 0x65, 0x78, 0x74, 0x72, 0x61, 0x63, 0x74, 0x65, 0x64, 0x53, 0x6b, 0x48, 0x65, 0x78, 0x12, - 0x20, 0x0a, 0x0c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x73, 0x6b, 0x5f, 0x68, 0x65, 0x78, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x6b, 0x48, 0x65, - 0x78, 0x22, 0x36, 0x0a, 0x1d, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x46, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x62, 0x74, 0x63, 0x50, 0x6b, 0x22, 0x39, 0x0a, 0x1e, 0x55, 0x6e, 0x6a, - 0x61, 0x69, 0x6c, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, - 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x78, - 0x48, 0x61, 0x73, 0x68, 0x22, 0x35, 0x0a, 0x1c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, - 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x74, 0x63, 0x50, 0x6b, 0x22, 0x69, 0x0a, 0x1d, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x11, - 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x10, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, - 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x22, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, - 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6f, 0x0a, 0x21, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4a, 0x0a, 0x12, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, 0x88, 0x03, 0x0a, 0x10, - 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, - 0x12, 0x31, 0x0a, 0x07, 0x66, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x66, 0x70, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x74, 0x63, 0x50, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x23, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x2a, 0x0a, 0x03, 0x70, 0x6f, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x66, 0x50, 0x6f, - 0x73, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x70, 0x6f, 0x70, 0x12, 0x19, 0x0a, - 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, 0x6f, 0x74, 0x65, - 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, - 0x6c, 0x61, 0x73, 0x74, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, - 0x35, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, - 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc5, 0x02, 0x0a, 0x14, 0x46, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, - 0x31, 0x0a, 0x07, 0x66, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x66, 0x70, 0x41, 0x64, - 0x64, 0x72, 0x12, 0x1c, 0x0a, 0x0a, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x5f, 0x68, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x74, 0x63, 0x50, 0x6b, 0x48, 0x65, 0x78, - 0x12, 0x34, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x62, 0x74, 0x63, 0x50, 0x6b, 0x22, 0x69, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x11, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x10, + 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x22, 0x22, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0x6f, 0x0a, 0x21, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x12, 0x66, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x11, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, 0xc1, 0x02, 0x0a, 0x10, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x31, 0x0a, 0x07, 0x66, 0x70, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x66, 0x70, 0x41, 0x64, 0x64, 0x72, 0x12, 0x15, 0x0a, + 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, + 0x74, 0x63, 0x50, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0x52, - 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x11, 0x6c, - 0x61, 0x73, 0x74, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x6f, 0x74, 0x65, - 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x22, 0xa2, - 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x29, - 0x0a, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, - 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x22, 0x2c, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, 0x66, 0x50, 0x6f, - 0x73, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x74, 0x63, 0x5f, - 0x73, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x74, 0x63, 0x53, 0x69, - 0x67, 0x22, 0x47, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x52, 0x61, 0x6e, 0x64, - 0x50, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x75, 0x62, 0x5f, 0x72, 0x61, 0x6e, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x75, 0x62, 0x52, 0x61, 0x6e, 0x64, 0x12, - 0x19, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x73, 0x65, 0x63, 0x52, 0x61, 0x6e, 0x64, 0x22, 0x94, 0x01, 0x0a, 0x1e, 0x53, - 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x43, 0x68, - 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, - 0x0b, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x6d, 0x73, 0x67, 0x54, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x19, 0x0a, - 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x73, - 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, - 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x64, 0x5f, 0x70, - 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x64, 0x50, 0x61, 0x74, - 0x68, 0x22, 0x3f, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x46, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x1b, 0x45, 0x64, 0x69, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x62, 0x74, 0x63, 0x50, 0x6b, 0x12, 0x34, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x4d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x2d, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, - 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, - 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, - 0x65, 0x63, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x0f, - 0x0a, 0x0d, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, - 0xbe, 0x01, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x52, - 0x45, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0b, 0x8a, 0x9d, 0x20, 0x07, 0x43, 0x52, 0x45, - 0x41, 0x54, 0x45, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, - 0x45, 0x44, 0x10, 0x01, 0x1a, 0x0e, 0x8a, 0x9d, 0x20, 0x0a, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, - 0x45, 0x52, 0x45, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, - 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x12, 0x1a, 0x0a, 0x08, - 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x03, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, - 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x4c, 0x41, 0x53, - 0x48, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x0b, 0x8a, 0x9d, 0x20, 0x07, 0x53, 0x4c, 0x41, 0x53, 0x48, - 0x45, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x4a, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x1a, 0x0a, - 0x8a, 0x9d, 0x20, 0x06, 0x4a, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, - 0x32, 0xf9, 0x06, 0x0a, 0x11, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x65, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, - 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, - 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x12, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x22, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x16, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x46, - 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, - 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x46, 0x69, + 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, + 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, + 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x56, 0x6f, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x46, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xc5, 0x02, 0x0a, 0x14, 0x46, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x31, 0x0a, 0x07, 0x66, 0x70, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x66, + 0x70, 0x41, 0x64, 0x64, 0x72, 0x12, 0x1c, 0x0a, 0x0a, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x5f, + 0x68, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x74, 0x63, 0x50, 0x6b, + 0x48, 0x65, 0x78, 0x12, 0x34, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc8, + 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, + 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x44, + 0x65, 0x63, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x2a, + 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x56, + 0x6f, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, + 0x67, 0x22, 0xa2, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, + 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, + 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x63, + 0x75, 0x72, 0x69, 0x74, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x64, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x2c, 0x0a, 0x11, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x4f, + 0x66, 0x50, 0x6f, 0x73, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x62, + 0x74, 0x63, 0x5f, 0x73, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x74, + 0x63, 0x53, 0x69, 0x67, 0x22, 0x47, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x52, + 0x61, 0x6e, 0x64, 0x50, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x75, 0x62, 0x5f, 0x72, + 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x75, 0x62, 0x52, 0x61, + 0x6e, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x73, 0x65, 0x63, 0x52, 0x61, 0x6e, 0x64, 0x22, 0x94, 0x01, + 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6f, + 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1e, 0x0a, 0x0b, 0x6d, 0x73, 0x67, 0x5f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6d, 0x73, 0x67, 0x54, 0x6f, 0x53, 0x69, 0x67, 0x6e, + 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, + 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, + 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x64, + 0x50, 0x61, 0x74, 0x68, 0x22, 0x3f, 0x0a, 0x1f, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xb9, 0x01, 0x0a, 0x1b, 0x45, 0x64, 0x69, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, - 0x6a, 0x61, 0x69, 0x6c, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x15, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, - 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, - 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x74, 0x63, 0x50, 0x6b, 0x12, 0x34, 0x0a, 0x0b, + 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x2d, 0xda, 0xde, 0x1f, 0x1b, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x44, 0x65, 0x63, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x22, 0x0f, 0x0a, 0x0d, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2a, 0xa4, 0x01, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, + 0x0a, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, 0x45, 0x44, 0x10, 0x00, 0x1a, 0x0e, 0x8a, + 0x9d, 0x20, 0x0a, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x45, 0x52, 0x45, 0x44, 0x12, 0x16, 0x0a, + 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x41, + 0x43, 0x54, 0x49, 0x56, 0x45, 0x12, 0x1a, 0x0a, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, + 0x45, 0x10, 0x02, 0x1a, 0x0c, 0x8a, 0x9d, 0x20, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, + 0x45, 0x12, 0x18, 0x0a, 0x07, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x0b, + 0x8a, 0x9d, 0x20, 0x07, 0x53, 0x4c, 0x41, 0x53, 0x48, 0x45, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x4a, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x0a, 0x8a, 0x9d, 0x20, 0x06, 0x4a, 0x41, 0x49, + 0x4c, 0x45, 0x44, 0x1a, 0x04, 0x88, 0xa3, 0x1e, 0x00, 0x32, 0x8c, 0x06, 0x0a, 0x11, 0x46, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, + 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x16, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x6e, 0x0a, 0x19, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, - 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, - 0x69, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x68, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, - 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, - 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, - 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x14, 0x45, 0x64, - 0x69, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, - 0x65, 0x72, 0x12, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x46, + 0x12, 0x5f, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x22, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, + 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x65, 0x0a, 0x16, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x46, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, + 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x15, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x12, 0x23, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x45, 0x5a, 0x43, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x62, 0x79, 0x6c, - 0x6f, 0x6e, 0x6c, 0x61, 0x62, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, - 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x66, 0x69, 0x6e, 0x61, - 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x19, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x46, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x17, + 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x12, 0x25, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x43, + 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x4b, 0x65, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x14, 0x45, 0x64, 0x69, 0x74, 0x46, 0x69, + 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x22, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x46, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x62, 0x79, 0x6c, 0x6f, 0x6e, 0x6c, 0x61, + 0x62, 0x73, 0x2d, 0x69, 0x6f, 0x2f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2d, 0x70, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, + 0x2d, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1759,64 +1613,59 @@ func file_finality_providers_proto_rawDescGZIP() []byte { } var file_finality_providers_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_finality_providers_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_finality_providers_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_finality_providers_proto_goTypes = []interface{}{ (FinalityProviderStatus)(0), // 0: proto.FinalityProviderStatus (*GetInfoRequest)(nil), // 1: proto.GetInfoRequest (*GetInfoResponse)(nil), // 2: proto.GetInfoResponse (*CreateFinalityProviderRequest)(nil), // 3: proto.CreateFinalityProviderRequest (*CreateFinalityProviderResponse)(nil), // 4: proto.CreateFinalityProviderResponse - (*RegisterFinalityProviderRequest)(nil), // 5: proto.RegisterFinalityProviderRequest - (*RegisterFinalityProviderResponse)(nil), // 6: proto.RegisterFinalityProviderResponse - (*AddFinalitySignatureRequest)(nil), // 7: proto.AddFinalitySignatureRequest - (*AddFinalitySignatureResponse)(nil), // 8: proto.AddFinalitySignatureResponse - (*UnjailFinalityProviderRequest)(nil), // 9: proto.UnjailFinalityProviderRequest - (*UnjailFinalityProviderResponse)(nil), // 10: proto.UnjailFinalityProviderResponse - (*QueryFinalityProviderRequest)(nil), // 11: proto.QueryFinalityProviderRequest - (*QueryFinalityProviderResponse)(nil), // 12: proto.QueryFinalityProviderResponse - (*QueryFinalityProviderListRequest)(nil), // 13: proto.QueryFinalityProviderListRequest - (*QueryFinalityProviderListResponse)(nil), // 14: proto.QueryFinalityProviderListResponse - (*FinalityProvider)(nil), // 15: proto.FinalityProvider - (*FinalityProviderInfo)(nil), // 16: proto.FinalityProviderInfo - (*Description)(nil), // 17: proto.Description - (*ProofOfPossession)(nil), // 18: proto.ProofOfPossession - (*SchnorrRandPair)(nil), // 19: proto.SchnorrRandPair - (*SignMessageFromChainKeyRequest)(nil), // 20: proto.SignMessageFromChainKeyRequest - (*SignMessageFromChainKeyResponse)(nil), // 21: proto.SignMessageFromChainKeyResponse - (*EditFinalityProviderRequest)(nil), // 22: proto.EditFinalityProviderRequest - (*EmptyResponse)(nil), // 23: proto.EmptyResponse + (*AddFinalitySignatureRequest)(nil), // 5: proto.AddFinalitySignatureRequest + (*AddFinalitySignatureResponse)(nil), // 6: proto.AddFinalitySignatureResponse + (*UnjailFinalityProviderRequest)(nil), // 7: proto.UnjailFinalityProviderRequest + (*UnjailFinalityProviderResponse)(nil), // 8: proto.UnjailFinalityProviderResponse + (*QueryFinalityProviderRequest)(nil), // 9: proto.QueryFinalityProviderRequest + (*QueryFinalityProviderResponse)(nil), // 10: proto.QueryFinalityProviderResponse + (*QueryFinalityProviderListRequest)(nil), // 11: proto.QueryFinalityProviderListRequest + (*QueryFinalityProviderListResponse)(nil), // 12: proto.QueryFinalityProviderListResponse + (*FinalityProvider)(nil), // 13: proto.FinalityProvider + (*FinalityProviderInfo)(nil), // 14: proto.FinalityProviderInfo + (*Description)(nil), // 15: proto.Description + (*ProofOfPossession)(nil), // 16: proto.ProofOfPossession + (*SchnorrRandPair)(nil), // 17: proto.SchnorrRandPair + (*SignMessageFromChainKeyRequest)(nil), // 18: proto.SignMessageFromChainKeyRequest + (*SignMessageFromChainKeyResponse)(nil), // 19: proto.SignMessageFromChainKeyResponse + (*EditFinalityProviderRequest)(nil), // 20: proto.EditFinalityProviderRequest + (*EmptyResponse)(nil), // 21: proto.EmptyResponse } var file_finality_providers_proto_depIdxs = []int32{ - 16, // 0: proto.CreateFinalityProviderResponse.finality_provider:type_name -> proto.FinalityProviderInfo - 16, // 1: proto.QueryFinalityProviderResponse.finality_provider:type_name -> proto.FinalityProviderInfo - 16, // 2: proto.QueryFinalityProviderListResponse.finality_providers:type_name -> proto.FinalityProviderInfo - 18, // 3: proto.FinalityProvider.pop:type_name -> proto.ProofOfPossession - 0, // 4: proto.FinalityProvider.status:type_name -> proto.FinalityProviderStatus - 17, // 5: proto.FinalityProviderInfo.description:type_name -> proto.Description - 17, // 6: proto.EditFinalityProviderRequest.description:type_name -> proto.Description - 1, // 7: proto.FinalityProviders.GetInfo:input_type -> proto.GetInfoRequest - 3, // 8: proto.FinalityProviders.CreateFinalityProvider:input_type -> proto.CreateFinalityProviderRequest - 5, // 9: proto.FinalityProviders.RegisterFinalityProvider:input_type -> proto.RegisterFinalityProviderRequest - 7, // 10: proto.FinalityProviders.AddFinalitySignature:input_type -> proto.AddFinalitySignatureRequest - 9, // 11: proto.FinalityProviders.UnjailFinalityProvider:input_type -> proto.UnjailFinalityProviderRequest - 11, // 12: proto.FinalityProviders.QueryFinalityProvider:input_type -> proto.QueryFinalityProviderRequest - 13, // 13: proto.FinalityProviders.QueryFinalityProviderList:input_type -> proto.QueryFinalityProviderListRequest - 20, // 14: proto.FinalityProviders.SignMessageFromChainKey:input_type -> proto.SignMessageFromChainKeyRequest - 22, // 15: proto.FinalityProviders.EditFinalityProvider:input_type -> proto.EditFinalityProviderRequest - 2, // 16: proto.FinalityProviders.GetInfo:output_type -> proto.GetInfoResponse - 4, // 17: proto.FinalityProviders.CreateFinalityProvider:output_type -> proto.CreateFinalityProviderResponse - 6, // 18: proto.FinalityProviders.RegisterFinalityProvider:output_type -> proto.RegisterFinalityProviderResponse - 8, // 19: proto.FinalityProviders.AddFinalitySignature:output_type -> proto.AddFinalitySignatureResponse - 10, // 20: proto.FinalityProviders.UnjailFinalityProvider:output_type -> proto.UnjailFinalityProviderResponse - 12, // 21: proto.FinalityProviders.QueryFinalityProvider:output_type -> proto.QueryFinalityProviderResponse - 14, // 22: proto.FinalityProviders.QueryFinalityProviderList:output_type -> proto.QueryFinalityProviderListResponse - 21, // 23: proto.FinalityProviders.SignMessageFromChainKey:output_type -> proto.SignMessageFromChainKeyResponse - 23, // 24: proto.FinalityProviders.EditFinalityProvider:output_type -> proto.EmptyResponse - 16, // [16:25] is the sub-list for method output_type - 7, // [7:16] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name + 14, // 0: proto.CreateFinalityProviderResponse.finality_provider:type_name -> proto.FinalityProviderInfo + 14, // 1: proto.QueryFinalityProviderResponse.finality_provider:type_name -> proto.FinalityProviderInfo + 14, // 2: proto.QueryFinalityProviderListResponse.finality_providers:type_name -> proto.FinalityProviderInfo + 0, // 3: proto.FinalityProvider.status:type_name -> proto.FinalityProviderStatus + 15, // 4: proto.FinalityProviderInfo.description:type_name -> proto.Description + 15, // 5: proto.EditFinalityProviderRequest.description:type_name -> proto.Description + 1, // 6: proto.FinalityProviders.GetInfo:input_type -> proto.GetInfoRequest + 3, // 7: proto.FinalityProviders.CreateFinalityProvider:input_type -> proto.CreateFinalityProviderRequest + 5, // 8: proto.FinalityProviders.AddFinalitySignature:input_type -> proto.AddFinalitySignatureRequest + 7, // 9: proto.FinalityProviders.UnjailFinalityProvider:input_type -> proto.UnjailFinalityProviderRequest + 9, // 10: proto.FinalityProviders.QueryFinalityProvider:input_type -> proto.QueryFinalityProviderRequest + 11, // 11: proto.FinalityProviders.QueryFinalityProviderList:input_type -> proto.QueryFinalityProviderListRequest + 18, // 12: proto.FinalityProviders.SignMessageFromChainKey:input_type -> proto.SignMessageFromChainKeyRequest + 20, // 13: proto.FinalityProviders.EditFinalityProvider:input_type -> proto.EditFinalityProviderRequest + 2, // 14: proto.FinalityProviders.GetInfo:output_type -> proto.GetInfoResponse + 4, // 15: proto.FinalityProviders.CreateFinalityProvider:output_type -> proto.CreateFinalityProviderResponse + 6, // 16: proto.FinalityProviders.AddFinalitySignature:output_type -> proto.AddFinalitySignatureResponse + 8, // 17: proto.FinalityProviders.UnjailFinalityProvider:output_type -> proto.UnjailFinalityProviderResponse + 10, // 18: proto.FinalityProviders.QueryFinalityProvider:output_type -> proto.QueryFinalityProviderResponse + 12, // 19: proto.FinalityProviders.QueryFinalityProviderList:output_type -> proto.QueryFinalityProviderListResponse + 19, // 20: proto.FinalityProviders.SignMessageFromChainKey:output_type -> proto.SignMessageFromChainKeyResponse + 21, // 21: proto.FinalityProviders.EditFinalityProvider:output_type -> proto.EmptyResponse + 14, // [14:22] is the sub-list for method output_type + 6, // [6:14] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_finality_providers_proto_init() } @@ -1874,30 +1723,6 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterFinalityProviderRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_finality_providers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegisterFinalityProviderResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_finality_providers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddFinalitySignatureRequest); i { case 0: return &v.state @@ -1909,7 +1734,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AddFinalitySignatureResponse); i { case 0: return &v.state @@ -1921,7 +1746,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnjailFinalityProviderRequest); i { case 0: return &v.state @@ -1933,7 +1758,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnjailFinalityProviderResponse); i { case 0: return &v.state @@ -1945,7 +1770,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryFinalityProviderRequest); i { case 0: return &v.state @@ -1957,7 +1782,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryFinalityProviderResponse); i { case 0: return &v.state @@ -1969,7 +1794,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryFinalityProviderListRequest); i { case 0: return &v.state @@ -1981,7 +1806,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryFinalityProviderListResponse); i { case 0: return &v.state @@ -1993,7 +1818,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FinalityProvider); i { case 0: return &v.state @@ -2005,7 +1830,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*FinalityProviderInfo); i { case 0: return &v.state @@ -2017,7 +1842,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Description); i { case 0: return &v.state @@ -2029,7 +1854,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ProofOfPossession); i { case 0: return &v.state @@ -2041,7 +1866,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SchnorrRandPair); i { case 0: return &v.state @@ -2053,7 +1878,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignMessageFromChainKeyRequest); i { case 0: return &v.state @@ -2065,7 +1890,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignMessageFromChainKeyResponse); i { case 0: return &v.state @@ -2077,7 +1902,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EditFinalityProviderRequest); i { case 0: return &v.state @@ -2089,7 +1914,7 @@ func file_finality_providers_proto_init() { return nil } } - file_finality_providers_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_finality_providers_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EmptyResponse); i { case 0: return &v.state @@ -2108,7 +1933,7 @@ func file_finality_providers_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_finality_providers_proto_rawDesc, NumEnums: 1, - NumMessages: 23, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/finality-provider/proto/finality_providers.proto b/finality-provider/proto/finality_providers.proto index 8b80e6e6..3ec97fe4 100644 --- a/finality-provider/proto/finality_providers.proto +++ b/finality-provider/proto/finality_providers.proto @@ -16,11 +16,6 @@ service FinalityProviders { rpc CreateFinalityProvider (CreateFinalityProviderRequest) returns (CreateFinalityProviderResponse); - // RegisterFinalityProvider sends a transactions to the consumer chain to register a BTC - // finality provider - rpc RegisterFinalityProvider (RegisterFinalityProviderRequest) - returns (RegisterFinalityProviderResponse); - // AddFinalitySignature sends a transactions to the consumer chain to add a Finality // signature for a block rpc AddFinalitySignature(AddFinalitySignatureRequest) @@ -58,37 +53,25 @@ message CreateFinalityProviderRequest { string key_name = 1; // passphrase is used to encrypt the keys string passphrase = 2; - // hd_path is the hd path for private key derivation - string hd_path = 3; // chain_id is the identifier of the consumer chain that the finality provider is connected to - string chain_id = 4; + string chain_id = 3; // description defines the description terms for the finality provider - bytes description = 5; + bytes description = 4; // commission defines the commission rate for the finality provider - string commission = 6 [ + string commission = 5 [ (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; // eots_pk_hex it is the optional EOTS public key and used to ask for // the key record from the EOTS manager for the corresponding EOTS public key. // If this property is not set, it will create a new EOTS key. - string eots_pk_hex = 7; + string eots_pk_hex = 6; } message CreateFinalityProviderResponse { FinalityProviderInfo finality_provider = 1; -} - -message RegisterFinalityProviderRequest { - // btc_pk is hex string of the BTC secp256k1 public key of the finality provider encoded in BIP-340 spec - string btc_pk = 1; - // passphrase is used to encrypt the keys - string passphrase = 2; -} - -message RegisterFinalityProviderResponse { - // hash of the successful chain registration transaction - string tx_hash = 1; + // hash of the successful finality provider creation transaction + string tx_hash = 2; } message AddFinalitySignatureRequest { @@ -150,16 +133,12 @@ message FinalityProvider { (gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", (gogoproto.nullable) = false ]; - // pop is the proof of possession of chain_pk and btc_pk - ProofOfPossession pop = 5; - // key_name is the identifier of the keyring - string key_name = 6; // chain_id is the identifier of the consumer chain that the finality provider connected to - string chain_id = 7; + string chain_id = 5; // last_voted_height defines the height of the last voted chain block - uint64 last_voted_height = 8; + uint64 last_voted_height = 6; // status defines the current finality provider status - FinalityProviderStatus status = 9; + FinalityProviderStatus status = 7; } // FinalityProviderInfo is the basic information of a finality provider mainly for external usage @@ -207,35 +186,36 @@ message SchnorrRandPair { } // FinalityProviderStatus is the status of a finality provider -// a FinalityProvider object has 4 states: -// - Created - created and managed by finality provider client, not registered to -// the consumer chain yet +// a FinalityProvider object has 5 states: // - Registered - created and registered to the consumer chain, but not voting yet (No // delegated stake) -// - Active - created and registered to the consumer chain with stake to vote -// - Inactive - created and registered to the consumer chain with no stake to vote. +// - Inactive - the finality provider does not have voting power to vote +// - Active - the finality provider has voting power to vote // Finality Provider was already active. -// Valid State Transactions: -// - Created -> Registered -// - Registered -> Active -// - Active -> Inactive -// - Inactive -> Active +// - Slashed - the finality provider looses all the voting power forever due to double voting +// - Jailed - the finality provider temporarily looses the voting power due to being sluggish +// Possible State Transactions: +// - Registered -> Inactive +// - Inactive -> Active +// - Active -> Inactive +// - Active -> Slashed +// - Active -> Jailed +// - Jailed -> Active +// - Jailed -> Inactive enum FinalityProviderStatus { option (gogoproto.goproto_enum_prefix) = false; - // CREATED defines a finality provider that is awaiting registration - CREATED = 0 [(gogoproto.enumvalue_customname) = "CREATED"]; // REGISTERED defines a finality provider that has been registered // to the consumer chain but has no delegated stake - REGISTERED = 1 [(gogoproto.enumvalue_customname) = "REGISTERED"]; + REGISTERED = 0 [(gogoproto.enumvalue_customname) = "REGISTERED"]; // ACTIVE defines a finality provider that is delegated to vote - ACTIVE = 2 [(gogoproto.enumvalue_customname) = "ACTIVE"]; + ACTIVE = 1 [(gogoproto.enumvalue_customname) = "ACTIVE"]; // INACTIVE defines a finality provider whose delegations are reduced to zero but not slashed - INACTIVE = 3 [(gogoproto.enumvalue_customname) = "INACTIVE"]; + INACTIVE = 2 [(gogoproto.enumvalue_customname) = "INACTIVE"]; // SLASHED defines a finality provider that has been slashed - SLASHED = 4 [(gogoproto.enumvalue_customname) = "SLASHED"]; + SLASHED = 3 [(gogoproto.enumvalue_customname) = "SLASHED"]; // JAILED defines a finality provider that has been jailed - JAILED = 5 [(gogoproto.enumvalue_customname) = "JAILED"]; + JAILED = 4 [(gogoproto.enumvalue_customname) = "JAILED"]; } message SignMessageFromChainKeyRequest { diff --git a/finality-provider/proto/finality_providers_grpc.pb.go b/finality-provider/proto/finality_providers_grpc.pb.go index 96b73db6..79dd0bf1 100644 --- a/finality-provider/proto/finality_providers_grpc.pb.go +++ b/finality-provider/proto/finality_providers_grpc.pb.go @@ -21,7 +21,6 @@ const _ = grpc.SupportPackageIsVersion7 const ( FinalityProviders_GetInfo_FullMethodName = "/proto.FinalityProviders/GetInfo" FinalityProviders_CreateFinalityProvider_FullMethodName = "/proto.FinalityProviders/CreateFinalityProvider" - FinalityProviders_RegisterFinalityProvider_FullMethodName = "/proto.FinalityProviders/RegisterFinalityProvider" FinalityProviders_AddFinalitySignature_FullMethodName = "/proto.FinalityProviders/AddFinalitySignature" FinalityProviders_UnjailFinalityProvider_FullMethodName = "/proto.FinalityProviders/UnjailFinalityProvider" FinalityProviders_QueryFinalityProvider_FullMethodName = "/proto.FinalityProviders/QueryFinalityProvider" @@ -38,9 +37,6 @@ type FinalityProvidersClient interface { GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) // CreateFinalityProvider generates and saves a finality provider object CreateFinalityProvider(ctx context.Context, in *CreateFinalityProviderRequest, opts ...grpc.CallOption) (*CreateFinalityProviderResponse, error) - // RegisterFinalityProvider sends a transactions to the consumer chain to register a BTC - // finality provider - RegisterFinalityProvider(ctx context.Context, in *RegisterFinalityProviderRequest, opts ...grpc.CallOption) (*RegisterFinalityProviderResponse, error) // AddFinalitySignature sends a transactions to the consumer chain to add a Finality // signature for a block AddFinalitySignature(ctx context.Context, in *AddFinalitySignatureRequest, opts ...grpc.CallOption) (*AddFinalitySignatureResponse, error) @@ -83,15 +79,6 @@ func (c *finalityProvidersClient) CreateFinalityProvider(ctx context.Context, in return out, nil } -func (c *finalityProvidersClient) RegisterFinalityProvider(ctx context.Context, in *RegisterFinalityProviderRequest, opts ...grpc.CallOption) (*RegisterFinalityProviderResponse, error) { - out := new(RegisterFinalityProviderResponse) - err := c.cc.Invoke(ctx, FinalityProviders_RegisterFinalityProvider_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *finalityProvidersClient) AddFinalitySignature(ctx context.Context, in *AddFinalitySignatureRequest, opts ...grpc.CallOption) (*AddFinalitySignatureResponse, error) { out := new(AddFinalitySignatureResponse) err := c.cc.Invoke(ctx, FinalityProviders_AddFinalitySignature_FullMethodName, in, out, opts...) @@ -154,9 +141,6 @@ type FinalityProvidersServer interface { GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) // CreateFinalityProvider generates and saves a finality provider object CreateFinalityProvider(context.Context, *CreateFinalityProviderRequest) (*CreateFinalityProviderResponse, error) - // RegisterFinalityProvider sends a transactions to the consumer chain to register a BTC - // finality provider - RegisterFinalityProvider(context.Context, *RegisterFinalityProviderRequest) (*RegisterFinalityProviderResponse, error) // AddFinalitySignature sends a transactions to the consumer chain to add a Finality // signature for a block AddFinalitySignature(context.Context, *AddFinalitySignatureRequest) (*AddFinalitySignatureResponse, error) @@ -184,9 +168,6 @@ func (UnimplementedFinalityProvidersServer) GetInfo(context.Context, *GetInfoReq func (UnimplementedFinalityProvidersServer) CreateFinalityProvider(context.Context, *CreateFinalityProviderRequest) (*CreateFinalityProviderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateFinalityProvider not implemented") } -func (UnimplementedFinalityProvidersServer) RegisterFinalityProvider(context.Context, *RegisterFinalityProviderRequest) (*RegisterFinalityProviderResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterFinalityProvider not implemented") -} func (UnimplementedFinalityProvidersServer) AddFinalitySignature(context.Context, *AddFinalitySignatureRequest) (*AddFinalitySignatureResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddFinalitySignature not implemented") } @@ -254,24 +235,6 @@ func _FinalityProviders_CreateFinalityProvider_Handler(srv interface{}, ctx cont return interceptor(ctx, in, info, handler) } -func _FinalityProviders_RegisterFinalityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterFinalityProviderRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(FinalityProvidersServer).RegisterFinalityProvider(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: FinalityProviders_RegisterFinalityProvider_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FinalityProvidersServer).RegisterFinalityProvider(ctx, req.(*RegisterFinalityProviderRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _FinalityProviders_AddFinalitySignature_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddFinalitySignatureRequest) if err := dec(in); err != nil { @@ -395,10 +358,6 @@ var FinalityProviders_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateFinalityProvider", Handler: _FinalityProviders_CreateFinalityProvider_Handler, }, - { - MethodName: "RegisterFinalityProvider", - Handler: _FinalityProviders_RegisterFinalityProvider_Handler, - }, { MethodName: "AddFinalitySignature", Handler: _FinalityProviders_AddFinalitySignature_Handler, diff --git a/finality-provider/service/app.go b/finality-provider/service/app.go index 93e5653e..d2ac1932 100644 --- a/finality-provider/service/app.go +++ b/finality-provider/service/app.go @@ -48,10 +48,8 @@ type FinalityProviderApp struct { metrics *metrics.FpMetrics - createFinalityProviderRequestChan chan *createFinalityProviderRequest - registerFinalityProviderRequestChan chan *registerFinalityProviderRequest - finalityProviderRegisteredEventChan chan *finalityProviderRegisteredEvent - criticalErrChan chan *CriticalError + createFinalityProviderRequestChan chan *CreateFinalityProviderRequest + criticalErrChan chan *CriticalError } func NewFinalityProviderAppFromConfig( @@ -105,21 +103,19 @@ func NewFinalityProviderApp( fpMetrics := metrics.NewFpMetrics() return &FinalityProviderApp{ - cc: cc, - fps: fpStore, - pubRandStore: pubRandStore, - kr: kr, - config: config, - logger: logger, - input: input, - fpIns: nil, - eotsManager: em, - metrics: fpMetrics, - quit: make(chan struct{}), - createFinalityProviderRequestChan: make(chan *createFinalityProviderRequest), - registerFinalityProviderRequestChan: make(chan *registerFinalityProviderRequest), - finalityProviderRegisteredEventChan: make(chan *finalityProviderRegisteredEvent), - criticalErrChan: make(chan *CriticalError), + cc: cc, + fps: fpStore, + pubRandStore: pubRandStore, + kr: kr, + config: config, + logger: logger, + input: input, + fpIns: nil, + eotsManager: em, + metrics: fpMetrics, + quit: make(chan struct{}), + createFinalityProviderRequestChan: make(chan *CreateFinalityProviderRequest), + criticalErrChan: make(chan *CriticalError), }, nil } @@ -179,58 +175,6 @@ func (app *FinalityProviderApp) GetFinalityProviderInstance() (*FinalityProvider return app.fpIns, nil } -func (app *FinalityProviderApp) RegisterFinalityProvider(fpPkStr string) (*RegisterFinalityProviderResponse, error) { - fpPk, err := bbntypes.NewBIP340PubKeyFromHex(fpPkStr) - if err != nil { - return nil, err - } - - fp, err := app.fps.GetFinalityProvider(fpPk.MustToBTCPK()) - if err != nil { - return nil, err - } - - if fp.Status != proto.FinalityProviderStatus_CREATED { - return nil, fmt.Errorf("finality-provider is already registered") - } - - btcSig, err := bbntypes.NewBIP340Signature(fp.Pop.BtcSig) - if err != nil { - return nil, err - } - - pop := &bstypes.ProofOfPossessionBTC{ - BtcSig: btcSig.MustMarshal(), - BtcSigType: bstypes.BTCSigType_BIP340, - } - - fpAddr, err := sdk.AccAddressFromBech32(fp.FPAddr) - if err != nil { - return nil, err - } - - request := ®isterFinalityProviderRequest{ - fpAddr: fpAddr, - btcPubKey: bbntypes.NewBIP340PubKeyFromBTCPK(fp.BtcPk), - pop: pop, - description: fp.Description, - commission: fp.Commission, - errResponse: make(chan error, 1), - successResponse: make(chan *RegisterFinalityProviderResponse, 1), - } - - app.registerFinalityProviderRequestChan <- request - - select { - case err := <-request.errResponse: - return nil, err - case successResponse := <-request.successResponse: - return successResponse, nil - case <-app.quit: - return nil, fmt.Errorf("finality-provider app is shutting down") - } -} - // StartFinalityProvider starts a finality provider instance with the given EOTS public key // Note: this should be called right after the finality-provider is registered func (app *FinalityProviderApp) StartFinalityProvider(fpPk *bbntypes.BIP340PubKey, passphrase string) error { @@ -307,9 +251,8 @@ func (app *FinalityProviderApp) Start() error { app.startOnce.Do(func() { app.logger.Info("Starting FinalityProviderApp") - app.wg.Add(6) + app.wg.Add(5) go app.syncChainFpStatusLoop() - go app.eventLoop() go app.registrationLoop() go app.metricsUpdateLoop() go app.monitorCriticalErr() @@ -351,31 +294,79 @@ func (app *FinalityProviderApp) Stop() error { } func (app *FinalityProviderApp) CreateFinalityProvider( - keyName, chainID, passPhrase, hdPath string, + keyName, chainID, passPhrase string, eotsPk *bbntypes.BIP340PubKey, description *stakingtypes.Description, commission *sdkmath.LegacyDec, ) (*CreateFinalityProviderResult, error) { - req := &createFinalityProviderRequest{ - keyName: keyName, - chainID: chainID, - passPhrase: passPhrase, - hdPath: hdPath, - eotsPk: eotsPk, + // 1. check if the chain key exists + kr, err := fpkr.NewChainKeyringControllerWithKeyring(app.kr, keyName, app.input) + if err != nil { + return nil, err + } + + fpAddr, err := kr.Address(passPhrase) + if err != nil { + // the chain key does not exist, should create the chain key first + return nil, fmt.Errorf("the keyname %s does not exist, add the key first: %w", keyName, err) + } + + // 2. create proof-of-possession + if eotsPk == nil { + return nil, fmt.Errorf("eots pk cannot be nil") + } + pop, err := app.CreatePop(fpAddr, eotsPk, passPhrase) + if err != nil { + return nil, fmt.Errorf("failed to create proof-of-possession of the finality-provider: %w", err) + } + + // TODO: query consumer chain to check if the fp is already registered + // if true, update db with the fp info from the consumer chain + // otherwise, proceed registration + + // 3. register the finality provider on the consumer chain + request := &CreateFinalityProviderRequest{ + fpAddr: fpAddr, + btcPubKey: eotsPk, + pop: pop, description: description, commission: commission, errResponse: make(chan error, 1), - successResponse: make(chan *createFinalityProviderResponse, 1), + successResponse: make(chan *RegisterFinalityProviderResponse, 1), } - app.createFinalityProviderRequestChan <- req + app.createFinalityProviderRequestChan <- request select { - case err := <-req.errResponse: + case err := <-request.errResponse: return nil, err - case successResponse := <-req.successResponse: + case successResponse := <-request.successResponse: + pkHex := eotsPk.MarshalHex() + btcPk := eotsPk.MustToBTCPK() + // save the fp info to db after successful registration + // this ensures the data saved in db is consistent with that on the consumer chain + // if the program crashes in the middle, the user can retry registration + // which will update db use the information from the consumer chain without + // submitting a registration again + if err := app.fps.CreateFinalityProvider(fpAddr, btcPk, description, commission, chainID); err != nil { + return nil, fmt.Errorf("failed to save finality-provider: %w", err) + } + + app.metrics.RecordFpStatus(pkHex, proto.FinalityProviderStatus_REGISTERED) + + app.logger.Info("successfully saved the finality-provider", + zap.String("eots_pk", pkHex), + zap.String("addr", fpAddr.String()), + ) + + storedFp, err := app.fps.GetFinalityProvider(btcPk) + if err != nil { + return nil, err + } + return &CreateFinalityProviderResult{ - FpInfo: successResponse.FpInfo, + FpInfo: storedFp.ToFinalityProviderInfo(), + TxHash: successResponse.txHash, }, nil case <-app.quit: return nil, fmt.Errorf("finality-provider app is shutting down") @@ -413,52 +404,6 @@ func (app *FinalityProviderApp) UnjailFinalityProvider(fpPk *bbntypes.BIP340PubK return res.TxHash, nil } -func (app *FinalityProviderApp) handleCreateFinalityProviderRequest(req *createFinalityProviderRequest) (*createFinalityProviderResponse, error) { - // 1. check if the chain key exists - kr, err := fpkr.NewChainKeyringControllerWithKeyring(app.kr, req.keyName, app.input) - if err != nil { - return nil, err - } - - fpAddr, err := kr.Address(req.passPhrase) - if err != nil { - // the chain key does not exist, should create the chain key first - return nil, fmt.Errorf("the keyname %s does not exist, add the key first: %w", req.keyName, err) - } - - // 2. create proof-of-possession - if req.eotsPk == nil { - return nil, fmt.Errorf("eots pk cannot be nil") - } - pop, err := app.CreatePop(fpAddr, req.eotsPk, req.passPhrase) - if err != nil { - return nil, fmt.Errorf("failed to create proof-of-possession of the finality-provider: %w", err) - } - - btcPk := req.eotsPk.MustToBTCPK() - if err := app.fps.CreateFinalityProvider(fpAddr, btcPk, req.description, req.commission, req.keyName, req.chainID, pop.BtcSig); err != nil { - return nil, fmt.Errorf("failed to save finality-provider: %w", err) - } - - pkHex := req.eotsPk.MarshalHex() - app.metrics.RecordFpStatus(pkHex, proto.FinalityProviderStatus_CREATED) - - app.logger.Info("successfully created a finality-provider", - zap.String("eots_pk", pkHex), - zap.String("addr", fpAddr.String()), - zap.String("key_name", req.keyName), - ) - - storedFp, err := app.fps.GetFinalityProvider(btcPk) - if err != nil { - return nil, err - } - - return &createFinalityProviderResponse{ - FpInfo: storedFp.ToFinalityProviderInfo(), - }, nil -} - func (app *FinalityProviderApp) CreatePop(fpAddress sdk.AccAddress, fpPk *bbntypes.BIP340PubKey, passphrase string) (*bstypes.ProofOfPossessionBTC, error) { pop := &bstypes.ProofOfPossessionBTC{ BtcSigType: bstypes.BTCSigType_BIP340, // by default, we use BIP-340 encoding for BTC signature diff --git a/finality-provider/service/app_test.go b/finality-provider/service/app_test.go index e1184a12..62bc4a92 100644 --- a/finality-provider/service/app_test.go +++ b/finality-provider/service/app_test.go @@ -12,8 +12,8 @@ import ( "github.com/babylonlabs-io/babylon/testutil/datagen" bbntypes "github.com/babylonlabs-io/babylon/types" - bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" finalitytypes "github.com/babylonlabs-io/babylon/x/finality/types" + sdkkeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" "go.uber.org/zap" @@ -27,7 +27,6 @@ import ( fpstore "github.com/babylonlabs-io/finality-provider/finality-provider/store" "github.com/babylonlabs-io/finality-provider/keyring" "github.com/babylonlabs-io/finality-provider/testutil" - "github.com/babylonlabs-io/finality-provider/testutil/mocks" "github.com/babylonlabs-io/finality-provider/types" "github.com/babylonlabs-io/finality-provider/util" ) @@ -39,7 +38,7 @@ const ( eventuallyPollTime = 10 * time.Millisecond ) -func FuzzRegisterFinalityProvider(f *testing.F) { +func FuzzCreateFinalityProvider(f *testing.F) { testutil.AddRandomSeedsToFuzzer(f, 10) f.Fuzz(func(t *testing.T, seed int64) { r := rand.New(rand.NewSource(seed)) @@ -97,52 +96,29 @@ func FuzzRegisterFinalityProvider(f *testing.F) { eotsPk, err = bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) - // create a finality-provider object and save it to db - fp := testutil.GenStoredFinalityProvider(r, t, app, passphrase, hdPath, eotsPk) - require.Equal(t, eotsPk, bbntypes.NewBIP340PubKeyFromBTCPK(fp.BtcPk)) + // generate keyring + keyName := testutil.GenRandomHexStr(r, 4) + chainID := testutil.GenRandomHexStr(r, 4) - btcSig := new(bbntypes.BIP340Signature) - err = btcSig.Unmarshal(fp.Pop.BtcSig) + cfg := app.GetConfig() + _, err = testutil.CreateChainKey(cfg.BabylonConfig.KeyDirectory, cfg.BabylonConfig.ChainID, keyName, sdkkeyring.BackendTest, passphrase, hdPath, "") require.NoError(t, err) - pop := &bstypes.ProofOfPossessionBTC{ - BtcSig: btcSig.MustMarshal(), - BtcSigType: bstypes.BTCSigType_BIP340, - } - popBytes, err := pop.Marshal() - require.NoError(t, err) - fpInfo, err := app.GetFinalityProviderInfo(fp.GetBIP340BTCPK()) - require.NoError(t, err) - require.Equal(t, proto.FinalityProviderStatus_name[0], fpInfo.Status) - require.Equal(t, false, fpInfo.IsRunning) - fpListInfo, err := app.ListAllFinalityProvidersInfo() - require.NoError(t, err) - require.Equal(t, fpInfo.BtcPkHex, fpListInfo[0].BtcPkHex) txHash := testutil.GenRandomHexStr(r, 32) mockClientController.EXPECT(). RegisterFinalityProvider( - fp.BtcPk, - popBytes, + eotsPk.MustToBTCPK(), + gomock.Any(), testutil.ZeroCommissionRate(), gomock.Any(), ).Return(&types.TxResponse{TxHash: txHash}, nil).AnyTimes() - - res, err := app.RegisterFinalityProvider(fp.GetBIP340BTCPK().MarshalHex()) + res, err := app.CreateFinalityProvider(keyName, chainID, passphrase, eotsPk, testutil.RandomDescription(r), testutil.ZeroCommissionRate()) require.NoError(t, err) require.Equal(t, txHash, res.TxHash) - mockClientController.EXPECT().QueryLastCommittedPublicRand(gomock.Any(), uint64(1)).Return(nil, nil).AnyTimes() - err = app.StartFinalityProvider(fp.GetBIP340BTCPK(), passphrase) - require.NoError(t, err) - - fpAfterReg, err := app.GetFinalityProviderInstance() - require.NoError(t, err) - require.Equal(t, proto.FinalityProviderStatus_REGISTERED, fpAfterReg.GetStoreFinalityProvider().Status) - - fpInfo, err = app.GetFinalityProviderInfo(fp.GetBIP340BTCPK()) + fpInfo, err := app.GetFinalityProviderInfo(eotsPk) require.NoError(t, err) - require.Equal(t, proto.FinalityProviderStatus_name[1], fpInfo.Status) - require.Equal(t, true, fpInfo.IsRunning) + require.Equal(t, eotsPk.MarshalHex(), fpInfo.BtcPkHex) }) } @@ -151,27 +127,6 @@ func FuzzSyncFinalityProviderStatus(f *testing.F) { f.Fuzz(func(t *testing.T, seed int64) { r := rand.New(rand.NewSource(seed)) - logger := zap.NewNop() - - pathSuffix := datagen.GenRandomHexStr(r, 10) - // create an EOTS manager - eotsHomeDir := filepath.Join(t.TempDir(), "eots-home", pathSuffix) - eotsCfg := eotscfg.DefaultConfigWithHomePath(eotsHomeDir) - dbBackend, err := eotsCfg.DatabaseConfig.GetDBBackend() - require.NoError(t, err) - em, err := eotsmanager.NewLocalEOTSManager(eotsHomeDir, eotsCfg.KeyringBackend, dbBackend, logger) - require.NoError(t, err) - - // Create randomized config - fpHomeDir := filepath.Join(t.TempDir(), "fp-home", pathSuffix) - fpCfg := config.DefaultConfigWithHome(fpHomeDir) - fpCfg.SyncFpStatusInterval = time.Millisecond * 100 - // no need for other intervals to run - fpCfg.StatusUpdateInterval = time.Minute * 10 - fpCfg.SubmissionRetryInterval = time.Minute * 10 - fpdb, err := fpCfg.DatabaseConfig.GetDBBackend() - require.NoError(t, err) - randomStartingHeight := uint64(r.Int63n(100) + 1) currentHeight := randomStartingHeight + uint64(r.Int63n(10)+2) mockClientController := testutil.PrepareMockedClientController(t, r, randomStartingHeight, currentHeight, 0) @@ -195,22 +150,20 @@ func FuzzSyncFinalityProviderStatus(f *testing.F) { } mockClientController.EXPECT().QueryFinalityProviderHighestVotedHeight(gomock.Any()).Return(uint64(0), nil).AnyTimes() - app, err := service.NewFinalityProviderApp(&fpCfg, mockClientController, em, fpdb, logger) - require.NoError(t, err) - - err = app.Start() - require.NoError(t, err) + // Create randomized config + pathSuffix := datagen.GenRandomHexStr(r, 10) + fpHomeDir := filepath.Join(t.TempDir(), "fp-home", pathSuffix) + fpCfg := config.DefaultConfigWithHome(fpHomeDir) + fpCfg.SyncFpStatusInterval = time.Millisecond * 100 + // no need for other intervals to run + fpCfg.StatusUpdateInterval = time.Minute * 10 + fpCfg.SubmissionRetryInterval = time.Minute * 10 - eotsKeyName := testutil.GenRandomHexStr(r, 4) - require.NoError(t, err) - eotsPkBz, err := em.CreateKey(eotsKeyName, passphrase, hdPath) - require.NoError(t, err) - eotsPk, err := bbntypes.NewBIP340PubKey(eotsPkBz) - require.NoError(t, err) - fp := testutil.GenStoredFinalityProvider(r, t, app, "", hdPath, eotsPk) + // Create fp app + app, fpPk, cleanup := startFPAppWithRegisteredFp(t, r, fpHomeDir, &fpCfg, mockClientController) + defer cleanup() require.Eventually(t, func() bool { - fpPk := fp.GetBIP340BTCPK() fpInfo, err := app.GetFinalityProviderInfo(fpPk) if err != nil { return false @@ -226,7 +179,7 @@ func FuzzSyncFinalityProviderStatus(f *testing.F) { } // TODO: verify why mocks are failing - btcPkEqual := fpInstance.GetBtcPk().IsEqual(fp.BtcPk) + btcPkEqual := fpInstance.GetBtcPk().IsEqual(fpPk.MustToBTCPK()) statusEqual := strings.EqualFold(fpInfo.Status, expectedStatus.String()) return statusEqual && btcPkEqual }, time.Second*5, time.Millisecond*200, "should eventually be registered or active") @@ -238,30 +191,18 @@ func FuzzUnjailFinalityProvider(f *testing.F) { f.Fuzz(func(t *testing.T, seed int64) { r := rand.New(rand.NewSource(seed)) - logger := zap.NewNop() - - pathSuffix := datagen.GenRandomHexStr(r, 10) - // create an EOTS manager - eotsHomeDir := filepath.Join(t.TempDir(), "eots-home", pathSuffix) - eotsCfg := eotscfg.DefaultConfigWithHomePath(eotsHomeDir) - dbBackend, err := eotsCfg.DatabaseConfig.GetDBBackend() - require.NoError(t, err) - em, err := eotsmanager.NewLocalEOTSManager(eotsHomeDir, eotsCfg.KeyringBackend, dbBackend, logger) - require.NoError(t, err) + randomStartingHeight := uint64(r.Int63n(100) + 1) + currentHeight := randomStartingHeight + uint64(r.Int63n(10)+2) + mockClientController := testutil.PrepareMockedClientController(t, r, randomStartingHeight, currentHeight, 0) // Create randomized config + pathSuffix := datagen.GenRandomHexStr(r, 10) fpHomeDir := filepath.Join(t.TempDir(), "fp-home", pathSuffix) fpCfg := config.DefaultConfigWithHome(fpHomeDir) // use shorter interval for the test to end faster fpCfg.SyncFpStatusInterval = time.Millisecond * 10 fpCfg.StatusUpdateInterval = time.Millisecond * 10 fpCfg.SubmissionRetryInterval = time.Millisecond * 10 - fpdb, err := fpCfg.DatabaseConfig.GetDBBackend() - require.NoError(t, err) - - randomStartingHeight := uint64(r.Int63n(100) + 1) - currentHeight := randomStartingHeight + uint64(r.Int63n(10)+2) - mockClientController := testutil.PrepareMockedClientController(t, r, randomStartingHeight, currentHeight, 0) blkInfo := &types.BlockInfo{Height: currentHeight} @@ -276,32 +217,16 @@ func FuzzUnjailFinalityProvider(f *testing.F) { mockClientController.EXPECT().QueryFinalityProviderSlashedOrJailed(gomock.Any()).Return(false, false, nil).AnyTimes() mockClientController.EXPECT().QueryFinalityProviderHighestVotedHeight(gomock.Any()).Return(uint64(0), nil).AnyTimes() - app, err := service.NewFinalityProviderApp(&fpCfg, mockClientController, em, fpdb, logger) - require.NoError(t, err) - - err = app.Start() - defer func() { - err := app.Stop() - require.NoError(t, err) - }() - require.NoError(t, err) - - eotsKeyName := testutil.GenRandomHexStr(r, 4) - require.NoError(t, err) - eotsPkBz, err := em.CreateKey(eotsKeyName, passphrase, hdPath) - require.NoError(t, err) - eotsPk, err := bbntypes.NewBIP340PubKey(eotsPkBz) - require.NoError(t, err) - fp := testutil.GenStoredFinalityProvider(r, t, app, "", hdPath, eotsPk) - err = app.GetFinalityProviderStore().SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_JAILED) - require.NoError(t, err) + // Create fp app + app, fpPk, cleanup := startFPAppWithRegisteredFp(t, r, fpHomeDir, &fpCfg, mockClientController) + defer cleanup() expectedTxHash := datagen.GenRandomHexStr(r, 32) - mockClientController.EXPECT().UnjailFinalityProvider(fp.BtcPk).Return(&types.TxResponse{TxHash: expectedTxHash}, nil) - txHash, err := app.UnjailFinalityProvider(fp.GetBIP340BTCPK()) + mockClientController.EXPECT().UnjailFinalityProvider(fpPk.MustToBTCPK()).Return(&types.TxResponse{TxHash: expectedTxHash}, nil) + txHash, err := app.UnjailFinalityProvider(fpPk) require.NoError(t, err) require.Equal(t, expectedTxHash, txHash) - fpInfo, err := app.GetFinalityProviderInfo(fp.GetBIP340BTCPK()) + fpInfo, err := app.GetFinalityProviderInfo(fpPk) require.NoError(t, err) require.Equal(t, proto.FinalityProviderStatus_INACTIVE.String(), fpInfo.GetStatus()) }) @@ -312,29 +237,17 @@ func FuzzStatusUpdate(f *testing.F) { f.Fuzz(func(t *testing.T, seed int64) { r := rand.New(rand.NewSource(seed)) - ctl := gomock.NewController(t) - mockClientController := mocks.NewMockClientController(ctl) - fpApp, fpPk, cleanUp := newFinalityProviderManagerWithRegisteredFp(t, r, mockClientController) - defer cleanUp() + randomStartingHeight := uint64(r.Int63n(100) + 1) + currentHeight := randomStartingHeight + uint64(r.Int63n(10)+2) + mockClientController := testutil.PrepareMockedClientController(t, r, randomStartingHeight, currentHeight, 0) // setup mocks - currentHeight := uint64(r.Int63n(100) + 1) - currentBlockRes := &types.BlockInfo{ - Height: currentHeight, - Hash: datagen.GenRandomByteArray(r, 32), - } - mockClientController.EXPECT().QueryBestBlock().Return(currentBlockRes, nil).AnyTimes() + votingPower := uint64(r.Intn(2)) + mockClientController.EXPECT().QueryFinalityProviderVotingPower(gomock.Any(), currentHeight).Return(votingPower, nil).AnyTimes() mockClientController.EXPECT().Close().Return(nil).AnyTimes() mockClientController.EXPECT().QueryLatestFinalizedBlocks(gomock.Any()).Return(nil, nil).AnyTimes() - mockClientController.EXPECT().QueryBestBlock().Return(currentBlockRes, nil).AnyTimes() - mockClientController.EXPECT().QueryActivatedHeight().Return(uint64(1), nil).AnyTimes() - mockClientController.EXPECT().QueryFinalityActivationBlockHeight().Return(uint64(0), nil).AnyTimes() mockClientController.EXPECT().QueryFinalityProviderHighestVotedHeight(gomock.Any()).Return(uint64(0), nil).AnyTimes() - mockClientController.EXPECT().QueryBlock(gomock.Any()).Return(currentBlockRes, nil).AnyTimes() mockClientController.EXPECT().QueryLastCommittedPublicRand(gomock.Any(), uint64(1)).Return(nil, nil).AnyTimes() - - votingPower := uint64(r.Intn(2)) - mockClientController.EXPECT().QueryFinalityProviderVotingPower(gomock.Any(), currentHeight).Return(votingPower, nil).AnyTimes() mockClientController.EXPECT().SubmitFinalitySig(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(&types.TxResponse{TxHash: ""}, nil).AnyTimes() var isSlashedOrJailed int if votingPower == 0 { @@ -350,13 +263,28 @@ func FuzzStatusUpdate(f *testing.F) { } } - err := fpApp.StartFinalityProvider(fpPk, passphrase) - require.NoError(t, err) - fpIns, err := fpApp.GetFinalityProviderInstance() - require.NoError(t, err) - // stop the finality-provider as we are testing static functionalities - err = fpIns.Stop() - require.NoError(t, err) + // Create randomized config + pathSuffix := datagen.GenRandomHexStr(r, 10) + fpHomeDir := filepath.Join(t.TempDir(), "fp-home", pathSuffix) + fpCfg := config.DefaultConfigWithHome(fpHomeDir) + // use shorter interval for the test to end faster + fpCfg.SyncFpStatusInterval = time.Millisecond * 10 + fpCfg.StatusUpdateInterval = time.Second * 1 + fpCfg.SubmissionRetryInterval = time.Millisecond * 10 + + // Create fp app + app, _, cleanup := startFPAppWithRegisteredFp(t, r, fpHomeDir, &fpCfg, mockClientController) + defer cleanup() + + var fpIns *service.FinalityProviderInstance + var err error + require.Eventually(t, func() bool { + fpIns, err = app.GetFinalityProviderInstance() + if err != nil { + return false + } + return true + }, time.Second*5, time.Millisecond*200, "should eventually be registered or active") if votingPower > 0 { waitForStatus(t, fpIns, proto.FinalityProviderStatus_ACTIVE) @@ -380,7 +308,7 @@ func waitForStatus(t *testing.T, fpIns *service.FinalityProviderInstance, s prot }, eventuallyWaitTimeOut, eventuallyPollTime) } -func newFinalityProviderManagerWithRegisteredFp(t *testing.T, r *rand.Rand, cc clientcontroller.ClientController) (*service.FinalityProviderApp, *bbntypes.BIP340PubKey, func()) { +func startFPAppWithRegisteredFp(t *testing.T, r *rand.Rand, homePath string, cfg *config.Config, cc clientcontroller.ClientController) (*service.FinalityProviderApp, *bbntypes.BIP340PubKey, func()) { logger := zap.NewNop() // create an EOTS manager eotsHomeDir := filepath.Join(t.TempDir(), "eots-home") @@ -391,31 +319,26 @@ func newFinalityProviderManagerWithRegisteredFp(t *testing.T, r *rand.Rand, cc c require.NoError(t, err) // create finality-provider app with randomized config - fpHomeDir := filepath.Join(t.TempDir(), "fp-home") - fpCfg := config.DefaultConfigWithHome(fpHomeDir) - fpCfg.StatusUpdateInterval = 10 * time.Millisecond input := strings.NewReader("") - kr, err := keyring.CreateKeyring( - fpCfg.BabylonConfig.KeyDirectory, - fpCfg.BabylonConfig.ChainID, - fpCfg.BabylonConfig.KeyringBackend, - input, - ) require.NoError(t, err) - err = util.MakeDirectory(config.DataDir(fpHomeDir)) + err = util.MakeDirectory(config.DataDir(homePath)) require.NoError(t, err) - db, err := fpCfg.DatabaseConfig.GetDBBackend() + db, err := cfg.DatabaseConfig.GetDBBackend() require.NoError(t, err) fpStore, err := fpstore.NewFinalityProviderStore(db) require.NoError(t, err) - app, err := service.NewFinalityProviderApp(&fpCfg, cc, em, db, logger) - require.NoError(t, err) - err = app.Start() + app, err := service.NewFinalityProviderApp(cfg, cc, em, db, logger) require.NoError(t, err) // create registered finality-provider keyName := datagen.GenRandomHexStr(r, 10) chainID := datagen.GenRandomHexStr(r, 10) + kr, err := keyring.CreateKeyring( + cfg.BabylonConfig.KeyDirectory, + cfg.BabylonConfig.ChainID, + cfg.BabylonConfig.KeyringBackend, + input, + ) kc, err := keyring.NewChainKeyringControllerWithKeyring(kr, keyName, input) require.NoError(t, err) btcPkBytes, err := em.CreateKey(keyName, passphrase, hdPath) @@ -425,22 +348,16 @@ func newFinalityProviderManagerWithRegisteredFp(t *testing.T, r *rand.Rand, cc c keyInfo, err := kc.CreateChainKey(passphrase, hdPath, "") require.NoError(t, err) fpAddr := keyInfo.AccAddress - fpRecord, err := em.KeyRecord(btcPk.MustMarshal(), passphrase) - require.NoError(t, err) - pop, err := kc.CreatePop(fpAddr, fpRecord.PrivKey) - require.NoError(t, err) err = fpStore.CreateFinalityProvider( fpAddr, btcPk.MustToBTCPK(), testutil.RandomDescription(r), testutil.ZeroCommissionRate(), - keyName, chainID, - pop.BtcSig, ) require.NoError(t, err) - err = fpStore.SetFpStatus(btcPk.MustToBTCPK(), proto.FinalityProviderStatus_REGISTERED) + err = app.Start() require.NoError(t, err) cleanUp := func() { @@ -452,7 +369,7 @@ func newFinalityProviderManagerWithRegisteredFp(t *testing.T, r *rand.Rand, cc c require.NoError(t, err) err = os.RemoveAll(eotsHomeDir) require.NoError(t, err) - err = os.RemoveAll(fpHomeDir) + err = os.RemoveAll(homePath) require.NoError(t, err) } diff --git a/finality-provider/service/client/rpcclient.go b/finality-provider/service/client/rpcclient.go index e6240e82..894f5923 100644 --- a/finality-provider/service/client/rpcclient.go +++ b/finality-provider/service/client/rpcclient.go @@ -46,23 +46,9 @@ func (c *FinalityProviderServiceGRpcClient) GetInfo(ctx context.Context) (*proto return res, nil } -func (c *FinalityProviderServiceGRpcClient) RegisterFinalityProvider( - ctx context.Context, - fpPk *bbntypes.BIP340PubKey, - passphrase string, -) (*proto.RegisterFinalityProviderResponse, error) { - req := &proto.RegisterFinalityProviderRequest{BtcPk: fpPk.MarshalHex(), Passphrase: passphrase} - res, err := c.client.RegisterFinalityProvider(ctx, req) - if err != nil { - return nil, err - } - - return res, nil -} - func (c *FinalityProviderServiceGRpcClient) CreateFinalityProvider( ctx context.Context, - keyName, chainID, eotsPkHex, passphrase, hdPath string, + keyName, chainID, eotsPkHex, passphrase string, description types.Description, commission *sdkmath.LegacyDec, ) (*proto.CreateFinalityProviderResponse, error) { @@ -75,7 +61,6 @@ func (c *FinalityProviderServiceGRpcClient) CreateFinalityProvider( KeyName: keyName, ChainId: chainID, Passphrase: passphrase, - HdPath: hdPath, Description: descBytes, Commission: commission.String(), EotsPkHex: eotsPkHex, diff --git a/finality-provider/service/event_loops.go b/finality-provider/service/event_loops.go index 73605dfa..abf5c7bc 100644 --- a/finality-provider/service/event_loops.go +++ b/finality-provider/service/event_loops.go @@ -9,46 +9,6 @@ import ( "github.com/babylonlabs-io/finality-provider/finality-provider/proto" ) -// main event loop for the finality-provider app -func (app *FinalityProviderApp) eventLoop() { - defer app.wg.Done() - - for { - select { - case req := <-app.createFinalityProviderRequestChan: - res, err := app.handleCreateFinalityProviderRequest(req) - if err != nil { - req.errResponse <- err - continue - } - - req.successResponse <- &createFinalityProviderResponse{FpInfo: res.FpInfo} - - case ev := <-app.finalityProviderRegisteredEventChan: - // change the status of the finality-provider to registered - err := app.fps.SetFpStatus(ev.btcPubKey.MustToBTCPK(), proto.FinalityProviderStatus_REGISTERED) - if err != nil { - app.logger.Fatal("failed to set finality-provider status to REGISTERED", - zap.String("pk", ev.btcPubKey.MarshalHex()), - zap.Error(err), - ) - } - app.metrics.RecordFpStatus(ev.btcPubKey.MarshalHex(), proto.FinalityProviderStatus_REGISTERED) - - // return to the caller - ev.successResponse <- &RegisterFinalityProviderResponse{ - bbnAddress: ev.bbnAddress, - btcPubKey: ev.btcPubKey, - TxHash: ev.txHash, - } - - case <-app.quit: - app.logger.Debug("exiting main event loop") - return - } - } -} - // monitorStatusUpdate periodically check the status of the running finality provider and update // it accordingly. We update the status by querying the latest voting power and the slashed_height. // In particular, we perform the following status transitions (REGISTERED, ACTIVE, INACTIVE, SLASHED): @@ -143,11 +103,13 @@ func (app *FinalityProviderApp) monitorStatusUpdate() { ) } case <-app.quit: + app.logger.Info("exiting monitor fp status update loop") return } } } +// event loop for critical errors func (app *FinalityProviderApp) monitorCriticalErr() { defer app.wg.Done() @@ -177,16 +139,18 @@ func (app *FinalityProviderApp) monitorCriticalErr() { app.logger.Fatal(instanceTerminatingMsg, zap.String("pk", criticalErr.fpBtcPk.MarshalHex()), zap.Error(criticalErr.err)) case <-app.quit: + app.logger.Info("exiting monitor critical error loop") return } } } +// event loop for handling fp registration func (app *FinalityProviderApp) registrationLoop() { defer app.wg.Done() for { select { - case req := <-app.registerFinalityProviderRequestChan: + case req := <-app.createFinalityProviderRequestChan: // we won't do any retries here to not block the loop for more important messages. // Most probably it fails due so some user error so we just return the error to the user. // TODO: need to start passing context here to be able to cancel the request in case of app quiting @@ -225,28 +189,28 @@ func (app *FinalityProviderApp) registrationLoop() { zap.String("txHash", res.TxHash), ) - app.finalityProviderRegisteredEventChan <- &finalityProviderRegisteredEvent{ - btcPubKey: req.btcPubKey, - bbnAddress: req.fpAddr, - txHash: res.TxHash, - // pass the channel to the event so that we can send the response to the user which requested - // the registration - successResponse: req.successResponse, + app.metrics.RecordFpStatus(req.btcPubKey.MarshalHex(), proto.FinalityProviderStatus_REGISTERED) + + req.successResponse <- &RegisterFinalityProviderResponse{ + txHash: res.TxHash, } case <-app.quit: - app.logger.Debug("exiting registration loop") + app.logger.Info("exiting registration loop") return } } } +// event loop for metrics update func (app *FinalityProviderApp) metricsUpdateLoop() { defer app.wg.Done() interval := app.config.Metrics.UpdateInterval app.logger.Info("starting metrics update loop", zap.Float64("interval seconds", interval.Seconds())) + updateTicker := time.NewTicker(interval) + defer updateTicker.Stop() for { select { @@ -258,7 +222,6 @@ func (app *FinalityProviderApp) metricsUpdateLoop() { } app.metrics.UpdateFpMetrics(fps) case <-app.quit: - updateTicker.Stop() app.logger.Info("exiting metrics update loop") return } diff --git a/finality-provider/service/fp_instance_test.go b/finality-provider/service/fp_instance_test.go index 34d24814..90b940c0 100644 --- a/finality-provider/service/fp_instance_test.go +++ b/finality-provider/service/fp_instance_test.go @@ -4,6 +4,7 @@ import ( "math/rand" "os" "path/filepath" + "strings" "testing" bbntypes "github.com/babylonlabs-io/babylon/types" @@ -18,8 +19,8 @@ import ( "github.com/babylonlabs-io/finality-provider/eotsmanager" eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" "github.com/babylonlabs-io/finality-provider/finality-provider/config" - "github.com/babylonlabs-io/finality-provider/finality-provider/proto" "github.com/babylonlabs-io/finality-provider/finality-provider/service" + fpkr "github.com/babylonlabs-io/finality-provider/keyring" "github.com/babylonlabs-io/finality-provider/metrics" "github.com/babylonlabs-io/finality-provider/testutil" "github.com/babylonlabs-io/finality-provider/types" @@ -169,14 +170,32 @@ func startFinalityProviderAppWithRegisteredFp(t *testing.T, r *rand.Rand, cc cli require.NoError(t, err) eotsPk, err := bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) - fp := testutil.GenStoredFinalityProvider(r, t, app, passphrase, hdPath, eotsPk) pubRandProofStore := app.GetPubRandProofStore() fpStore := app.GetFinalityProviderStore() - err = fpStore.SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_REGISTERED) + keyName := datagen.GenRandomHexStr(r, 10) + chainID := datagen.GenRandomHexStr(r, 10) + input := strings.NewReader("") + kr, err := fpkr.CreateKeyring( + fpCfg.BabylonConfig.KeyDirectory, + fpCfg.BabylonConfig.ChainID, + fpCfg.BabylonConfig.KeyringBackend, + input, + ) + kc, err := fpkr.NewChainKeyringControllerWithKeyring(kr, keyName, input) + require.NoError(t, err) + keyInfo, err := kc.CreateChainKey("", "", "") + require.NoError(t, err) + fpAddr := keyInfo.AccAddress + err = fpStore.CreateFinalityProvider( + fpAddr, + eotsPk.MustToBTCPK(), + testutil.RandomDescription(r), + testutil.ZeroCommissionRate(), + chainID, + ) require.NoError(t, err) - // TODO: use mock metrics m := metrics.NewFpMetrics() - fpIns, err := service.NewFinalityProviderInstance(fp.GetBIP340BTCPK(), &fpCfg, fpStore, pubRandProofStore, cc, em, m, passphrase, make(chan *service.CriticalError), logger) + fpIns, err := service.NewFinalityProviderInstance(eotsPk, &fpCfg, fpStore, pubRandProofStore, cc, em, m, passphrase, make(chan *service.CriticalError), logger) require.NoError(t, err) cleanUp := func() { diff --git a/finality-provider/service/fp_store_adapter.go b/finality-provider/service/fp_store_adapter.go index 36ecef86..18290af3 100644 --- a/finality-provider/service/fp_store_adapter.go +++ b/finality-provider/service/fp_store_adapter.go @@ -15,23 +15,7 @@ import ( "github.com/babylonlabs-io/finality-provider/finality-provider/store" ) -type createFinalityProviderResponse struct { - FpInfo *proto.FinalityProviderInfo -} - -type createFinalityProviderRequest struct { - keyName string - passPhrase string - hdPath string - chainID string - eotsPk *bbntypes.BIP340PubKey - description *stakingtypes.Description - commission *sdkmath.LegacyDec - errResponse chan error - successResponse chan *createFinalityProviderResponse -} - -type registerFinalityProviderRequest struct { +type CreateFinalityProviderRequest struct { fpAddr sdk.AccAddress btcPubKey *bbntypes.BIP340PubKey pop *btcstakingtypes.ProofOfPossessionBTC @@ -41,21 +25,13 @@ type registerFinalityProviderRequest struct { successResponse chan *RegisterFinalityProviderResponse } -type finalityProviderRegisteredEvent struct { - bbnAddress sdk.AccAddress - btcPubKey *bbntypes.BIP340PubKey - txHash string - successResponse chan *RegisterFinalityProviderResponse -} - type RegisterFinalityProviderResponse struct { - bbnAddress sdk.AccAddress - btcPubKey *bbntypes.BIP340PubKey - TxHash string + txHash string } type CreateFinalityProviderResult struct { FpInfo *proto.FinalityProviderInfo + TxHash string } type fpState struct { diff --git a/finality-provider/service/rpcserver.go b/finality-provider/service/rpcserver.go index a956e499..0269c138 100644 --- a/finality-provider/service/rpcserver.go +++ b/finality-provider/service/rpcserver.go @@ -104,7 +104,6 @@ func (r *rpcServer) CreateFinalityProvider( req.KeyName, req.ChainId, req.Passphrase, - req.HdPath, eotsPk, &description, &commissionRate, @@ -116,25 +115,10 @@ func (r *rpcServer) CreateFinalityProvider( return &proto.CreateFinalityProviderResponse{ FinalityProvider: result.FpInfo, + TxHash: result.TxHash, }, nil } -// RegisterFinalityProvider sends a transactions to Babylon to register a BTC finality-provider -func (r *rpcServer) RegisterFinalityProvider(_ context.Context, req *proto.RegisterFinalityProviderRequest) ( - *proto.RegisterFinalityProviderResponse, error) { - txRes, err := r.app.RegisterFinalityProvider(req.BtcPk) - if err != nil { - return nil, fmt.Errorf("failed to register the finality-provider to Babylon: %w", err) - } - - // the finality-provider instance should be started right after registration - if err := r.app.StartFinalityProvider(txRes.btcPubKey, req.Passphrase); err != nil { - return nil, fmt.Errorf("failed to start the registered finality-provider %s: %w", txRes.bbnAddress.String(), err) - } - - return &proto.RegisterFinalityProviderResponse{TxHash: txRes.TxHash}, nil -} - // AddFinalitySignature adds a manually constructed finality signature to Babylon // NOTE: this is only used for presentation/testing purposes func (r *rpcServer) AddFinalitySignature(_ context.Context, req *proto.AddFinalitySignatureRequest) ( diff --git a/finality-provider/store/fpstore.go b/finality-provider/store/fpstore.go index 8b8a3efc..77a4fa13 100644 --- a/finality-provider/store/fpstore.go +++ b/finality-provider/store/fpstore.go @@ -46,8 +46,7 @@ func (s *FinalityProviderStore) CreateFinalityProvider( btcPk *btcec.PublicKey, description *stakingtypes.Description, commission *sdkmath.LegacyDec, - keyName, chainID string, - btcSig []byte, + chainID string, ) error { desBytes, err := description.Marshal() if err != nil { @@ -58,12 +57,8 @@ func (s *FinalityProviderStore) CreateFinalityProvider( BtcPk: schnorr.SerializePubKey(btcPk), Description: desBytes, Commission: commission.String(), - Pop: &proto.ProofOfPossession{ - BtcSig: btcSig, - }, - KeyName: keyName, - ChainId: chainID, - Status: proto.FinalityProviderStatus_CREATED, + ChainId: chainID, + Status: proto.FinalityProviderStatus_REGISTERED, } return s.createFinalityProviderInternal(fp) @@ -131,9 +126,6 @@ func (s *FinalityProviderStore) UpdateFpStatusFromVotingPower( // voting power == 0 then set status depending on previous status //nolint:exhaustive switch fp.Status { - case proto.FinalityProviderStatus_CREATED: - // previous status is CREATED then set to REGISTERED - return proto.FinalityProviderStatus_REGISTERED, s.SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_REGISTERED) case proto.FinalityProviderStatus_ACTIVE: // previous status is ACTIVE then set to INACTIVE return proto.FinalityProviderStatus_INACTIVE, s.SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_INACTIVE) diff --git a/finality-provider/store/fpstore_test.go b/finality-provider/store/fpstore_test.go index aa349b61..3e212a47 100644 --- a/finality-provider/store/fpstore_test.go +++ b/finality-provider/store/fpstore_test.go @@ -8,11 +8,12 @@ import ( "github.com/babylonlabs-io/babylon/testutil/datagen" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/babylonlabs-io/finality-provider/finality-provider/config" "github.com/babylonlabs-io/finality-provider/finality-provider/proto" fpstore "github.com/babylonlabs-io/finality-provider/finality-provider/store" "github.com/babylonlabs-io/finality-provider/testutil" - sdk "github.com/cosmos/cosmos-sdk/types" ) // FuzzFinalityProvidersStore tests save and list finality providers properly @@ -47,9 +48,7 @@ func FuzzFinalityProvidersStore(f *testing.F) { fp.BtcPk, fp.Description, fp.Commission, - fp.KeyName, fp.ChainID, - fp.Pop.BtcSig, ) require.NoError(t, err) @@ -60,9 +59,7 @@ func FuzzFinalityProvidersStore(f *testing.F) { fp.BtcPk, fp.Description, fp.Commission, - fp.KeyName, fp.ChainID, - fp.Pop.BtcSig, ) require.ErrorIs(t, err, fpstore.ErrDuplicateFinalityProvider) @@ -93,13 +90,6 @@ func TestUpdateFpStatusFromVotingPower(t *testing.T) { expStatus proto.FinalityProviderStatus expErr error }{ - { - "zero vp: Created to Registered", - proto.FinalityProviderStatus_CREATED, - 0, - proto.FinalityProviderStatus_REGISTERED, - nil, - }, { "zero vp: Active to Inactive", proto.FinalityProviderStatus_ACTIVE, @@ -128,13 +118,6 @@ func TestUpdateFpStatusFromVotingPower(t *testing.T) { proto.FinalityProviderStatus_SLASHED, nil, }, - { - "vp > 0: Created to Active", - proto.FinalityProviderStatus_CREATED, - 1, - proto.FinalityProviderStatus_ACTIVE, - nil, - }, { "vp > 0: Registered to Active", proto.FinalityProviderStatus_REGISTERED, @@ -156,13 +139,6 @@ func TestUpdateFpStatusFromVotingPower(t *testing.T) { anyFpStatus, fpstore.ErrFinalityProviderNotFound, }, - { - "err: fp not found and vp == 0 && created", - proto.FinalityProviderStatus_CREATED, - 0, - anyFpStatus, - fpstore.ErrFinalityProviderNotFound, - }, { "err: fp not found and vp == 0 && active", proto.FinalityProviderStatus_ACTIVE, @@ -199,9 +175,7 @@ func TestUpdateFpStatusFromVotingPower(t *testing.T) { fp.BtcPk, fp.Description, fp.Commission, - fp.KeyName, fp.ChainID, - fp.Pop.BtcSig, ) require.NoError(t, err) diff --git a/finality-provider/store/storedfp.go b/finality-provider/store/storedfp.go index d0a15a56..5da283ed 100644 --- a/finality-provider/store/storedfp.go +++ b/finality-provider/store/storedfp.go @@ -17,8 +17,6 @@ type StoredFinalityProvider struct { BtcPk *btcec.PublicKey Description *stakingtypes.Description Commission *sdkmath.LegacyDec - Pop *proto.ProofOfPossession - KeyName string ChainID string LastVotedHeight uint64 Status proto.FinalityProviderStatus @@ -41,14 +39,10 @@ func protoFpToStoredFinalityProvider(fp *proto.FinalityProvider) (*StoredFinalit } return &StoredFinalityProvider{ - FPAddr: fp.FpAddr, - BtcPk: btcPk, - Description: &des, - Commission: &commission, - Pop: &proto.ProofOfPossession{ - BtcSig: fp.Pop.BtcSig, - }, - KeyName: fp.KeyName, + FPAddr: fp.FpAddr, + BtcPk: btcPk, + Description: &des, + Commission: &commission, ChainID: fp.ChainId, LastVotedHeight: fp.LastVotedHeight, Status: fp.Status, @@ -79,11 +73,10 @@ func (sfp *StoredFinalityProvider) ToFinalityProviderInfo() *proto.FinalityProvi // ShouldStart returns true if the finality provider should start his instance // based on the current status of the finality provider. // -// It returns false if the status is either 'CREATED', 'JAILED' or 'SLASHED'. -// It returs true for all the other status. +// It returns false if the status is either 'REGISTERED', 'JAILED' or 'SLASHED'. +// It returns true for all the other status. func (sfp *StoredFinalityProvider) ShouldStart() bool { - if sfp.Status == proto.FinalityProviderStatus_CREATED || - sfp.Status == proto.FinalityProviderStatus_SLASHED || + if sfp.Status == proto.FinalityProviderStatus_SLASHED || sfp.Status == proto.FinalityProviderStatus_JAILED { return false } diff --git a/finality-provider/store/storedfp_test.go b/finality-provider/store/storedfp_test.go index 932caed3..d99d7f2b 100644 --- a/finality-provider/store/storedfp_test.go +++ b/finality-provider/store/storedfp_test.go @@ -4,9 +4,10 @@ import ( "math/rand" "testing" + "github.com/stretchr/testify/require" + "github.com/babylonlabs-io/finality-provider/finality-provider/proto" "github.com/babylonlabs-io/finality-provider/testutil" - "github.com/stretchr/testify/require" ) func TestShouldStart(t *testing.T) { @@ -16,11 +17,6 @@ func TestShouldStart(t *testing.T) { currFpStatus proto.FinalityProviderStatus expShouldStart bool }{ - { - "Created: Should NOT start", - proto.FinalityProviderStatus_CREATED, - false, - }, { "Slashed: Should NOT start", proto.FinalityProviderStatus_SLASHED, diff --git a/itest/test_manager.go b/itest/test_manager.go index 513cda0d..76ad3c25 100644 --- a/itest/test_manager.go +++ b/itest/test_manager.go @@ -199,13 +199,11 @@ func StartManagerWithFinalityProvider(t *testing.T) (*TestManager, *service.Fina require.NoError(t, err) eotsPk, err := bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) - res, err := app.CreateFinalityProvider(cfg.BabylonConfig.Key, testChainID, passphrase, hdPath, eotsPk, desc, &commission) + res, err := app.CreateFinalityProvider(cfg.BabylonConfig.Key, testChainID, passphrase, eotsPk, desc, &commission) require.NoError(t, err) fpPk, err := bbntypes.NewBIP340PubKeyFromHex(res.FpInfo.BtcPkHex) require.NoError(t, err) - _, err = app.RegisterFinalityProvider(fpPk.MarshalHex()) - require.NoError(t, err) err = app.StartFinalityProvider(fpPk, passphrase) require.NoError(t, err) fpIns, err := app.GetFinalityProviderInstance() diff --git a/testutil/datagen.go b/testutil/datagen.go index c27f0cd6..e3c0ec47 100644 --- a/testutil/datagen.go +++ b/testutil/datagen.go @@ -6,25 +6,19 @@ import ( "testing" "time" + sdkmath "cosmossdk.io/math" "github.com/babylonlabs-io/babylon/crypto/eots" - "github.com/cosmos/cosmos-sdk/crypto/keyring" + "github.com/babylonlabs-io/babylon/testutil/datagen" + bbn "github.com/babylonlabs-io/babylon/types" + "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/stretchr/testify/require" "github.com/babylonlabs-io/finality-provider/finality-provider/store" fpkr "github.com/babylonlabs-io/finality-provider/keyring" - sdkmath "cosmossdk.io/math" - "github.com/babylonlabs-io/babylon/testutil/datagen" - bbn "github.com/babylonlabs-io/babylon/types" - bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" - "github.com/btcsuite/btcd/chaincfg" - "github.com/cosmos/cosmos-sdk/client" - "github.com/stretchr/testify/require" - "github.com/babylonlabs-io/finality-provider/codec" - "github.com/babylonlabs-io/finality-provider/finality-provider/proto" - "github.com/babylonlabs-io/finality-provider/finality-provider/service" "github.com/babylonlabs-io/finality-provider/types" ) @@ -61,29 +55,19 @@ func GenPublicRand(r *rand.Rand, t *testing.T) *bbn.SchnorrPubRand { func GenRandomFinalityProvider(r *rand.Rand, t *testing.T) *store.StoredFinalityProvider { // generate BTC key pair - btcSK, btcPK, err := datagen.GenRandomBTCKeyPair(r) + _, btcPK, err := datagen.GenRandomBTCKeyPair(r) require.NoError(t, err) bip340PK := bbn.NewBIP340PubKeyFromBTCPK(btcPK) fpAddr, err := sdk.AccAddressFromBech32(datagen.GenRandomAccount().Address) require.NoError(t, err) - // generate and verify PoP, correct case - pop, err := bstypes.NewPoPBTC(fpAddr, btcSK) - require.NoError(t, err) - err = pop.Verify(fpAddr, bip340PK, &chaincfg.SimNetParams) - require.NoError(t, err) - return &store.StoredFinalityProvider{ FPAddr: fpAddr.String(), - KeyName: GenRandomHexStr(r, 4), ChainID: "chain-test", BtcPk: bip340PK.MustToBTCPK(), Description: RandomDescription(r), Commission: ZeroCommissionRate(), - Pop: &proto.ProofOfPossession{ - BtcSig: pop.BtcSig, - }, } } @@ -104,27 +88,6 @@ func GenBlocks(r *rand.Rand, startHeight, endHeight uint64) []*types.BlockInfo { return blocks } -// GenStoredFinalityProvider generates a random finality-provider from the keyring and store it in DB -func GenStoredFinalityProvider(r *rand.Rand, t *testing.T, app *service.FinalityProviderApp, passphrase, hdPath string, eotsPk *bbn.BIP340PubKey) *store.StoredFinalityProvider { - // generate keyring - keyName := GenRandomHexStr(r, 4) - chainID := GenRandomHexStr(r, 4) - - cfg := app.GetConfig() - _, err := CreateChainKey(cfg.BabylonConfig.KeyDirectory, cfg.BabylonConfig.ChainID, keyName, keyring.BackendTest, passphrase, hdPath, "") - require.NoError(t, err) - - res, err := app.CreateFinalityProvider(keyName, chainID, passphrase, hdPath, eotsPk, RandomDescription(r), ZeroCommissionRate()) - require.NoError(t, err) - - btcPk, err := bbn.NewBIP340PubKeyFromHex(res.FpInfo.BtcPkHex) - require.NoError(t, err) - storedFp, err := app.GetFinalityProviderStore().GetFinalityProvider(btcPk.MustToBTCPK()) - require.NoError(t, err) - - return storedFp -} - func CreateChainKey(keyringDir, chainID, keyName, backend, passphrase, hdPath, mnemonic string) (*types.ChainKeyInfo, error) { sdkCtx, err := fpkr.CreateClientCtx( keyringDir, chainID, From 5224b3f709302c00e114cab92edb81aeed97b75a Mon Sep 17 00:00:00 2001 From: Fangyu Gai Date: Wed, 4 Dec 2024 18:50:38 +0800 Subject: [PATCH 2/4] update doc --- docs/finality-provider-operation.md | 73 ++++++------------- .../cmd/fpd/daemon/daemon_commands.go | 4 +- 2 files changed, 23 insertions(+), 54 deletions(-) diff --git a/docs/finality-provider-operation.md b/docs/finality-provider-operation.md index 155afb59..e248a41c 100644 --- a/docs/finality-provider-operation.md +++ b/docs/finality-provider-operation.md @@ -32,10 +32,9 @@ gain an overall understanding of the finality provider. 4. [Starting the Finality Provider Daemon](#44-starting-the-finality-provider-daemon) 5. [Finality Provider Operation](#5-finality-provider-operations) 1. [Create Finality Provider](#51-create-finality-provider) - 2. [Register Finality Provider](#52-register-finality-provider) - 3. [Withdrawing Rewards](#53-withdrawing-rewards) - 4. [Jailing and Unjailing](#54-jailing-and-unjailing) - 5. [Slashing](#55-slashing) + 2. [Withdrawing Rewards](#52-withdrawing-rewards) + 3. [Jailing and Unjailing](#53-jailing-and-unjailing) + 4. [Slashing](#54-slashing) ## 1. A note about Phase-1 Finality Providers @@ -479,14 +478,14 @@ RPC will have access to all the EOTS keys held within it For example, after registering a finality provider, you can start its daemon by providing the EOTS public key `fpd start --eots-pk ` -``` ## 5. Finality Provider Operations ### 5.1 Create Finality Provider -The `create-finality-provider` command initializes a new finality provider -instance locally. +The `create-finality-provider` command initializes a new finality provider, +submits `MsgCreateFinalityProvider` to register it on the Babylon chain, and +saves the finality provider information in the database. ``` shell fpd create-finality-provider \ @@ -531,9 +530,11 @@ your finality provider's details: ``` json { - "fp_addr": "bbn1ht2nxa6hlyl89m8xpdde9xsj40n0sxd2f9shsq", - "eots_pk_hex": - "cf0f03b9ee2d4a0f27240e2d8b8c8ef609e24358b2eb3cfd89ae4e4f472e1a41", + "finality_provider": + { + "fp_addr": "bbn1ht2nxa6hlyl89m8xpdde9xsj40n0sxd2f9shsq", + "eots_pk_hex": + "cf0f03b9ee2d4a0f27240e2d8b8c8ef609e24358b2eb3cfd89ae4e4f472e1a41", "description": { "moniker": "MyFinalityProvider", @@ -542,7 +543,9 @@ your finality provider's details: "details": "finality provider for the Babylon network" }, "commission": "0.050000000000000000", - "status": "CREATED" + "status": "REGISTERED" + } + "tx_hash": "C08377CF289DF0DC5FA462E6409ADCB65A3492C22A112C58EA449F4DC544A3B1" } ``` @@ -552,11 +555,13 @@ The response includes: - `description`: Your finality provider's metadata - `commission`: Your set commission rate - `status`: Current status of the finality provider. +- `tx_hash`: Babylon transaction hash of the finality provider creation + transaction, which you can use to verify the success of the transaction + on the Babylon chain. Below you can see a list of the statuses that a finality provider can transition to: -- `CREATED`: defines a finality provider that is awaiting registration -- `REGISTERED`: defines a finality provider that has been registered +- `REGISTERED`: defines a finality provider that has been created and registered to the consumer chain but has no delegated stake - `ACTIVE`: defines a finality provider that is delegated to vote - `INACTIVE`: defines a finality provider whose delegations are reduced to @@ -569,56 +574,20 @@ to: For more information on statuses please refer to diagram in the core documentation [fp-core](fp-core.md). -### 5.2. Register Finality Provider - -The `register-finality-provider` command registers your finality provider on the -Babylon chain. This command requires you to specify: - -1. The EOTS public key of the finality provider you wish to register -2. The Babylon account associated with your finality provider - (the one specified in the creation) having sufficient funds - to pay for the transaction fee. -3. A running fpd daemon - -``` shell -fpd register-finality-provider \ - \ - --daemon-address \ - --home -``` - -Parameters: -- ``: The EOTS public key of the finality provider you want to -register (e.g., `cf0f03b9ee2d4a0f27240e2d8b8c8ef609e24358b2eb3cfd89ae4e4f472e1a41`) -- `--daemon-address`: RPC address of the finality provider daemon - (default: `127.0.0.1:12581`) -- `--home`: Path to your finality provider daemon home directory (e.g., `~/.fpdHome`) - -If successful, the command will return a transaction hash: - -``` shell -{ "tx_hash": -"C08377CF289DF0DC5FA462E6409ADCB65A3492C22A112C58EA449F4DC544A3B1" } -``` - -You can verify the transaction was successful by looking up this transaction -hash on the Babylon chain. - - -### 5.3. Withdrawing Rewards +### 5.2. Withdrawing Rewards As a participant in the Finality Provider Program, you will earn rewards that can be withdrawn. The functionality for withdrawing rewards is currently under development and will be available soon. Further updates will be provided once this feature is implemented. -### 5.4. Jailing and Unjailing +### 5.3. Jailing and Unjailing A finality provider can be jailed for the following reasons: 1. Missing Votes @@ -655,7 +624,7 @@ Parameters: > ⚠️ Before unjailing, ensure you've fixed the underlying issue that caused jailing -### 5.5. Slashing +### 5.4. Slashing **Slashing occurs** when a finality provider **double signs**, meaning that the finality provider signs conflicting blocks at the same height. This results in diff --git a/finality-provider/cmd/fpd/daemon/daemon_commands.go b/finality-provider/cmd/fpd/daemon/daemon_commands.go index 2b251a11..3708d045 100644 --- a/finality-provider/cmd/fpd/daemon/daemon_commands.go +++ b/finality-provider/cmd/fpd/daemon/daemon_commands.go @@ -176,7 +176,7 @@ func runCommandCreateFP(ctx client.Context, cmd *cobra.Command, _ []string) erro return fmt.Errorf("eots-pk cannot be empty") } - info, err := client.CreateFinalityProvider( + res, err := client.CreateFinalityProvider( context.Background(), keyName, chainID, @@ -189,7 +189,7 @@ func runCommandCreateFP(ctx client.Context, cmd *cobra.Command, _ []string) erro return err } - printRespJSON(info.FinalityProvider) + printRespJSON(res) return nil } From aadbeaa39a5cabc3647be3d22bb6c153071e0bfa Mon Sep 17 00:00:00 2001 From: Fangyu Gai Date: Wed, 4 Dec 2024 18:52:13 +0800 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9aa08f7..e0fa1cd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) * [#175](https://github.com/babylonlabs-io/finality-provider/pull/175) adds: `eotsd version` command * [#179](https://github.com/babylonlabs-io/finality-provider/pull/179) Change `btc_pk` text to `eots_pk` in CLI * [#182](https://github.com/babylonlabs-io/finality-provider/pull/182) Remove fp manager +* [#189](https://github.com/babylonlabs-io/finality-provider/pull/189) Remove `fpd register-finality-provider` cmd ### Bug Fixes From 6ca05645c325c3e11d7fd6a912466f9c116e64d6 Mon Sep 17 00:00:00 2001 From: Fangyu Gai Date: Wed, 4 Dec 2024 19:00:11 +0800 Subject: [PATCH 4/4] fix lint --- finality-provider/service/app_test.go | 6 ++---- finality-provider/service/fp_instance_test.go | 1 + finality-provider/store/fpstore.go | 6 ++---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/finality-provider/service/app_test.go b/finality-provider/service/app_test.go index 62bc4a92..f45d910f 100644 --- a/finality-provider/service/app_test.go +++ b/finality-provider/service/app_test.go @@ -280,10 +280,7 @@ func FuzzStatusUpdate(f *testing.F) { var err error require.Eventually(t, func() bool { fpIns, err = app.GetFinalityProviderInstance() - if err != nil { - return false - } - return true + return err == nil }, time.Second*5, time.Millisecond*200, "should eventually be registered or active") if votingPower > 0 { @@ -339,6 +336,7 @@ func startFPAppWithRegisteredFp(t *testing.T, r *rand.Rand, homePath string, cfg cfg.BabylonConfig.KeyringBackend, input, ) + require.NoError(t, err) kc, err := keyring.NewChainKeyringControllerWithKeyring(kr, keyName, input) require.NoError(t, err) btcPkBytes, err := em.CreateKey(keyName, passphrase, hdPath) diff --git a/finality-provider/service/fp_instance_test.go b/finality-provider/service/fp_instance_test.go index 90b940c0..8b4c487f 100644 --- a/finality-provider/service/fp_instance_test.go +++ b/finality-provider/service/fp_instance_test.go @@ -181,6 +181,7 @@ func startFinalityProviderAppWithRegisteredFp(t *testing.T, r *rand.Rand, cc cli fpCfg.BabylonConfig.KeyringBackend, input, ) + require.NoError(t, err) kc, err := fpkr.NewChainKeyringControllerWithKeyring(kr, keyName, input) require.NoError(t, err) keyInfo, err := kc.CreateChainKey("", "", "") diff --git a/finality-provider/store/fpstore.go b/finality-provider/store/fpstore.go index 77a4fa13..ffff5334 100644 --- a/finality-provider/store/fpstore.go +++ b/finality-provider/store/fpstore.go @@ -123,13 +123,11 @@ func (s *FinalityProviderStore) UpdateFpStatusFromVotingPower( return proto.FinalityProviderStatus_ACTIVE, s.SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_ACTIVE) } - // voting power == 0 then set status depending on previous status - //nolint:exhaustive - switch fp.Status { - case proto.FinalityProviderStatus_ACTIVE: + if fp.Status == proto.FinalityProviderStatus_ACTIVE { // previous status is ACTIVE then set to INACTIVE return proto.FinalityProviderStatus_INACTIVE, s.SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_INACTIVE) } + return fp.Status, nil }