diff --git a/clientcontroller/babylon.go b/clientcontroller/babylon.go index ff89ce8d..efcc4e0f 100644 --- a/clientcontroller/babylon.go +++ b/clientcontroller/babylon.go @@ -257,6 +257,27 @@ func (bc *BabylonController) SubmitBatchFinalitySigs( return &types.TxResponse{TxHash: res.TxHash, Events: res.Events}, nil } +// UnjailFinalityProvider sends an unjail transaction to the consumer chain +func (bc *BabylonController) UnjailFinalityProvider(fpPk *btcec.PublicKey) (*types.TxResponse, error) { + msg := &finalitytypes.MsgUnjailFinalityProvider{ + Signer: bc.mustGetTxSigner(), + FpBtcPk: bbntypes.NewBIP340PubKeyFromBTCPK(fpPk), + } + + unrecoverableErrs := []*sdkErr.Error{ + btcstakingtypes.ErrFpNotFound, + btcstakingtypes.ErrFpNotJailed, + btcstakingtypes.ErrFpAlreadySlashed, + } + + res, err := bc.reliablySendMsg(msg, emptyErrs, unrecoverableErrs) + if err != nil { + return nil, err + } + + return &types.TxResponse{TxHash: res.TxHash, Events: res.Events}, nil +} + func (bc *BabylonController) QueryFinalityProviderSlashedOrJailed(fpPk *btcec.PublicKey) (slashed bool, jailed bool, err error) { fpPubKey := bbntypes.NewBIP340PubKeyFromBTCPK(fpPk) res, err := bc.bbnClient.QueryClient.FinalityProvider(fpPubKey.MarshalHex()) diff --git a/clientcontroller/interface.go b/clientcontroller/interface.go index c1e210a5..3b84a2aa 100644 --- a/clientcontroller/interface.go +++ b/clientcontroller/interface.go @@ -40,7 +40,8 @@ type ClientController interface { // SubmitBatchFinalitySigs submits a batch of finality signatures to the consumer chain SubmitBatchFinalitySigs(fpPk *btcec.PublicKey, blocks []*types.BlockInfo, pubRandList []*btcec.FieldVal, proofList [][]byte, sigs []*btcec.ModNScalar) (*types.TxResponse, error) - // Note: the following queries are only for PoC + // UnjailFinalityProvider sends an unjail transaction to the consumer chain + UnjailFinalityProvider(fpPk *btcec.PublicKey) (*types.TxResponse, error) // QueryFinalityProviderVotingPower queries the voting power of the finality provider at a given height QueryFinalityProviderVotingPower(fpPk *btcec.PublicKey, blockHeight uint64) (uint64, error) diff --git a/finality-provider/cmd/fpd/daemon/daemon_commands.go b/finality-provider/cmd/fpd/daemon/daemon_commands.go index c8683e5c..30501050 100644 --- a/finality-provider/cmd/fpd/daemon/daemon_commands.go +++ b/finality-provider/cmd/fpd/daemon/daemon_commands.go @@ -174,6 +174,44 @@ func runCommandCreateFP(ctx client.Context, cmd *cobra.Command, _ []string) erro return nil } +// CommandUnjailFP returns the unjail-finality-provider command by connecting to the fpd daemon. +func CommandUnjailFP() *cobra.Command { + var cmd = &cobra.Command{ + Use: "unjail-finality-provider", + Aliases: []string{"ufp"}, + Short: "Unjail the given finality provider.", + Example: fmt.Sprintf(`fpd unjail-finality-provider [eots-pk] --daemon-address %s ...`, defaultFpdDaemonAddress), + Args: cobra.ExactArgs(1), + RunE: fpcmd.RunEWithClientCtx(runCommandUnjailFP), + } + + f := cmd.Flags() + f.String(fpdDaemonAddressFlag, defaultFpdDaemonAddress, "The RPC server address of fpd") + + return cmd +} + +func runCommandUnjailFP(_ client.Context, cmd *cobra.Command, args []string) error { + 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 cleanUp() + + _, err = client.UnjailFinalityProvider(context.Background(), args[0]) + if err != nil { + return err + } + + return nil +} + func getDescriptionFromFlags(f *pflag.FlagSet) (desc stakingtypes.Description, err error) { // get information for description monikerStr, err := f.GetString(monikerFlag) diff --git a/finality-provider/cmd/fpd/daemon/start.go b/finality-provider/cmd/fpd/daemon/start.go index 14b4dc24..0a8c92db 100644 --- a/finality-provider/cmd/fpd/daemon/start.go +++ b/finality-provider/cmd/fpd/daemon/start.go @@ -1,6 +1,7 @@ package daemon import ( + "errors" "fmt" "net" "path/filepath" @@ -133,9 +134,22 @@ func startApp( } if err := fpApp.StartHandlingFinalityProvider(fpPk, passphrase); err != nil { + if errors.Is(err, service.ErrFinalityProviderJailed) { + fpApp.Logger().Error("failed to start finality provider", zap.Error(err)) + // do not return error as we still want the service to start + return nil + } return fmt.Errorf("failed to start the finality-provider instance %s: %w", fpPkStr, err) } } - return fpApp.StartHandlingAll() + if err := fpApp.StartHandlingAll(); err != nil { + if errors.Is(err, service.ErrFinalityProviderJailed) { + fpApp.Logger().Error("failed to start finality provider", zap.Error(err)) + // do not return error as we still want the service to start + return nil + } + } + + return nil } diff --git a/finality-provider/cmd/fpd/daemon/tx.go b/finality-provider/cmd/fpd/daemon/tx.go index 9a5897de..f13339d2 100644 --- a/finality-provider/cmd/fpd/daemon/tx.go +++ b/finality-provider/cmd/fpd/daemon/tx.go @@ -9,7 +9,6 @@ import ( btcstakingcli "github.com/babylonlabs-io/babylon/x/btcstaking/client/cli" btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" - finalitycli "github.com/babylonlabs-io/babylon/x/finality/client/cli" sdk "github.com/cosmos/cosmos-sdk/types" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" authcli "github.com/cosmos/cosmos-sdk/x/auth/client/cli" @@ -28,7 +27,6 @@ func CommandTxs() *cobra.Command { cmd.AddCommand( authcli.GetSignCommand(), btcstakingcli.NewCreateFinalityProviderCmd(), - finalitycli.NewUnjailFinalityProviderCmd(), NewValidateSignedFinalityProviderCmd(), ) diff --git a/finality-provider/cmd/fpd/main.go b/finality-provider/cmd/fpd/main.go index b898de30..9d168bbb 100644 --- a/finality-provider/cmd/fpd/main.go +++ b/finality-provider/cmd/fpd/main.go @@ -33,7 +33,7 @@ func main() { daemon.CommandInit(), daemon.CommandStart(), daemon.CommandKeys(), daemon.CommandGetDaemonInfo(), daemon.CommandCreateFP(), daemon.CommandLsFP(), daemon.CommandInfoFP(), daemon.CommandRegisterFP(), daemon.CommandAddFinalitySig(), - daemon.CommandExportFP(), daemon.CommandTxs(), + daemon.CommandExportFP(), daemon.CommandTxs(), daemon.CommandUnjailFP(), ) if err := cmd.Execute(); err != nil { diff --git a/finality-provider/proto/finality_providers.pb.go b/finality-provider/proto/finality_providers.pb.go index fe2b59f3..0a0fa1dd 100644 --- a/finality-provider/proto/finality_providers.pb.go +++ b/finality-provider/proto/finality_providers.pb.go @@ -576,6 +576,102 @@ func (x *AddFinalitySignatureResponse) GetLocalSkHex() string { return "" } +type UnjailFinalityProviderRequest 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"` +} + +func (x *UnjailFinalityProviderRequest) Reset() { + *x = UnjailFinalityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_finality_providers_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnjailFinalityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnjailFinalityProviderRequest) ProtoMessage() {} + +func (x *UnjailFinalityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_finality_providers_proto_msgTypes[8] + 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 UnjailFinalityProviderRequest.ProtoReflect.Descriptor instead. +func (*UnjailFinalityProviderRequest) Descriptor() ([]byte, []int) { + return file_finality_providers_proto_rawDescGZIP(), []int{8} +} + +func (x *UnjailFinalityProviderRequest) GetBtcPk() string { + if x != nil { + return x.BtcPk + } + return "" +} + +type UnjailFinalityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // hash of the successful chain unjail finality provider transaction + TxHash string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` +} + +func (x *UnjailFinalityProviderResponse) Reset() { + *x = UnjailFinalityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_finality_providers_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UnjailFinalityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UnjailFinalityProviderResponse) ProtoMessage() {} + +func (x *UnjailFinalityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_finality_providers_proto_msgTypes[9] + 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 UnjailFinalityProviderResponse.ProtoReflect.Descriptor instead. +func (*UnjailFinalityProviderResponse) Descriptor() ([]byte, []int) { + return file_finality_providers_proto_rawDescGZIP(), []int{9} +} + +func (x *UnjailFinalityProviderResponse) GetTxHash() string { + if x != nil { + return x.TxHash + } + return "" +} + type QueryFinalityProviderRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -588,7 +684,7 @@ type QueryFinalityProviderRequest struct { func (x *QueryFinalityProviderRequest) Reset() { *x = QueryFinalityProviderRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[8] + mi := &file_finality_providers_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -601,7 +697,7 @@ func (x *QueryFinalityProviderRequest) String() string { func (*QueryFinalityProviderRequest) ProtoMessage() {} func (x *QueryFinalityProviderRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[8] + mi := &file_finality_providers_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -614,7 +710,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{8} + return file_finality_providers_proto_rawDescGZIP(), []int{10} } func (x *QueryFinalityProviderRequest) GetBtcPk() string { @@ -635,7 +731,7 @@ type QueryFinalityProviderResponse struct { func (x *QueryFinalityProviderResponse) Reset() { *x = QueryFinalityProviderResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[9] + mi := &file_finality_providers_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -648,7 +744,7 @@ func (x *QueryFinalityProviderResponse) String() string { func (*QueryFinalityProviderResponse) ProtoMessage() {} func (x *QueryFinalityProviderResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[9] + mi := &file_finality_providers_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -661,7 +757,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{9} + return file_finality_providers_proto_rawDescGZIP(), []int{11} } func (x *QueryFinalityProviderResponse) GetFinalityProvider() *FinalityProviderInfo { @@ -680,7 +776,7 @@ type QueryFinalityProviderListRequest struct { func (x *QueryFinalityProviderListRequest) Reset() { *x = QueryFinalityProviderListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[10] + mi := &file_finality_providers_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -693,7 +789,7 @@ func (x *QueryFinalityProviderListRequest) String() string { func (*QueryFinalityProviderListRequest) ProtoMessage() {} func (x *QueryFinalityProviderListRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[10] + mi := &file_finality_providers_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -706,7 +802,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{10} + return file_finality_providers_proto_rawDescGZIP(), []int{12} } type QueryFinalityProviderListResponse struct { @@ -720,7 +816,7 @@ type QueryFinalityProviderListResponse struct { func (x *QueryFinalityProviderListResponse) Reset() { *x = QueryFinalityProviderListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[11] + mi := &file_finality_providers_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -733,7 +829,7 @@ func (x *QueryFinalityProviderListResponse) String() string { func (*QueryFinalityProviderListResponse) ProtoMessage() {} func (x *QueryFinalityProviderListResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[11] + mi := &file_finality_providers_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -746,7 +842,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{11} + return file_finality_providers_proto_rawDescGZIP(), []int{13} } func (x *QueryFinalityProviderListResponse) GetFinalityProviders() []*FinalityProviderInfo { @@ -788,7 +884,7 @@ type FinalityProvider struct { func (x *FinalityProvider) Reset() { *x = FinalityProvider{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[12] + mi := &file_finality_providers_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -801,7 +897,7 @@ func (x *FinalityProvider) String() string { func (*FinalityProvider) ProtoMessage() {} func (x *FinalityProvider) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[12] + mi := &file_finality_providers_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -814,7 +910,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{12} + return file_finality_providers_proto_rawDescGZIP(), []int{14} } func (x *FinalityProvider) GetFpAddr() string { @@ -912,7 +1008,7 @@ type FinalityProviderInfo struct { func (x *FinalityProviderInfo) Reset() { *x = FinalityProviderInfo{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[13] + mi := &file_finality_providers_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -925,7 +1021,7 @@ func (x *FinalityProviderInfo) String() string { func (*FinalityProviderInfo) ProtoMessage() {} func (x *FinalityProviderInfo) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[13] + mi := &file_finality_providers_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -938,7 +1034,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{13} + return file_finality_providers_proto_rawDescGZIP(), []int{15} } func (x *FinalityProviderInfo) GetFpAddr() string { @@ -1006,7 +1102,7 @@ type Description struct { func (x *Description) Reset() { *x = Description{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[14] + mi := &file_finality_providers_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1019,7 +1115,7 @@ func (x *Description) String() string { func (*Description) ProtoMessage() {} func (x *Description) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[14] + mi := &file_finality_providers_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1032,7 +1128,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{14} + return file_finality_providers_proto_rawDescGZIP(), []int{16} } func (x *Description) GetMoniker() string { @@ -1086,7 +1182,7 @@ type ProofOfPossession struct { func (x *ProofOfPossession) Reset() { *x = ProofOfPossession{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[15] + mi := &file_finality_providers_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1099,7 +1195,7 @@ func (x *ProofOfPossession) String() string { func (*ProofOfPossession) ProtoMessage() {} func (x *ProofOfPossession) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[15] + mi := &file_finality_providers_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1112,7 +1208,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{15} + return file_finality_providers_proto_rawDescGZIP(), []int{17} } func (x *ProofOfPossession) GetBtcSig() []byte { @@ -1134,7 +1230,7 @@ type SchnorrRandPair struct { func (x *SchnorrRandPair) Reset() { *x = SchnorrRandPair{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[16] + mi := &file_finality_providers_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1147,7 +1243,7 @@ func (x *SchnorrRandPair) String() string { func (*SchnorrRandPair) ProtoMessage() {} func (x *SchnorrRandPair) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[16] + mi := &file_finality_providers_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1160,7 +1256,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{16} + return file_finality_providers_proto_rawDescGZIP(), []int{18} } func (x *SchnorrRandPair) GetPubRand() []byte { @@ -1195,7 +1291,7 @@ type SignMessageFromChainKeyRequest struct { func (x *SignMessageFromChainKeyRequest) Reset() { *x = SignMessageFromChainKeyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[17] + mi := &file_finality_providers_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1208,7 +1304,7 @@ func (x *SignMessageFromChainKeyRequest) String() string { func (*SignMessageFromChainKeyRequest) ProtoMessage() {} func (x *SignMessageFromChainKeyRequest) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[17] + mi := &file_finality_providers_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1221,7 +1317,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{17} + return file_finality_providers_proto_rawDescGZIP(), []int{19} } func (x *SignMessageFromChainKeyRequest) GetMsgToSign() []byte { @@ -1264,7 +1360,7 @@ type SignMessageFromChainKeyResponse struct { func (x *SignMessageFromChainKeyResponse) Reset() { *x = SignMessageFromChainKeyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_finality_providers_proto_msgTypes[18] + mi := &file_finality_providers_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1277,7 +1373,7 @@ func (x *SignMessageFromChainKeyResponse) String() string { func (*SignMessageFromChainKeyResponse) ProtoMessage() {} func (x *SignMessageFromChainKeyResponse) ProtoReflect() protoreflect.Message { - mi := &file_finality_providers_proto_msgTypes[18] + mi := &file_finality_providers_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1290,7 +1386,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{18} + return file_finality_providers_proto_rawDescGZIP(), []int{20} } func (x *SignMessageFromChainKeyResponse) GetSignature() []byte { @@ -1363,167 +1459,180 @@ var file_finality_providers_proto_rawDesc = []byte{ 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, 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, + 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, 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, 0xbc, 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, 0x32, 0x0a, 0x15, - 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x5f, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6c, 0x61, 0x73, - 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x35, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 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, + 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, 0xbc, 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, 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, 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, 0xc0, 0x05, 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, + 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, + 0x32, 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, + 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, + 0x6c, 0x61, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x48, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 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, 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, 0xa7, 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, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x46, + 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, - 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, 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, + 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, 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, - 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, 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, 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, + 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, 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 ( @@ -1539,7 +1648,7 @@ 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, 19) +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 @@ -1550,41 +1659,45 @@ var file_finality_providers_proto_goTypes = []interface{}{ (*RegisterFinalityProviderResponse)(nil), // 6: proto.RegisterFinalityProviderResponse (*AddFinalitySignatureRequest)(nil), // 7: proto.AddFinalitySignatureRequest (*AddFinalitySignatureResponse)(nil), // 8: proto.AddFinalitySignatureResponse - (*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 + (*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 } var file_finality_providers_proto_depIdxs = []int32{ - 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 - 16, // 3: proto.FinalityProvider.pop:type_name -> proto.ProofOfPossession + 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 - 15, // 5: proto.FinalityProviderInfo.description:type_name -> proto.Description + 17, // 5: proto.FinalityProviderInfo.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.RegisterFinalityProvider:input_type -> proto.RegisterFinalityProviderRequest 7, // 9: proto.FinalityProviders.AddFinalitySignature:input_type -> proto.AddFinalitySignatureRequest - 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 - 2, // 13: proto.FinalityProviders.GetInfo:output_type -> proto.GetInfoResponse - 4, // 14: proto.FinalityProviders.CreateFinalityProvider:output_type -> proto.CreateFinalityProviderResponse - 6, // 15: proto.FinalityProviders.RegisterFinalityProvider:output_type -> proto.RegisterFinalityProviderResponse - 8, // 16: proto.FinalityProviders.AddFinalitySignature:output_type -> proto.AddFinalitySignatureResponse - 10, // 17: proto.FinalityProviders.QueryFinalityProvider:output_type -> proto.QueryFinalityProviderResponse - 12, // 18: proto.FinalityProviders.QueryFinalityProviderList:output_type -> proto.QueryFinalityProviderListResponse - 19, // 19: proto.FinalityProviders.SignMessageFromChainKey:output_type -> proto.SignMessageFromChainKeyResponse - 13, // [13:20] is the sub-list for method output_type - 6, // [6:13] is the sub-list for method input_type + 9, // 10: proto.FinalityProviders.UnjailFinalityProvider:input_type -> proto.UnjailFinalityProviderRequest + 11, // 11: proto.FinalityProviders.QueryFinalityProvider:input_type -> proto.QueryFinalityProviderRequest + 13, // 12: proto.FinalityProviders.QueryFinalityProviderList:input_type -> proto.QueryFinalityProviderListRequest + 20, // 13: proto.FinalityProviders.SignMessageFromChainKey:input_type -> proto.SignMessageFromChainKeyRequest + 2, // 14: proto.FinalityProviders.GetInfo:output_type -> proto.GetInfoResponse + 4, // 15: proto.FinalityProviders.CreateFinalityProvider:output_type -> proto.CreateFinalityProviderResponse + 6, // 16: proto.FinalityProviders.RegisterFinalityProvider:output_type -> proto.RegisterFinalityProviderResponse + 8, // 17: proto.FinalityProviders.AddFinalitySignature:output_type -> proto.AddFinalitySignatureResponse + 10, // 18: proto.FinalityProviders.UnjailFinalityProvider:output_type -> proto.UnjailFinalityProviderResponse + 12, // 19: proto.FinalityProviders.QueryFinalityProvider:output_type -> proto.QueryFinalityProviderResponse + 14, // 20: proto.FinalityProviders.QueryFinalityProviderList:output_type -> proto.QueryFinalityProviderListResponse + 21, // 21: proto.FinalityProviders.SignMessageFromChainKey:output_type -> proto.SignMessageFromChainKeyResponse + 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 @@ -1693,7 +1806,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryFinalityProviderRequest); i { + switch v := v.(*UnjailFinalityProviderRequest); i { case 0: return &v.state case 1: @@ -1705,7 +1818,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryFinalityProviderResponse); i { + switch v := v.(*UnjailFinalityProviderResponse); i { case 0: return &v.state case 1: @@ -1717,7 +1830,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryFinalityProviderListRequest); i { + switch v := v.(*QueryFinalityProviderRequest); i { case 0: return &v.state case 1: @@ -1729,7 +1842,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryFinalityProviderListResponse); i { + switch v := v.(*QueryFinalityProviderResponse); i { case 0: return &v.state case 1: @@ -1741,7 +1854,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FinalityProvider); i { + switch v := v.(*QueryFinalityProviderListRequest); i { case 0: return &v.state case 1: @@ -1753,7 +1866,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FinalityProviderInfo); i { + switch v := v.(*QueryFinalityProviderListResponse); i { case 0: return &v.state case 1: @@ -1765,7 +1878,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Description); i { + switch v := v.(*FinalityProvider); i { case 0: return &v.state case 1: @@ -1777,7 +1890,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProofOfPossession); i { + switch v := v.(*FinalityProviderInfo); i { case 0: return &v.state case 1: @@ -1789,7 +1902,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchnorrRandPair); i { + switch v := v.(*Description); i { case 0: return &v.state case 1: @@ -1801,7 +1914,7 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignMessageFromChainKeyRequest); i { + switch v := v.(*ProofOfPossession); i { case 0: return &v.state case 1: @@ -1813,6 +1926,30 @@ func file_finality_providers_proto_init() { } } file_finality_providers_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SchnorrRandPair); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_finality_providers_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SignMessageFromChainKeyRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_finality_providers_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignMessageFromChainKeyResponse); i { case 0: return &v.state @@ -1831,7 +1968,7 @@ func file_finality_providers_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_finality_providers_proto_rawDesc, NumEnums: 1, - NumMessages: 19, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/finality-provider/proto/finality_providers.proto b/finality-provider/proto/finality_providers.proto index 66083d1a..8760db57 100644 --- a/finality-provider/proto/finality_providers.proto +++ b/finality-provider/proto/finality_providers.proto @@ -26,6 +26,11 @@ service FinalityProviders { rpc AddFinalitySignature(AddFinalitySignatureRequest) returns (AddFinalitySignatureResponse); + // UnjailFinalityProvider sends a transactions to the consumer chain to unjail a given + // finality provider + rpc UnjailFinalityProvider(UnjailFinalityProviderRequest) + returns (UnjailFinalityProviderResponse); + // QueryFinalityProvider queries the finality provider rpc QueryFinalityProvider (QueryFinalityProviderRequest) returns (QueryFinalityProviderResponse); @@ -101,6 +106,16 @@ message AddFinalitySignatureResponse { string local_sk_hex = 3; } +message UnjailFinalityProviderRequest { + // btc_pk is hex string of the BTC secp256k1 public key of the finality provider encoded in BIP-340 spec + string btc_pk = 1; +} + +message UnjailFinalityProviderResponse { + // hash of the successful chain unjail finality provider transaction + string tx_hash = 1; +} + message QueryFinalityProviderRequest { // btc_pk is hex string of the BTC secp256k1 public key of the finality provider encoded in BIP-340 spec string btc_pk = 1; diff --git a/finality-provider/proto/finality_providers_grpc.pb.go b/finality-provider/proto/finality_providers_grpc.pb.go index e2d7bdca..a3ab355d 100644 --- a/finality-provider/proto/finality_providers_grpc.pb.go +++ b/finality-provider/proto/finality_providers_grpc.pb.go @@ -23,6 +23,7 @@ const ( 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" FinalityProviders_QueryFinalityProviderList_FullMethodName = "/proto.FinalityProviders/QueryFinalityProviderList" FinalityProviders_SignMessageFromChainKey_FullMethodName = "/proto.FinalityProviders/SignMessageFromChainKey" @@ -42,6 +43,9 @@ type FinalityProvidersClient interface { // 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) + // UnjailFinalityProvider sends a transactions to the consumer chain to unjail a given + // finality provider + UnjailFinalityProvider(ctx context.Context, in *UnjailFinalityProviderRequest, opts ...grpc.CallOption) (*UnjailFinalityProviderResponse, error) // QueryFinalityProvider queries the finality provider QueryFinalityProvider(ctx context.Context, in *QueryFinalityProviderRequest, opts ...grpc.CallOption) (*QueryFinalityProviderResponse, error) // QueryFinalityProviderList queries a list of finality providers @@ -94,6 +98,15 @@ func (c *finalityProvidersClient) AddFinalitySignature(ctx context.Context, in * return out, nil } +func (c *finalityProvidersClient) UnjailFinalityProvider(ctx context.Context, in *UnjailFinalityProviderRequest, opts ...grpc.CallOption) (*UnjailFinalityProviderResponse, error) { + out := new(UnjailFinalityProviderResponse) + err := c.cc.Invoke(ctx, FinalityProviders_UnjailFinalityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *finalityProvidersClient) QueryFinalityProvider(ctx context.Context, in *QueryFinalityProviderRequest, opts ...grpc.CallOption) (*QueryFinalityProviderResponse, error) { out := new(QueryFinalityProviderResponse) err := c.cc.Invoke(ctx, FinalityProviders_QueryFinalityProvider_FullMethodName, in, out, opts...) @@ -135,6 +148,9 @@ type FinalityProvidersServer interface { // AddFinalitySignature sends a transactions to the consumer chain to add a Finality // signature for a block AddFinalitySignature(context.Context, *AddFinalitySignatureRequest) (*AddFinalitySignatureResponse, error) + // UnjailFinalityProvider sends a transactions to the consumer chain to unjail a given + // finality provider + UnjailFinalityProvider(context.Context, *UnjailFinalityProviderRequest) (*UnjailFinalityProviderResponse, error) // QueryFinalityProvider queries the finality provider QueryFinalityProvider(context.Context, *QueryFinalityProviderRequest) (*QueryFinalityProviderResponse, error) // QueryFinalityProviderList queries a list of finality providers @@ -160,6 +176,9 @@ func (UnimplementedFinalityProvidersServer) RegisterFinalityProvider(context.Con func (UnimplementedFinalityProvidersServer) AddFinalitySignature(context.Context, *AddFinalitySignatureRequest) (*AddFinalitySignatureResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddFinalitySignature not implemented") } +func (UnimplementedFinalityProvidersServer) UnjailFinalityProvider(context.Context, *UnjailFinalityProviderRequest) (*UnjailFinalityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UnjailFinalityProvider not implemented") +} func (UnimplementedFinalityProvidersServer) QueryFinalityProvider(context.Context, *QueryFinalityProviderRequest) (*QueryFinalityProviderResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryFinalityProvider not implemented") } @@ -254,6 +273,24 @@ func _FinalityProviders_AddFinalitySignature_Handler(srv interface{}, ctx contex return interceptor(ctx, in, info, handler) } +func _FinalityProviders_UnjailFinalityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnjailFinalityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(FinalityProvidersServer).UnjailFinalityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: FinalityProviders_UnjailFinalityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(FinalityProvidersServer).UnjailFinalityProvider(ctx, req.(*UnjailFinalityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _FinalityProviders_QueryFinalityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryFinalityProviderRequest) if err := dec(in); err != nil { @@ -331,6 +368,10 @@ var FinalityProviders_ServiceDesc = grpc.ServiceDesc{ MethodName: "AddFinalitySignature", Handler: _FinalityProviders_AddFinalitySignature_Handler, }, + { + MethodName: "UnjailFinalityProvider", + Handler: _FinalityProviders_UnjailFinalityProvider_Handler, + }, { MethodName: "QueryFinalityProvider", Handler: _FinalityProviders_QueryFinalityProvider_Handler, diff --git a/finality-provider/service/app.go b/finality-provider/service/app.go index 6c5c7c2a..01d3e3be 100644 --- a/finality-provider/service/app.go +++ b/finality-provider/service/app.go @@ -379,6 +379,37 @@ func (app *FinalityProviderApp) CreateFinalityProvider( } } +// UnjailFinalityProvider sends a transaction to unjail a finality-provider +func (app *FinalityProviderApp) UnjailFinalityProvider(fpPk *bbntypes.BIP340PubKey) (string, error) { + _, err := app.fps.GetFinalityProvider(fpPk.MustToBTCPK()) + if err != nil { + return "", fmt.Errorf("failed to get finality provider from db: %w", err) + } + + // Send unjail transaction + res, err := app.cc.UnjailFinalityProvider(fpPk.MustToBTCPK()) + if err != nil { + return "", fmt.Errorf("failed to send unjail transaction: %w", err) + } + + // Update finality-provider status in the local store + // set it to INACTIVE for now and it will be updated to + // ACTIVE if the fp has voting power + err = app.fps.SetFpStatus(fpPk.MustToBTCPK(), proto.FinalityProviderStatus_INACTIVE) + if err != nil { + return "", fmt.Errorf("failed to update finality-provider status after unjailing: %w", err) + } + + app.fpManager.metrics.RecordFpStatus(fpPk.MarshalHex(), proto.FinalityProviderStatus_INACTIVE) + + app.logger.Info("successfully unjailed finality-provider", + zap.String("btc_pk", fpPk.MarshalHex()), + zap.String("txHash", res.TxHash), + ) + + 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) diff --git a/finality-provider/service/app_test.go b/finality-provider/service/app_test.go index c9772897..d4ccad71 100644 --- a/finality-provider/service/app_test.go +++ b/finality-provider/service/app_test.go @@ -176,6 +176,7 @@ func FuzzSyncFinalityProviderStatus(f *testing.F) { blkInfo := &types.BlockInfo{Height: currentHeight} + mockClientController.EXPECT().QueryLastCommittedPublicRand(gomock.Any(), uint64(1)).Return(nil, nil).AnyTimes() mockClientController.EXPECT().QueryLatestFinalizedBlocks(gomock.Any()).Return(nil, nil).AnyTimes() mockClientController.EXPECT().QueryBestBlock().Return(blkInfo, nil).Return(blkInfo, nil).AnyTimes() mockClientController.EXPECT().QueryBlock(gomock.Any()).Return(nil, errors.New("chain not online")).AnyTimes() @@ -221,3 +222,70 @@ func FuzzSyncFinalityProviderStatus(f *testing.F) { }, time.Second*5, time.Millisecond*200, "should eventually be registered or active") }) } + +func FuzzUnjailFinalityProvider(f *testing.F) { + testutil.AddRandomSeedsToFuzzer(f, 10) + 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) + // 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) + + blkInfo := &types.BlockInfo{Height: currentHeight} + + mockClientController.EXPECT().QueryLastCommittedPublicRand(gomock.Any(), uint64(1)).Return(nil, nil).AnyTimes() + mockClientController.EXPECT().QueryLatestFinalizedBlocks(gomock.Any()).Return(nil, nil).AnyTimes() + mockClientController.EXPECT().QueryBestBlock().Return(blkInfo, nil).Return(blkInfo, nil).AnyTimes() + mockClientController.EXPECT().QueryBlock(gomock.Any()).Return(nil, errors.New("chain not online")).AnyTimes() + + // set voting power to be positive so that the fp should eventually become ACTIVE + mockClientController.EXPECT().QueryFinalityProviderVotingPower(gomock.Any(), gomock.Any()).Return(uint64(0), nil).AnyTimes() + mockClientController.EXPECT().QueryActivatedHeight().Return(uint64(1), nil).AnyTimes() + mockClientController.EXPECT().QueryFinalityProviderSlashedOrJailed(gomock.Any()).Return(false, false, 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) + + fp := testutil.GenStoredFinalityProvider(r, t, app, "", hdPath, nil) + err = app.GetFinalityProviderStore().SetFpStatus(fp.BtcPk, proto.FinalityProviderStatus_JAILED) + require.NoError(t, err) + + expectedTxHash := datagen.GenRandomHexStr(r, 32) + mockClientController.EXPECT().UnjailFinalityProvider(fp.BtcPk).Return(&types.TxResponse{TxHash: expectedTxHash}, nil) + txHash, err := app.UnjailFinalityProvider(fp.GetBIP340BTCPK()) + require.NoError(t, err) + require.Equal(t, expectedTxHash, txHash) + fpInfo, err := app.GetFinalityProviderInfo(fp.GetBIP340BTCPK()) + require.NoError(t, err) + require.Equal(t, proto.FinalityProviderStatus_INACTIVE.String(), fpInfo.GetStatus()) + }) +} diff --git a/finality-provider/service/client/rpcclient.go b/finality-provider/service/client/rpcclient.go index 21bdc39f..833ec5bb 100644 --- a/finality-provider/service/client/rpcclient.go +++ b/finality-provider/service/client/rpcclient.go @@ -103,6 +103,19 @@ func (c *FinalityProviderServiceGRpcClient) AddFinalitySignature(ctx context.Con return res, nil } +func (c *FinalityProviderServiceGRpcClient) UnjailFinalityProvider(ctx context.Context, fpPk string) (*proto.UnjailFinalityProviderResponse, error) { + req := &proto.UnjailFinalityProviderRequest{ + BtcPk: fpPk, + } + + res, err := c.client.UnjailFinalityProvider(ctx, req) + if err != nil { + return nil, err + } + + return res, nil +} + func (c *FinalityProviderServiceGRpcClient) QueryFinalityProviderList(ctx context.Context) (*proto.QueryFinalityProviderListResponse, error) { req := &proto.QueryFinalityProviderListRequest{} res, err := c.client.QueryFinalityProviderList(ctx, req) diff --git a/finality-provider/service/errors.go b/finality-provider/service/errors.go index c499215e..fa6b50af 100644 --- a/finality-provider/service/errors.go +++ b/finality-provider/service/errors.go @@ -4,4 +4,6 @@ import "errors" var ( ErrFinalityProviderShutDown = errors.New("the finality provider instance is shutting down") + ErrFinalityProviderJailed = errors.New("the finality provider instance is jailed") + ErrFinalityProviderSlashed = errors.New("the finality provider instance is slashed") ) diff --git a/finality-provider/service/fp_instance.go b/finality-provider/service/fp_instance.go index 4d0731a2..d643ee8a 100644 --- a/finality-provider/service/fp_instance.go +++ b/finality-provider/service/fp_instance.go @@ -9,7 +9,6 @@ import ( "github.com/avast/retry-go/v4" bbntypes "github.com/babylonlabs-io/babylon/types" - bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" ftypes "github.com/babylonlabs-io/babylon/x/finality/types" "github.com/btcsuite/btcd/btcec/v2" "github.com/gogo/protobuf/jsonpb" @@ -98,6 +97,10 @@ func (fp *FinalityProviderInstance) Start() error { return fmt.Errorf("the finality-provider instance %s is already started", fp.GetBtcPkHex()) } + if fp.IsJailed() { + return fmt.Errorf("%w: %s", ErrFinalityProviderJailed, fp.GetBtcPkHex()) + } + fp.logger.Info("Starting finality-provider instance", zap.String("pk", fp.GetBtcPkHex())) startHeight, err := fp.bootstrap() @@ -138,8 +141,13 @@ func (fp *FinalityProviderInstance) bootstrap() (uint64, error) { if fp.checkLagging(latestBlock) { _, err := fp.tryFastSync(latestBlock) - if err != nil && !clientcontroller.IsExpected(err) { - return 0, err + if err != nil { + if errors.Is(err, ErrFinalityProviderJailed) { + fp.MustSetStatus(proto.FinalityProviderStatus_JAILED) + } + if !clientcontroller.IsExpected(err) { + return 0, err + } } } @@ -174,6 +182,10 @@ func (fp *FinalityProviderInstance) IsRunning() bool { return fp.isStarted.Load() } +func (fp *FinalityProviderInstance) IsJailed() bool { + return fp.GetStatus() == proto.FinalityProviderStatus_JAILED +} + func (fp *FinalityProviderInstance) finalitySigSubmissionLoop() { defer fp.wg.Done() @@ -230,7 +242,7 @@ func (fp *FinalityProviderInstance) finalitySigSubmissionLoop() { res, err := fp.tryFastSync(targetBlock) fp.isLagging.Store(false) if err != nil { - if errors.Is(err, bstypes.ErrFpAlreadySlashed) { + if errors.Is(err, ErrFinalityProviderSlashed) { fp.reportCriticalErr(err) continue } @@ -696,7 +708,13 @@ func (fp *FinalityProviderInstance) SubmitBatchFinalitySignatures(blocks []*type // send finality signature to the consumer chain res, err := fp.cc.SubmitBatchFinalitySigs(fp.GetBtcPk(), blocks, prList, proofBytesList, sigList) if err != nil { - return nil, fmt.Errorf("failed to send a batch of finality signatures to the consumer chain: %w", err) + if strings.Contains(err.Error(), "jailed") { + return nil, ErrFinalityProviderJailed + } + if strings.Contains(err.Error(), "slashed") { + return nil, ErrFinalityProviderSlashed + } + return nil, err } // update DB diff --git a/finality-provider/service/fp_manager.go b/finality-provider/service/fp_manager.go index 12a39d3f..55c87e58 100644 --- a/finality-provider/service/fp_manager.go +++ b/finality-provider/service/fp_manager.go @@ -1,14 +1,13 @@ package service import ( + "errors" "fmt" - "strings" "sync" "time" "github.com/avast/retry-go/v4" bbntypes "github.com/babylonlabs-io/babylon/types" - btcstakingtypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "go.uber.org/atomic" "go.uber.org/zap" @@ -100,13 +99,13 @@ func (fpm *FinalityProviderManager) monitorCriticalErr() { } // cannot use error.Is because the unwrapped error // is not the expected error type - if strings.Contains(criticalErr.err.Error(), btcstakingtypes.ErrFpAlreadySlashed.Error()) { + if errors.Is(criticalErr.err, ErrFinalityProviderSlashed) { fpm.setFinalityProviderSlashed(fpi) fpm.logger.Debug("the finality-provider has been slashed", zap.String("pk", criticalErr.fpBtcPk.MarshalHex())) continue } - if strings.Contains(criticalErr.err.Error(), btcstakingtypes.ErrFpAlreadyJailed.Error()) { + if errors.Is(criticalErr.err, ErrFinalityProviderJailed) { fpm.setFinalityProviderJailed(fpi) fpm.logger.Debug("the finality-provider has been jailed", zap.String("pk", criticalErr.fpBtcPk.MarshalHex())) diff --git a/finality-provider/service/rpcserver.go b/finality-provider/service/rpcserver.go index b792491d..3064000e 100644 --- a/finality-provider/service/rpcserver.go +++ b/finality-provider/service/rpcserver.go @@ -187,6 +187,28 @@ func (r *rpcServer) AddFinalitySignature(ctx context.Context, req *proto.AddFina return res, nil } +// UnjailFinalityProvider unjails a finality-provider +func (r *rpcServer) UnjailFinalityProvider(ctx context.Context, req *proto.UnjailFinalityProviderRequest) ( + *proto.UnjailFinalityProviderResponse, error) { + + fpPk, err := bbntypes.NewBIP340PubKeyFromHex(req.BtcPk) + if err != nil { + return nil, err + } + + txHash, err := r.app.UnjailFinalityProvider(fpPk) + if err != nil { + return nil, fmt.Errorf("failed to unjail the finality-provider: %w", err) + } + + // todo: keep passphrase as empty for now + if err := r.app.StartHandlingFinalityProvider(fpPk, ""); err != nil { + return nil, fmt.Errorf("failed to start the finality provider instance after unjailing: %w", err) + } + + return &proto.UnjailFinalityProviderResponse{TxHash: txHash}, nil +} + // QueryFinalityProvider queries the information of the finality-provider func (r *rpcServer) QueryFinalityProvider(ctx context.Context, req *proto.QueryFinalityProviderRequest) ( *proto.QueryFinalityProviderResponse, error) { diff --git a/go.mod b/go.mod index 9a0dfbd2..46ec6c76 100644 --- a/go.mod +++ b/go.mod @@ -34,6 +34,7 @@ require ( github.com/urfave/cli v1.22.14 go.uber.org/atomic v1.10.0 go.uber.org/zap v1.26.0 + golang.org/x/mod v0.17.0 google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -283,7 +284,6 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.23.0 // indirect golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect - golang.org/x/mod v0.17.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect golang.org/x/sync v0.7.0 // indirect diff --git a/itest/test_manager.go b/itest/test_manager.go index f0c8e7ae..549a01d4 100644 --- a/itest/test_manager.go +++ b/itest/test_manager.go @@ -3,8 +3,6 @@ package e2etest import ( "encoding/hex" "fmt" - "github.com/babylonlabs-io/finality-provider/itest/container" - "github.com/babylonlabs-io/finality-provider/testutil" "math/rand" "os" "path/filepath" @@ -14,6 +12,9 @@ import ( "testing" "time" + "github.com/babylonlabs-io/finality-provider/itest/container" + "github.com/babylonlabs-io/finality-provider/testutil" + sdkmath "cosmossdk.io/math" "github.com/babylonlabs-io/babylon/btcstaking" txformat "github.com/babylonlabs-io/babylon/btctxformatter" diff --git a/testutil/mocks/babylon.go b/testutil/mocks/babylon.go index 31be816d..7ba26689 100644 --- a/testutil/mocks/babylon.go +++ b/testutil/mocks/babylon.go @@ -232,3 +232,18 @@ func (mr *MockClientControllerMockRecorder) SubmitFinalitySig(fpPk, block, pubRa mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubmitFinalitySig", reflect.TypeOf((*MockClientController)(nil).SubmitFinalitySig), fpPk, block, pubRand, proof, sig) } + +// UnjailFinalityProvider mocks base method. +func (m *MockClientController) UnjailFinalityProvider(fpPk *btcec.PublicKey) (*types0.TxResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UnjailFinalityProvider", fpPk) + ret0, _ := ret[0].(*types0.TxResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UnjailFinalityProvider indicates an expected call of UnjailFinalityProvider. +func (mr *MockClientControllerMockRecorder) UnjailFinalityProvider(fpPk interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnjailFinalityProvider", reflect.TypeOf((*MockClientController)(nil).UnjailFinalityProvider), fpPk) +}