diff --git a/CHANGELOG.md b/CHANGELOG.md index 995544b7..27cedb74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) * [#333](https://github.com/babylonlabs-io/finality-provider/pull/333) poller: skip if no new block is polled * [#328](https://github.com/babylonlabs-io/finality-provider/pull/328) Fix small bias in EOTS private key generation +* [#337](https://github.com/babylonlabs-io/finality-provider/pull/337) Cleanup EOTS manager interfaces ## v1.0.0-rc.1 diff --git a/eotsmanager/client/rpcclient.go b/eotsmanager/client/rpcclient.go index 3d0a17f7..7d622dd1 100644 --- a/eotsmanager/client/rpcclient.go +++ b/eotsmanager/client/rpcclient.go @@ -11,7 +11,6 @@ import ( "github.com/babylonlabs-io/finality-provider/eotsmanager" "github.com/babylonlabs-io/finality-provider/eotsmanager/proto" - "github.com/babylonlabs-io/finality-provider/eotsmanager/types" ) var _ eotsmanager.EOTSManager = &EOTSManagerGRpcClient{} @@ -50,23 +49,12 @@ func (c *EOTSManagerGRpcClient) Ping() error { return nil } -func (c *EOTSManagerGRpcClient) CreateKey(name, passphrase, hdPath string) ([]byte, error) { - req := &proto.CreateKeyRequest{Name: name, Passphrase: passphrase, HdPath: hdPath} - res, err := c.client.CreateKey(context.Background(), req) - if err != nil { - return nil, err - } - - return res.Pk, nil -} - -func (c *EOTSManagerGRpcClient) CreateRandomnessPairList(uid, chainID []byte, startHeight uint64, num uint32, passphrase string) ([]*btcec.FieldVal, error) { +func (c *EOTSManagerGRpcClient) CreateRandomnessPairList(uid, chainID []byte, startHeight uint64, num uint32) ([]*btcec.FieldVal, error) { req := &proto.CreateRandomnessPairListRequest{ Uid: uid, ChainId: chainID, StartHeight: startHeight, Num: num, - Passphrase: passphrase, } res, err := c.client.CreateRandomnessPairList(context.Background(), req) if err != nil { @@ -93,29 +81,12 @@ func (c *EOTSManagerGRpcClient) SaveEOTSKeyName(pk *btcec.PublicKey, keyName str return err } -func (c *EOTSManagerGRpcClient) KeyRecord(uid []byte, passphrase string) (*types.KeyRecord, error) { - req := &proto.KeyRecordRequest{Uid: uid, Passphrase: passphrase} - - res, err := c.client.KeyRecord(context.Background(), req) - if err != nil { - return nil, err - } - - privKey, _ := btcec.PrivKeyFromBytes(res.PrivateKey) - - return &types.KeyRecord{ - Name: res.Name, - PrivKey: privKey, - }, nil -} - -func (c *EOTSManagerGRpcClient) SignEOTS(uid, chaiID, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) { +func (c *EOTSManagerGRpcClient) SignEOTS(uid, chaiID, msg []byte, height uint64) (*btcec.ModNScalar, error) { req := &proto.SignEOTSRequest{ - Uid: uid, - ChainId: chaiID, - Msg: msg, - Height: height, - Passphrase: passphrase, + Uid: uid, + ChainId: chaiID, + Msg: msg, + Height: height, } res, err := c.client.SignEOTS(context.Background(), req) if err != nil { @@ -128,13 +99,12 @@ func (c *EOTSManagerGRpcClient) SignEOTS(uid, chaiID, msg []byte, height uint64, return &s, nil } -func (c *EOTSManagerGRpcClient) UnsafeSignEOTS(uid, chaiID, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) { +func (c *EOTSManagerGRpcClient) UnsafeSignEOTS(uid, chaiID, msg []byte, height uint64) (*btcec.ModNScalar, error) { req := &proto.SignEOTSRequest{ - Uid: uid, - ChainId: chaiID, - Msg: msg, - Height: height, - Passphrase: passphrase, + Uid: uid, + ChainId: chaiID, + Msg: msg, + Height: height, } res, err := c.client.UnsafeSignEOTS(context.Background(), req) if err != nil { @@ -147,8 +117,8 @@ func (c *EOTSManagerGRpcClient) UnsafeSignEOTS(uid, chaiID, msg []byte, height u return &s, nil } -func (c *EOTSManagerGRpcClient) SignSchnorrSig(uid, msg []byte, passphrase string) (*schnorr.Signature, error) { - req := &proto.SignSchnorrSigRequest{Uid: uid, Msg: msg, Passphrase: passphrase} +func (c *EOTSManagerGRpcClient) SignSchnorrSig(uid, msg []byte) (*schnorr.Signature, error) { + req := &proto.SignSchnorrSigRequest{Uid: uid, Msg: msg} res, err := c.client.SignSchnorrSig(context.Background(), req) if err != nil { return nil, err diff --git a/eotsmanager/cmd/eotsd/daemon/flags.go b/eotsmanager/cmd/eotsd/daemon/flags.go index 0a21ac87..8eb8ba2a 100644 --- a/eotsmanager/cmd/eotsd/daemon/flags.go +++ b/eotsmanager/cmd/eotsd/daemon/flags.go @@ -3,7 +3,6 @@ package daemon const ( keyNameFlag = "key-name" eotsPkFlag = "eots-pk" - passphraseFlag = "passphrase" forceFlag = "force" rpcListenerFlag = "rpc-listener" rpcClientFlag = "rpc-client" diff --git a/eotsmanager/cmd/eotsd/daemon/keys.go b/eotsmanager/cmd/eotsd/daemon/keys.go index 1ebb9776..c0bbad0d 100644 --- a/eotsmanager/cmd/eotsd/daemon/keys.go +++ b/eotsmanager/cmd/eotsd/daemon/keys.go @@ -5,22 +5,22 @@ import ( "encoding/json" "fmt" "io" - "strings" "github.com/btcsuite/btcd/btcec/v2/schnorr" "github.com/babylonlabs-io/babylon/types" - "github.com/babylonlabs-io/finality-provider/eotsmanager" - eotsclient "github.com/babylonlabs-io/finality-provider/eotsmanager/client" - "github.com/babylonlabs-io/finality-provider/eotsmanager/config" - "github.com/babylonlabs-io/finality-provider/log" - "github.com/babylonlabs-io/finality-provider/util" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" cryptokeyring "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/spf13/cobra" "sigs.k8s.io/yaml" + + "github.com/babylonlabs-io/finality-provider/eotsmanager" + eotsclient "github.com/babylonlabs-io/finality-provider/eotsmanager/client" + "github.com/babylonlabs-io/finality-provider/eotsmanager/config" + "github.com/babylonlabs-io/finality-provider/log" + "github.com/babylonlabs-io/finality-provider/util" ) type KeyOutputWithPubKeyHex struct { @@ -110,7 +110,7 @@ func saveKeyNameMapping(cmd *cobra.Command, keyName string) (*types.BIP340PubKey return nil, err } - kr, err := eotsmanager.InitKeyring(clientCtx.HomeDir, clientCtx.Keyring.Backend(), strings.NewReader("")) + kr, err := eotsmanager.InitKeyring(clientCtx.HomeDir, clientCtx.Keyring.Backend()) if err != nil { return nil, fmt.Errorf("failed to init keyring: %w", err) } @@ -245,7 +245,7 @@ func printFromKey(cmd *cobra.Command, keyName string, eotsPk *types.BIP340PubKey } ctx := cmd.Context() - mnemonic := ctx.Value(mnemonicCtxKey).(string) //nolint: forcetypeassert + mnemonic := ctx.Value(mnemonicCtxKey).(string) // nolint: forcetypeassert showMnemonic := ctx.Value(mnemonicShowCtxKey).(bool) return printCreatePubKeyHex(cmd, k, eotsPk, showMnemonic, mnemonic, clientCtx.OutputFormat) diff --git a/eotsmanager/cmd/eotsd/daemon/pop.go b/eotsmanager/cmd/eotsd/daemon/pop.go index eb59aec1..b9843a14 100644 --- a/eotsmanager/cmd/eotsd/daemon/pop.go +++ b/eotsmanager/cmd/eotsd/daemon/pop.go @@ -101,7 +101,6 @@ func NewPopExportCmd() *cobra.Command { f.String(sdkflags.FlagHome, config.DefaultEOTSDir, "EOTS home directory") f.String(keyNameFlag, "", "EOTS key name") f.String(eotsPkFlag, "", "EOTS public key of the finality-provider") - f.String(passphraseFlag, "", "EOTS passphrase used to decrypt the keyring") f.String(sdkflags.FlagKeyringBackend, keyring.BackendTest, "EOTS backend of the keyring") f.String(flagHomeBaby, "", "BABY home directory") @@ -183,11 +182,6 @@ func validatePop(cmd *cobra.Command, args []string) error { } func exportPop(cmd *cobra.Command, _ []string) error { - eotsPassphrase, err := cmd.Flags().GetString(passphraseFlag) - if err != nil { - return err - } - eotsHomePath, eotsKeyName, eotsFpPubKeyStr, eotsKeyringBackend, err := eotsFlags(cmd) if err != nil { return err @@ -211,7 +205,7 @@ func exportPop(cmd *cobra.Command, _ []string) error { bbnAddrStr := bbnAddr.String() hashOfMsgToSign := tmhash.Sum([]byte(bbnAddrStr)) - schnorrSigOverBabyAddr, eotsPk, err := eotsSignMsg(eotsManager, eotsKeyName, eotsFpPubKeyStr, eotsPassphrase, hashOfMsgToSign) + schnorrSigOverBabyAddr, eotsPk, err := eotsSignMsg(eotsManager, eotsKeyName, eotsFpPubKeyStr, hashOfMsgToSign) if err != nil { return fmt.Errorf("failed to sign address %s: %w", bbnAddrStr, err) } @@ -572,7 +566,7 @@ func eotsPubKey( func eotsSignMsg( eotsManager *eotsmanager.LocalEOTSManager, - keyName, fpPkStr, passphrase string, + keyName, fpPkStr string, hashOfMsgToSign []byte, ) (*schnorr.Signature, *bbntypes.BIP340PubKey, error) { if len(fpPkStr) > 0 { @@ -580,7 +574,7 @@ func eotsSignMsg( if err != nil { return nil, nil, fmt.Errorf("invalid finality-provider public key %s: %w", fpPkStr, err) } - signature, err := eotsManager.SignSchnorrSig(*fpPk, hashOfMsgToSign, passphrase) + signature, err := eotsManager.SignSchnorrSig(*fpPk, hashOfMsgToSign) if err != nil { return nil, nil, fmt.Errorf("unable to sign msg with pk %s: %w", fpPkStr, err) } @@ -588,7 +582,7 @@ func eotsSignMsg( return signature, fpPk, nil } - return eotsManager.SignSchnorrSigFromKeyname(keyName, passphrase, hashOfMsgToSign) + return eotsManager.SignSchnorrSigFromKeyname(keyName, hashOfMsgToSign) } func cmdCloseEots( diff --git a/eotsmanager/eotsmanager.go b/eotsmanager/eotsmanager.go index aa4537bc..b6707829 100644 --- a/eotsmanager/eotsmanager.go +++ b/eotsmanager/eotsmanager.go @@ -3,47 +3,33 @@ package eotsmanager import ( "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/btcec/v2/schnorr" - - "github.com/babylonlabs-io/finality-provider/eotsmanager/types" ) type EOTSManager interface { - // CreateKey generates a key pair at the given name and persists it in storage. - // The key pair is formatted by BIP-340 (Schnorr Signatures) - // It fails if there is an existing key Info with the same name or public key. - CreateKey(name, passphrase, hdPath string) ([]byte, error) - // CreateRandomnessPairList generates a list of Schnorr randomness pairs from // startHeight to startHeight+(num-1) where num means the number of public randomness // It fails if the finality provider does not exist or a randomness pair has been created before // or passPhrase is incorrect // NOTE: the randomness is deterministically generated based on the EOTS key, chainID and // block height - CreateRandomnessPairList(uid []byte, chainID []byte, startHeight uint64, num uint32, passphrase string) ([]*btcec.FieldVal, error) - - // KeyRecord returns the finality provider record - // It fails if the finality provider does not exist or passPhrase is incorrect - KeyRecord(uid []byte, passphrase string) (*types.KeyRecord, error) + CreateRandomnessPairList(uid []byte, chainID []byte, startHeight uint64, num uint32) ([]*btcec.FieldVal, error) // SignEOTS signs an EOTS using the private key of the finality provider and the corresponding // secret randomness of the given chain at the given height // It fails if the finality provider does not exist or there's no randomness committed to the given height // or passPhrase is incorrect. Has built-in anti-slashing mechanism to ensure signature // for the same height will not be signed twice. - SignEOTS(uid []byte, chainID []byte, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) + SignEOTS(uid []byte, chainID []byte, msg []byte, height uint64) (*btcec.ModNScalar, error) // UnsafeSignEOTS should only be used in e2e tests for demonstration purposes. // Does not offer double sign protection. // Use SignEOTS for real operations. - UnsafeSignEOTS(uid []byte, chainID []byte, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) + UnsafeSignEOTS(uid []byte, chainID []byte, msg []byte, height uint64) (*btcec.ModNScalar, error) // SignSchnorrSig signs a Schnorr signature using the private key of the finality provider // It fails if the finality provider does not exist or the message size is not 32 bytes // or passPhrase is incorrect - SignSchnorrSig(uid []byte, msg []byte, passphrase string) (*schnorr.Signature, error) - - // SaveEOTSKeyName saves a new key under the EOTS key name mapping - SaveEOTSKeyName(pk *btcec.PublicKey, keyName string) error + SignSchnorrSig(uid []byte, msg []byte) (*schnorr.Signature, error) Close() error } diff --git a/eotsmanager/localmanager.go b/eotsmanager/localmanager.go index 4edc5a46..11296589 100644 --- a/eotsmanager/localmanager.go +++ b/eotsmanager/localmanager.go @@ -1,10 +1,11 @@ package eotsmanager import ( + "bufio" "bytes" "encoding/hex" "fmt" - "strings" + "os" "sync" "github.com/babylonlabs-io/finality-provider/metrics" @@ -33,24 +34,20 @@ const ( var _ EOTSManager = &LocalEOTSManager{} type LocalEOTSManager struct { - mu sync.Mutex - kr keyring.Keyring - es *store.EOTSStore - logger *zap.Logger - // input is to send passphrase to kr - input *strings.Reader + mu sync.Mutex + kr keyring.Keyring + es *store.EOTSStore + logger *zap.Logger metrics *metrics.EotsMetrics } func NewLocalEOTSManager(homeDir, keyringBackend string, dbbackend kvdb.Backend, logger *zap.Logger) (*LocalEOTSManager, error) { - inputReader := strings.NewReader("") - es, err := store.NewEOTSStore(dbbackend) if err != nil { return nil, fmt.Errorf("failed to initialize store: %w", err) } - kr, err := InitKeyring(homeDir, keyringBackend, inputReader) + kr, err := InitKeyring(homeDir, keyringBackend) if err != nil { return nil, fmt.Errorf("failed to initialize keyring: %w", err) } @@ -61,28 +58,27 @@ func NewLocalEOTSManager(homeDir, keyringBackend string, dbbackend kvdb.Backend, kr: kr, es: es, logger: logger, - input: inputReader, metrics: eotsMetrics, }, nil } -func InitKeyring(homeDir, keyringBackend string, inputReader *strings.Reader) (keyring.Keyring, error) { +func InitKeyring(homeDir, keyringBackend string) (keyring.Keyring, error) { return keyring.New( "eots-manager", keyringBackend, homeDir, - inputReader, + bufio.NewReader(os.Stdin), codec.MakeCodec(), ) } -func (lm *LocalEOTSManager) CreateKey(name, passphrase, hdPath string) ([]byte, error) { +func (lm *LocalEOTSManager) CreateKey(name string) ([]byte, error) { mnemonic, err := NewMnemonic() if err != nil { return nil, err } - eotsPk, err := lm.CreateKeyWithMnemonic(name, passphrase, hdPath, mnemonic) + eotsPk, err := lm.CreateKeyWithMnemonic(name, mnemonic) if err != nil { return nil, err } @@ -105,7 +101,7 @@ func NewMnemonic() (string, error) { return mnemonic, nil } -func (lm *LocalEOTSManager) CreateKeyWithMnemonic(name, passphrase, hdPath, mnemonic string) (*bbntypes.BIP340PubKey, error) { +func (lm *LocalEOTSManager) CreateKeyWithMnemonic(name, mnemonic string) (*bbntypes.BIP340PubKey, error) { if lm.keyExists(name) { return nil, eotstypes.ErrFinalityProviderAlreadyExisted } @@ -116,11 +112,7 @@ func (lm *LocalEOTSManager) CreateKeyWithMnemonic(name, passphrase, hdPath, mnem return nil, err } - // we need to repeat the passphrase to mock the re-entry - // as when creating an account, passphrase will be asked twice - // by the keyring - lm.input.Reset(passphrase + "\n" + passphrase) - _, err = lm.kr.NewAccount(name, mnemonic, passphrase, hdPath, algo) + _, err = lm.kr.NewAccount(name, mnemonic, "", "", algo) if err != nil { return nil, err } @@ -177,12 +169,12 @@ func LoadBIP340PubKeyFromKeyName(kr keyring.Keyring, keyName string) (*bbntypes. } } -func (lm *LocalEOTSManager) CreateRandomnessPairList(fpPk []byte, chainID []byte, startHeight uint64, num uint32, passphrase string) ([]*btcec.FieldVal, error) { +func (lm *LocalEOTSManager) CreateRandomnessPairList(fpPk []byte, chainID []byte, startHeight uint64, num uint32) ([]*btcec.FieldVal, error) { prList := make([]*btcec.FieldVal, 0, num) for i := uint32(0); i < num; i++ { height := startHeight + uint64(i) - _, pubRand, err := lm.getRandomnessPair(fpPk, chainID, height, passphrase) + _, pubRand, err := lm.getRandomnessPair(fpPk, chainID, height) if err != nil { return nil, err } @@ -195,7 +187,7 @@ func (lm *LocalEOTSManager) CreateRandomnessPairList(fpPk []byte, chainID []byte return prList, nil } -func (lm *LocalEOTSManager) SignEOTS(eotsPk []byte, chainID []byte, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) { +func (lm *LocalEOTSManager) SignEOTS(eotsPk []byte, chainID []byte, msg []byte, height uint64) (*btcec.ModNScalar, error) { record, found, err := lm.es.GetSignRecord(eotsPk, chainID, height) if err != nil { return nil, fmt.Errorf("error getting sign record: %w", err) @@ -228,12 +220,12 @@ func (lm *LocalEOTSManager) SignEOTS(eotsPk []byte, chainID []byte, msg []byte, return nil, eotstypes.ErrDoubleSign } - privRand, _, err := lm.getRandomnessPair(eotsPk, chainID, height, passphrase) + privRand, _, err := lm.getRandomnessPair(eotsPk, chainID, height) if err != nil { return nil, fmt.Errorf("failed to get private randomness: %w", err) } - privKey, err := lm.getEOTSPrivKey(eotsPk, passphrase) + privKey, err := lm.getEOTSPrivKey(eotsPk) if err != nil { return nil, fmt.Errorf("failed to get EOTS private key: %w", err) } @@ -256,13 +248,13 @@ func (lm *LocalEOTSManager) SignEOTS(eotsPk []byte, chainID []byte, msg []byte, } // UnsafeSignEOTS should only be used in e2e test to demonstrate double sign -func (lm *LocalEOTSManager) UnsafeSignEOTS(fpPk []byte, chainID []byte, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) { - privRand, _, err := lm.getRandomnessPair(fpPk, chainID, height, passphrase) +func (lm *LocalEOTSManager) UnsafeSignEOTS(fpPk []byte, chainID []byte, msg []byte, height uint64) (*btcec.ModNScalar, error) { + privRand, _, err := lm.getRandomnessPair(fpPk, chainID, height) if err != nil { return nil, fmt.Errorf("failed to get private randomness: %w", err) } - privKey, err := lm.getEOTSPrivKey(fpPk, passphrase) + privKey, err := lm.getEOTSPrivKey(fpPk) if err != nil { return nil, fmt.Errorf("failed to get EOTS private key: %w", err) } @@ -274,8 +266,8 @@ func (lm *LocalEOTSManager) UnsafeSignEOTS(fpPk []byte, chainID []byte, msg []by return eots.Sign(privKey, privRand, msg) } -func (lm *LocalEOTSManager) SignSchnorrSig(fpPk []byte, msg []byte, passphrase string) (*schnorr.Signature, error) { - privKey, err := lm.getEOTSPrivKey(fpPk, passphrase) +func (lm *LocalEOTSManager) SignSchnorrSig(fpPk []byte, msg []byte) (*schnorr.Signature, error) { + privKey, err := lm.getEOTSPrivKey(fpPk) if err != nil { return nil, fmt.Errorf("failed to get EOTS private key: %w", err) } @@ -291,9 +283,7 @@ func (lm *LocalEOTSManager) signSchnorrSigFromPrivKey(privKey *btcec.PrivateKey, return schnorr.Sign(privKey, msg) } -func (lm *LocalEOTSManager) SignSchnorrSigFromKeyname(keyName, passphrase string, msg []byte) (*schnorr.Signature, *bbntypes.BIP340PubKey, error) { - lm.input.Reset(passphrase) - +func (lm *LocalEOTSManager) SignSchnorrSigFromKeyname(keyName string, msg []byte) (*schnorr.Signature, *bbntypes.BIP340PubKey, error) { eotsPk, err := lm.LoadBIP340PubKeyFromKeyName(keyName) if err != nil { return nil, nil, err @@ -317,8 +307,8 @@ func (lm *LocalEOTSManager) Close() error { } // getRandomnessPair returns a randomness pair generated based on the given finality provider key, chainID and height -func (lm *LocalEOTSManager) getRandomnessPair(fpPk []byte, chainID []byte, height uint64, passphrase string) (*eots.PrivateRand, *eots.PublicRand, error) { - record, err := lm.KeyRecord(fpPk, passphrase) +func (lm *LocalEOTSManager) getRandomnessPair(fpPk []byte, chainID []byte, height uint64) (*eots.PrivateRand, *eots.PublicRand, error) { + record, err := lm.KeyRecord(fpPk) if err != nil { return nil, nil, err } @@ -327,12 +317,12 @@ func (lm *LocalEOTSManager) getRandomnessPair(fpPk []byte, chainID []byte, heigh return privRand, pubRand, nil } -func (lm *LocalEOTSManager) KeyRecord(fpPk []byte, passphrase string) (*eotstypes.KeyRecord, error) { +func (lm *LocalEOTSManager) KeyRecord(fpPk []byte) (*eotstypes.KeyRecord, error) { name, err := lm.es.GetEOTSKeyName(fpPk) if err != nil { return nil, err } - privKey, err := lm.getEOTSPrivKey(fpPk, passphrase) + privKey, err := lm.getEOTSPrivKey(fpPk) if err != nil { return nil, err } @@ -343,7 +333,7 @@ func (lm *LocalEOTSManager) KeyRecord(fpPk []byte, passphrase string) (*eotstype }, nil } -func (lm *LocalEOTSManager) getEOTSPrivKey(fpPk []byte, passphrase string) (*btcec.PrivateKey, error) { +func (lm *LocalEOTSManager) getEOTSPrivKey(fpPk []byte) (*btcec.PrivateKey, error) { lm.mu.Lock() defer lm.mu.Unlock() keyName, err := lm.es.GetEOTSKeyName(fpPk) @@ -351,8 +341,6 @@ func (lm *LocalEOTSManager) getEOTSPrivKey(fpPk []byte, passphrase string) (*btc return nil, err } - lm.input.Reset(passphrase) - return lm.eotsPrivKeyFromKeyName(keyName) } diff --git a/eotsmanager/localmanager_test.go b/eotsmanager/localmanager_test.go index 0f3672d2..4af91e7c 100644 --- a/eotsmanager/localmanager_test.go +++ b/eotsmanager/localmanager_test.go @@ -18,11 +18,6 @@ import ( "github.com/babylonlabs-io/finality-provider/testutil" ) -var ( - passphrase = "testpass" - hdPath = "" -) - // FuzzCreateKey tests the creation of an EOTS key func FuzzCreateKey(f *testing.F) { testutil.AddRandomSeedsToFuzzer(f, 10) @@ -43,18 +38,18 @@ func FuzzCreateKey(f *testing.F) { lm, err := eotsmanager.NewLocalEOTSManager(homeDir, eotsCfg.KeyringBackend, dbBackend, zap.NewNop()) require.NoError(t, err) - fpPk, err := lm.CreateKey(fpName, passphrase, hdPath) + fpPk, err := lm.CreateKey(fpName) require.NoError(t, err) - fpRecord, err := lm.KeyRecord(fpPk, passphrase) + fpRecord, err := lm.KeyRecord(fpPk) require.NoError(t, err) require.Equal(t, fpName, fpRecord.Name) - sig, err := lm.SignSchnorrSig(fpPk, datagen.GenRandomByteArray(r, 32), passphrase) + sig, err := lm.SignSchnorrSig(fpPk, datagen.GenRandomByteArray(r, 32)) require.NoError(t, err) require.NotNil(t, sig) - _, err = lm.CreateKey(fpName, passphrase, hdPath) + _, err = lm.CreateKey(fpName) require.ErrorIs(t, err, types.ErrFinalityProviderAlreadyExisted) }) } @@ -77,18 +72,18 @@ func FuzzCreateRandomnessPairList(f *testing.F) { lm, err := eotsmanager.NewLocalEOTSManager(homeDir, eotsCfg.KeyringBackend, dbBackend, zap.NewNop()) require.NoError(t, err) - fpPk, err := lm.CreateKey(fpName, passphrase, hdPath) + fpPk, err := lm.CreateKey(fpName) require.NoError(t, err) chainID := datagen.GenRandomByteArray(r, 10) startHeight := datagen.RandomInt(r, 100) num := r.Intn(10) + 1 - pubRandList, err := lm.CreateRandomnessPairList(fpPk, chainID, startHeight, uint32(num), passphrase) + pubRandList, err := lm.CreateRandomnessPairList(fpPk, chainID, startHeight, uint32(num)) require.NoError(t, err) require.Len(t, pubRandList, num) for i := 0; i < num; i++ { - sig, err := lm.SignEOTS(fpPk, chainID, datagen.GenRandomByteArray(r, 32), startHeight+uint64(i), passphrase) + sig, err := lm.SignEOTS(fpPk, chainID, datagen.GenRandomByteArray(r, 32), startHeight+uint64(i)) require.NoError(t, err) require.NotNil(t, sig) } @@ -120,13 +115,13 @@ func FuzzSignRecord(f *testing.F) { for i := 0; i < numFps; i++ { chainID := datagen.GenRandomByteArray(r, 10) fpName := testutil.GenRandomHexStr(r, 4) - fpPk, err := lm.CreateKey(fpName, passphrase, hdPath) + fpPk, err := lm.CreateKey(fpName) require.NoError(t, err) - pubRandList, err := lm.CreateRandomnessPairList(fpPk, chainID, startHeight, uint32(numRand), passphrase) + pubRandList, err := lm.CreateRandomnessPairList(fpPk, chainID, startHeight, uint32(numRand)) require.NoError(t, err) require.Len(t, pubRandList, numRand) - sig, err := lm.SignEOTS(fpPk, chainID, msg, startHeight, passphrase) + sig, err := lm.SignEOTS(fpPk, chainID, msg, startHeight) require.NoError(t, err) require.NotNil(t, sig) @@ -137,7 +132,7 @@ func FuzzSignRecord(f *testing.F) { require.NoError(t, err) // we expect return from db - sig2, err := lm.SignEOTS(fpPk, chainID, msg, startHeight, passphrase) + sig2, err := lm.SignEOTS(fpPk, chainID, msg, startHeight) require.NoError(t, err) require.Equal(t, sig, sig2) @@ -145,7 +140,7 @@ func FuzzSignRecord(f *testing.F) { require.NoError(t, err) // same height diff msg - _, err = lm.SignEOTS(fpPk, chainID, datagen.GenRandomByteArray(r, 32), startHeight, passphrase) + _, err = lm.SignEOTS(fpPk, chainID, datagen.GenRandomByteArray(r, 32), startHeight) require.ErrorIs(t, err, types.ErrDoubleSign) } }) diff --git a/eotsmanager/proto/eotsmanager.pb.go b/eotsmanager/proto/eotsmanager.pb.go index 1207629d..af3b0b10 100644 --- a/eotsmanager/proto/eotsmanager.pb.go +++ b/eotsmanager/proto/eotsmanager.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: eotsmanager.proto @@ -103,10 +103,8 @@ type CreateKeyRequest struct { // name is the identifier key in keyring Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // passphrase is used to encrypt the EOTS key - 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"` + HdPath string `protobuf:"bytes,2,opt,name=hd_path,json=hdPath,proto3" json:"hd_path,omitempty"` } func (x *CreateKeyRequest) Reset() { @@ -148,13 +146,6 @@ func (x *CreateKeyRequest) GetName() string { return "" } -func (x *CreateKeyRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - func (x *CreateKeyRequest) GetHdPath() string { if x != nil { return x.HdPath @@ -223,8 +214,6 @@ type CreateRandomnessPairListRequest struct { StartHeight uint64 `protobuf:"varint,3,opt,name=start_height,json=startHeight,proto3" json:"start_height,omitempty"` // num is the number of randomness pair list Num uint32 `protobuf:"varint,4,opt,name=num,proto3" json:"num,omitempty"` - // passphrase is used to decrypt the EOTS key - Passphrase string `protobuf:"bytes,5,opt,name=passphrase,proto3" json:"passphrase,omitempty"` } func (x *CreateRandomnessPairListRequest) Reset() { @@ -287,13 +276,6 @@ func (x *CreateRandomnessPairListRequest) GetNum() uint32 { return 0 } -func (x *CreateRandomnessPairListRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - type CreateRandomnessPairListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -342,120 +324,6 @@ func (x *CreateRandomnessPairListResponse) GetPubRandList() [][]byte { return nil } -type KeyRecordRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // uid is the identifier of an EOTS key, i.e., public key following BIP-340 spec - Uid []byte `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - // passphrase is used to decrypt the EOTS key - Passphrase string `protobuf:"bytes,2,opt,name=passphrase,proto3" json:"passphrase,omitempty"` -} - -func (x *KeyRecordRequest) Reset() { - *x = KeyRecordRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyRecordRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyRecordRequest) ProtoMessage() {} - -func (x *KeyRecordRequest) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[6] - 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 KeyRecordRequest.ProtoReflect.Descriptor instead. -func (*KeyRecordRequest) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{6} -} - -func (x *KeyRecordRequest) GetUid() []byte { - if x != nil { - return x.Uid - } - return nil -} - -func (x *KeyRecordRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - -type KeyRecordResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // name is the identifier key in keyring - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // private_key is the private EOTS key encoded in secp256k1 spec - PrivateKey []byte `protobuf:"bytes,2,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` -} - -func (x *KeyRecordResponse) Reset() { - *x = KeyRecordResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyRecordResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyRecordResponse) ProtoMessage() {} - -func (x *KeyRecordResponse) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[7] - 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 KeyRecordResponse.ProtoReflect.Descriptor instead. -func (*KeyRecordResponse) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{7} -} - -func (x *KeyRecordResponse) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *KeyRecordResponse) GetPrivateKey() []byte { - if x != nil { - return x.PrivateKey - } - return nil -} - type SignEOTSRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -469,14 +337,12 @@ type SignEOTSRequest struct { Msg []byte `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` // the block height which the EOTS signs Height uint64 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"` - // passphrase is used to decrypt the EOTS key - Passphrase string `protobuf:"bytes,5,opt,name=passphrase,proto3" json:"passphrase,omitempty"` } func (x *SignEOTSRequest) Reset() { *x = SignEOTSRequest{} if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[8] + mi := &file_eotsmanager_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -489,7 +355,7 @@ func (x *SignEOTSRequest) String() string { func (*SignEOTSRequest) ProtoMessage() {} func (x *SignEOTSRequest) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[8] + mi := &file_eotsmanager_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -502,7 +368,7 @@ func (x *SignEOTSRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignEOTSRequest.ProtoReflect.Descriptor instead. func (*SignEOTSRequest) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{8} + return file_eotsmanager_proto_rawDescGZIP(), []int{6} } func (x *SignEOTSRequest) GetUid() []byte { @@ -533,13 +399,6 @@ func (x *SignEOTSRequest) GetHeight() uint64 { return 0 } -func (x *SignEOTSRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - type SignEOTSResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -552,7 +411,7 @@ type SignEOTSResponse struct { func (x *SignEOTSResponse) Reset() { *x = SignEOTSResponse{} if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[9] + mi := &file_eotsmanager_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -565,7 +424,7 @@ func (x *SignEOTSResponse) String() string { func (*SignEOTSResponse) ProtoMessage() {} func (x *SignEOTSResponse) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[9] + mi := &file_eotsmanager_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -578,7 +437,7 @@ func (x *SignEOTSResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SignEOTSResponse.ProtoReflect.Descriptor instead. func (*SignEOTSResponse) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{9} + return file_eotsmanager_proto_rawDescGZIP(), []int{7} } func (x *SignEOTSResponse) GetSig() []byte { @@ -597,14 +456,12 @@ type SignSchnorrSigRequest struct { Uid []byte `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` // the message which the Schnorr signature signs Msg []byte `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - // passphrase is used to decrypt the EOTS key - Passphrase string `protobuf:"bytes,3,opt,name=passphrase,proto3" json:"passphrase,omitempty"` } func (x *SignSchnorrSigRequest) Reset() { *x = SignSchnorrSigRequest{} if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[10] + mi := &file_eotsmanager_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -617,7 +474,7 @@ func (x *SignSchnorrSigRequest) String() string { func (*SignSchnorrSigRequest) ProtoMessage() {} func (x *SignSchnorrSigRequest) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[10] + mi := &file_eotsmanager_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -630,7 +487,7 @@ func (x *SignSchnorrSigRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignSchnorrSigRequest.ProtoReflect.Descriptor instead. func (*SignSchnorrSigRequest) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{10} + return file_eotsmanager_proto_rawDescGZIP(), []int{8} } func (x *SignSchnorrSigRequest) GetUid() []byte { @@ -647,13 +504,6 @@ func (x *SignSchnorrSigRequest) GetMsg() []byte { return nil } -func (x *SignSchnorrSigRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - type SignSchnorrSigResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -666,7 +516,7 @@ type SignSchnorrSigResponse struct { func (x *SignSchnorrSigResponse) Reset() { *x = SignSchnorrSigResponse{} if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[11] + mi := &file_eotsmanager_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -679,7 +529,7 @@ func (x *SignSchnorrSigResponse) String() string { func (*SignSchnorrSigResponse) ProtoMessage() {} func (x *SignSchnorrSigResponse) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[11] + mi := &file_eotsmanager_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -692,7 +542,7 @@ func (x *SignSchnorrSigResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SignSchnorrSigResponse.ProtoReflect.Descriptor instead. func (*SignSchnorrSigResponse) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{11} + return file_eotsmanager_proto_rawDescGZIP(), []int{9} } func (x *SignSchnorrSigResponse) GetSig() []byte { @@ -717,7 +567,7 @@ type SaveEOTSKeyNameRequest struct { func (x *SaveEOTSKeyNameRequest) Reset() { *x = SaveEOTSKeyNameRequest{} if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[12] + mi := &file_eotsmanager_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -730,7 +580,7 @@ func (x *SaveEOTSKeyNameRequest) String() string { func (*SaveEOTSKeyNameRequest) ProtoMessage() {} func (x *SaveEOTSKeyNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[12] + mi := &file_eotsmanager_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -743,7 +593,7 @@ func (x *SaveEOTSKeyNameRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveEOTSKeyNameRequest.ProtoReflect.Descriptor instead. func (*SaveEOTSKeyNameRequest) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{12} + return file_eotsmanager_proto_rawDescGZIP(), []int{10} } func (x *SaveEOTSKeyNameRequest) GetKeyName() string { @@ -769,7 +619,7 @@ type SaveEOTSKeyNameResponse struct { func (x *SaveEOTSKeyNameResponse) Reset() { *x = SaveEOTSKeyNameResponse{} if protoimpl.UnsafeEnabled { - mi := &file_eotsmanager_proto_msgTypes[13] + mi := &file_eotsmanager_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -782,7 +632,7 @@ func (x *SaveEOTSKeyNameResponse) String() string { func (*SaveEOTSKeyNameResponse) ProtoMessage() {} func (x *SaveEOTSKeyNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_eotsmanager_proto_msgTypes[13] + mi := &file_eotsmanager_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -795,7 +645,7 @@ func (x *SaveEOTSKeyNameResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SaveEOTSKeyNameResponse.ProtoReflect.Descriptor instead. func (*SaveEOTSKeyNameResponse) Descriptor() ([]byte, []int) { - return file_eotsmanager_proto_rawDescGZIP(), []int{13} + return file_eotsmanager_proto_rawDescGZIP(), []int{11} } var File_eotsmanager_proto protoreflect.FileDescriptor @@ -804,16 +654,14 @@ var file_eotsmanager_proto_rawDesc = []byte{ 0x0a, 0x11, 0x65, 0x6f, 0x74, 0x73, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x50, 0x69, 0x6e, - 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5f, 0x0a, 0x10, 0x43, 0x72, 0x65, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3f, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 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, + 0x65, 0x12, 0x17, 0x0a, 0x07, 0x68, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x64, 0x50, 0x61, 0x74, 0x68, 0x22, 0x23, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x70, 0x6b, 0x22, - 0xa3, 0x01, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, + 0x83, 0x01, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, @@ -821,90 +669,67 @@ var file_eotsmanager_proto_rawDesc = []byte{ 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, 0x68, 0x72, - 0x61, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x73, 0x73, 0x70, - 0x68, 0x72, 0x61, 0x73, 0x65, 0x22, 0x46, 0x0a, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, + 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x46, 0x0a, 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x0b, 0x70, 0x75, 0x62, 0x52, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x44, 0x0a, - 0x10, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, - 0x75, 0x69, 0x64, 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, 0x48, 0x0a, 0x11, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0x88, 0x01, - 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x10, - 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, - 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x73, 0x73, - 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, - 0x73, 0x73, 0x70, 0x68, 0x72, 0x61, 0x73, 0x65, 0x22, 0x24, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, - 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x73, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x22, 0x5b, - 0x0a, 0x15, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, 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, 0x22, 0x2a, 0x0a, 0x16, 0x53, - 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x22, 0x4c, 0x0a, 0x16, 0x53, 0x61, 0x76, 0x65, 0x45, - 0x4f, 0x54, 0x53, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 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, 0x17, 0x0a, 0x07, - 0x65, 0x6f, 0x74, 0x73, 0x5f, 0x70, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x65, - 0x6f, 0x74, 0x73, 0x50, 0x6b, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, - 0x53, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x32, 0xcc, 0x04, 0x0a, 0x0b, 0x45, 0x4f, 0x54, 0x53, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, - 0x12, 0x2f, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x12, 0x17, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x6b, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, - 0x6d, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, - 0x6f, 0x6d, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, - 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, - 0x0a, 0x09, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x17, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4b, 0x65, 0x79, - 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, - 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x45, - 0x4f, 0x54, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x55, - 0x6e, 0x73, 0x61, 0x66, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x12, 0x16, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, - 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, - 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, - 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, - 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, - 0x0f, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, 0x53, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, - 0x53, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, 0x53, - 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x3f, 0x5a, 0x3d, 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, 0x65, - 0x6f, 0x74, 0x73, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x0b, 0x70, 0x75, 0x62, 0x52, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x68, 0x0a, + 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x75, + 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, + 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x24, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x45, + 0x4f, 0x54, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, + 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x22, 0x3b, 0x0a, + 0x15, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0x2a, 0x0a, 0x16, 0x53, 0x69, + 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x22, 0x4c, 0x0a, 0x16, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, + 0x54, 0x53, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 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, 0x17, 0x0a, 0x07, 0x65, + 0x6f, 0x74, 0x73, 0x5f, 0x70, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x65, 0x6f, + 0x74, 0x73, 0x50, 0x6b, 0x22, 0x19, 0x0a, 0x17, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, 0x53, + 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, + 0xcc, 0x03, 0x0a, 0x0b, 0x45, 0x4f, 0x54, 0x53, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, + 0x2f, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6b, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, + 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x26, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, + 0x6d, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, 0x69, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x61, 0x69, + 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, + 0x08, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x12, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, + 0x54, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x55, 0x6e, + 0x73, 0x61, 0x66, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x12, 0x16, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x45, 0x4f, 0x54, 0x53, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, + 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x12, + 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, + 0x6f, 0x72, 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x53, 0x63, 0x68, 0x6e, 0x6f, 0x72, + 0x72, 0x53, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0f, + 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, 0x53, 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, 0x53, + 0x4b, 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x45, 0x4f, 0x54, 0x53, 0x4b, + 0x65, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x3f, + 0x5a, 0x3d, 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, 0x65, 0x6f, + 0x74, 0x73, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -919,7 +744,7 @@ func file_eotsmanager_proto_rawDescGZIP() []byte { return file_eotsmanager_proto_rawDescData } -var file_eotsmanager_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_eotsmanager_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_eotsmanager_proto_goTypes = []interface{}{ (*PingRequest)(nil), // 0: proto.PingRequest (*PingResponse)(nil), // 1: proto.PingResponse @@ -927,34 +752,28 @@ var file_eotsmanager_proto_goTypes = []interface{}{ (*CreateKeyResponse)(nil), // 3: proto.CreateKeyResponse (*CreateRandomnessPairListRequest)(nil), // 4: proto.CreateRandomnessPairListRequest (*CreateRandomnessPairListResponse)(nil), // 5: proto.CreateRandomnessPairListResponse - (*KeyRecordRequest)(nil), // 6: proto.KeyRecordRequest - (*KeyRecordResponse)(nil), // 7: proto.KeyRecordResponse - (*SignEOTSRequest)(nil), // 8: proto.SignEOTSRequest - (*SignEOTSResponse)(nil), // 9: proto.SignEOTSResponse - (*SignSchnorrSigRequest)(nil), // 10: proto.SignSchnorrSigRequest - (*SignSchnorrSigResponse)(nil), // 11: proto.SignSchnorrSigResponse - (*SaveEOTSKeyNameRequest)(nil), // 12: proto.SaveEOTSKeyNameRequest - (*SaveEOTSKeyNameResponse)(nil), // 13: proto.SaveEOTSKeyNameResponse + (*SignEOTSRequest)(nil), // 6: proto.SignEOTSRequest + (*SignEOTSResponse)(nil), // 7: proto.SignEOTSResponse + (*SignSchnorrSigRequest)(nil), // 8: proto.SignSchnorrSigRequest + (*SignSchnorrSigResponse)(nil), // 9: proto.SignSchnorrSigResponse + (*SaveEOTSKeyNameRequest)(nil), // 10: proto.SaveEOTSKeyNameRequest + (*SaveEOTSKeyNameResponse)(nil), // 11: proto.SaveEOTSKeyNameResponse } var file_eotsmanager_proto_depIdxs = []int32{ 0, // 0: proto.EOTSManager.Ping:input_type -> proto.PingRequest - 2, // 1: proto.EOTSManager.CreateKey:input_type -> proto.CreateKeyRequest - 4, // 2: proto.EOTSManager.CreateRandomnessPairList:input_type -> proto.CreateRandomnessPairListRequest - 6, // 3: proto.EOTSManager.KeyRecord:input_type -> proto.KeyRecordRequest - 8, // 4: proto.EOTSManager.SignEOTS:input_type -> proto.SignEOTSRequest - 8, // 5: proto.EOTSManager.UnsafeSignEOTS:input_type -> proto.SignEOTSRequest - 10, // 6: proto.EOTSManager.SignSchnorrSig:input_type -> proto.SignSchnorrSigRequest - 12, // 7: proto.EOTSManager.SaveEOTSKeyName:input_type -> proto.SaveEOTSKeyNameRequest - 1, // 8: proto.EOTSManager.Ping:output_type -> proto.PingResponse - 3, // 9: proto.EOTSManager.CreateKey:output_type -> proto.CreateKeyResponse - 5, // 10: proto.EOTSManager.CreateRandomnessPairList:output_type -> proto.CreateRandomnessPairListResponse - 7, // 11: proto.EOTSManager.KeyRecord:output_type -> proto.KeyRecordResponse - 9, // 12: proto.EOTSManager.SignEOTS:output_type -> proto.SignEOTSResponse - 9, // 13: proto.EOTSManager.UnsafeSignEOTS:output_type -> proto.SignEOTSResponse - 11, // 14: proto.EOTSManager.SignSchnorrSig:output_type -> proto.SignSchnorrSigResponse - 13, // 15: proto.EOTSManager.SaveEOTSKeyName:output_type -> proto.SaveEOTSKeyNameResponse - 8, // [8:16] is the sub-list for method output_type - 0, // [0:8] is the sub-list for method input_type + 4, // 1: proto.EOTSManager.CreateRandomnessPairList:input_type -> proto.CreateRandomnessPairListRequest + 6, // 2: proto.EOTSManager.SignEOTS:input_type -> proto.SignEOTSRequest + 6, // 3: proto.EOTSManager.UnsafeSignEOTS:input_type -> proto.SignEOTSRequest + 8, // 4: proto.EOTSManager.SignSchnorrSig:input_type -> proto.SignSchnorrSigRequest + 10, // 5: proto.EOTSManager.SaveEOTSKeyName:input_type -> proto.SaveEOTSKeyNameRequest + 1, // 6: proto.EOTSManager.Ping:output_type -> proto.PingResponse + 5, // 7: proto.EOTSManager.CreateRandomnessPairList:output_type -> proto.CreateRandomnessPairListResponse + 7, // 8: proto.EOTSManager.SignEOTS:output_type -> proto.SignEOTSResponse + 7, // 9: proto.EOTSManager.UnsafeSignEOTS:output_type -> proto.SignEOTSResponse + 9, // 10: proto.EOTSManager.SignSchnorrSig:output_type -> proto.SignSchnorrSigResponse + 11, // 11: proto.EOTSManager.SaveEOTSKeyName:output_type -> proto.SaveEOTSKeyNameResponse + 6, // [6:12] is the sub-list for method output_type + 0, // [0:6] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -1039,30 +858,6 @@ func file_eotsmanager_proto_init() { } } file_eotsmanager_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyRecordRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_eotsmanager_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyRecordResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_eotsmanager_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignEOTSRequest); i { case 0: return &v.state @@ -1074,7 +869,7 @@ func file_eotsmanager_proto_init() { return nil } } - file_eotsmanager_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_eotsmanager_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignEOTSResponse); i { case 0: return &v.state @@ -1086,7 +881,7 @@ func file_eotsmanager_proto_init() { return nil } } - file_eotsmanager_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_eotsmanager_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignSchnorrSigRequest); i { case 0: return &v.state @@ -1098,7 +893,7 @@ func file_eotsmanager_proto_init() { return nil } } - file_eotsmanager_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_eotsmanager_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignSchnorrSigResponse); i { case 0: return &v.state @@ -1110,7 +905,7 @@ func file_eotsmanager_proto_init() { return nil } } - file_eotsmanager_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_eotsmanager_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SaveEOTSKeyNameRequest); i { case 0: return &v.state @@ -1122,7 +917,7 @@ func file_eotsmanager_proto_init() { return nil } } - file_eotsmanager_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_eotsmanager_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SaveEOTSKeyNameResponse); i { case 0: return &v.state @@ -1141,7 +936,7 @@ func file_eotsmanager_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_eotsmanager_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/eotsmanager/proto/eotsmanager.proto b/eotsmanager/proto/eotsmanager.proto index c0cbc91e..f41ff626 100644 --- a/eotsmanager/proto/eotsmanager.proto +++ b/eotsmanager/proto/eotsmanager.proto @@ -7,18 +7,10 @@ option go_package = "github.com/babylonlabs-io/finality-provider/eotsmanager/pro service EOTSManager { rpc Ping (PingRequest) returns (PingResponse); - // CreateKey generates and saves an EOTS key - rpc CreateKey (CreateKeyRequest) - returns (CreateKeyResponse); - // CreateRandomnessPairList returns a list of Schnorr randomness pairs rpc CreateRandomnessPairList (CreateRandomnessPairListRequest) returns (CreateRandomnessPairListResponse); - // KeyRecord returns the key record - rpc KeyRecord(KeyRecordRequest) - returns (KeyRecordResponse); - // SignEOTS signs an EOTS with the EOTS private key and the relevant randomness rpc SignEOTS (SignEOTSRequest) returns (SignEOTSResponse); @@ -43,10 +35,8 @@ message PingResponse {} message CreateKeyRequest { // name is the identifier key in keyring string name = 1; - // passphrase is used to encrypt the EOTS key - string passphrase = 2; // hd_path is the hd path for private key derivation - string hd_path = 3; + string hd_path = 2; } message CreateKeyResponse { @@ -63,8 +53,6 @@ message CreateRandomnessPairListRequest { uint64 start_height = 3; // num is the number of randomness pair list uint32 num = 4; - // passphrase is used to decrypt the EOTS key - string passphrase = 5; } message CreateRandomnessPairListResponse { @@ -72,20 +60,6 @@ message CreateRandomnessPairListResponse { repeated bytes pub_rand_list = 1; } -message KeyRecordRequest { - // uid is the identifier of an EOTS key, i.e., public key following BIP-340 spec - bytes uid = 1; - // passphrase is used to decrypt the EOTS key - string passphrase = 2; -} - -message KeyRecordResponse { - // name is the identifier key in keyring - string name = 1; - // private_key is the private EOTS key encoded in secp256k1 spec - bytes private_key = 2; -} - message SignEOTSRequest { // uid is the identifier of an EOTS key, i.e., public key following BIP-340 spec bytes uid = 1; @@ -95,8 +69,6 @@ message SignEOTSRequest { bytes msg = 3; // the block height which the EOTS signs uint64 height = 4; - // passphrase is used to decrypt the EOTS key - string passphrase = 5; } message SignEOTSResponse { @@ -109,8 +81,6 @@ message SignSchnorrSigRequest { bytes uid = 1; // the message which the Schnorr signature signs bytes msg = 2; - // passphrase is used to decrypt the EOTS key - string passphrase = 3; } message SignSchnorrSigResponse { diff --git a/eotsmanager/proto/eotsmanager_grpc.pb.go b/eotsmanager/proto/eotsmanager_grpc.pb.go index 4b695e92..0219a8ab 100644 --- a/eotsmanager/proto/eotsmanager_grpc.pb.go +++ b/eotsmanager/proto/eotsmanager_grpc.pb.go @@ -20,9 +20,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( EOTSManager_Ping_FullMethodName = "/proto.EOTSManager/Ping" - EOTSManager_CreateKey_FullMethodName = "/proto.EOTSManager/CreateKey" EOTSManager_CreateRandomnessPairList_FullMethodName = "/proto.EOTSManager/CreateRandomnessPairList" - EOTSManager_KeyRecord_FullMethodName = "/proto.EOTSManager/KeyRecord" EOTSManager_SignEOTS_FullMethodName = "/proto.EOTSManager/SignEOTS" EOTSManager_UnsafeSignEOTS_FullMethodName = "/proto.EOTSManager/UnsafeSignEOTS" EOTSManager_SignSchnorrSig_FullMethodName = "/proto.EOTSManager/SignSchnorrSig" @@ -34,12 +32,8 @@ const ( // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type EOTSManagerClient interface { Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) - // CreateKey generates and saves an EOTS key - CreateKey(ctx context.Context, in *CreateKeyRequest, opts ...grpc.CallOption) (*CreateKeyResponse, error) // CreateRandomnessPairList returns a list of Schnorr randomness pairs CreateRandomnessPairList(ctx context.Context, in *CreateRandomnessPairListRequest, opts ...grpc.CallOption) (*CreateRandomnessPairListResponse, error) - // KeyRecord returns the key record - KeyRecord(ctx context.Context, in *KeyRecordRequest, opts ...grpc.CallOption) (*KeyRecordResponse, error) // SignEOTS signs an EOTS with the EOTS private key and the relevant randomness SignEOTS(ctx context.Context, in *SignEOTSRequest, opts ...grpc.CallOption) (*SignEOTSResponse, error) // UnsafeSignEOTS used only for testing purpose. Use SignEOTS for real operations @@ -67,15 +61,6 @@ func (c *eOTSManagerClient) Ping(ctx context.Context, in *PingRequest, opts ...g return out, nil } -func (c *eOTSManagerClient) CreateKey(ctx context.Context, in *CreateKeyRequest, opts ...grpc.CallOption) (*CreateKeyResponse, error) { - out := new(CreateKeyResponse) - err := c.cc.Invoke(ctx, EOTSManager_CreateKey_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *eOTSManagerClient) CreateRandomnessPairList(ctx context.Context, in *CreateRandomnessPairListRequest, opts ...grpc.CallOption) (*CreateRandomnessPairListResponse, error) { out := new(CreateRandomnessPairListResponse) err := c.cc.Invoke(ctx, EOTSManager_CreateRandomnessPairList_FullMethodName, in, out, opts...) @@ -85,15 +70,6 @@ func (c *eOTSManagerClient) CreateRandomnessPairList(ctx context.Context, in *Cr return out, nil } -func (c *eOTSManagerClient) KeyRecord(ctx context.Context, in *KeyRecordRequest, opts ...grpc.CallOption) (*KeyRecordResponse, error) { - out := new(KeyRecordResponse) - err := c.cc.Invoke(ctx, EOTSManager_KeyRecord_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *eOTSManagerClient) SignEOTS(ctx context.Context, in *SignEOTSRequest, opts ...grpc.CallOption) (*SignEOTSResponse, error) { out := new(SignEOTSResponse) err := c.cc.Invoke(ctx, EOTSManager_SignEOTS_FullMethodName, in, out, opts...) @@ -135,12 +111,8 @@ func (c *eOTSManagerClient) SaveEOTSKeyName(ctx context.Context, in *SaveEOTSKey // for forward compatibility type EOTSManagerServer interface { Ping(context.Context, *PingRequest) (*PingResponse, error) - // CreateKey generates and saves an EOTS key - CreateKey(context.Context, *CreateKeyRequest) (*CreateKeyResponse, error) // CreateRandomnessPairList returns a list of Schnorr randomness pairs CreateRandomnessPairList(context.Context, *CreateRandomnessPairListRequest) (*CreateRandomnessPairListResponse, error) - // KeyRecord returns the key record - KeyRecord(context.Context, *KeyRecordRequest) (*KeyRecordResponse, error) // SignEOTS signs an EOTS with the EOTS private key and the relevant randomness SignEOTS(context.Context, *SignEOTSRequest) (*SignEOTSResponse, error) // UnsafeSignEOTS used only for testing purpose. Use SignEOTS for real operations @@ -159,15 +131,9 @@ type UnimplementedEOTSManagerServer struct { func (UnimplementedEOTSManagerServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } -func (UnimplementedEOTSManagerServer) CreateKey(context.Context, *CreateKeyRequest) (*CreateKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateKey not implemented") -} func (UnimplementedEOTSManagerServer) CreateRandomnessPairList(context.Context, *CreateRandomnessPairListRequest) (*CreateRandomnessPairListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateRandomnessPairList not implemented") } -func (UnimplementedEOTSManagerServer) KeyRecord(context.Context, *KeyRecordRequest) (*KeyRecordResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method KeyRecord not implemented") -} func (UnimplementedEOTSManagerServer) SignEOTS(context.Context, *SignEOTSRequest) (*SignEOTSResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SignEOTS not implemented") } @@ -211,24 +177,6 @@ func _EOTSManager_Ping_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } -func _EOTSManager_CreateKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateKeyRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EOTSManagerServer).CreateKey(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: EOTSManager_CreateKey_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EOTSManagerServer).CreateKey(ctx, req.(*CreateKeyRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _EOTSManager_CreateRandomnessPairList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateRandomnessPairListRequest) if err := dec(in); err != nil { @@ -247,24 +195,6 @@ func _EOTSManager_CreateRandomnessPairList_Handler(srv interface{}, ctx context. return interceptor(ctx, in, info, handler) } -func _EOTSManager_KeyRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(KeyRecordRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EOTSManagerServer).KeyRecord(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: EOTSManager_KeyRecord_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EOTSManagerServer).KeyRecord(ctx, req.(*KeyRecordRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _EOTSManager_SignEOTS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SignEOTSRequest) if err := dec(in); err != nil { @@ -348,18 +278,10 @@ var EOTSManager_ServiceDesc = grpc.ServiceDesc{ MethodName: "Ping", Handler: _EOTSManager_Ping_Handler, }, - { - MethodName: "CreateKey", - Handler: _EOTSManager_CreateKey_Handler, - }, { MethodName: "CreateRandomnessPairList", Handler: _EOTSManager_CreateRandomnessPairList_Handler, }, - { - MethodName: "KeyRecord", - Handler: _EOTSManager_KeyRecord_Handler, - }, { MethodName: "SignEOTS", Handler: _EOTSManager_SignEOTS_Handler, diff --git a/eotsmanager/proto/signstore.pb.go b/eotsmanager/proto/signstore.pb.go index 1e9058a3..af355827 100644 --- a/eotsmanager/proto/signstore.pb.go +++ b/eotsmanager/proto/signstore.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: signstore.proto diff --git a/eotsmanager/service/rpcserver.go b/eotsmanager/service/rpcserver.go index cd91aa01..813ee57b 100644 --- a/eotsmanager/service/rpcserver.go +++ b/eotsmanager/service/rpcserver.go @@ -15,12 +15,12 @@ import ( type rpcServer struct { proto.UnimplementedEOTSManagerServer - em eotsmanager.EOTSManager + em *eotsmanager.LocalEOTSManager } // newRPCServer creates a new RPC sever from the set of input dependencies. func newRPCServer( - em eotsmanager.EOTSManager, + em *eotsmanager.LocalEOTSManager, ) *rpcServer { return &rpcServer{ em: em, @@ -40,22 +40,10 @@ func (r *rpcServer) Ping(_ context.Context, _ *proto.PingRequest) (*proto.PingRe return &proto.PingResponse{}, nil } -// CreateKey generates and saves an EOTS key -func (r *rpcServer) CreateKey(_ context.Context, req *proto.CreateKeyRequest) ( - *proto.CreateKeyResponse, error) { - pk, err := r.em.CreateKey(req.Name, req.Passphrase, req.HdPath) - - if err != nil { - return nil, err - } - - return &proto.CreateKeyResponse{Pk: pk}, nil -} - // CreateRandomnessPairList returns a list of Schnorr randomness pairs func (r *rpcServer) CreateRandomnessPairList(_ context.Context, req *proto.CreateRandomnessPairListRequest) ( *proto.CreateRandomnessPairListResponse, error) { - pubRandList, err := r.em.CreateRandomnessPairList(req.Uid, req.ChainId, req.StartHeight, req.Num, req.Passphrase) + pubRandList, err := r.em.CreateRandomnessPairList(req.Uid, req.ChainId, req.StartHeight, req.Num) if err != nil { return nil, err @@ -71,26 +59,10 @@ func (r *rpcServer) CreateRandomnessPairList(_ context.Context, req *proto.Creat }, nil } -// KeyRecord returns the key record -func (r *rpcServer) KeyRecord(_ context.Context, req *proto.KeyRecordRequest) ( - *proto.KeyRecordResponse, error) { - record, err := r.em.KeyRecord(req.Uid, req.Passphrase) - if err != nil { - return nil, err - } - - res := &proto.KeyRecordResponse{ - Name: record.Name, - PrivateKey: record.PrivKey.Serialize(), - } - - return res, nil -} - // SignEOTS signs an EOTS with the EOTS private key and the relevant randomness func (r *rpcServer) SignEOTS(_ context.Context, req *proto.SignEOTSRequest) ( *proto.SignEOTSResponse, error) { - sig, err := r.em.SignEOTS(req.Uid, req.ChainId, req.Msg, req.Height, req.Passphrase) + sig, err := r.em.SignEOTS(req.Uid, req.ChainId, req.Msg, req.Height) if err != nil { return nil, err } @@ -103,7 +75,7 @@ func (r *rpcServer) SignEOTS(_ context.Context, req *proto.SignEOTSRequest) ( // UnsafeSignEOTS only used for testing purposes. Doesn't offer slashing protection! func (r *rpcServer) UnsafeSignEOTS(_ context.Context, req *proto.SignEOTSRequest) ( *proto.SignEOTSResponse, error) { - sig, err := r.em.UnsafeSignEOTS(req.Uid, req.ChainId, req.Msg, req.Height, req.Passphrase) + sig, err := r.em.UnsafeSignEOTS(req.Uid, req.ChainId, req.Msg, req.Height) if err != nil { return nil, err } @@ -116,7 +88,7 @@ func (r *rpcServer) UnsafeSignEOTS(_ context.Context, req *proto.SignEOTSRequest // SignSchnorrSig signs a Schnorr sig with the EOTS private key func (r *rpcServer) SignSchnorrSig(_ context.Context, req *proto.SignSchnorrSigRequest) ( *proto.SignSchnorrSigResponse, error) { - sig, err := r.em.SignSchnorrSig(req.Uid, req.Msg, req.Passphrase) + sig, err := r.em.SignSchnorrSig(req.Uid, req.Msg) if err != nil { return nil, err } diff --git a/eotsmanager/service/server.go b/eotsmanager/service/server.go index 9b80c7ec..e4ed7f41 100644 --- a/eotsmanager/service/server.go +++ b/eotsmanager/service/server.go @@ -33,7 +33,7 @@ type Server struct { } // NewEOTSManagerServer creates a new server with the given config. -func NewEOTSManagerServer(cfg *config.Config, l *zap.Logger, em eotsmanager.EOTSManager, db kvdb.Backend) *Server { +func NewEOTSManagerServer(cfg *config.Config, l *zap.Logger, em *eotsmanager.LocalEOTSManager, db kvdb.Backend) *Server { return &Server{ cfg: cfg, logger: l, diff --git a/finality-provider/cmd/fpd/daemon/commit_pr.go b/finality-provider/cmd/fpd/daemon/commit_pr.go index 09b5f6e1..45704a78 100644 --- a/finality-provider/cmd/fpd/daemon/commit_pr.go +++ b/finality-provider/cmd/fpd/daemon/commit_pr.go @@ -7,6 +7,9 @@ import ( "strconv" bbntypes "github.com/babylonlabs-io/babylon/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" eotsclient "github.com/babylonlabs-io/finality-provider/eotsmanager/client" fpcmd "github.com/babylonlabs-io/finality-provider/finality-provider/cmd" @@ -16,8 +19,6 @@ import ( "github.com/babylonlabs-io/finality-provider/log" "github.com/babylonlabs-io/finality-provider/metrics" "github.com/babylonlabs-io/finality-provider/util" - "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" ) // CommandCommitPubRand returns the commit-pubrand command by connecting to the fpd daemon. @@ -98,7 +99,7 @@ func runCommandCommitPubRand(ctx client.Context, cmd *cobra.Command, args []stri } fp, err := service.NewFinalityProviderInstance( - fpPk, cfg, fpStore, pubRandStore, cc, consumerCon, em, metrics.NewFpMetrics(), "", + fpPk, cfg, fpStore, pubRandStore, cc, consumerCon, em, metrics.NewFpMetrics(), make(chan<- *service.CriticalError), logger) if err != nil { return fmt.Errorf("failed to create finality-provider %s instance: %w", fpPk.MarshalHex(), err) diff --git a/finality-provider/cmd/fpd/daemon/daemon_commands.go b/finality-provider/cmd/fpd/daemon/daemon_commands.go index e8308195..87c0c8ee 100644 --- a/finality-provider/cmd/fpd/daemon/daemon_commands.go +++ b/finality-provider/cmd/fpd/daemon/daemon_commands.go @@ -111,7 +111,6 @@ Where finality-provider.json contains: 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(commissionRateFlag, "", "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)") @@ -189,7 +188,6 @@ func runCommandCreateFP(ctx client.Context, cmd *cobra.Command, _ []string) erro fp.keyName, fp.chainID, fp.eotsPK, - fp.passphrase, fp.description, &fp.commissionRate, ) @@ -597,7 +595,6 @@ type parsedFinalityProvider struct { keyName string chainID string eotsPK string - passphrase string description stakingtypes.Description commissionRate math.LegacyDec } @@ -668,7 +665,6 @@ func parseFinalityProviderJSON(path string, homeDir string) (*parsedFinalityProv keyName: fp.KeyName, chainID: fp.ChainID, eotsPK: fp.EotsPK, - passphrase: fp.Passphrase, description: description, commissionRate: commissionRate, }, nil @@ -709,11 +705,6 @@ func parseFinalityProviderFlags(cmd *cobra.Command, homeDir string) (*parsedFina return nil, fmt.Errorf("chain-id cannot be empty") } - passphrase, err := flags.GetString(passphraseFlag) - if err != nil { - return nil, fmt.Errorf("failed to read flag %s: %w", passphraseFlag, err) - } - eotsPkHex, err := flags.GetString(fpEotsPkFlag) if err != nil { return nil, fmt.Errorf("failed to read flag %s: %w", fpEotsPkFlag, err) @@ -727,7 +718,6 @@ func parseFinalityProviderFlags(cmd *cobra.Command, homeDir string) (*parsedFina keyName: keyName, chainID: chainID, eotsPK: eotsPkHex, - passphrase: passphrase, description: description, commissionRate: commissionRate, }, nil diff --git a/finality-provider/cmd/fpd/daemon/flags.go b/finality-provider/cmd/fpd/daemon/flags.go index 6a1f7965..aebb976b 100644 --- a/finality-provider/cmd/fpd/daemon/flags.go +++ b/finality-provider/cmd/fpd/daemon/flags.go @@ -7,10 +7,7 @@ const ( fpdDaemonAddressFlag = "daemon-address" keyNameFlag = "key-name" appHashFlag = "app-hash" - passphraseFlag = "passphrase" - hdPathFlag = "hd-path" chainIDFlag = "chain-id" - signedFlag = "signed" checkDoubleSignFlag = "check-double-sign" fromFile = "from-file" upToHeight = "up-to-height" diff --git a/finality-provider/cmd/fpd/daemon/start.go b/finality-provider/cmd/fpd/daemon/start.go index c759331b..b10cf132 100644 --- a/finality-provider/cmd/fpd/daemon/start.go +++ b/finality-provider/cmd/fpd/daemon/start.go @@ -30,7 +30,6 @@ func CommandStart() *cobra.Command { RunE: fpcmd.RunEWithClientCtx(runStartCmd), } cmd.Flags().String(fpEotsPkFlag, "", "The EOTS public key of the finality-provider to start") - cmd.Flags().String(passphraseFlag, "", "The pass phrase used to decrypt the private key") cmd.Flags().String(rpcListenerFlag, "", "The address that the RPC server listens to") cmd.Flags().String(flags.FlagHome, fpcfg.DefaultFpdDir, "The application home directory") @@ -55,11 +54,6 @@ func runStartCmd(ctx client.Context, cmd *cobra.Command, _ []string) error { return fmt.Errorf("failed to read flag %s: %w", rpcListenerFlag, err) } - passphrase, err := flags.GetString(passphraseFlag) - if err != nil { - return fmt.Errorf("failed to read flag %s: %w", passphraseFlag, err) - } - cfg, err := fpcfg.LoadConfig(homePath) if err != nil { return fmt.Errorf("failed to load configuration: %w", err) @@ -88,7 +82,7 @@ func runStartCmd(ctx client.Context, cmd *cobra.Command, _ []string) error { return fmt.Errorf("failed to load app: %w", err) } - if err := startApp(fpApp, fpStr, passphrase); err != nil { + if err := startApp(fpApp, fpStr); err != nil { return fmt.Errorf("failed to start app: %w", err) } @@ -114,7 +108,7 @@ func loadApp( // startApp starts the app and the handle of finality providers if needed based on flags. func startApp( fpApp *service.FinalityProviderApp, - fpPkStr, passphrase string, + fpPkStr string, ) error { // only start the app without starting any finality provider instance // this is needed for new finality provider registration or unjailing @@ -131,7 +125,7 @@ func startApp( return fmt.Errorf("invalid finality provider public key %s: %w", fpPkStr, err) } - return fpApp.StartFinalityProvider(fpPk, passphrase) + return fpApp.StartFinalityProvider(fpPk) } storedFps, err := fpApp.GetFinalityProviderStore().GetAllStoredFinalityProviders() @@ -140,7 +134,7 @@ func startApp( } if len(storedFps) == 1 { - return fpApp.StartFinalityProvider(types.NewBIP340PubKeyFromBTCPK(storedFps[0].BtcPk), passphrase) + return fpApp.StartFinalityProvider(types.NewBIP340PubKeyFromBTCPK(storedFps[0].BtcPk)) } if len(storedFps) > 1 { diff --git a/finality-provider/proto/finality_providers.pb.go b/finality-provider/proto/finality_providers.pb.go index c545ea01..80861b63 100644 --- a/finality-provider/proto/finality_providers.pb.go +++ b/finality-provider/proto/finality_providers.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.33.0 +// protoc-gen-go v1.31.0 // protoc (unknown) // source: finality_providers.proto @@ -194,18 +194,16 @@ type CreateFinalityProviderRequest struct { // key_name is the identifier key in keyring 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"` // chain_id is the identifier of the consumer chain that the finality provider is connected to - ChainId string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // description defines the description terms for the finality provider - Description []byte `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + 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,5,opt,name=commission,proto3" json:"commission,omitempty"` + Commission string `protobuf:"bytes,4,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,6,opt,name=eots_pk_hex,json=eotsPkHex,proto3" json:"eots_pk_hex,omitempty"` + EotsPkHex string `protobuf:"bytes,5,opt,name=eots_pk_hex,json=eotsPkHex,proto3" json:"eots_pk_hex,omitempty"` } func (x *CreateFinalityProviderRequest) Reset() { @@ -247,13 +245,6 @@ func (x *CreateFinalityProviderRequest) GetKeyName() string { return "" } -func (x *CreateFinalityProviderRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - func (x *CreateFinalityProviderRequest) GetChainId() string { if x != nil { return x.ChainId @@ -422,8 +413,6 @@ type AddFinalitySignatureResponse struct { TxHash string `protobuf:"bytes,1,opt,name=tx_hash,json=txHash,proto3" json:"tx_hash,omitempty"` // the hex string of the extracted Bitcoin secp256k1 private key ExtractedSkHex string `protobuf:"bytes,2,opt,name=extracted_sk_hex,json=extractedSkHex,proto3" json:"extracted_sk_hex,omitempty"` - // the hex string of the local Bitcoin secp256k1 private key - LocalSkHex string `protobuf:"bytes,3,opt,name=local_sk_hex,json=localSkHex,proto3" json:"local_sk_hex,omitempty"` } func (x *AddFinalitySignatureResponse) Reset() { @@ -472,13 +461,6 @@ func (x *AddFinalitySignatureResponse) GetExtractedSkHex() string { return "" } -func (x *AddFinalitySignatureResponse) GetLocalSkHex() string { - if x != nil { - return x.LocalSkHex - } - return "" -} - type UnjailFinalityProviderRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1157,10 +1139,8 @@ type SignMessageFromChainKeyRequest struct { MsgToSign []byte `protobuf:"bytes,1,opt,name=msg_to_sign,json=msgToSign,proto3" json:"msg_to_sign,omitempty"` // key_name is the identifier key in keyring KeyName string `protobuf:"bytes,2,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"` - // passphrase is used to encrypt the keys - Passphrase string `protobuf:"bytes,3,opt,name=passphrase,proto3" json:"passphrase,omitempty"` // hd_path is the hd path for private key derivation - HdPath string `protobuf:"bytes,4,opt,name=hd_path,json=hdPath,proto3" json:"hd_path,omitempty"` + HdPath string `protobuf:"bytes,3,opt,name=hd_path,json=hdPath,proto3" json:"hd_path,omitempty"` } func (x *SignMessageFromChainKeyRequest) Reset() { @@ -1209,13 +1189,6 @@ func (x *SignMessageFromChainKeyRequest) GetKeyName() string { return "" } -func (x *SignMessageFromChainKeyRequest) GetPassphrase() string { - if x != nil { - return x.Passphrase - } - return "" -} - func (x *SignMessageFromChainKeyRequest) GetHdPath() string { if x != nil { return x.HdPath @@ -1457,22 +1430,20 @@ 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, 0xfc, 0x01, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xdc, 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, 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, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x02, 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, 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, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x23, 0xc8, 0xde, 0x1f, 0x00, 0xda, 0xde, 0x1f, 0x1b, 0x63, + 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, 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, + 0x6b, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x05, 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, @@ -1491,197 +1462,193 @@ var file_finality_providers_proto_rawDesc = []byte{ 0x70, 0x70, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2a, 0x0a, 0x11, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x53, 0x69, - 0x67, 0x6e, 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, + 0x67, 0x6e, 0x22, 0x61, 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, 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, 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, + 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, 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, + 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, 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, 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, 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, 0x78, - 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x0a, 0x62, 0x74, - 0x63, 0x5f, 0x70, 0x6b, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x62, 0x74, 0x63, 0x50, 0x6b, 0x48, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 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, 0xf4, 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, 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, 0x24, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x69, 0x6e, 0x61, 0x6c, + 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, 0x74, 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, 0x17, 0x0a, 0x07, 0x68, 0x64, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x03, 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, 0x78, 0x0a, 0x18, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x0a, 0x62, 0x74, 0x63, 0x5f, 0x70, 0x6b, + 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x62, 0x74, 0x63, 0x50, + 0x6b, 0x48, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, + 0x23, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x48, 0x65, + 0x69, 0x67, 0x68, 0x74, 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, 0xf4, 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, 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, + 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, 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, 0x4c, 0x69, 0x73, 0x74, 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, 0x12, 0x50, 0x0a, 0x17, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, - 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 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, + 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, + 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, 0x12, 0x50, 0x0a, 0x17, 0x55, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, + 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x1f, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, + 0x65, 0x50, 0x72, 0x6f, 0x6f, 0x66, 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 ( diff --git a/finality-provider/proto/finality_providers.proto b/finality-provider/proto/finality_providers.proto index 87e0704b..b79a4e41 100644 --- a/finality-provider/proto/finality_providers.proto +++ b/finality-provider/proto/finality_providers.proto @@ -50,21 +50,19 @@ message GetInfoResponse { message CreateFinalityProviderRequest { // key_name is the identifier key in keyring string key_name = 1; - // passphrase is used to encrypt the keys - string passphrase = 2; // chain_id is the identifier of the consumer chain that the finality provider is connected to - string chain_id = 3; + string chain_id = 2; // description defines the description terms for the finality provider - bytes description = 4; + bytes description = 3; // commission defines the commission rate for the finality provider - string commission = 5 [ + string commission = 4 [ (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 = 6; + string eots_pk_hex = 5; } message CreateFinalityProviderResponse { @@ -89,8 +87,6 @@ message AddFinalitySignatureResponse { string tx_hash = 1; // the hex string of the extracted Bitcoin secp256k1 private key string extracted_sk_hex = 2; - // the hex string of the local Bitcoin secp256k1 private key - string local_sk_hex = 3; } message UnjailFinalityProviderRequest { @@ -222,10 +218,8 @@ message SignMessageFromChainKeyRequest { bytes msg_to_sign = 1; // key_name is the identifier key in keyring string key_name = 2; - // passphrase is used to encrypt the keys - string passphrase = 3; // hd_path is the hd path for private key derivation - string hd_path = 4; + string hd_path = 3; } // SignMessageFromChainKeyResponse contains the signed message from the chain keyring. diff --git a/finality-provider/service/app.go b/finality-provider/service/app.go index 359b7979..374ead2c 100644 --- a/finality-provider/service/app.go +++ b/finality-provider/service/app.go @@ -9,7 +9,6 @@ import ( sdkmath "cosmossdk.io/math" bbntypes "github.com/babylonlabs-io/babylon/types" bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" - "github.com/btcsuite/btcd/btcec/v2" "github.com/cometbft/cometbft/crypto/tmhash" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" @@ -41,7 +40,6 @@ type FinalityProviderApp struct { pubRandStore *store.PubRandProofStore config *fpcfg.Config logger *zap.Logger - input *strings.Reader fpInsMu sync.RWMutex // Protects fpIns fpIns *FinalityProviderInstance @@ -102,12 +100,10 @@ func NewFinalityProviderApp( return nil, fmt.Errorf("failed to initiate public randomness store: %w", err) } - input := strings.NewReader("") kr, err := fpkr.CreateKeyring( config.BabylonConfig.KeyDirectory, config.BabylonConfig.ChainID, config.BabylonConfig.KeyringBackend, - input, ) if err != nil { return nil, fmt.Errorf("failed to create keyring: %w", err) @@ -123,7 +119,6 @@ func NewFinalityProviderApp( kr: kr, config: config, logger: logger, - input: input, eotsManager: em, metrics: fpMetrics, quit: make(chan struct{}), @@ -206,10 +201,10 @@ func (app *FinalityProviderApp) Logger() *zap.Logger { // 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 { +func (app *FinalityProviderApp) StartFinalityProvider(fpPk *bbntypes.BIP340PubKey) error { app.logger.Info("starting finality provider", zap.String("pk", fpPk.MarshalHex())) - if err := app.startFinalityProviderInstance(fpPk, passphrase); err != nil { + if err := app.startFinalityProviderInstance(fpPk); err != nil { return err } @@ -349,18 +344,18 @@ func (app *FinalityProviderApp) Stop() error { } func (app *FinalityProviderApp) CreateFinalityProvider( - keyName, chainID, passPhrase string, + keyName, chainID string, eotsPk *bbntypes.BIP340PubKey, description *stakingtypes.Description, commission *sdkmath.LegacyDec, ) (*CreateFinalityProviderResult, error) { // 1. check if the chain key exists - kr, err := fpkr.NewChainKeyringControllerWithKeyring(app.kr, keyName, app.input) + kr, err := fpkr.NewChainKeyringControllerWithKeyring(app.kr, keyName) if err != nil { return nil, err } - fpAddr, err := kr.Address(passPhrase) + fpAddr, err := kr.Address() 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) @@ -370,7 +365,7 @@ func (app *FinalityProviderApp) CreateFinalityProvider( if eotsPk == nil { return nil, fmt.Errorf("eots pk cannot be nil") } - pop, err := app.CreatePop(fpAddr, eotsPk, passPhrase) + pop, err := app.CreatePop(fpAddr, eotsPk) if err != nil { return nil, fmt.Errorf("failed to create proof-of-possession of the finality-provider: %w", err) } @@ -490,7 +485,7 @@ func (app *FinalityProviderApp) UnjailFinalityProvider(fpPk *bbntypes.BIP340PubK } } -func (app *FinalityProviderApp) CreatePop(fpAddress sdk.AccAddress, fpPk *bbntypes.BIP340PubKey, passphrase string) (*bstypes.ProofOfPossessionBTC, error) { +func (app *FinalityProviderApp) CreatePop(fpAddress sdk.AccAddress, fpPk *bbntypes.BIP340PubKey) (*bstypes.ProofOfPossessionBTC, error) { pop := &bstypes.ProofOfPossessionBTC{ BtcSigType: bstypes.BTCSigType_BIP340, // by default, we use BIP-340 encoding for BTC signature } @@ -500,7 +495,7 @@ func (app *FinalityProviderApp) CreatePop(fpAddress sdk.AccAddress, fpPk *bbntyp // So we have to hash the address before signing hash := tmhash.Sum(fpAddress.Bytes()) - sig, err := app.eotsManager.SignSchnorrSig(fpPk.MustMarshal(), hash, passphrase) + sig, err := app.eotsManager.SignSchnorrSig(fpPk.MustMarshal(), hash) if err != nil { return nil, fmt.Errorf("failed to get schnorr signature from the EOTS manager: %w", err) } @@ -512,7 +507,6 @@ func (app *FinalityProviderApp) CreatePop(fpAddress sdk.AccAddress, fpPk *bbntyp func (app *FinalityProviderApp) startFinalityProviderInstance( pk *bbntypes.BIP340PubKey, - passphrase string, ) error { pkHex := pk.MarshalHex() app.fpInsMu.Lock() @@ -521,7 +515,7 @@ func (app *FinalityProviderApp) startFinalityProviderInstance( if app.fpIns == nil { fpIns, err := NewFinalityProviderInstance( pk, app.config, app.fps, app.pubRandStore, app.cc, app.consumerCon, app.eotsManager, - app.metrics, passphrase, app.criticalErrChan, app.logger, + app.metrics, app.criticalErrChan, app.logger, ) if err != nil { return fmt.Errorf("failed to create finality provider instance %s: %w", pkHex, err) @@ -577,16 +571,6 @@ func (app *FinalityProviderApp) setFinalityProviderSlashed(fpi *FinalityProvider } } -// NOTE: this is not safe in production, so only used for testing purpose -func (app *FinalityProviderApp) getFpPrivKey(fpPk []byte) (*btcec.PrivateKey, error) { - record, err := app.eotsManager.KeyRecord(fpPk, "") - if err != nil { - return nil, err - } - - return record.PrivKey, nil -} - // putFpFromResponse creates or updates finality-provider in the local store func (app *FinalityProviderApp) putFpFromResponse(fp *bstypes.FinalityProviderResponse, chainID string) error { btcPk := fp.BtcPk.MustToBTCPK() diff --git a/finality-provider/service/app_test.go b/finality-provider/service/app_test.go index 4d024084..c22be888 100644 --- a/finality-provider/service/app_test.go +++ b/finality-provider/service/app_test.go @@ -6,7 +6,6 @@ import ( "math/rand" "os" "path/filepath" - "strings" "testing" "time" @@ -97,7 +96,7 @@ func FuzzCreateFinalityProvider(f *testing.F) { var eotsPk *bbntypes.BIP340PubKey eotsKeyName := testutil.GenRandomHexStr(r, 4) require.NoError(t, err) - eotsPkBz, err := em.CreateKey(eotsKeyName, passphrase, hdPath) + eotsPkBz, err := em.CreateKey(eotsKeyName) require.NoError(t, err) eotsPk, err = bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) @@ -120,7 +119,7 @@ func FuzzCreateFinalityProvider(f *testing.F) { gomock.Any(), ).Return(&types.TxResponse{TxHash: txHash}, nil).AnyTimes() mockBabylonController.EXPECT().QueryFinalityProvider(gomock.Any()).Return(nil, nil).AnyTimes() - res, err := app.CreateFinalityProvider(keyName, chainID, passphrase, eotsPk, testutil.RandomDescription(r), testutil.ZeroCommissionRate()) + res, err := app.CreateFinalityProvider(keyName, chainID, eotsPk, testutil.RandomDescription(r), testutil.ZeroCommissionRate()) require.NoError(t, err) require.Equal(t, txHash, res.TxHash) @@ -237,7 +236,7 @@ func FuzzUnjailFinalityProvider(f *testing.F) { expectedTxHash := datagen.GenRandomHexStr(r, 32) mockConsumerController.EXPECT().UnjailFinalityProvider(fpPk.MustToBTCPK()).Return(&types.TxResponse{TxHash: expectedTxHash}, nil).AnyTimes() - err := app.StartFinalityProvider(fpPk, "") + err := app.StartFinalityProvider(fpPk) require.NoError(t, err) fpIns, err := app.GetFinalityProviderInstance() require.NoError(t, err) @@ -306,7 +305,7 @@ func FuzzSaveAlreadyRegisteredFinalityProvider(f *testing.F) { var eotsPk *bbntypes.BIP340PubKey eotsKeyName := testutil.GenRandomHexStr(r, 4) require.NoError(t, err) - eotsPkBz, err := em.CreateKey(eotsKeyName, passphrase, hdPath) + eotsPkBz, err := em.CreateKey(eotsKeyName) require.NoError(t, err) eotsPk, err = bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) @@ -333,7 +332,7 @@ func FuzzSaveAlreadyRegisteredFinalityProvider(f *testing.F) { mockBabylonController.EXPECT().QueryFinalityProvider(gomock.Any()).Return(fpRes, nil).AnyTimes() - res, err := app.CreateFinalityProvider(keyName, chainID, passphrase, eotsPk, testutil.RandomDescription(r), testutil.ZeroCommissionRate()) + res, err := app.CreateFinalityProvider(keyName, chainID, eotsPk, testutil.RandomDescription(r), testutil.ZeroCommissionRate()) require.NoError(t, err) require.Equal(t, res.FpInfo.BtcPkHex, eotsPk.MarshalHex()) @@ -354,7 +353,6 @@ func startFPAppWithRegisteredFp(t *testing.T, r *rand.Rand, homePath string, cfg require.NoError(t, err) // create finality-provider app with randomized config - input := strings.NewReader("") require.NoError(t, err) err = util.MakeDirectory(config.DataDir(homePath)) require.NoError(t, err) @@ -372,12 +370,11 @@ func startFPAppWithRegisteredFp(t *testing.T, r *rand.Rand, homePath string, cfg cfg.BabylonConfig.KeyDirectory, cfg.BabylonConfig.ChainID, cfg.BabylonConfig.KeyringBackend, - input, ) require.NoError(t, err) - kc, err := keyring.NewChainKeyringControllerWithKeyring(kr, keyName, input) + kc, err := keyring.NewChainKeyringControllerWithKeyring(kr, keyName) require.NoError(t, err) - btcPkBytes, err := em.CreateKey(keyName, passphrase, hdPath) + btcPkBytes, err := em.CreateKey(keyName) require.NoError(t, err) btcPk, err := bbntypes.NewBIP340PubKey(btcPkBytes) require.NoError(t, err) diff --git a/finality-provider/service/client/rpcclient.go b/finality-provider/service/client/rpcclient.go index a5cb15c2..7be5b292 100644 --- a/finality-provider/service/client/rpcclient.go +++ b/finality-provider/service/client/rpcclient.go @@ -49,7 +49,7 @@ func (c *FinalityProviderServiceGRpcClient) GetInfo(ctx context.Context) (*proto func (c *FinalityProviderServiceGRpcClient) CreateFinalityProvider( ctx context.Context, - keyName, chainID, eotsPkHex, passphrase string, + keyName, chainID, eotsPkHex string, description types.Description, commission *sdkmath.LegacyDec, ) (*proto.CreateFinalityProviderResponse, error) { @@ -61,7 +61,6 @@ func (c *FinalityProviderServiceGRpcClient) CreateFinalityProvider( req := &proto.CreateFinalityProviderRequest{ KeyName: keyName, ChainId: chainID, - Passphrase: passphrase, Description: descBytes, Commission: commission.String(), EotsPkHex: eotsPkHex, diff --git a/finality-provider/service/eots_manager_adapter.go b/finality-provider/service/eots_manager_adapter.go index 882dec33..462a63ba 100644 --- a/finality-provider/service/eots_manager_adapter.go +++ b/finality-provider/service/eots_manager_adapter.go @@ -18,7 +18,6 @@ func (fp *FinalityProviderInstance) GetPubRandList(startHeight uint64, numPubRan fp.GetChainID(), startHeight, numPubRand, - fp.passphrase, ) if err != nil { return nil, err @@ -49,7 +48,7 @@ func (fp *FinalityProviderInstance) SignPubRandCommit(startHeight uint64, numPub } // sign the message hash using the finality-provider's BTC private key - return fp.em.SignSchnorrSig(fp.btcPk.MustMarshal(), hash, fp.passphrase) + return fp.em.SignSchnorrSig(fp.btcPk.MustMarshal(), hash) } func getMsgToSignForVote(blockHeight uint64, blockHash []byte) []byte { @@ -59,7 +58,7 @@ func getMsgToSignForVote(blockHeight uint64, blockHash []byte) []byte { func (fp *FinalityProviderInstance) SignFinalitySig(b *types.BlockInfo) (*bbntypes.SchnorrEOTSSig, error) { // build proper finality signature request msgToSign := getMsgToSignForVote(b.Height, b.Hash) - sig, err := fp.em.SignEOTS(fp.btcPk.MustMarshal(), fp.GetChainID(), msgToSign, b.Height, fp.passphrase) + sig, err := fp.em.SignEOTS(fp.btcPk.MustMarshal(), fp.GetChainID(), msgToSign, b.Height) if err != nil { return nil, fmt.Errorf("failed to sign EOTS: %w", err) } diff --git a/finality-provider/service/fp_instance.go b/finality-provider/service/fp_instance.go index 4f933879..610f98d5 100644 --- a/finality-provider/service/fp_instance.go +++ b/finality-provider/service/fp_instance.go @@ -40,9 +40,6 @@ type FinalityProviderInstance struct { poller *ChainPoller metrics *metrics.FpMetrics - // passphrase is used to unlock private keys - passphrase string - criticalErrChan chan<- *CriticalError isStarted *atomic.Bool @@ -62,7 +59,6 @@ func NewFinalityProviderInstance( consumerCon ccapi.ConsumerController, em eotsmanager.EOTSManager, metrics *metrics.FpMetrics, - passphrase string, errChan chan<- *CriticalError, logger *zap.Logger, ) (*FinalityProviderInstance, error) { @@ -75,7 +71,7 @@ func NewFinalityProviderInstance( return nil, fmt.Errorf("the finality provider instance is already slashed") } - return newFinalityProviderInstanceFromStore(sfp, cfg, s, prStore, cc, consumerCon, em, metrics, passphrase, errChan, logger) + return newFinalityProviderInstanceFromStore(sfp, cfg, s, prStore, cc, consumerCon, em, metrics, errChan, logger) } // Helper function to create FinalityProviderInstance from store data @@ -88,7 +84,6 @@ func newFinalityProviderInstanceFromStore( consumerCon ccapi.ConsumerController, em eotsmanager.EOTSManager, metrics *metrics.FpMetrics, - passphrase string, errChan chan<- *CriticalError, logger *zap.Logger, ) (*FinalityProviderInstance, error) { @@ -100,7 +95,6 @@ func newFinalityProviderInstanceFromStore( logger: logger, isStarted: atomic.NewBool(false), criticalErrChan: errChan, - passphrase: passphrase, em: em, cc: cc, consumerCon: consumerCon, @@ -722,7 +716,7 @@ func (fp *FinalityProviderInstance) TestSubmitFinalitySignatureAndExtractPrivKey eotsSignerFunc := func(b *types.BlockInfo) (*bbntypes.SchnorrEOTSSig, error) { msgToSign := getMsgToSignForVote(b.Height, b.Hash) - sig, err := fp.em.UnsafeSignEOTS(fp.btcPk.MustMarshal(), fp.GetChainID(), msgToSign, b.Height, fp.passphrase) + sig, err := fp.em.UnsafeSignEOTS(fp.btcPk.MustMarshal(), fp.GetChainID(), msgToSign, b.Height) if err != nil { return nil, fmt.Errorf("failed to sign EOTS: %w", err) } diff --git a/finality-provider/service/fp_instance_test.go b/finality-provider/service/fp_instance_test.go index f0d18389..594ee6ab 100644 --- a/finality-provider/service/fp_instance_test.go +++ b/finality-provider/service/fp_instance_test.go @@ -5,7 +5,6 @@ import ( "math/rand" "os" "path/filepath" - "strings" "testing" "github.com/babylonlabs-io/babylon/testutil/datagen" @@ -166,7 +165,7 @@ func startFinalityProviderAppWithRegisteredFp( // create registered finality-provider eotsKeyName := testutil.GenRandomHexStr(r, 4) require.NoError(t, err) - eotsPkBz, err := em.CreateKey(eotsKeyName, passphrase, hdPath) + eotsPkBz, err := em.CreateKey(eotsKeyName) require.NoError(t, err) eotsPk, err := bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) @@ -174,15 +173,13 @@ func startFinalityProviderAppWithRegisteredFp( fpStore := app.GetFinalityProviderStore() 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, ) require.NoError(t, err) - kc, err := fpkr.NewChainKeyringControllerWithKeyring(kr, keyName, input) + kc, err := fpkr.NewChainKeyringControllerWithKeyring(kr, keyName) require.NoError(t, err) keyInfo, err := kc.CreateChainKey("", "", "") require.NoError(t, err) @@ -196,7 +193,7 @@ func startFinalityProviderAppWithRegisteredFp( ) require.NoError(t, err) m := metrics.NewFpMetrics() - fpIns, err := service.NewFinalityProviderInstance(eotsPk, &fpCfg, fpStore, pubRandProofStore, cc, consumerCon, em, m, passphrase, make(chan *service.CriticalError), logger) + fpIns, err := service.NewFinalityProviderInstance(eotsPk, &fpCfg, fpStore, pubRandProofStore, cc, consumerCon, em, m, make(chan *service.CriticalError), logger) require.NoError(t, err) cleanUp := func() { diff --git a/finality-provider/service/rpcserver.go b/finality-provider/service/rpcserver.go index 38e80d9b..f9532a34 100644 --- a/finality-provider/service/rpcserver.go +++ b/finality-provider/service/rpcserver.go @@ -104,7 +104,6 @@ func (r *rpcServer) CreateFinalityProvider( result, err := r.app.CreateFinalityProvider( req.KeyName, req.ChainId, - req.Passphrase, eotsPk, &description, &commissionRate, @@ -137,11 +136,6 @@ func (r *rpcServer) AddFinalitySignature(_ context.Context, req *proto.AddFinali return res, nil default: - fpPk, err := bbntypes.NewBIP340PubKeyFromHex(req.BtcPk) - if err != nil { - return nil, err - } - fpi, err := r.app.GetFinalityProviderInstance() if err != nil { return nil, err @@ -169,30 +163,7 @@ func (r *rpcServer) AddFinalitySignature(_ context.Context, req *proto.AddFinali // if privKey is not empty, then this BTC finality-provider // has voted for a fork and will be slashed if privKey != nil { - localPrivKey, err := r.app.getFpPrivKey(fpPk.MustMarshal()) - if err != nil { - r.app.logger.Error(fmt.Sprintf("err get priv key %s", err.Error())) - - return nil, err - } - res.ExtractedSkHex = privKey.Key.String() - localSkHex := localPrivKey.Key.String() - localSkNegateHex := localPrivKey.Key.Negate().String() - switch { - case res.ExtractedSkHex == localSkHex: - res.LocalSkHex = localSkHex - case res.ExtractedSkHex == localSkNegateHex: - res.LocalSkHex = localSkNegateHex - default: - msg := fmt.Sprintf( - "the finality-provider's BTC private key is extracted but does not match the local key,"+ - " extracted: %s, local: %s, local-negated: %s", - res.ExtractedSkHex, localSkHex, localSkNegateHex, - ) - - return nil, errors.New(msg) - } } return res, nil diff --git a/itest/babylon/babylon_e2e_test.go b/itest/babylon/babylon_e2e_test.go index 1dcf125e..39111a48 100644 --- a/itest/babylon/babylon_e2e_test.go +++ b/itest/babylon/babylon_e2e_test.go @@ -24,6 +24,7 @@ import ( sdkmath "cosmossdk.io/math" bbntypes "github.com/babylonlabs-io/babylon/types" bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" + eotscmd "github.com/babylonlabs-io/finality-provider/eotsmanager/cmd/eotsd/daemon" eotscfg "github.com/babylonlabs-io/finality-provider/eotsmanager/config" "github.com/babylonlabs-io/finality-provider/finality-provider/cmd/fpd/daemon" @@ -130,7 +131,7 @@ func TestDoubleSigning(t *testing.T) { _, extractedKey, err = fpIns.TestSubmitFinalitySignatureAndExtractPrivKey(b, false) require.NoError(t, err) require.NotNil(t, extractedKey) - localKey := tm.GetFpPrivKey(t, fpIns.GetBtcPkBIP340().MustMarshal()) + localKey := tm.EOTSServerHandler.GetFPPrivKey(t, fpIns.GetBtcPkBIP340().MustMarshal()) require.True(t, localKey.Key.Equals(&extractedKey.Key) || localKey.Key.Negate().Equals(&extractedKey.Key)) t.Logf("the equivocation attack is successful") @@ -282,7 +283,7 @@ func TestFinalityProviderCreateCmd(t *testing.T) { cmd := daemon.CommandCreateFP() eotsKeyName := "eots-key-2" - eotsPkBz, err := tm.EOTSClient.CreateKey(eotsKeyName, passphrase, hdPath) + eotsPkBz, err := tm.EOTSServerHandler.CreateKey(eotsKeyName) require.NoError(t, err) eotsPk, err := bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) @@ -378,7 +379,7 @@ func TestPrintEotsCmd(t *testing.T) { expected := make(map[string]string) for i := 0; i < r.Intn(10); i++ { eotsKeyName := fmt.Sprintf("eots-key-%s", datagen.GenRandomHexStr(r, 4)) - ekey, err := tm.EOTSClient.CreateKey(eotsKeyName, passphrase, hdPath) + ekey, err := tm.EOTSServerHandler.CreateKey(eotsKeyName) require.NoError(t, err) pk, err := schnorr.ParsePubKey(ekey) require.NoError(t, err) diff --git a/itest/babylon/babylon_test_manager.go b/itest/babylon/babylon_test_manager.go index 5b98881e..135188f7 100644 --- a/itest/babylon/babylon_test_manager.go +++ b/itest/babylon/babylon_test_manager.go @@ -13,6 +13,11 @@ import ( bbnclient "github.com/babylonlabs-io/babylon/client/client" "github.com/babylonlabs-io/babylon/testutil/datagen" bbntypes "github.com/babylonlabs-io/babylon/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/ory/dockertest/v3" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" @@ -25,11 +30,6 @@ import ( base_test_manager "github.com/babylonlabs-io/finality-provider/itest/test-manager" "github.com/babylonlabs-io/finality-provider/testutil" "github.com/babylonlabs-io/finality-provider/types" - "github.com/btcsuite/btcd/btcec/v2" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/ory/dockertest/v3" - "github.com/stretchr/testify/require" - "go.uber.org/zap" ) const ( @@ -155,7 +155,7 @@ func (tm *TestManager) AddFinalityProvider(t *testing.T, ctx context.Context) *s // Create EOTS key eotsKeyName := fmt.Sprintf("eots-key-%s", datagen.GenRandomHexStr(r, 4)) - eotsPkBz, err := tm.EOTSClient.CreateKey(eotsKeyName, passphrase, hdPath) + eotsPkBz, err := tm.EOTSServerHandler.CreateKey(eotsKeyName) require.NoError(t, err) eotsPk, err := bbntypes.NewBIP340PubKey(eotsPkBz) require.NoError(t, err) @@ -199,13 +199,13 @@ func (tm *TestManager) AddFinalityProvider(t *testing.T, ctx context.Context) *s // Create and register the finality provider commission := sdkmath.LegacyZeroDec() desc := newDescription(testMoniker) - _, err = fpApp.CreateFinalityProvider(cfg.BabylonConfig.Key, testChainID, passphrase, eotsPk, desc, &commission) + _, err = fpApp.CreateFinalityProvider(cfg.BabylonConfig.Key, testChainID, eotsPk, desc, &commission) require.NoError(t, err) cfg.RPCListener = fmt.Sprintf("127.0.0.1:%d", testutil.AllocateUniquePort(t)) cfg.Metrics.Port = testutil.AllocateUniquePort(t) - err = fpApp.StartFinalityProvider(eotsPk, passphrase) + err = fpApp.StartFinalityProvider(eotsPk) require.NoError(t, err) fpServer := service.NewFinalityProviderServer(cfg, tm.logger, fpApp, fpdb) @@ -303,12 +303,6 @@ func (tm *TestManager) WaitForFpVoteCast(t *testing.T, fpIns *service.FinalityPr return lastVotedHeight } -func (tm *TestManager) GetFpPrivKey(t *testing.T, fpPk []byte) *btcec.PrivateKey { - record, err := tm.EOTSClient.KeyRecord(fpPk, passphrase) - require.NoError(t, err) - return record.PrivKey -} - func (tm *TestManager) StopAndRestartFpAfterNBlocks(t *testing.T, n int, fpIns *service.FinalityProviderInstance) { blockBeforeStop, err := tm.BBNConsumerClient.QueryLatestBlockHeight() require.NoError(t, err) diff --git a/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go b/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go index ba580bc6..3cd71994 100644 --- a/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go +++ b/itest/cosmwasm/bcd/bcd_consumer_e2e_test.go @@ -13,10 +13,11 @@ import ( bbnappparams "github.com/babylonlabs-io/babylon-sdk/demo/app/params" "github.com/babylonlabs-io/babylon-sdk/x/babylon/client/cli" appparams "github.com/babylonlabs-io/babylon/app/params" - e2eutils "github.com/babylonlabs-io/finality-provider/itest" sdk "github.com/cosmos/cosmos-sdk/types" sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" + + e2eutils "github.com/babylonlabs-io/finality-provider/itest" ) // TestConsumerFpLifecycle tests the consumer finality provider lifecycle diff --git a/itest/cosmwasm/bcd/bcd_handler.go b/itest/cosmwasm/bcd/bcd_handler.go index dc302d2e..dbca8d5b 100644 --- a/itest/cosmwasm/bcd/bcd_handler.go +++ b/itest/cosmwasm/bcd/bcd_handler.go @@ -14,8 +14,9 @@ import ( "strings" "testing" - common "github.com/babylonlabs-io/finality-provider/itest" "github.com/stretchr/testify/require" + + common "github.com/babylonlabs-io/finality-provider/itest" ) const ( diff --git a/itest/cosmwasm/bcd/bcd_test_manager.go b/itest/cosmwasm/bcd/bcd_test_manager.go index c9497aa7..a0757518 100644 --- a/itest/cosmwasm/bcd/bcd_test_manager.go +++ b/itest/cosmwasm/bcd/bcd_test_manager.go @@ -23,6 +23,12 @@ import ( bbnclient "github.com/babylonlabs-io/babylon/client/client" "github.com/babylonlabs-io/babylon/testutil/datagen" bbntypes "github.com/babylonlabs-io/babylon/types" + dbm "github.com/cosmos/cosmos-db" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" ccapi "github.com/babylonlabs-io/finality-provider/clientcontroller/api" bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" @@ -36,16 +42,6 @@ import ( base_test_manager "github.com/babylonlabs-io/finality-provider/itest/test-manager" "github.com/babylonlabs-io/finality-provider/testutil" "github.com/babylonlabs-io/finality-provider/types" - dbm "github.com/cosmos/cosmos-db" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -const ( - passphrase = "testpass" - hdPath = "" ) type BcdTestManager struct { @@ -244,7 +240,7 @@ func (ctm *BcdTestManager) CreateConsumerFinalityProviders(t *testing.T, consume commission := sdkmath.LegacyZeroDec() desc := e2eutils.NewDescription(moniker) - eotsPk, err := ctm.EOTSClient.CreateKey(keyName, passphrase, hdPath) + eotsPk, err := ctm.EOTSServerHandler.CreateKey(keyName) require.NoError(t, err) eotsPubKey, err := bbntypes.NewBIP340PubKey(eotsPk) require.NoError(t, err) @@ -257,13 +253,13 @@ func (ctm *BcdTestManager) CreateConsumerFinalityProviders(t *testing.T, consume require.NoError(t, err) // register fp in Babylon - _, err = app.CreateFinalityProvider(keyName, consumerId, passphrase, eotsPubKey, desc, &commission) + _, err = app.CreateFinalityProvider(keyName, consumerId, eotsPubKey, desc, &commission) require.NoError(t, err) cfg.RPCListener = fmt.Sprintf("127.0.0.1:%d", testutil.AllocateUniquePort(t)) cfg.Metrics.Port = testutil.AllocateUniquePort(t) - err = app.StartFinalityProvider(eotsPubKey, passphrase) + err = app.StartFinalityProvider(eotsPubKey) require.NoError(t, err) fpIns, err := app.GetFinalityProviderInstance() diff --git a/itest/eotsmanager_handler.go b/itest/eotsmanager_handler.go index b7ddf528..b85fd9bc 100644 --- a/itest/eotsmanager_handler.go +++ b/itest/eotsmanager_handler.go @@ -4,6 +4,7 @@ import ( "context" "testing" + "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/require" "go.uber.org/zap" @@ -13,9 +14,10 @@ import ( ) type EOTSServerHandler struct { - t *testing.T - eotsServer *service.Server - cfg *config.Config + t *testing.T + eotsServer *service.Server + eotsManager *eotsmanager.LocalEOTSManager + cfg *config.Config } func NewEOTSServerHandler(t *testing.T, cfg *config.Config, eotsHomeDir string) *EOTSServerHandler { @@ -31,9 +33,10 @@ func NewEOTSServerHandler(t *testing.T, cfg *config.Config, eotsHomeDir string) eotsServer := service.NewEOTSManagerServer(cfg, logger, eotsManager, dbBackend) return &EOTSServerHandler{ - t: t, - eotsServer: eotsServer, - cfg: cfg, + t: t, + eotsServer: eotsServer, + eotsManager: eotsManager, + cfg: cfg, } } @@ -49,3 +52,13 @@ func (eh *EOTSServerHandler) startServer(ctx context.Context) { err := eh.eotsServer.RunUntilShutdown(ctx) require.NoError(eh.t, err) } + +func (eh *EOTSServerHandler) CreateKey(name string) ([]byte, error) { + return eh.eotsManager.CreateKey(name) +} + +func (eh *EOTSServerHandler) GetFPPrivKey(t *testing.T, fpPk []byte) *btcec.PrivateKey { + privKey, err := eh.eotsManager.KeyRecord(fpPk) + require.NoError(t, err) + return privKey.PrivKey +} diff --git a/itest/opstackl2/op_e2e_test.go b/itest/opstackl2/op_e2e_test.go index 100b2efe..d14dd15a 100644 --- a/itest/opstackl2/op_e2e_test.go +++ b/itest/opstackl2/op_e2e_test.go @@ -12,8 +12,9 @@ import ( "testing" "time" - "github.com/babylonlabs-io/finality-provider/testutil" "github.com/stretchr/testify/require" + + "github.com/babylonlabs-io/finality-provider/testutil" ) // TestPubRandCommitment tests the consumer controller's functions: diff --git a/itest/opstackl2/op_test_manager.go b/itest/opstackl2/op_test_manager.go index 2c56342d..8d76edde 100644 --- a/itest/opstackl2/op_test_manager.go +++ b/itest/opstackl2/op_test_manager.go @@ -14,6 +14,14 @@ import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" bbntypes "github.com/babylonlabs-io/babylon/types" + "github.com/btcsuite/btcd/btcec/v2" + sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" + "github.com/decred/dcrd/dcrec/secp256k1/v4" + "github.com/ory/dockertest/v3" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" opcc "github.com/babylonlabs-io/finality-provider/clientcontroller/opstackl2" @@ -29,13 +37,6 @@ import ( "github.com/babylonlabs-io/finality-provider/testutil" "github.com/babylonlabs-io/finality-provider/testutil/log" "github.com/babylonlabs-io/finality-provider/types" - "github.com/btcsuite/btcd/btcec/v2" - sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" - "github.com/decred/dcrd/dcrec/secp256k1/v4" - "github.com/ory/dockertest/v3" - "github.com/stretchr/testify/require" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" ) const ( @@ -369,7 +370,7 @@ func (ctm *OpL2ConsumerTestManager) setupBabylonAndConsumerFp(t *testing.T) []*b babylonKeyName := babylonCfg.BabylonConfig.Key // create and register Babylon FP - eotsPk, err := ctm.BabylonEOTSClient.CreateKey(babylonKeyName, passphrase, hdPath) + eotsPk, err := ctm.EOTSServerHandler.CreateKey(babylonKeyName) require.NoError(t, err) babylonFpPk, err := bbntypes.NewBIP340PubKey(eotsPk) require.NoError(t, err) @@ -386,7 +387,7 @@ func (ctm *OpL2ConsumerTestManager) setupBabylonAndConsumerFp(t *testing.T) []*b consumerKeyName := consumerCfg.OPStackL2Config.Key + "2" // create and register consumer FP - consumerEotsPk, err := ctm.ConsumerEOTSClient.CreateKey(consumerKeyName, passphrase, hdPath) + consumerEotsPk, err := ctm.EOTSServerHandler.CreateKey(consumerKeyName) require.NoError(t, err) consumerFpPk, err := bbntypes.NewBIP340PubKey(consumerEotsPk) require.NoError(t, err) @@ -435,7 +436,7 @@ func (ctm *OpL2ConsumerTestManager) getConsumerFpInstance( fpInstance, err := service.NewFinalityProviderInstance( consumerFpPk, fpCfg, fpStore, pubRandStore, bc, ctm.OpConsumerController, ctm.ConsumerEOTSClient, - metrics.NewFpMetrics(), "", make(chan<- *service.CriticalError), ctm.logger) + metrics.NewFpMetrics(), make(chan<- *service.CriticalError), ctm.logger) require.NoError(t, err) return fpInstance } diff --git a/itest/test-manager/base_test_manager.go b/itest/test-manager/base_test_manager.go index 84e5cb41..69cdbe00 100644 --- a/itest/test-manager/base_test_manager.go +++ b/itest/test-manager/base_test_manager.go @@ -20,6 +20,14 @@ import ( btclctypes "github.com/babylonlabs-io/babylon/x/btclightclient/types" bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" ckpttypes "github.com/babylonlabs-io/babylon/x/checkpointing/types" + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/wire" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + fpcc "github.com/babylonlabs-io/finality-provider/clientcontroller" "github.com/babylonlabs-io/finality-provider/clientcontroller/api" bbncc "github.com/babylonlabs-io/finality-provider/clientcontroller/babylon" @@ -30,13 +38,6 @@ import ( "github.com/babylonlabs-io/finality-provider/finality-provider/service" e2eutils "github.com/babylonlabs-io/finality-provider/itest" "github.com/babylonlabs-io/finality-provider/metrics" - "github.com/btcsuite/btcd/btcec/v2" - "github.com/btcsuite/btcd/btcutil" - "github.com/btcsuite/btcd/wire" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkquerytypes "github.com/cosmos/cosmos-sdk/types/query" - "github.com/stretchr/testify/require" - "go.uber.org/zap" ) type BaseTestManager struct { @@ -625,7 +626,6 @@ func CreateAndRegisterFinalityProvider(t *testing.T, fpApp *service.FinalityProv _, err := fpApp.CreateFinalityProvider( keyName, chainId, - e2eutils.Passphrase, eotsPk, desc, &commission, diff --git a/itest/utils.go b/itest/utils.go index eb2a02c3..72f0dddd 100644 --- a/itest/utils.go +++ b/itest/utils.go @@ -1,20 +1,20 @@ package e2e_utils import ( + "encoding/hex" "fmt" "os" "os/exec" "testing" "time" - "encoding/hex" - - "github.com/babylonlabs-io/finality-provider/finality-provider/config" - "github.com/babylonlabs-io/finality-provider/finality-provider/service" "github.com/btcsuite/btcd/btcec/v2" "github.com/btcsuite/btcd/chaincfg" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/babylonlabs-io/finality-provider/finality-provider/config" + "github.com/babylonlabs-io/finality-provider/finality-provider/service" + bbntypes "github.com/babylonlabs-io/babylon/types" bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/stretchr/testify/require" @@ -26,8 +26,6 @@ var ( FpNamePrefix = "test-fp-" MonikerPrefix = "moniker-" ChainID = "chain-test" - Passphrase = "testpass" - HdPath = "" WasmStake = "ustake" // Default staking token WasmFee = "ucosm" // Default fee token WasmMoniker = "node001" // Default moniker diff --git a/keyring/keyring.go b/keyring/keyring.go index e0d97f06..84965ea7 100644 --- a/keyring/keyring.go +++ b/keyring/keyring.go @@ -4,7 +4,6 @@ import ( "fmt" "os" "path" - "strings" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -12,7 +11,7 @@ import ( "github.com/babylonlabs-io/finality-provider/codec" ) -func CreateKeyring(keyringDir string, chainID string, backend string, input *strings.Reader) (keyring.Keyring, error) { +func CreateKeyring(keyringDir string, chainID string, backend string) (keyring.Keyring, error) { ctx, err := CreateClientCtx(keyringDir, chainID) if err != nil { return nil, err @@ -26,7 +25,7 @@ func CreateKeyring(keyringDir string, chainID string, backend string, input *str ctx.ChainID, backend, ctx.KeyringDir, - input, + os.Stdin, ctx.Codec, ctx.KeyringOptions...) if err != nil { diff --git a/keyring/keyringcontroller.go b/keyring/keyringcontroller.go index ad4c194e..3fa520c4 100644 --- a/keyring/keyringcontroller.go +++ b/keyring/keyringcontroller.go @@ -2,7 +2,7 @@ package keyring import ( "fmt" - "strings" + "os" bstypes "github.com/babylonlabs-io/babylon/x/btcstaking/types" "github.com/btcsuite/btcd/btcec/v2" @@ -23,8 +23,6 @@ const ( type ChainKeyringController struct { kr keyring.Keyring fpName string - // input is to send passphrase to kr - input *strings.Reader } func NewChainKeyringController(ctx client.Context, name, keyringBackend string) (*ChainKeyringController, error) { @@ -36,12 +34,11 @@ func NewChainKeyringController(ctx client.Context, name, keyringBackend string) return nil, fmt.Errorf("the keyring backend should not be empty") } - inputReader := strings.NewReader("") kr, err := keyring.New( ctx.ChainID, keyringBackend, ctx.KeyringDir, - inputReader, + os.Stdin, ctx.Codec, ctx.KeyringOptions...) if err != nil { @@ -51,11 +48,10 @@ func NewChainKeyringController(ctx client.Context, name, keyringBackend string) return &ChainKeyringController{ fpName: name, kr: kr, - input: inputReader, }, nil } -func NewChainKeyringControllerWithKeyring(kr keyring.Keyring, name string, input *strings.Reader) (*ChainKeyringController, error) { +func NewChainKeyringControllerWithKeyring(kr keyring.Keyring, name string) (*ChainKeyringController, error) { if name == "" { return nil, fmt.Errorf("the key name should not be empty") } @@ -63,7 +59,6 @@ func NewChainKeyringControllerWithKeyring(kr keyring.Keyring, name string, input return &ChainKeyringController{ kr: kr, fpName: name, - input: input, }, nil } @@ -91,8 +86,6 @@ func (kc *ChainKeyringController) CreateChainKey(passphrase, hdPath, mnemonic st } } - // we need to repeat the passphrase to mock the reentry - kc.input.Reset(passphrase + "\n" + passphrase) record, err := kc.kr.NewAccount(kc.fpName, mnemonic, passphrase, hdPath, algo) if err != nil { return nil, err @@ -128,8 +121,7 @@ func (kc *ChainKeyringController) CreatePop(fpAddr sdk.AccAddress, btcPrivKey *b } // Address returns the address from the keyring -func (kc *ChainKeyringController) Address(passphrase string) (sdk.AccAddress, error) { - kc.input.Reset(passphrase) +func (kc *ChainKeyringController) Address() (sdk.AccAddress, error) { k, err := kc.kr.Key(kc.fpName) if err != nil { return nil, fmt.Errorf("failed to get address: %w", err) @@ -137,20 +129,3 @@ func (kc *ChainKeyringController) Address(passphrase string) (sdk.AccAddress, er return k.GetAddress() } - -func (kc *ChainKeyringController) GetChainPrivKey(passphrase string) (*sdksecp256k1.PrivKey, error) { - kc.input.Reset(passphrase) - k, err := kc.kr.Key(kc.fpName) - if err != nil { - return nil, fmt.Errorf("failed to get private key: %w", err) - } - - privKeyCached := k.GetLocal().PrivKey.GetCachedValue() - - switch v := privKeyCached.(type) { - case *sdksecp256k1.PrivKey: - return v, nil - default: - return nil, fmt.Errorf("unsupported key type in keyring") - } -} diff --git a/keyring/keyringcontroller_test.go b/keyring/keyringcontroller_test.go index 2320340f..8b068ca8 100644 --- a/keyring/keyringcontroller_test.go +++ b/keyring/keyringcontroller_test.go @@ -52,7 +52,7 @@ func FuzzCreatePoP(f *testing.F) { }() require.NoError(t, err) - btcPkBytes, err := em.CreateKey(keyName, passphrase, hdPath) + btcPkBytes, err := em.CreateKey(keyName) require.NoError(t, err) btcPk, err := types.NewBIP340PubKey(btcPkBytes) require.NoError(t, err) @@ -60,7 +60,7 @@ func FuzzCreatePoP(f *testing.F) { require.NoError(t, err) fpAddr := keyInfo.AccAddress - fpRecord, err := em.KeyRecord(btcPk.MustMarshal(), passphrase) + fpRecord, err := em.KeyRecord(btcPk.MustMarshal()) require.NoError(t, err) pop, err := kc.CreatePop(fpAddr, fpRecord.PrivKey) require.NoError(t, err)