From 5610039b068ee27ee7e1efb45b7f1003032396be Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 19 Feb 2021 14:58:38 +0530 Subject: [PATCH 01/27] add fix for multisig keys --- client/keys/migrate.go | 2 +- client/keys/testdata/keys/keys.db/000008.ldb | Bin 0 -> 472 bytes client/keys/testdata/keys/keys.db/000013.ldb | Bin 0 -> 474 bytes client/keys/testdata/keys/keys.db/000026.ldb | Bin 0 -> 319 bytes .../testdata/keys/keys.db/MANIFEST-000038 | Bin 0 -> 299 bytes codec/legacy/codec.go | 7 +++++++ crypto/keyring/keyring.go | 19 +++++++++++++----- 7 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 client/keys/testdata/keys/keys.db/000008.ldb create mode 100644 client/keys/testdata/keys/keys.db/000013.ldb create mode 100644 client/keys/testdata/keys/keys.db/000026.ldb create mode 100644 client/keys/testdata/keys/keys.db/MANIFEST-000038 diff --git a/client/keys/migrate.go b/client/keys/migrate.go index 836a2655b087..0fe3582e3dfc 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -112,7 +112,7 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { return err } - if err := migrator.ImportPubKey(keyName, pubkeyArmor); err != nil { + if err := migrator.ImportPubKey(keyName, pubkeyArmor, keyType); err != nil { return err } diff --git a/client/keys/testdata/keys/keys.db/000008.ldb b/client/keys/testdata/keys/keys.db/000008.ldb new file mode 100644 index 0000000000000000000000000000000000000000..bbe0b95818b623d7ba42ef99f20243d6f6825a4b GIT binary patch literal 472 zcmeBY{t(Sz%axp8oSR>4SX@?OmYh>mP-bGBn`KdIkdj`Umu6y=n^A0$m{XB!Y-EvE zo?5Awn37VIT3pP?!~g~*sl_FRdYO4?`3yqKnGifiMg|5(MTMnIylX{mxmZgWH9q(V zslASR*{;Z>c4LdlV=#}HQqZ`Vj&Mx_r+xUy5ytQ3-xiz*9BxQY{VN~{!IElr(G z+>FgkEDX#IO)ZRFUEG{394(D3oy^TF%*`#hxXdjq$`W0REW-1QJ4SX@$>lTlG_U}2J*l5CuuW}1^yX;f8ao@Y^-ZJuploMmpB zRcNM{n37VIT3pP?$^Zr>sl_EmdYO4?`3yqKnGifi76t}JMTMnIylX{mxmZgWH9q(V zslASR*{;a^tk=Ij`)A^VklitGlP4 zLWrxMi))atr(cLdK#*scV~DGQw`-&>qtb^ZT-hmURtibUMU@35T*ZkwB~}V%Ca#7q z#)fWY&PIktMlJ@Y3OLIyx^)mC)@)?BoGa`75> zQ#$zl5eK7?+Uuy7?TXCLdj0FOeM=r|*f%r;J=*7{x%U@q_T+ K4c#iG?zaK&RbIaU literal 0 HcmV?d00001 diff --git a/client/keys/testdata/keys/keys.db/MANIFEST-000038 b/client/keys/testdata/keys/keys.db/MANIFEST-000038 new file mode 100644 index 0000000000000000000000000000000000000000..deaebcd05c8d7ac60bf2fe9470f323c3bad828b8 GIT binary patch literal 299 zcmYk!K~jS-7(ih{>rfYNy6jrV9YcYXY~1KMT*M?$(j>IW4o} zkO8p8*fhQ|lQdd;V65~h<=hJA&?@?Et$PJ++M2pU$-I*2?rU*T9R#%>eMU;nS;1#&MKPM57_8fg8%>k literal 0 HcmV?d00001 diff --git a/codec/legacy/codec.go b/codec/legacy/codec.go index 5ec6b2976cab..26c223743231 100644 --- a/codec/legacy/codec.go +++ b/codec/legacy/codec.go @@ -3,6 +3,7 @@ package legacy import ( "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -29,3 +30,9 @@ func PubKeyFromBytes(pubKeyBytes []byte) (pubKey cryptotypes.PubKey, err error) err = Cdc.UnmarshalBinaryBare(pubKeyBytes, &pubKey) return } + +// LegacyAminoPubKeyFromBytes unmarshals public key bytes and returns a PubKey +func LegacyAminoPubKeyFromBytes(pubKeyBytes []byte) (pubKey multisig.LegacyAminoPubKey, err error) { + err = Cdc.UnmarshalBinaryBare(pubKeyBytes, &pubKey) + return +} diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 164e6bfc19d5..e8295671ad46 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -110,7 +110,7 @@ type Importer interface { ImportPrivKey(uid, armor, passphrase string) error // ImportPubKey imports ASCII armored public keys. - ImportPubKey(uid string, armor string) error + ImportPubKey(uid string, armor string, keyType KeyType) error } // Exporter is implemented by key stores that support export of public and private keys. @@ -295,7 +295,7 @@ func (ks keystore) ImportPrivKey(uid, armor, passphrase string) error { return nil } -func (ks keystore) ImportPubKey(uid string, armor string) error { +func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error { if _, err := ks.Key(uid); err == nil { return fmt.Errorf("cannot overwrite key: %s", uid) } @@ -305,10 +305,19 @@ func (ks keystore) ImportPubKey(uid string, armor string) error { return err } - pubKey, err := legacy.PubKeyFromBytes(pubBytes) - if err != nil { - return err + fmt.Printf("this is keyType %v", keyType) + if keyType == TypeMulti { + fmt.Printf("this is in if %v", keyType) + + pubKey, err := legacy.LegacyAminoPubKeyFromBytes(pubBytes) + _, err = ks.writeMultisigKey(uid, &pubKey) + if err != nil { + return err + } + return nil } + fmt.Printf("this is uid %s", uid) + pubKey, err := legacy.PubKeyFromBytes(pubBytes) _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) if err != nil { From f5992202c1b3e873638ecc2dfe07ad92b1c5212a Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 19 Feb 2021 15:57:37 +0530 Subject: [PATCH 02/27] update tests --- client/keys/testdata/keys/keys.db/CURRENT | 2 +- client/keys/testdata/keys/keys.db/CURRENT.bak | 2 +- client/keys/testdata/keys/keys.db/LOG | 354 ++++++++++++++++-- .../testdata/keys/keys.db/MANIFEST-000005 | Bin 41 -> 0 bytes .../{MANIFEST-000038 => MANIFEST-000062} | Bin 299 -> 299 bytes crypto/keyring/keyring.go | 4 - crypto/keyring/keyring_test.go | 30 +- 7 files changed, 341 insertions(+), 51 deletions(-) delete mode 100644 client/keys/testdata/keys/keys.db/MANIFEST-000005 rename client/keys/testdata/keys/keys.db/{MANIFEST-000038 => MANIFEST-000062} (78%) diff --git a/client/keys/testdata/keys/keys.db/CURRENT b/client/keys/testdata/keys/keys.db/CURRENT index aa5bb8ea5090..5ca571d22d0b 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT +++ b/client/keys/testdata/keys/keys.db/CURRENT @@ -1 +1 @@ -MANIFEST-000005 +MANIFEST-000062 diff --git a/client/keys/testdata/keys/keys.db/CURRENT.bak b/client/keys/testdata/keys/keys.db/CURRENT.bak index 4fb1dad19e03..0556986296ec 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT.bak +++ b/client/keys/testdata/keys/keys.db/CURRENT.bak @@ -1 +1 @@ -MANIFEST-000003 +MANIFEST-000060 diff --git a/client/keys/testdata/keys/keys.db/LOG b/client/keys/testdata/keys/keys.db/LOG index e37648b855bb..920f94552972 100644 --- a/client/keys/testdata/keys/keys.db/LOG +++ b/client/keys/testdata/keys/keys.db/LOG @@ -1,30 +1,324 @@ -=============== Feb 2, 2021 (IST) =============== -00:03:25.348369 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -00:03:25.350695 db@open opening -00:03:25.350888 version@stat F·[] S·0B[] Sc·[] -00:03:25.351864 db@janitor F·2 G·0 -00:03:25.351881 db@open done T·1.169825ms -00:03:25.351895 db@close closing -00:03:25.351929 db@close done T·33.042µs -=============== Feb 2, 2021 (IST) =============== -00:03:34.450638 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -00:03:34.450722 version@stat F·[] S·0B[] Sc·[] -00:03:34.450737 db@open opening -00:03:34.450765 journal@recovery F·1 -00:03:34.450851 journal@recovery recovering @1 -00:03:34.451173 version@stat F·[] S·0B[] Sc·[] -00:03:34.454278 db@janitor F·2 G·0 -00:03:34.454298 db@open done T·3.548046ms -00:03:34.454307 db@close closing -00:03:34.454327 db@close done T·19.017µs -=============== Feb 2, 2021 (IST) =============== -00:03:42.025705 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -00:03:42.025892 version@stat F·[] S·0B[] Sc·[] -00:03:42.025907 db@open opening -00:03:42.025943 journal@recovery F·1 -00:03:42.026790 journal@recovery recovering @2 -00:03:42.026946 version@stat F·[] S·0B[] Sc·[] -00:03:42.031645 db@janitor F·2 G·0 -00:03:42.031661 db@open done T·5.750008ms -00:03:42.283102 db@close closing -00:03:42.283162 db@close done T·58.775µs +=============== Feb 18, 2021 (IST) =============== +19:55:21.746342 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:55:21.749786 db@open opening +19:55:21.749971 version@stat F·[] S·0B[] Sc·[] +19:55:21.750906 db@janitor F·2 G·0 +19:55:21.750924 db@open done T·1.122724ms +19:55:21.750937 db@close closing +19:55:21.751010 db@close done T·59.508µs +=============== Feb 18, 2021 (IST) =============== +19:55:34.470289 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:55:34.470381 version@stat F·[] S·0B[] Sc·[] +19:55:34.470398 db@open opening +19:55:34.470435 journal@recovery F·1 +19:55:34.470534 journal@recovery recovering @1 +19:55:34.470797 version@stat F·[] S·0B[] Sc·[] +19:55:34.475040 db@janitor F·2 G·0 +19:55:34.475058 db@open done T·4.651192ms +19:55:34.475068 db@close closing +19:55:34.475099 db@close done T·29.747µs +=============== Feb 18, 2021 (IST) =============== +19:55:55.559301 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:55:55.559405 version@stat F·[] S·0B[] Sc·[] +19:55:55.559423 db@open opening +19:55:55.559462 journal@recovery F·1 +19:55:55.560430 journal@recovery recovering @2 +19:55:55.560885 version@stat F·[] S·0B[] Sc·[] +19:55:55.564548 db@janitor F·2 G·0 +19:55:55.564566 db@open done T·5.132791ms +19:55:55.564576 db@close closing +19:55:55.564620 db@close done T·40.809µs +=============== Feb 18, 2021 (IST) =============== +19:56:02.009665 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:56:02.009975 version@stat F·[] S·0B[] Sc·[] +19:56:02.010033 db@open opening +19:56:02.010189 journal@recovery F·1 +19:56:02.011047 journal@recovery recovering @4 +19:56:02.011583 version@stat F·[] S·0B[] Sc·[] +19:56:02.016108 db@janitor F·2 G·0 +19:56:02.016120 db@open done T·6.072306ms +19:56:02.252918 db@close closing +19:56:02.252954 db@close done T·34.003µs +=============== Feb 18, 2021 (IST) =============== +19:56:08.674814 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:56:08.675058 version@stat F·[] S·0B[] Sc·[] +19:56:08.675088 db@open opening +19:56:08.675200 journal@recovery F·1 +19:56:08.675324 journal@recovery recovering @6 +19:56:08.677956 memdb@flush created L0@8 N·2 S·472B "cos..ess,v2":"tes..nfo,v1" +19:56:08.678065 version@stat F·[1] S·472B[472B] Sc·[0.25] +19:56:08.682869 db@janitor F·3 G·0 +19:56:08.682881 db@open done T·7.786465ms +19:56:08.682890 db@close closing +19:56:08.682914 db@close done T·23.78µs +=============== Feb 18, 2021 (IST) =============== +19:56:15.429130 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:56:15.429502 version@stat F·[1] S·472B[472B] Sc·[0.25] +19:56:15.429567 db@open opening +19:56:15.429708 journal@recovery F·1 +19:56:15.430627 journal@recovery recovering @9 +19:56:15.431649 version@stat F·[1] S·472B[472B] Sc·[0.25] +19:56:15.436312 db@janitor F·3 G·0 +19:56:15.436327 db@open done T·6.74915ms +19:56:15.692407 db@close closing +19:56:15.692462 db@close done T·53.032µs +=============== Feb 18, 2021 (IST) =============== +19:57:03.867735 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:57:03.868070 version@stat F·[1] S·472B[472B] Sc·[0.25] +19:57:03.868090 db@open opening +19:57:03.868198 journal@recovery F·1 +19:57:03.868564 journal@recovery recovering @11 +19:57:03.871006 memdb@flush created L0@13 N·2 S·474B "cos..ess,v5":"tes..nfo,v4" +19:57:03.871329 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:03.873977 db@janitor F·4 G·0 +19:57:03.873999 db@open done T·5.895918ms +19:57:03.874050 db@close closing +19:57:03.874097 db@close done T·44.46µs +=============== Feb 18, 2021 (IST) =============== +19:57:03.874184 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:57:03.874267 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:03.874281 db@open opening +19:57:03.874316 journal@recovery F·1 +19:57:03.875087 journal@recovery recovering @14 +19:57:03.875231 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:03.877724 db@janitor F·4 G·0 +19:57:03.877734 db@open done T·3.449027ms +19:57:03.877775 db@close closing +19:57:03.877798 db@close done T·21.916µs +=============== Feb 18, 2021 (IST) =============== +19:57:13.250092 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:57:13.250195 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.250219 db@open opening +19:57:13.250258 journal@recovery F·1 +19:57:13.250369 journal@recovery recovering @16 +19:57:13.250677 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.254378 db@janitor F·4 G·0 +19:57:13.254393 db@open done T·4.167045ms +19:57:13.254459 db@close closing +19:57:13.254494 db@close done T·34.322µs +=============== Feb 18, 2021 (IST) =============== +19:57:13.254566 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:57:13.254640 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.254655 db@open opening +19:57:13.254689 journal@recovery F·1 +19:57:13.255206 journal@recovery recovering @18 +19:57:13.255349 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.258000 db@janitor F·4 G·0 +19:57:13.258010 db@open done T·3.35032ms +19:57:13.258061 db@close closing +19:57:13.258093 db@close done T·30.599µs +=============== Feb 18, 2021 (IST) =============== +19:57:13.258142 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:57:13.258207 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.258221 db@open opening +19:57:13.258258 journal@recovery F·1 +19:57:13.258565 journal@recovery recovering @20 +19:57:13.258972 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.261719 db@janitor F·4 G·0 +19:57:13.261731 db@open done T·3.504128ms +19:57:13.261763 db@close closing +19:57:13.261783 db@close done T·19.411µs +=============== Feb 18, 2021 (IST) =============== +19:57:13.261838 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:57:13.261899 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.261911 db@open opening +19:57:13.261945 journal@recovery F·1 +19:57:13.262432 journal@recovery recovering @22 +19:57:13.263487 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:57:13.266236 db@janitor F·4 G·0 +19:57:13.266258 db@open done T·4.343035ms +19:57:13.268002 db@close closing +19:57:13.268033 db@close done T·30.43µs +=============== Feb 18, 2021 (IST) =============== +19:58:46.390844 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:58:46.390931 version@stat F·[2] S·946B[946B] Sc·[0.50] +19:58:46.390945 db@open opening +19:58:46.390978 journal@recovery F·1 +19:58:46.391193 journal@recovery recovering @24 +19:58:46.392281 memdb@flush created L0@26 N·2 S·319B "cos..ess,v8":"mul..nfo,v7" +19:58:46.392402 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +19:58:46.395177 db@janitor F·5 G·0 +19:58:46.395188 db@open done T·4.239206ms +19:58:51.803805 db@close closing +19:58:51.804111 db@close done T·299.418µs +=============== Feb 18, 2021 (IST) =============== +20:02:37.179459 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +20:02:37.179558 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +20:02:37.179574 db@open opening +20:02:37.179619 journal@recovery F·1 +20:02:37.179879 journal@recovery recovering @27 +20:02:37.180415 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +20:02:37.184816 db@janitor F·5 G·0 +20:02:37.184842 db@open done T·5.255578ms +20:02:40.778667 db@close closing +20:02:40.778890 db@close done T·218.287µs +=============== Feb 18, 2021 (IST) =============== +20:04:06.448046 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +20:04:06.448157 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +20:04:06.448174 db@open opening +20:04:06.448214 journal@recovery F·1 +20:04:06.448314 journal@recovery recovering @29 +20:04:06.448570 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +20:04:06.452972 db@janitor F·5 G·0 +20:04:06.452994 db@open done T·4.807108ms +20:04:06.453109 db@close closing +20:04:06.453163 db@close done T·50.43µs +=============== Feb 18, 2021 (IST) =============== +20:29:40.048262 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +20:29:40.049987 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +20:29:40.050003 db@open opening +20:29:40.050044 journal@recovery F·1 +20:29:40.050260 journal@recovery recovering @31 +20:29:40.050808 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +20:29:40.053723 db@janitor F·5 G·0 +20:29:40.053740 db@open done T·3.728083ms +20:29:41.898517 db@close closing +20:29:41.898693 db@close done T·164.864µs +=============== Feb 18, 2021 (IST) =============== +21:07:19.610996 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +21:07:19.611389 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +21:07:19.611408 db@open opening +21:07:19.611451 journal@recovery F·1 +21:07:19.611895 journal@recovery recovering @33 +21:07:19.612326 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +21:07:19.615103 db@janitor F·5 G·0 +21:07:19.615117 db@open done T·3.701842ms +=============== Feb 18, 2021 (IST) =============== +21:22:17.908927 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +21:22:17.909297 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +21:22:17.909321 db@open opening +21:22:17.909376 journal@recovery F·1 +21:22:17.909609 journal@recovery recovering @35 +21:22:17.910230 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +21:22:17.913089 db@janitor F·5 G·0 +21:22:17.913115 db@open done T·3.7861ms +=============== Feb 19, 2021 (IST) =============== +14:35:40.001538 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:35:40.002006 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:35:40.002028 db@open opening +14:35:40.002079 journal@recovery F·1 +14:35:40.002413 journal@recovery recovering @37 +14:35:40.003107 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:35:40.006189 db@janitor F·5 G·0 +14:35:40.006204 db@open done T·4.169376ms +14:35:41.622336 db@close closing +14:35:41.622423 db@close done T·87.082µs +=============== Feb 19, 2021 (IST) =============== +14:42:56.814630 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:42:56.814763 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:42:56.814786 db@open opening +14:42:56.814845 journal@recovery F·1 +14:42:56.815210 journal@recovery recovering @39 +14:42:56.815839 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:42:56.820271 db@janitor F·5 G·0 +14:42:56.820313 db@open done T·5.505688ms +14:42:59.007273 db@close closing +14:42:59.007430 db@close done T·160.414µs +=============== Feb 19, 2021 (IST) =============== +14:43:38.020230 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:43:38.020347 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:43:38.020369 db@open opening +14:43:38.020419 journal@recovery F·1 +14:43:38.020729 journal@recovery recovering @41 +14:43:38.021514 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:43:38.024483 db@janitor F·5 G·0 +14:43:38.024497 db@open done T·4.121329ms +=============== Feb 19, 2021 (IST) =============== +14:44:02.293151 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:44:02.294326 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:44:02.294353 db@open opening +14:44:02.294403 journal@recovery F·1 +14:44:02.294719 journal@recovery recovering @43 +14:44:02.295476 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:44:02.298593 db@janitor F·5 G·0 +14:44:02.298621 db@open done T·4.251319ms +14:44:03.615728 db@close closing +14:44:03.615809 db@close done T·79.173µs +=============== Feb 19, 2021 (IST) =============== +14:45:02.325906 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:45:02.326045 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:45:02.326066 db@open opening +14:45:02.326125 journal@recovery F·1 +14:45:02.326548 journal@recovery recovering @45 +14:45:02.327179 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:45:02.331737 db@janitor F·5 G·0 +14:45:02.331761 db@open done T·5.679085ms +14:45:03.790521 db@close closing +14:45:03.790819 db@close done T·291.566µs +=============== Feb 19, 2021 (IST) =============== +14:45:20.989589 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:45:20.989762 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:45:20.989788 db@open opening +14:45:20.989852 journal@recovery F·1 +14:45:20.991585 journal@recovery recovering @47 +14:45:20.991942 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:45:20.994916 db@janitor F·5 G·0 +14:45:20.994937 db@open done T·5.136054ms +14:45:20.995464 db@close closing +14:45:20.995512 db@close done T·46.824µs +=============== Feb 19, 2021 (IST) =============== +14:45:49.932890 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:45:49.933054 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:45:49.933075 db@open opening +14:45:49.933125 journal@recovery F·1 +14:45:49.933518 journal@recovery recovering @49 +14:45:49.934218 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:45:49.937610 db@janitor F·5 G·0 +14:45:49.937641 db@open done T·4.551123ms +14:45:52.068809 db@close closing +14:45:52.068913 db@close done T·100.268µs +=============== Feb 19, 2021 (IST) =============== +14:47:19.401175 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:47:19.401307 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:47:19.401325 db@open opening +14:47:19.401377 journal@recovery F·1 +14:47:19.401847 journal@recovery recovering @51 +14:47:19.402402 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:47:19.406692 db@janitor F·5 G·0 +14:47:19.406711 db@open done T·5.375705ms +14:47:21.044284 db@close closing +14:47:21.044388 db@close done T·101.194µs +=============== Feb 19, 2021 (IST) =============== +14:48:21.413725 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:48:21.413872 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:48:21.413895 db@open opening +14:48:21.413957 journal@recovery F·1 +14:48:21.414275 journal@recovery recovering @53 +14:48:21.414984 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:48:21.419314 db@janitor F·5 G·0 +14:48:21.419328 db@open done T·5.42456ms +14:48:23.502854 db@close closing +14:48:23.502936 db@close done T·79.035µs +=============== Feb 19, 2021 (IST) =============== +14:54:11.839440 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:54:11.839856 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:54:11.839878 db@open opening +14:54:11.839932 journal@recovery F·1 +14:54:11.840206 journal@recovery recovering @55 +14:54:11.841010 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:54:11.844094 db@janitor F·5 G·0 +14:54:11.844112 db@open done T·4.226897ms +14:54:13.782398 db@close closing +14:54:13.782490 db@close done T·89.573µs +=============== Feb 19, 2021 (IST) =============== +14:54:22.511807 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:54:22.511948 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:54:22.511970 db@open opening +14:54:22.512018 journal@recovery F·1 +14:54:22.512458 journal@recovery recovering @57 +14:54:22.513208 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:54:22.517444 db@janitor F·5 G·0 +14:54:22.517460 db@open done T·5.483271ms +14:54:23.975752 db@close closing +14:54:23.975839 db@close done T·85.523µs +=============== Feb 19, 2021 (IST) =============== +14:56:23.671326 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:56:23.671451 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:56:23.671471 db@open opening +14:56:23.671523 journal@recovery F·1 +14:56:23.672021 journal@recovery recovering @59 +14:56:23.672512 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +14:56:23.675973 db@janitor F·5 G·0 +14:56:23.675999 db@open done T·4.513247ms +14:56:41.226250 db@close closing +14:56:41.226327 db@close done T·74.817µs diff --git a/client/keys/testdata/keys/keys.db/MANIFEST-000005 b/client/keys/testdata/keys/keys.db/MANIFEST-000005 deleted file mode 100644 index a9e8a261c7882e802f65360dc49782db7df6fb77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 41 wcmYcef4W17fss)vC$%g!CnZVGsj?)sJhM2}IX|}`u_&=5zle#2nT>@304?eb82|tP diff --git a/client/keys/testdata/keys/keys.db/MANIFEST-000038 b/client/keys/testdata/keys/keys.db/MANIFEST-000062 similarity index 78% rename from client/keys/testdata/keys/keys.db/MANIFEST-000038 rename to client/keys/testdata/keys/keys.db/MANIFEST-000062 index deaebcd05c8d7ac60bf2fe9470f323c3bad828b8..ab22832387589228dd4d678060a6c6d2bedd4b69 100644 GIT binary patch delta 20 ccmZ3@w3>-!^Mr;=6Im3PZJF&is+}c0%5pi7X1ts?6#e)maz;M63mh diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index e8295671ad46..6c57699b42e4 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -305,10 +305,7 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error return err } - fmt.Printf("this is keyType %v", keyType) if keyType == TypeMulti { - fmt.Printf("this is in if %v", keyType) - pubKey, err := legacy.LegacyAminoPubKeyFromBytes(pubBytes) _, err = ks.writeMultisigKey(uid, &pubKey) if err != nil { @@ -316,7 +313,6 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error } return nil } - fmt.Printf("this is uid %s", uid) pubKey, err := legacy.PubKeyFromBytes(pubBytes) _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) diff --git a/crypto/keyring/keyring_test.go b/crypto/keyring/keyring_test.go index bcd7eddf39f9..7cd74b3eeb1c 100644 --- a/crypto/keyring/keyring_test.go +++ b/crypto/keyring/keyring_test.go @@ -195,7 +195,7 @@ func TestSignVerifyKeyRing(t *testing.T) { require.NoError(t, err) require.NoError(t, kb.Delete(n2)) - require.NoError(t, kb.ImportPubKey(n3, armor)) + require.NoError(t, kb.ImportPubKey(n3, armor, TypeLocal)) i3, err := kb.Key(n3) require.NoError(t, err) require.Equal(t, i3.GetName(), n3) @@ -260,7 +260,7 @@ func TestExportImportPubKeyKeyRing(t *testing.T) { require.NoError(t, err) // Import it under a different name - err = kb.ImportPubKey("john-pubkey-only", armor) + err = kb.ImportPubKey("john-pubkey-only", armor, TypeLocal) require.NoError(t, err) // Ensure consistency @@ -271,7 +271,7 @@ func TestExportImportPubKeyKeyRing(t *testing.T) { require.True(t, john.GetPubKey().Equals(john2.GetPubKey())) // Ensure keys cannot be overwritten - err = kb.ImportPubKey("john-pubkey-only", armor) + err = kb.ImportPubKey("john-pubkey-only", armor, TypeLocal) require.NotNil(t, err) } @@ -302,11 +302,11 @@ func TestAdvancedKeyManagementKeyRing(t *testing.T) { require.NoError(t, err) // import succeeds - err = kb.ImportPubKey(n2, exported) + err = kb.ImportPubKey(n2, exported, TypeLocal) require.NoError(t, err) // second import fails - err = kb.ImportPubKey(n2, exported) + err = kb.ImportPubKey(n2, exported, TypeLocal) require.NotNil(t, err) } @@ -549,7 +549,7 @@ func TestInMemorySignVerify(t *testing.T) { require.Nil(t, err) err = cstore.Delete(n2) require.NoError(t, err) - err = cstore.ImportPubKey(n3, armor) + err = cstore.ImportPubKey(n3, armor, TypeLocal) require.NoError(t, err) i3, err := cstore.Key(n3) require.NoError(t, err) @@ -580,7 +580,7 @@ func TestInMemoryExportImport(t *testing.T) { err = cstore.Delete("john") require.NoError(t, err) - err = cstore.ImportPubKey("john2", armor) + err = cstore.ImportPubKey("john2", armor, TypeLocal) require.NoError(t, err) john2, err := cstore.Key("john2") @@ -641,7 +641,7 @@ func TestInMemoryExportImportPubKey(t *testing.T) { require.NoError(t, err) // Import it under a different name - err = cstore.ImportPubKey("john-pubkey-only", armor) + err = cstore.ImportPubKey("john-pubkey-only", armor, TypeLocal) require.NoError(t, err) // Ensure consistency john2, err := cstore.Key("john-pubkey-only") @@ -650,7 +650,7 @@ func TestInMemoryExportImportPubKey(t *testing.T) { require.True(t, john.GetPubKey().Equals(john2.GetPubKey())) // Ensure keys cannot be overwritten - err = cstore.ImportPubKey("john-pubkey-only", armor) + err = cstore.ImportPubKey("john-pubkey-only", armor, TypeLocal) require.NotNil(t, err) } @@ -681,11 +681,11 @@ func TestInMemoryAdvancedKeyManagement(t *testing.T) { require.NoError(t, err) // import succeeds - err = cstore.ImportPubKey(n2, exported) + err = cstore.ImportPubKey(n2, exported, TypeLocal) require.NoError(t, err) // second import fails - err = cstore.ImportPubKey(n2, exported) + err = cstore.ImportPubKey(n2, exported, TypeLocal) require.NotNil(t, err) } @@ -1063,11 +1063,11 @@ func TestAltKeyring_ImportExportPubKey(t *testing.T) { require.NoError(t, err) newUID := otherID - err = keyring.ImportPubKey(newUID, armor) + err = keyring.ImportPubKey(newUID, armor, TypeLocal) require.NoError(t, err) // Should fail importing private key on existing key. - err = keyring.ImportPubKey(newUID, armor) + err = keyring.ImportPubKey(newUID, armor, TypeLocal) require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) } @@ -1085,11 +1085,11 @@ func TestAltKeyring_ImportExportPubKey_ByAddress(t *testing.T) { require.NoError(t, err) newUID := otherID - err = keyring.ImportPubKey(newUID, armor) + err = keyring.ImportPubKey(newUID, armor, TypeLocal) require.NoError(t, err) // Should fail importing private key on existing key. - err = keyring.ImportPubKey(newUID, armor) + err = keyring.ImportPubKey(newUID, armor, TypeLocal) require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) } From ca120e8ac48fa304fb85ae91cbc9782b55539c0d Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Sat, 20 Feb 2021 00:09:18 +0530 Subject: [PATCH 03/27] fix lint --- crypto/keyring/keyring.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 6c57699b42e4..156b64510ebf 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -307,6 +307,10 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error if keyType == TypeMulti { pubKey, err := legacy.LegacyAminoPubKeyFromBytes(pubBytes) + if err != nil { + return err + } + _, err = ks.writeMultisigKey(uid, &pubKey) if err != nil { return err @@ -314,6 +318,9 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error return nil } pubKey, err := legacy.PubKeyFromBytes(pubBytes) + if err != nil { + return err + } _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) if err != nil { From 88e1eed4b9e9c63815d186a1ed507d7bf57261bf Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Tue, 23 Feb 2021 09:12:30 +0100 Subject: [PATCH 04/27] rename function legacy --- codec/legacy/codec.go | 4 ++-- crypto/keyring/keyring.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codec/legacy/codec.go b/codec/legacy/codec.go index 26c223743231..778600242611 100644 --- a/codec/legacy/codec.go +++ b/codec/legacy/codec.go @@ -31,8 +31,8 @@ func PubKeyFromBytes(pubKeyBytes []byte) (pubKey cryptotypes.PubKey, err error) return } -// LegacyAminoPubKeyFromBytes unmarshals public key bytes and returns a PubKey -func LegacyAminoPubKeyFromBytes(pubKeyBytes []byte) (pubKey multisig.LegacyAminoPubKey, err error) { +// AminoPubKeyFromBytes unmarshals public key bytes and returns a PubKey +func AminoPubKeyFromBytes(pubKeyBytes []byte) (pubKey multisig.LegacyAminoPubKey, err error) { err = Cdc.UnmarshalBinaryBare(pubKeyBytes, &pubKey) return } diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 156b64510ebf..588ccc03d79e 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -306,7 +306,7 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error } if keyType == TypeMulti { - pubKey, err := legacy.LegacyAminoPubKeyFromBytes(pubBytes) + pubKey, err := legacy.AminoPubKeyFromBytes(pubBytes) if err != nil { return err } From 3288631ec84f03f7343acb26eb055e6d7f791e97 Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Tue, 23 Feb 2021 11:43:36 +0100 Subject: [PATCH 05/27] fix linter --- types/address/hash.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/address/hash.go b/types/address/hash.go index 8c0cddae02e6..64b30226c047 100644 --- a/types/address/hash.go +++ b/types/address/hash.go @@ -67,8 +67,8 @@ func Module(moduleName string, key []byte) []byte { // unsafeStrToByteArray uses unsafe to convert string into byte array. Returned array // cannot be altered after this functions is called func unsafeStrToByteArray(s string) []byte { - sh := *(*reflect.SliceHeader)(unsafe.Pointer(&s)) + sh := *(*reflect.SliceHeader)(unsafe.Pointer(&s)) // nolint sh.Cap = sh.Len - bs := *(*[]byte)(unsafe.Pointer(&sh)) + bs := *(*[]byte)(unsafe.Pointer(&sh)) // nolint return bs } From da71b0419bd97ee41d5b0dd1bda2a4356c4b4972 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Tue, 23 Feb 2021 17:35:51 +0530 Subject: [PATCH 06/27] update keys --- client/keys/testdata/keys/keys.db/CURRENT | 2 +- client/keys/testdata/keys/keys.db/CURRENT.bak | 2 +- client/keys/testdata/keys/keys.db/LOG | 53 ++++++++++++++++++ .../{MANIFEST-000062 => MANIFEST-000072} | Bin 299 -> 299 bytes 4 files changed, 55 insertions(+), 2 deletions(-) rename client/keys/testdata/keys/keys.db/{MANIFEST-000062 => MANIFEST-000072} (78%) diff --git a/client/keys/testdata/keys/keys.db/CURRENT b/client/keys/testdata/keys/keys.db/CURRENT index 5ca571d22d0b..f74be168efe7 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT +++ b/client/keys/testdata/keys/keys.db/CURRENT @@ -1 +1 @@ -MANIFEST-000062 +MANIFEST-000072 diff --git a/client/keys/testdata/keys/keys.db/CURRENT.bak b/client/keys/testdata/keys/keys.db/CURRENT.bak index 0556986296ec..bcf10793aaa2 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT.bak +++ b/client/keys/testdata/keys/keys.db/CURRENT.bak @@ -1 +1 @@ -MANIFEST-000060 +MANIFEST-000070 diff --git a/client/keys/testdata/keys/keys.db/LOG b/client/keys/testdata/keys/keys.db/LOG index 920f94552972..628161ffe65a 100644 --- a/client/keys/testdata/keys/keys.db/LOG +++ b/client/keys/testdata/keys/keys.db/LOG @@ -322,3 +322,56 @@ 14:56:23.675999 db@open done T·4.513247ms 14:56:41.226250 db@close closing 14:56:41.226327 db@close done T·74.817µs +=============== Feb 19, 2021 (IST) =============== +15:58:32.661888 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:58:32.661976 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +15:58:32.661993 db@open opening +15:58:32.662032 journal@recovery F·1 +15:58:32.662272 journal@recovery recovering @61 +15:58:32.662998 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +15:58:32.665560 db@janitor F·5 G·0 +15:58:32.665575 db@open done T·3.57577ms +15:58:34.373361 db@close closing +15:58:34.373547 db@close done T·181.217µs +=============== Feb 19, 2021 (IST) =============== +15:58:39.417932 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:58:39.418051 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +15:58:39.418067 db@open opening +15:58:39.418104 journal@recovery F·1 +15:58:39.418335 journal@recovery recovering @63 +15:58:39.418784 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +15:58:39.423506 db@janitor F·5 G·0 +15:58:39.423534 db@open done T·5.453295ms +15:58:46.716446 db@close closing +15:58:46.716501 db@close done T·53.532µs +=============== Feb 23, 2021 (IST) =============== +00:16:24.952717 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +00:16:24.953346 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +00:16:24.953363 db@open opening +00:16:24.953401 journal@recovery F·1 +00:16:24.953995 journal@recovery recovering @65 +00:16:24.954332 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +00:16:24.957437 db@janitor F·5 G·0 +00:16:24.957454 db@open done T·4.085773ms +00:16:24.957713 db@close closing +00:16:24.957753 db@close done T·37.55µs +=============== Feb 23, 2021 (IST) =============== +16:24:20.149172 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +16:24:20.149548 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +16:24:20.149567 db@open opening +16:24:20.149614 journal@recovery F·1 +16:24:20.151223 journal@recovery recovering @67 +16:24:20.151678 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +16:24:20.154840 db@janitor F·5 G·0 +16:24:20.154853 db@open done T·5.280143ms +=============== Feb 23, 2021 (IST) =============== +16:24:26.059591 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +16:24:26.059706 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +16:24:26.059721 db@open opening +16:24:26.059757 journal@recovery F·1 +16:24:26.060898 journal@recovery recovering @69 +16:24:26.061653 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +16:24:26.064929 db@janitor F·5 G·0 +16:24:26.064942 db@open done T·5.215816ms +16:24:26.065074 db@close closing +16:24:26.065124 db@close done T·47.02µs diff --git a/client/keys/testdata/keys/keys.db/MANIFEST-000062 b/client/keys/testdata/keys/keys.db/MANIFEST-000072 similarity index 78% rename from client/keys/testdata/keys/keys.db/MANIFEST-000062 rename to client/keys/testdata/keys/keys.db/MANIFEST-000072 index ab22832387589228dd4d678060a6c6d2bedd4b69..1314730128bdcddf823927cd7f68f9c4947843e8 100644 GIT binary patch delta 20 ccmZ3@w3>;9Y2BV>6Im3P-I+Z%s-!^Mr;=6Im3PZJF&is Date: Tue, 23 Feb 2021 13:23:22 +0100 Subject: [PATCH 07/27] test offline --- crypto/keyring/keyring.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 588ccc03d79e..319e982a284a 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -317,6 +317,20 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error } return nil } + + if keyType == TypeOffline { + pubKey, err := legacy.AminoPubKeyFromBytes(pubBytes) + if err != nil { + return err + } + + _, err = ks.writeOfflineKey(uid, &pubKey, hd.PubKeyType(algo)) + if err != nil { + return err + } + return nil + } + pubKey, err := legacy.PubKeyFromBytes(pubBytes) if err != nil { return err From 42682cec3a8e9879dba3f9a056249f80b024371d Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Tue, 23 Feb 2021 13:26:32 +0100 Subject: [PATCH 08/27] temp commit --- crypto/keyring/keyring.go | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 319e982a284a..5819a2e30178 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -305,40 +305,30 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error return err } - if keyType == TypeMulti { - pubKey, err := legacy.AminoPubKeyFromBytes(pubBytes) - if err != nil { - return err - } + pubKey, err := legacy.AminoPubKeyFromBytes(pubBytes) + if err != nil { + return err + } + if keyType == TypeMulti { _, err = ks.writeMultisigKey(uid, &pubKey) if err != nil { return err } - return nil } if keyType == TypeOffline { - pubKey, err := legacy.AminoPubKeyFromBytes(pubBytes) + _, err = ks.writeOfflineKey(uid, &pubKey, hd.PubKeyType(algo)) if err != nil { return err } + } - _, err = ks.writeOfflineKey(uid, &pubKey, hd.PubKeyType(algo)) + if keyType == TypeLedger { + _, err = ks.writeLedgerKey(uid, &pubKey, hd.PubKeyType(algo)) if err != nil { return err } - return nil - } - - pubKey, err := legacy.PubKeyFromBytes(pubBytes) - if err != nil { - return err - } - - _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) - if err != nil { - return err } return nil From 1afcbe36ec260ec15a3c90861a08ab36752ed4e6 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Tue, 23 Feb 2021 18:08:14 +0530 Subject: [PATCH 09/27] update ledger keys --- crypto/keyring/keyring.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 5819a2e30178..829c46744ae9 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -317,20 +317,13 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error } } - if keyType == TypeOffline { + if keyType == TypeOffline || keyType == TypeLedger { _, err = ks.writeOfflineKey(uid, &pubKey, hd.PubKeyType(algo)) if err != nil { return err } } - if keyType == TypeLedger { - _, err = ks.writeLedgerKey(uid, &pubKey, hd.PubKeyType(algo)) - if err != nil { - return err - } - } - return nil } From a34d140d88688d8946c2bc48bd2267c857fa965c Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Tue, 23 Feb 2021 15:20:06 +0000 Subject: [PATCH 10/27] Apply suggestions from code review --- types/address/hash.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/address/hash.go b/types/address/hash.go index 64b30226c047..8c0cddae02e6 100644 --- a/types/address/hash.go +++ b/types/address/hash.go @@ -67,8 +67,8 @@ func Module(moduleName string, key []byte) []byte { // unsafeStrToByteArray uses unsafe to convert string into byte array. Returned array // cannot be altered after this functions is called func unsafeStrToByteArray(s string) []byte { - sh := *(*reflect.SliceHeader)(unsafe.Pointer(&s)) // nolint + sh := *(*reflect.SliceHeader)(unsafe.Pointer(&s)) sh.Cap = sh.Len - bs := *(*[]byte)(unsafe.Pointer(&sh)) // nolint + bs := *(*[]byte)(unsafe.Pointer(&sh)) return bs } From a95da2500aa939070877107780cea659ce6b2c46 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Thu, 25 Feb 2021 18:26:22 +0100 Subject: [PATCH 11/27] Fix `keys migrate` command (#8703) * Add MigrateInfo in keyring. * Add password back for TypeLocal. * Add comment. --- client/keys/migrate.go | 23 +++++++++++++---------- codec/legacy/codec.go | 7 ------- crypto/keyring/keyring.go | 20 +++++++++++++++++--- 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index 0fe3582e3dfc..f304668e77f1 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -19,6 +19,8 @@ import ( // is not needed for importing into the Keyring keystore. const migratePassphrase = "NOOP_PASSPHRASE" +const flagOldHome = "old-home" + // MigrateCommand migrates key information from legacy keybase to OS secret store. func MigrateCommand() *cobra.Command { cmd := &cobra.Command{ @@ -35,16 +37,18 @@ It is recommended to run in 'dry-run' mode first to verify all key migration mat RunE: runMigrateCmd, } + cmd.Flags().String(flagOldHome, "", "The root directory of the old keyring") cmd.Flags().Bool(flags.FlagDryRun, false, "Run migration without actually persisting any changes to the new Keybase") return cmd } func runMigrateCmd(cmd *cobra.Command, args []string) error { + oldRootDir, _ := cmd.Flags().GetString(flagOldHome) rootDir, _ := cmd.Flags().GetString(flags.FlagHome) // instantiate legacy keybase var legacyKb keyring.LegacyKeybase - legacyKb, err := NewLegacyKeyBaseFromDir(rootDir) + legacyKb, err := NewLegacyKeyBaseFromDir(oldRootDir) if err != nil { return err } @@ -91,11 +95,11 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { return nil } - for _, key := range oldKeys { - keyName := key.GetName() - keyType := key.GetType() + for _, oldInfo := range oldKeys { + keyName := oldInfo.GetName() + keyType := oldInfo.GetType() - cmd.PrintErrf("Migrating key: '%s (%s)' ...\n", key.GetName(), keyType) + cmd.PrintErrf("Migrating key: '%s (%s)' ...\n", keyName, keyType) // allow user to skip migrating specific keys ok, err := input.GetConfirmation("Skip key migration?", buf, cmd.ErrOrStderr()) @@ -106,16 +110,14 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { continue } + // TypeLocal needs an additional step to ask password. + // The other keyring types are handled by MigrateInfo. if keyType != keyring.TypeLocal { - pubkeyArmor, err := legacyKb.ExportPubKey(keyName) + err = migrator.MigrateInfo(oldInfo) if err != nil { return err } - if err := migrator.ImportPubKey(keyName, pubkeyArmor, keyType); err != nil { - return err - } - continue } @@ -135,6 +137,7 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { if err := migrator.ImportPrivKey(keyName, armoredPriv, migratePassphrase); err != nil { return err } + } cmd.Print("Migration Complete") diff --git a/codec/legacy/codec.go b/codec/legacy/codec.go index 778600242611..5ec6b2976cab 100644 --- a/codec/legacy/codec.go +++ b/codec/legacy/codec.go @@ -3,7 +3,6 @@ package legacy import ( "github.com/cosmos/cosmos-sdk/codec" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) @@ -30,9 +29,3 @@ func PubKeyFromBytes(pubKeyBytes []byte) (pubKey cryptotypes.PubKey, err error) err = Cdc.UnmarshalBinaryBare(pubKeyBytes, &pubKey) return } - -// AminoPubKeyFromBytes unmarshals public key bytes and returns a PubKey -func AminoPubKeyFromBytes(pubKeyBytes []byte) (pubKey multisig.LegacyAminoPubKey, err error) { - err = Cdc.UnmarshalBinaryBare(pubKeyBytes, &pubKey) - return -} diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 829c46744ae9..0c5901dd6120 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -111,6 +111,11 @@ type Importer interface { // ImportPubKey imports ASCII armored public keys. ImportPubKey(uid string, armor string, keyType KeyType) error + + // MigrateInfo takes a keyring.Info (in practise, from an old keyring), and + // writes it to the current keyring. We use it to migrate Type{Multi,Ledger,Offline} + // keyring.Infos. + MigrateInfo(oldInfo Info) error } // Exporter is implemented by key stores that support export of public and private keys. @@ -305,20 +310,20 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error return err } - pubKey, err := legacy.AminoPubKeyFromBytes(pubBytes) + pubKey, err := legacy.PubKeyFromBytes(pubBytes) if err != nil { return err } if keyType == TypeMulti { - _, err = ks.writeMultisigKey(uid, &pubKey) + _, err = ks.writeMultisigKey(uid, pubKey) if err != nil { return err } } if keyType == TypeOffline || keyType == TypeLedger { - _, err = ks.writeOfflineKey(uid, &pubKey, hd.PubKeyType(algo)) + _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) if err != nil { return err } @@ -327,6 +332,15 @@ func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error return nil } +// MigrateInfo implements Importer.MigrateInfo. +func (ks keystore) MigrateInfo(oldInfo Info) error { + if _, err := ks.Key(oldInfo.GetName()); err == nil { + return fmt.Errorf("cannot overwrite key: %s", oldInfo.GetName()) + } + + return ks.writeInfo(oldInfo) +} + func (ks keystore) Sign(uid string, msg []byte) ([]byte, types.PubKey, error) { info, err := ks.Key(uid) if err != nil { From eb03b8fac9fe4535e99d43f0e4b7a196458770d4 Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Fri, 26 Feb 2021 08:24:50 +0100 Subject: [PATCH 12/27] Jonathan/remove unused import pub (#8704) * remove unused import pub * fix comment * Update crypto/keyring/keyring.go Co-authored-by: Alessio Treglia Co-authored-by: Alessio Treglia --- client/keys/migrate.go | 4 +- crypto/keyring/keyring.go | 71 +-------- crypto/keyring/keyring_test.go | 256 +-------------------------------- go.sum | 19 --- 4 files changed, 9 insertions(+), 341 deletions(-) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index f304668e77f1..d4f9b8c2077d 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -111,9 +111,9 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { } // TypeLocal needs an additional step to ask password. - // The other keyring types are handled by MigrateInfo. + // The other keyring types are handled by ImportInfo. if keyType != keyring.TypeLocal { - err = migrator.MigrateInfo(oldInfo) + err = migrator.ImportInfo(oldInfo) if err != nil { return err } diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 98c5284dc9b8..4b2fd87d3654 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -112,22 +112,15 @@ type Importer interface { // ImportPrivKey imports ASCII armored passphrase-encrypted private keys. ImportPrivKey(uid, armor, passphrase string) error - // ImportPubKey imports ASCII armored public keys. - ImportPubKey(uid string, armor string, keyType KeyType) error - - // MigrateInfo takes a keyring.Info (in practise, from an old keyring), and + // ImportInfo MigrateInfo takes a keyring.Info (in practise, from an old keyring), and // writes it to the current keyring. We use it to migrate Type{Multi,Ledger,Offline} // keyring.Infos. - MigrateInfo(oldInfo Info) error + ImportInfo(oldInfo Info) error } -// Exporter is implemented by key stores that support export of public and private keys. +// Exporter is implemented by key stores that support export of private keys. type Exporter interface { - // Export public key - ExportPubKeyArmor(uid string) (string, error) - ExportPubKeyArmorByAddress(address sdk.Address) (string, error) - - // ExportPrivKey returns a private key in ASCII armored format. + // ExportPrivKeyArmor returns a private key in ASCII armored format. // It returns an error if the key does not exist or a wrong encryption passphrase is supplied. ExportPrivKeyArmor(uid, encryptPassphrase string) (armor string, err error) ExportPrivKeyArmorByAddress(address sdk.Address, encryptPassphrase string) (armor string, err error) @@ -212,28 +205,6 @@ func newKeystore(kr keyring.Keyring, opts ...Option) keystore { return keystore{kr, options} } -func (ks keystore) ExportPubKeyArmor(uid string) (string, error) { - bz, err := ks.Key(uid) - if err != nil { - return "", err - } - - if bz == nil { - return "", fmt.Errorf("no key to export with name: %s", uid) - } - - return crypto.ArmorPubKeyBytes(legacy.Cdc.MustMarshalBinaryBare(bz.GetPubKey()), string(bz.GetAlgo())), nil -} - -func (ks keystore) ExportPubKeyArmorByAddress(address sdk.Address) (string, error) { - info, err := ks.KeyByAddress(address) - if err != nil { - return "", err - } - - return ks.ExportPubKeyArmor(info.GetName()) -} - func (ks keystore) ExportPrivKeyArmor(uid, encryptPassphrase string) (armor string, err error) { priv, err := ks.ExportPrivateKeyObject(uid) if err != nil { @@ -303,40 +274,8 @@ func (ks keystore) ImportPrivKey(uid, armor, passphrase string) error { return nil } -func (ks keystore) ImportPubKey(uid string, armor string, keyType KeyType) error { - if _, err := ks.Key(uid); err == nil { - return fmt.Errorf("cannot overwrite key: %s", uid) - } - - pubBytes, algo, err := crypto.UnarmorPubKeyBytes(armor) - if err != nil { - return err - } - - pubKey, err := legacy.PubKeyFromBytes(pubBytes) - if err != nil { - return err - } - - if keyType == TypeMulti { - _, err = ks.writeMultisigKey(uid, pubKey) - if err != nil { - return err - } - } - - if keyType == TypeOffline || keyType == TypeLedger { - _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) - if err != nil { - return err - } - } - - return nil -} - // MigrateInfo implements Importer.MigrateInfo. -func (ks keystore) MigrateInfo(oldInfo Info) error { +func (ks keystore) ImportInfo(oldInfo Info) error { if _, err := ks.Key(oldInfo.GetName()); err == nil { return fmt.Errorf("cannot overwrite key: %s", oldInfo.GetName()) } diff --git a/crypto/keyring/keyring_test.go b/crypto/keyring/keyring_test.go index fb288e42287d..d23c1aaf252f 100644 --- a/crypto/keyring/keyring_test.go +++ b/crypto/keyring/keyring_test.go @@ -134,7 +134,7 @@ func TestSignVerifyKeyRing(t *testing.T) { require.NoError(t, err) algo := hd.Secp256k1 - n1, n2, n3 := "some dude", "a dudette", "dude-ish" + n1, n2 := "some dude", "a dudette" // create two users and get their info i1, _, err := kb.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) @@ -146,7 +146,6 @@ func TestSignVerifyKeyRing(t *testing.T) { // let's try to sign some messages d1 := []byte("my first message") d2 := []byte("some other important info!") - d3 := []byte("feels like I forgot something...") // try signing both data with both .. s11, pub1, err := kb.Sign(n1, d1) @@ -188,21 +187,6 @@ func TestSignVerifyKeyRing(t *testing.T) { valid := tc.key.VerifySignature(tc.data, tc.sig) require.Equal(t, tc.valid, valid, "%d", i) } - - // Now try to sign data with a secret-less key - // Import a public key - armor, err := kb.ExportPubKeyArmor(n2) - require.NoError(t, err) - require.NoError(t, kb.Delete(n2)) - - require.NoError(t, kb.ImportPubKey(n3, armor, TypeLocal)) - i3, err := kb.Key(n3) - require.NoError(t, err) - require.Equal(t, i3.GetName(), n3) - - _, _, err = kb.Sign(n3, d3) - require.Error(t, err) - require.Equal(t, "cannot sign with offline keys", err.Error()) } func TestExportImportKeyRing(t *testing.T) { @@ -237,79 +221,6 @@ func TestExportImportKeyRing(t *testing.T) { require.Equal(t, john.GetType(), john2.GetType()) } -func TestExportImportPubKeyKeyRing(t *testing.T) { - kb, err := New("keybasename", "test", t.TempDir(), nil) - require.NoError(t, err) - algo := hd.Secp256k1 - - // CreateMnemonic a private-public key pair and ensure consistency - info, _, err := kb.NewMnemonic("john", English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) - require.Nil(t, err) - require.NotEqual(t, info, "") - require.Equal(t, info.GetName(), "john") - addr := info.GetPubKey().Address() - john, err := kb.Key("john") - require.NoError(t, err) - require.Equal(t, john.GetName(), "john") - require.Equal(t, john.GetPubKey().Address(), addr) - - // Export the public key only - armor, err := kb.ExportPubKeyArmor("john") - require.NoError(t, err) - err = kb.Delete("john") - require.NoError(t, err) - - // Import it under a different name - err = kb.ImportPubKey("john-pubkey-only", armor, TypeLocal) - require.NoError(t, err) - - // Ensure consistency - john2, err := kb.Key("john-pubkey-only") - require.NoError(t, err) - - // Compare the public keys - require.True(t, john.GetPubKey().Equals(john2.GetPubKey())) - - // Ensure keys cannot be overwritten - err = kb.ImportPubKey("john-pubkey-only", armor, TypeLocal) - require.NotNil(t, err) -} - -func TestAdvancedKeyManagementKeyRing(t *testing.T) { - dir := t.TempDir() - - kb, err := New("keybasename", "test", dir, nil) - require.NoError(t, err) - - algo := hd.Secp256k1 - n1, n2 := "old-name", "new name" - - // make sure key works with initial password - _, _, err = kb.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) - require.Nil(t, err, "%+v", err) - - _, err = kb.ExportPubKeyArmor(n1 + ".notreal") - require.NotNil(t, err) - _, err = kb.ExportPubKeyArmor(" " + n1) - require.NotNil(t, err) - _, err = kb.ExportPubKeyArmor(n1 + " ") - require.NotNil(t, err) - _, err = kb.ExportPubKeyArmor("") - require.NotNil(t, err) - exported, err := kb.ExportPubKeyArmor(n1) - require.Nil(t, err, "%+v", err) - err = kb.Delete(n1) - require.NoError(t, err) - - // import succeeds - err = kb.ImportPubKey(n2, exported, TypeLocal) - require.NoError(t, err) - - // second import fails - err = kb.ImportPubKey(n2, exported, TypeLocal) - require.NotNil(t, err) -} - func TestSeedPhraseKeyRing(t *testing.T) { dir := t.TempDir() @@ -489,7 +400,7 @@ func TestInMemorySignVerify(t *testing.T) { cstore := NewInMemory() algo := hd.Secp256k1 - n1, n2, n3 := "some dude", "a dudette", "dude-ish" + n1, n2 := "some dude", "a dudette" // create two users and get their info i1, _, err := cstore.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) @@ -501,7 +412,6 @@ func TestInMemorySignVerify(t *testing.T) { // let's try to sign some messages d1 := []byte("my first message") d2 := []byte("some other important info!") - d3 := []byte("feels like I forgot something...") // try signing both data with both .. s11, pub1, err := cstore.Sign(n1, d1) @@ -543,54 +453,6 @@ func TestInMemorySignVerify(t *testing.T) { valid := tc.key.VerifySignature(tc.data, tc.sig) require.Equal(t, tc.valid, valid, "%d", i) } - - // Import a public key - armor, err := cstore.ExportPubKeyArmor(n2) - require.Nil(t, err) - err = cstore.Delete(n2) - require.NoError(t, err) - err = cstore.ImportPubKey(n3, armor, TypeLocal) - require.NoError(t, err) - i3, err := cstore.Key(n3) - require.NoError(t, err) - require.Equal(t, i3.GetName(), n3) - - // Now try to sign data with a secret-less key - _, _, err = cstore.Sign(n3, d3) - require.Error(t, err) - require.Equal(t, "cannot sign with offline keys", err.Error()) -} - -// TestInMemoryExportImport tests exporting and importing -func TestInMemoryExportImport(t *testing.T) { - // make the storage with reasonable defaults - cstore := NewInMemory() - - info, _, err := cstore.NewMnemonic("john", English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) - require.NoError(t, err) - require.Equal(t, info.GetName(), "john") - - john, err := cstore.Key("john") - require.NoError(t, err) - require.Equal(t, info.GetName(), "john") - johnAddr := info.GetPubKey().Address() - - armor, err := cstore.ExportPubKeyArmor("john") - require.NoError(t, err) - err = cstore.Delete("john") - require.NoError(t, err) - - err = cstore.ImportPubKey("john2", armor, TypeLocal) - require.NoError(t, err) - - john2, err := cstore.Key("john2") - require.NoError(t, err) - - require.Equal(t, john.GetPubKey().Address(), johnAddr) - require.Equal(t, john.GetName(), "john") - require.Equal(t, john.GetAddress(), john2.GetAddress()) - require.Equal(t, john.GetAlgo(), john2.GetAlgo()) - require.Equal(t, john.GetPubKey(), john2.GetPubKey()) } func TestInMemoryExportImportPrivKey(t *testing.T) { @@ -619,76 +481,6 @@ func TestInMemoryExportImportPrivKey(t *testing.T) { require.True(t, priv1.GetPubKey().Equals(priv2.GetPubKey())) } -func TestInMemoryExportImportPubKey(t *testing.T) { - // make the storage with reasonable defaults - cstore := NewInMemory() - - // CreateMnemonic a private-public key pair and ensure consistency - info, _, err := cstore.NewMnemonic("john", English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) - require.Nil(t, err) - require.NotEqual(t, info, "") - require.Equal(t, info.GetName(), "john") - addr := info.GetPubKey().Address() - john, err := cstore.Key("john") - require.NoError(t, err) - require.Equal(t, john.GetName(), "john") - require.Equal(t, john.GetPubKey().Address(), addr) - - // Export the public key only - armor, err := cstore.ExportPubKeyArmor("john") - require.NoError(t, err) - err = cstore.Delete("john") - require.NoError(t, err) - - // Import it under a different name - err = cstore.ImportPubKey("john-pubkey-only", armor, TypeLocal) - require.NoError(t, err) - // Ensure consistency - john2, err := cstore.Key("john-pubkey-only") - require.NoError(t, err) - // Compare the public keys - require.True(t, john.GetPubKey().Equals(john2.GetPubKey())) - - // Ensure keys cannot be overwritten - err = cstore.ImportPubKey("john-pubkey-only", armor, TypeLocal) - require.NotNil(t, err) -} - -// TestInMemoryAdvancedKeyManagement verifies update, import, export functionality -func TestInMemoryAdvancedKeyManagement(t *testing.T) { - // make the storage with reasonable defaults - cstore := NewInMemory() - - algo := hd.Secp256k1 - n1, n2 := "old-name", "new name" - - // make sure key works with initial password - _, _, err := cstore.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) - require.Nil(t, err, "%+v", err) - - // exporting requires the proper name and passphrase - _, err = cstore.ExportPubKeyArmor(n1 + ".notreal") - require.NotNil(t, err) - _, err = cstore.ExportPubKeyArmor(" " + n1) - require.NotNil(t, err) - _, err = cstore.ExportPubKeyArmor(n1 + " ") - require.NotNil(t, err) - _, err = cstore.ExportPubKeyArmor("") - require.NotNil(t, err) - exported, err := cstore.ExportPubKeyArmor(n1) - require.Nil(t, err, "%+v", err) - err = cstore.Delete(n1) - require.NoError(t, err) - - // import succeeds - err = cstore.ImportPubKey(n2, exported, TypeLocal) - require.NoError(t, err) - - // second import fails - err = cstore.ImportPubKey(n2, exported, TypeLocal) - require.NotNil(t, err) -} - // TestInMemorySeedPhrase verifies restoring from a seed phrase func TestInMemorySeedPhrase(t *testing.T) { // make the storage with reasonable defaults @@ -1049,50 +841,6 @@ func TestAltKeyring_ImportExportPrivKey_ByAddress(t *testing.T) { require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) } -func TestAltKeyring_ImportExportPubKey(t *testing.T) { - keyring, err := New(t.Name(), BackendTest, t.TempDir(), nil) - require.NoError(t, err) - - uid := theID - _, _, err = keyring.NewMnemonic(uid, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) - require.NoError(t, err) - - armor, err := keyring.ExportPubKeyArmor(uid) - require.NoError(t, err) - err = keyring.Delete(uid) - require.NoError(t, err) - - newUID := otherID - err = keyring.ImportPubKey(newUID, armor, TypeLocal) - require.NoError(t, err) - - // Should fail importing private key on existing key. - err = keyring.ImportPubKey(newUID, armor, TypeLocal) - require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) -} - -func TestAltKeyring_ImportExportPubKey_ByAddress(t *testing.T) { - keyring, err := New(t.Name(), BackendTest, t.TempDir(), nil) - require.NoError(t, err) - - uid := theID - mnemonic, _, err := keyring.NewMnemonic(uid, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) - require.NoError(t, err) - - armor, err := keyring.ExportPubKeyArmorByAddress(mnemonic.GetAddress()) - require.NoError(t, err) - err = keyring.Delete(uid) - require.NoError(t, err) - - newUID := otherID - err = keyring.ImportPubKey(newUID, armor, TypeLocal) - require.NoError(t, err) - - // Should fail importing private key on existing key. - err = keyring.ImportPubKey(newUID, armor, TypeLocal) - require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) -} - func TestAltKeyring_UnsafeExportPrivKeyHex(t *testing.T) { keyring, err := New(t.Name(), BackendTest, t.TempDir(), nil) require.NoError(t, err) diff --git a/go.sum b/go.sum index bf6adda80984..32b2d2e2883b 100644 --- a/go.sum +++ b/go.sum @@ -25,7 +25,6 @@ github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxB github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= @@ -176,9 +175,7 @@ github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaB github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 h1:2vLKys4RBU4pn2T/hjXMbvwTr1Cvy5THHrQkbeY9HRk= github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25/go.mod h1:hTr8+TLQmkUkgcuh3mcr5fjrT9c64ZzsBCdCEC6UppY= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.9.23 h1:SIKhg/z4Q7AbvqcxuPYvMxf36che/Rq/Pp0IdYEkbtw= github.com/ethereum/go-ethereum v1.9.23/go.mod h1:JIfVb6esrqALTExdz9hRYvrP0xBDf6wCncIu1hNwHpM= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51 h1:0JZ+dUmQeA8IIVUMzysrX4/AKuQwWhV2dYQuPZdvdSQ= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= @@ -273,12 +270,10 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa h1:Q75Upo5UN4JbPFURXZ8nLKYUvF85dyFRop/vQ0Rv+64= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -287,7 +282,6 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= @@ -312,7 +306,6 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-middleware v1.2.1/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2 h1:FlFbCRLd5Jr4iYXZufAvgWN6Ao0JrI5chLINnUXDDr0= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -375,7 +368,6 @@ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= @@ -400,7 +392,6 @@ github.com/kkdai/bstream v1.0.0/go.mod h1:FDnDOHt5Yx4p3FaHcioFT0QjDOtgUpvjeZqAs+ github.com/klauspost/compress v1.10.3 h1:OP96hzwJVBIHYU52pVTI6CczrxPvrGfgqF9N5eTO0Q8= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -452,7 +443,6 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8= github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -544,7 +534,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.8.0 h1:zvJNkoCFAnYFNC24FV8nW4JdRJ3GIFcLbg65lL/JDcw= github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= @@ -600,7 +589,6 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sasha-s/go-deadlock v0.2.0 h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y= github.com/sasha-s/go-deadlock v0.2.0/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= @@ -609,7 +597,6 @@ github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -630,7 +617,6 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= @@ -659,7 +645,6 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -683,7 +668,6 @@ github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESx github.com/tendermint/tendermint v0.34.8 h1:PMWgUx47FrNTsfhxCWzoiIlVAC1SE9+WBlnsF9oQW0I= github.com/tendermint/tendermint v0.34.8/go.mod h1:JVuu3V1ZexOaZG8VJMRl8lnfrGw6hEB2TVnoUwKRbss= github.com/tendermint/tm-db v0.6.2/go.mod h1:GYtQ67SUvATOcoY8/+x6ylk8Qo02BQyLrAs+yAcLvGI= -github.com/tendermint/tm-db v0.6.3 h1:ZkhQcKnB8/2jr5EaZwGndN4owkPsGezW2fSisS9zGbg= github.com/tendermint/tm-db v0.6.3/go.mod h1:lfA1dL9/Y/Y8wwyPp2NMLyn5P5Ptr/gvDFNWtrCWSf8= github.com/tendermint/tm-db v0.6.4 h1:3N2jlnYQkXNQclQwd/eKV/NzlqPlfK21cpRRIx80XXQ= github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= @@ -862,7 +846,6 @@ golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e h1:AyodaIpKjppX+cBfTASF2E1US3H2JFBj920Ot3rtDjs= golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -961,7 +944,6 @@ gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qS gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.61.0 h1:LBCdW4FmFYL4s/vDZD1RQYX7oAR6IjujCYgMdbHBR10= gopkg.in/ini.v1 v1.61.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= @@ -982,7 +964,6 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 9e8e55d69022b35c3f72f51ced568bc9931ee73c Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 26 Feb 2021 13:41:48 +0530 Subject: [PATCH 13/27] update godoc --- crypto/keyring/keyring.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 4b2fd87d3654..8f6e21bae4a1 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -112,7 +112,7 @@ type Importer interface { // ImportPrivKey imports ASCII armored passphrase-encrypted private keys. ImportPrivKey(uid, armor, passphrase string) error - // ImportInfo MigrateInfo takes a keyring.Info (in practise, from an old keyring), and + // ImportInfo takes a keyring.Info (in practise, from an old keyring), and // writes it to the current keyring. We use it to migrate Type{Multi,Ledger,Offline} // keyring.Infos. ImportInfo(oldInfo Info) error @@ -274,7 +274,7 @@ func (ks keystore) ImportPrivKey(uid, armor, passphrase string) error { return nil } -// MigrateInfo implements Importer.MigrateInfo. +// ImportInfo implements Importer.MigrateInfo. func (ks keystore) ImportInfo(oldInfo Info) error { if _, err := ks.Key(oldInfo.GetName()); err == nil { return fmt.Errorf("cannot overwrite key: %s", oldInfo.GetName()) From 5168b5375363afab33b0fc8e649d8ac01b8ef68d Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 26 Feb 2021 15:26:56 +0530 Subject: [PATCH 14/27] revert api breaking changes --- crypto/keyring/keyring.go | 53 +++++++ crypto/keyring/keyring_test.go | 256 ++++++++++++++++++++++++++++++++- 2 files changed, 307 insertions(+), 2 deletions(-) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 8f6e21bae4a1..60d7efcbb50f 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -112,6 +112,9 @@ type Importer interface { // ImportPrivKey imports ASCII armored passphrase-encrypted private keys. ImportPrivKey(uid, armor, passphrase string) error + // ImportPubKey imports ASCII armored public keys. + ImportPubKey(uid string, armor string) error + // ImportInfo takes a keyring.Info (in practise, from an old keyring), and // writes it to the current keyring. We use it to migrate Type{Multi,Ledger,Offline} // keyring.Infos. @@ -120,6 +123,11 @@ type Importer interface { // Exporter is implemented by key stores that support export of private keys. type Exporter interface { + // Export public key + ExportPubKeyArmor(uid string) (string, error) + ExportPubKeyArmorByAddress(address sdk.Address) (string, error) + + // ExportPrivKey returns a private key in ASCII armored format. // ExportPrivKeyArmor returns a private key in ASCII armored format. // It returns an error if the key does not exist or a wrong encryption passphrase is supplied. ExportPrivKeyArmor(uid, encryptPassphrase string) (armor string, err error) @@ -205,6 +213,51 @@ func newKeystore(kr keyring.Keyring, opts ...Option) keystore { return keystore{kr, options} } +func (ks keystore) ImportPubKey(uid string, armor string) error { + if _, err := ks.Key(uid); err == nil { + return fmt.Errorf("cannot overwrite key: %s", uid) + } + + pubBytes, algo, err := crypto.UnarmorPubKeyBytes(armor) + if err != nil { + return err + } + + pubKey, err := legacy.PubKeyFromBytes(pubBytes) + if err != nil { + return err + } + + _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) + if err != nil { + return err + } + + return nil +} + +func (ks keystore) ExportPubKeyArmor(uid string) (string, error) { + bz, err := ks.Key(uid) + if err != nil { + return "", err + } + + if bz == nil { + return "", fmt.Errorf("no key to export with name: %s", uid) + } + + return crypto.ArmorPubKeyBytes(legacy.Cdc.MustMarshalBinaryBare(bz.GetPubKey()), string(bz.GetAlgo())), nil +} + +func (ks keystore) ExportPubKeyArmorByAddress(address sdk.Address) (string, error) { + info, err := ks.KeyByAddress(address) + if err != nil { + return "", err + } + + return ks.ExportPubKeyArmor(info.GetName()) +} + func (ks keystore) ExportPrivKeyArmor(uid, encryptPassphrase string) (armor string, err error) { priv, err := ks.ExportPrivateKeyObject(uid) if err != nil { diff --git a/crypto/keyring/keyring_test.go b/crypto/keyring/keyring_test.go index d23c1aaf252f..c9f387e78e41 100644 --- a/crypto/keyring/keyring_test.go +++ b/crypto/keyring/keyring_test.go @@ -134,7 +134,7 @@ func TestSignVerifyKeyRing(t *testing.T) { require.NoError(t, err) algo := hd.Secp256k1 - n1, n2 := "some dude", "a dudette" + n1, n2, n3 := "some dude", "a dudette", "dude-ish" // create two users and get their info i1, _, err := kb.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) @@ -146,6 +146,7 @@ func TestSignVerifyKeyRing(t *testing.T) { // let's try to sign some messages d1 := []byte("my first message") d2 := []byte("some other important info!") + d3 := []byte("feels like I forgot something...") // try signing both data with both .. s11, pub1, err := kb.Sign(n1, d1) @@ -187,6 +188,21 @@ func TestSignVerifyKeyRing(t *testing.T) { valid := tc.key.VerifySignature(tc.data, tc.sig) require.Equal(t, tc.valid, valid, "%d", i) } + + // Now try to sign data with a secret-less key + // Import a public key + armor, err := kb.ExportPubKeyArmor(n2) + require.NoError(t, err) + require.NoError(t, kb.Delete(n2)) + + require.NoError(t, kb.ImportPubKey(n3, armor)) + i3, err := kb.Key(n3) + require.NoError(t, err) + require.Equal(t, i3.GetName(), n3) + + _, _, err = kb.Sign(n3, d3) + require.Error(t, err) + require.Equal(t, "cannot sign with offline keys", err.Error()) } func TestExportImportKeyRing(t *testing.T) { @@ -221,6 +237,79 @@ func TestExportImportKeyRing(t *testing.T) { require.Equal(t, john.GetType(), john2.GetType()) } +func TestExportImportPubKeyKeyRing(t *testing.T) { + kb, err := New("keybasename", "test", t.TempDir(), nil) + require.NoError(t, err) + algo := hd.Secp256k1 + + // CreateMnemonic a private-public key pair and ensure consistency + info, _, err := kb.NewMnemonic("john", English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) + require.Nil(t, err) + require.NotEqual(t, info, "") + require.Equal(t, info.GetName(), "john") + addr := info.GetPubKey().Address() + john, err := kb.Key("john") + require.NoError(t, err) + require.Equal(t, john.GetName(), "john") + require.Equal(t, john.GetPubKey().Address(), addr) + + // Export the public key only + armor, err := kb.ExportPubKeyArmor("john") + require.NoError(t, err) + err = kb.Delete("john") + require.NoError(t, err) + + // Import it under a different name + err = kb.ImportPubKey("john-pubkey-only", armor) + require.NoError(t, err) + + // Ensure consistency + john2, err := kb.Key("john-pubkey-only") + require.NoError(t, err) + + // Compare the public keys + require.True(t, john.GetPubKey().Equals(john2.GetPubKey())) + + // Ensure keys cannot be overwritten + err = kb.ImportPubKey("john-pubkey-only", armor) + require.NotNil(t, err) +} + +func TestAdvancedKeyManagementKeyRing(t *testing.T) { + dir := t.TempDir() + + kb, err := New("keybasename", "test", dir, nil) + require.NoError(t, err) + + algo := hd.Secp256k1 + n1, n2 := "old-name", "new name" + + // make sure key works with initial password + _, _, err = kb.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) + require.Nil(t, err, "%+v", err) + + _, err = kb.ExportPubKeyArmor(n1 + ".notreal") + require.NotNil(t, err) + _, err = kb.ExportPubKeyArmor(" " + n1) + require.NotNil(t, err) + _, err = kb.ExportPubKeyArmor(n1 + " ") + require.NotNil(t, err) + _, err = kb.ExportPubKeyArmor("") + require.NotNil(t, err) + exported, err := kb.ExportPubKeyArmor(n1) + require.Nil(t, err, "%+v", err) + err = kb.Delete(n1) + require.NoError(t, err) + + // import succeeds + err = kb.ImportPubKey(n2, exported) + require.NoError(t, err) + + // second import fails + err = kb.ImportPubKey(n2, exported) + require.NotNil(t, err) +} + func TestSeedPhraseKeyRing(t *testing.T) { dir := t.TempDir() @@ -400,7 +489,7 @@ func TestInMemorySignVerify(t *testing.T) { cstore := NewInMemory() algo := hd.Secp256k1 - n1, n2 := "some dude", "a dudette" + n1, n2, n3 := "some dude", "a dudette", "dude-ish" // create two users and get their info i1, _, err := cstore.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) @@ -412,6 +501,7 @@ func TestInMemorySignVerify(t *testing.T) { // let's try to sign some messages d1 := []byte("my first message") d2 := []byte("some other important info!") + d3 := []byte("feels like I forgot something...") // try signing both data with both .. s11, pub1, err := cstore.Sign(n1, d1) @@ -453,6 +543,54 @@ func TestInMemorySignVerify(t *testing.T) { valid := tc.key.VerifySignature(tc.data, tc.sig) require.Equal(t, tc.valid, valid, "%d", i) } + + // Import a public key + armor, err := cstore.ExportPubKeyArmor(n2) + require.Nil(t, err) + err = cstore.Delete(n2) + require.NoError(t, err) + err = cstore.ImportPubKey(n3, armor) + require.NoError(t, err) + i3, err := cstore.Key(n3) + require.NoError(t, err) + require.Equal(t, i3.GetName(), n3) + + // Now try to sign data with a secret-less key + _, _, err = cstore.Sign(n3, d3) + require.Error(t, err) + require.Equal(t, "cannot sign with offline keys", err.Error()) +} + +// TestInMemoryExportImport tests exporting and importing +func TestInMemoryExportImport(t *testing.T) { + // make the storage with reasonable defaults + cstore := NewInMemory() + + info, _, err := cstore.NewMnemonic("john", English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) + require.NoError(t, err) + require.Equal(t, info.GetName(), "john") + + john, err := cstore.Key("john") + require.NoError(t, err) + require.Equal(t, info.GetName(), "john") + johnAddr := info.GetPubKey().Address() + + armor, err := cstore.ExportPubKeyArmor("john") + require.NoError(t, err) + err = cstore.Delete("john") + require.NoError(t, err) + + err = cstore.ImportPubKey("john2", armor) + require.NoError(t, err) + + john2, err := cstore.Key("john2") + require.NoError(t, err) + + require.Equal(t, john.GetPubKey().Address(), johnAddr) + require.Equal(t, john.GetName(), "john") + require.Equal(t, john.GetAddress(), john2.GetAddress()) + require.Equal(t, john.GetAlgo(), john2.GetAlgo()) + require.Equal(t, john.GetPubKey(), john2.GetPubKey()) } func TestInMemoryExportImportPrivKey(t *testing.T) { @@ -481,6 +619,76 @@ func TestInMemoryExportImportPrivKey(t *testing.T) { require.True(t, priv1.GetPubKey().Equals(priv2.GetPubKey())) } +func TestInMemoryExportImportPubKey(t *testing.T) { + // make the storage with reasonable defaults + cstore := NewInMemory() + + // CreateMnemonic a private-public key pair and ensure consistency + info, _, err := cstore.NewMnemonic("john", English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) + require.Nil(t, err) + require.NotEqual(t, info, "") + require.Equal(t, info.GetName(), "john") + addr := info.GetPubKey().Address() + john, err := cstore.Key("john") + require.NoError(t, err) + require.Equal(t, john.GetName(), "john") + require.Equal(t, john.GetPubKey().Address(), addr) + + // Export the public key only + armor, err := cstore.ExportPubKeyArmor("john") + require.NoError(t, err) + err = cstore.Delete("john") + require.NoError(t, err) + + // Import it under a different name + err = cstore.ImportPubKey("john-pubkey-only", armor) + require.NoError(t, err) + // Ensure consistency + john2, err := cstore.Key("john-pubkey-only") + require.NoError(t, err) + // Compare the public keys + require.True(t, john.GetPubKey().Equals(john2.GetPubKey())) + + // Ensure keys cannot be overwritten + err = cstore.ImportPubKey("john-pubkey-only", armor) + require.NotNil(t, err) +} + +// TestInMemoryAdvancedKeyManagement verifies update, import, export functionality +func TestInMemoryAdvancedKeyManagement(t *testing.T) { + // make the storage with reasonable defaults + cstore := NewInMemory() + + algo := hd.Secp256k1 + n1, n2 := "old-name", "new name" + + // make sure key works with initial password + _, _, err := cstore.NewMnemonic(n1, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, algo) + require.Nil(t, err, "%+v", err) + + // exporting requires the proper name and passphrase + _, err = cstore.ExportPubKeyArmor(n1 + ".notreal") + require.NotNil(t, err) + _, err = cstore.ExportPubKeyArmor(" " + n1) + require.NotNil(t, err) + _, err = cstore.ExportPubKeyArmor(n1 + " ") + require.NotNil(t, err) + _, err = cstore.ExportPubKeyArmor("") + require.NotNil(t, err) + exported, err := cstore.ExportPubKeyArmor(n1) + require.Nil(t, err, "%+v", err) + err = cstore.Delete(n1) + require.NoError(t, err) + + // import succeeds + err = cstore.ImportPubKey(n2, exported) + require.NoError(t, err) + + // second import fails + err = cstore.ImportPubKey(n2, exported) + require.NotNil(t, err) +} + // TestInMemorySeedPhrase verifies restoring from a seed phrase func TestInMemorySeedPhrase(t *testing.T) { // make the storage with reasonable defaults @@ -841,6 +1049,50 @@ func TestAltKeyring_ImportExportPrivKey_ByAddress(t *testing.T) { require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) } +func TestAltKeyring_ImportExportPubKey(t *testing.T) { + keyring, err := New(t.Name(), BackendTest, t.TempDir(), nil) + require.NoError(t, err) + + uid := theID + _, _, err = keyring.NewMnemonic(uid, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) + require.NoError(t, err) + + armor, err := keyring.ExportPubKeyArmor(uid) + require.NoError(t, err) + err = keyring.Delete(uid) + require.NoError(t, err) + + newUID := otherID + err = keyring.ImportPubKey(newUID, armor) + require.NoError(t, err) + + // Should fail importing private key on existing key. + err = keyring.ImportPubKey(newUID, armor) + require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) +} + +func TestAltKeyring_ImportExportPubKey_ByAddress(t *testing.T) { + keyring, err := New(t.Name(), BackendTest, t.TempDir(), nil) + require.NoError(t, err) + + uid := theID + mnemonic, _, err := keyring.NewMnemonic(uid, English, sdk.FullFundraiserPath, DefaultBIP39Passphrase, hd.Secp256k1) + require.NoError(t, err) + + armor, err := keyring.ExportPubKeyArmorByAddress(mnemonic.GetAddress()) + require.NoError(t, err) + err = keyring.Delete(uid) + require.NoError(t, err) + + newUID := otherID + err = keyring.ImportPubKey(newUID, armor) + require.NoError(t, err) + + // Should fail importing private key on existing key. + err = keyring.ImportPubKey(newUID, armor) + require.EqualError(t, err, fmt.Sprintf("cannot overwrite key: %s", newUID)) +} + func TestAltKeyring_UnsafeExportPrivKeyHex(t *testing.T) { keyring, err := New(t.Name(), BackendTest, t.TempDir(), nil) require.NoError(t, err) From b53bc9ef7234fc9f22253ed0aea46b05470c9081 Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 26 Feb 2021 15:30:54 +0530 Subject: [PATCH 15/27] update docs --- crypto/keyring/keyring.go | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 60d7efcbb50f..c7b6b44f173c 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -107,7 +107,7 @@ type Signer interface { SignByAddress(address sdk.Address, msg []byte) ([]byte, types.PubKey, error) } -// Importer is implemented by key stores that support import of public and private keys. +// Importer is implemented by key stores that support import of info, public and private keys. type Importer interface { // ImportPrivKey imports ASCII armored passphrase-encrypted private keys. ImportPrivKey(uid, armor, passphrase string) error @@ -121,7 +121,7 @@ type Importer interface { ImportInfo(oldInfo Info) error } -// Exporter is implemented by key stores that support export of private keys. +// Exporter is implemented by key stores that support export of public and private keys. type Exporter interface { // Export public key ExportPubKeyArmor(uid string) (string, error) @@ -213,29 +213,6 @@ func newKeystore(kr keyring.Keyring, opts ...Option) keystore { return keystore{kr, options} } -func (ks keystore) ImportPubKey(uid string, armor string) error { - if _, err := ks.Key(uid); err == nil { - return fmt.Errorf("cannot overwrite key: %s", uid) - } - - pubBytes, algo, err := crypto.UnarmorPubKeyBytes(armor) - if err != nil { - return err - } - - pubKey, err := legacy.PubKeyFromBytes(pubBytes) - if err != nil { - return err - } - - _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) - if err != nil { - return err - } - - return nil -} - func (ks keystore) ExportPubKeyArmor(uid string) (string, error) { bz, err := ks.Key(uid) if err != nil { @@ -327,6 +304,29 @@ func (ks keystore) ImportPrivKey(uid, armor, passphrase string) error { return nil } +func (ks keystore) ImportPubKey(uid string, armor string) error { + if _, err := ks.Key(uid); err == nil { + return fmt.Errorf("cannot overwrite key: %s", uid) + } + + pubBytes, algo, err := crypto.UnarmorPubKeyBytes(armor) + if err != nil { + return err + } + + pubKey, err := legacy.PubKeyFromBytes(pubBytes) + if err != nil { + return err + } + + _, err = ks.writeOfflineKey(uid, pubKey, hd.PubKeyType(algo)) + if err != nil { + return err + } + + return nil +} + // ImportInfo implements Importer.MigrateInfo. func (ks keystore) ImportInfo(oldInfo Info) error { if _, err := ks.Key(oldInfo.GetName()); err == nil { From 5a048ab661b57c5db2fb1a23e80c6d84ea990ace Mon Sep 17 00:00:00 2001 From: sahith-narahari Date: Fri, 26 Feb 2021 15:38:14 +0530 Subject: [PATCH 16/27] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a3ce60607a6..13de8fd0551e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command * (server) [\#8399](https://github.com/cosmos/cosmos-sdk/pull/8399) fix gRPC-web flag default value * (server) [\#8641](https://github.com/cosmos/cosmos-sdk/pull/8641) Fix Tendermint and application configuration reading from file +* (client/keys) [\#8639] (https://github.com/cosmos/cosmos-sdk/pull/8639) Fix keys migrate for mulitisig, offline and ledger keys ## [v0.41.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.3) - 2021-02-18 From 4e328c3ff8d82150f8ec93c01bff4a55e9b829c6 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 26 Feb 2021 11:37:07 +0000 Subject: [PATCH 17/27] fix end message --- client/keys/migrate.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index d4f9b8c2077d..0e6a192ff323 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -139,7 +139,8 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { } } - cmd.Print("Migration Complete") + + cmd.PrintErrln("Migration complete.") return err } From 17b606e66d06959cc137c1f7c89322e82074aca8 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 26 Feb 2021 12:06:53 +0000 Subject: [PATCH 18/27] try display race detector while running --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b499f2822817..b45beac6f757 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -201,7 +201,7 @@ jobs: if: env.GIT_DIFF - name: test & coverage report creation run: | - cat pkgs.txt.part.${{ matrix.part }} | xargs go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' > ${{ matrix.part }}-race-output.txt + xargs --arg-file=pkgs.txt.part.${{ matrix.part }} go test -mod=readonly -json -timeout 30m -race -tags='cgo ledger test_ledger_mock' | tee ${{ matrix.part }}-race-output.txt if: env.GIT_DIFF - uses: actions/upload-artifact@v2 with: From e10efd0e5721753342822b220a4434d99fe5d466 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 26 Feb 2021 12:35:12 +0000 Subject: [PATCH 19/27] turn --old-home into a positional argument --- client/keys/migrate.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index 0e6a192ff323..e811dcc6a53a 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -19,41 +19,39 @@ import ( // is not needed for importing into the Keyring keystore. const migratePassphrase = "NOOP_PASSPHRASE" -const flagOldHome = "old-home" - // MigrateCommand migrates key information from legacy keybase to OS secret store. func MigrateCommand() *cobra.Command { cmd := &cobra.Command{ - Use: "migrate", + Use: "migrate ", Short: "Migrate keys from the legacy (db-based) Keybase", - Long: `Migrate key information from the legacy (db-based) Keybase to the new keyring-based Keybase. + Long: `Migrate key information from the legacy (db-based) Keybase to the new keyring-based Keyring. +The legacy Keybase used to persist keys in a LevelDB database stored in a 'keys' sub-directory of +the old client application's home directory, e.g. $HOME/.gaiacli/keys/. For each key material entry, the command will prompt if the key should be skipped or not. If the key is not to be skipped, the passphrase must be entered. The key will only be migrated if the passphrase is correct. Otherwise, the command will exit and migration must be repeated. It is recommended to run in 'dry-run' mode first to verify all key migration material. `, - Args: cobra.ExactArgs(0), + Args: cobra.ExactArgs(1), RunE: runMigrateCmd, } - cmd.Flags().String(flagOldHome, "", "The root directory of the old keyring") cmd.Flags().Bool(flags.FlagDryRun, false, "Run migration without actually persisting any changes to the new Keybase") return cmd } func runMigrateCmd(cmd *cobra.Command, args []string) error { - oldRootDir, _ := cmd.Flags().GetString(flagOldHome) rootDir, _ := cmd.Flags().GetString(flags.FlagHome) // instantiate legacy keybase var legacyKb keyring.LegacyKeybase - legacyKb, err := NewLegacyKeyBaseFromDir(oldRootDir) + legacyKb, err := NewLegacyKeyBaseFromDir(args[0]) if err != nil { return err } - defer legacyKb.Close() + defer func() { _ = legacyKb.Close() }() // fetch list of keys from legacy keybase oldKeys, err := legacyKb.List() @@ -75,7 +73,7 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { return errors.Wrap(err, "failed to create temporary directory for dryrun migration") } - defer os.RemoveAll(tmpDir) + defer func() { _ = os.RemoveAll(tmpDir) }() migrator, err = keyring.New(keyringServiceName, keyring.BackendTest, tmpDir, buf) } else { From 28070f291420771f9fd563aece954758c1c65865 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 26 Feb 2021 13:29:24 +0000 Subject: [PATCH 20/27] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dce9e1344ba..ec29c0cebcc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,7 +77,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command * (server) [\#8399](https://github.com/cosmos/cosmos-sdk/pull/8399) fix gRPC-web flag default value * (server) [\#8641](https://github.com/cosmos/cosmos-sdk/pull/8641) Fix Tendermint and application configuration reading from file -* (client/keys) [\#8639] (https://github.com/cosmos/cosmos-sdk/pull/8639) Fix keys migrate for mulitisig, offline and ledger keys +* (client/keys) [\#8639] (https://github.com/cosmos/cosmos-sdk/pull/8639) Fix keys migrate for mulitisig, offline, and ledger keys. The migrate command now takes a positional old_home_dir argument. ## [v0.41.3](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.41.3) - 2021-02-18 From f7d907dad693f4698fa10a9bc20f90de18969485 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 26 Feb 2021 13:32:51 +0000 Subject: [PATCH 21/27] remove redundant comment --- crypto/keyring/keyring.go | 1 - 1 file changed, 1 deletion(-) diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index c7b6b44f173c..f3b34794026d 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -127,7 +127,6 @@ type Exporter interface { ExportPubKeyArmor(uid string) (string, error) ExportPubKeyArmorByAddress(address sdk.Address) (string, error) - // ExportPrivKey returns a private key in ASCII armored format. // ExportPrivKeyArmor returns a private key in ASCII armored format. // It returns an error if the key does not exist or a wrong encryption passphrase is supplied. ExportPrivKeyArmor(uid, encryptPassphrase string) (armor string, err error) From 5478cb632f2e7211c12c822f3f96808415627e53 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 26 Feb 2021 16:46:00 +0000 Subject: [PATCH 22/27] try fix test --- client/keys/migrate_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/keys/migrate_test.go b/client/keys/migrate_test.go index 948e0144fc90..c95414c290f2 100644 --- a/client/keys/migrate_test.go +++ b/client/keys/migrate_test.go @@ -38,6 +38,7 @@ func Test_runMigrateCmd(t *testing.T) { mockIn := testutil.ApplyMockIODiscardOutErr(cmd) cmd.SetArgs([]string{ + kbHome, fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), fmt.Sprintf("--%s=true", flags.FlagDryRun), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), From a7babacab7e3ebcf11265b848f8744fa4cdac5c0 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 26 Feb 2021 20:57:39 +0000 Subject: [PATCH 23/27] fixing the test case --- client/keys/migrate_test.go | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/client/keys/migrate_test.go b/client/keys/migrate_test.go index c95414c290f2..e6ce52e80f39 100644 --- a/client/keys/migrate_test.go +++ b/client/keys/migrate_test.go @@ -5,45 +5,38 @@ import ( "fmt" "testing" + "github.com/cosmos/cosmos-sdk/client" + + "github.com/stretchr/testify/require" + "github.com/otiai10/copy" "github.com/stretchr/testify/assert" - "github.com/tendermint/tendermint/libs/cli" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/testutil" ) func Test_runMigrateCmd(t *testing.T) { - cmd := AddKeyCommand() - _ = testutil.ApplyMockIODiscardOutErr(cmd) - cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) - kbHome := t.TempDir() - clientCtx := client.Context{}.WithKeyringDir(kbHome) ctx := context.WithValue(context.Background(), client.ClientContextKey, &clientCtx) - copy.Copy("testdata", kbHome) - cmd.SetArgs([]string{ - "keyname1", - fmt.Sprintf("--%s=%s", cli.OutputFlag, OutputFormatText), - fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), - }) - assert.NoError(t, cmd.ExecuteContext(ctx)) + require.NoError(t, copy.Copy("testdata", kbHome)) - cmd = MigrateCommand() + cmd := MigrateCommand() cmd.Flags().AddFlagSet(Commands("home").PersistentFlags()) - mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + //mockIn := testutil.ApplyMockIODiscardOutErr(cmd) + mockIn, mockOut := testutil.ApplyMockIO(cmd) cmd.SetArgs([]string{ kbHome, - fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), + //fmt.Sprintf("--%s=%s", flags.FlagHome, kbHome), fmt.Sprintf("--%s=true", flags.FlagDryRun), fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) mockIn.Reset("test1234\ntest1234\n") + t.Log(mockOut.String()) assert.NoError(t, cmd.ExecuteContext(ctx)) } From 455ccce2300f1fdc32aaeb1b4bd7ed983e307f84 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Sat, 27 Feb 2021 17:16:25 +0000 Subject: [PATCH 24/27] new testdata --- client/keys/migrate_test.go | 2 +- client/keys/testdata/keys/keys.db/000008.ldb | Bin 472 -> 0 bytes client/keys/testdata/keys/keys.db/000013.ldb | Bin 474 -> 0 bytes client/keys/testdata/keys/keys.db/000026.ldb | Bin 319 -> 0 bytes client/keys/testdata/keys/keys.db/000136.ldb | Bin 0 -> 825 bytes client/keys/testdata/keys/keys.db/000137.ldb | Bin 0 -> 244 bytes client/keys/testdata/keys/keys.db/CURRENT | 2 +- client/keys/testdata/keys/keys.db/CURRENT.bak | 2 +- client/keys/testdata/keys/keys.db/LOG | 1253 ++++++++++++----- .../testdata/keys/keys.db/MANIFEST-000072 | Bin 299 -> 0 bytes .../testdata/keys/keys.db/MANIFEST-000167 | Bin 0 -> 195 bytes 11 files changed, 879 insertions(+), 380 deletions(-) delete mode 100644 client/keys/testdata/keys/keys.db/000008.ldb delete mode 100644 client/keys/testdata/keys/keys.db/000013.ldb delete mode 100644 client/keys/testdata/keys/keys.db/000026.ldb create mode 100644 client/keys/testdata/keys/keys.db/000136.ldb create mode 100644 client/keys/testdata/keys/keys.db/000137.ldb delete mode 100644 client/keys/testdata/keys/keys.db/MANIFEST-000072 create mode 100644 client/keys/testdata/keys/keys.db/MANIFEST-000167 diff --git a/client/keys/migrate_test.go b/client/keys/migrate_test.go index e6ce52e80f39..32746291c882 100644 --- a/client/keys/migrate_test.go +++ b/client/keys/migrate_test.go @@ -36,7 +36,7 @@ func Test_runMigrateCmd(t *testing.T) { fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), }) - mockIn.Reset("test1234\ntest1234\n") + mockIn.Reset("\n12345678\n\n\n\n\n") t.Log(mockOut.String()) assert.NoError(t, cmd.ExecuteContext(ctx)) } diff --git a/client/keys/testdata/keys/keys.db/000008.ldb b/client/keys/testdata/keys/keys.db/000008.ldb deleted file mode 100644 index bbe0b95818b623d7ba42ef99f20243d6f6825a4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 472 zcmeBY{t(Sz%axp8oSR>4SX@?OmYh>mP-bGBn`KdIkdj`Umu6y=n^A0$m{XB!Y-EvE zo?5Awn37VIT3pP?!~g~*sl_FRdYO4?`3yqKnGifiMg|5(MTMnIylX{mxmZgWH9q(V zslASR*{;Z>c4LdlV=#}HQqZ`Vj&Mx_r+xUy5ytQ3-xiz*9BxQY{VN~{!IElr(G z+>FgkEDX#IO)ZRFUEG{394(D3oy^TF%*`#hxXdjq$`W0REW-1QJ4SX@$>lTlG_U}2J*l5CuuW}1^yX;f8ao@Y^-ZJuploMmpB zRcNM{n37VIT3pP?$^Zr>sl_EmdYO4?`3yqKnGifi76t}JMTMnIylX{mxmZgWH9q(V zslASR*{;a^tk=Ij`)A^VklitGlP4 zLWrxMi))atr(cLdK#*scV~DGQw`-&>qtb^ZT-hmURtibUMU@35T*ZkwB~}V%Ca#7q z#)fWY&PIktMlJ@Y3OLIyx^)mC)@)?BoGa`75> zQ#$zl5eK7?+Uuy7?TXCLdj0FOeM=r|*f%r;J=*7{x%U@q_T+ K4c#iG?zaK&RbIaU diff --git a/client/keys/testdata/keys/keys.db/000136.ldb b/client/keys/testdata/keys/keys.db/000136.ldb new file mode 100644 index 0000000000000000000000000000000000000000..58165a9ab136c5ea64590cbc0de97487c1a4b47a GIT binary patch literal 825 zcmZ3>X2Bq^lqo5(NG~%lEuWE>ftB%#0^?#P-nF8(T+BdmA+^_0FWVKFz7+5APUTBi zxpVrr<>xtTVk;Jy#xba*x#@kKy>OPIuddX4MqLnaa&`CgQwVYOb8!vw_4Er-2ng~F za}04+@OF&^E8r?l%qg)_Fg7qVF>^L|GqA99GO%q6F3&47%ql333{4453oQt)C{DLb_jES&OA2!d&`t@f^mMgM^UO{$ z@GbSsjtnmI(Ka*7NX)Y+%T4w+_cGveN{le|a`es5F-UjK$_p}&FgCYzs&WqW3U$hK zuP`yvPYL$UNer~*vMmk|(dPoY6zB(B9$|d-!I{C9GdaIFH^11>yr?kQJiQ{fpuDOm z$E>i@pd>G^!Z@QSr`R&v)FL~(yehe(G(#^jC8a2}xR_Ca0SpRClZ;f$POzJCXOx;* z8s`}&S7qfEWmOfJm{%m`Rhed4B$}8SRHc*ygUYm^A`PxzkkwIyAtyB@Jymnp3U)Kj zf}Dy(OM@b#LX*l0bCVQqoUk`yuw7w+%yZb;tG?jj7q&kUKa*gP8S}ay@tGP zGdRjJOiKz1N>g*v({hW`k}WEYa#D>_ipz{kEzGKlvdU9aEVGJCMV%PODKj53`55=QdAcGtLA7`F-fPMEaVAkwIpcc}I~N89BSDurUJ|MW?J4Fpr_&xV?Y=DLa(u4S zC7lqZfOUUn{R);5*$xU?MiBm!uu+FY2F_(OnLj~Xgn^T}knuk!qXxq*R=AXH|K>~g VS-IY^ih+digYe%C-72N-w*gPx^}hfB literal 0 HcmV?d00001 diff --git a/client/keys/testdata/keys/keys.db/000137.ldb b/client/keys/testdata/keys/keys.db/000137.ldb new file mode 100644 index 0000000000000000000000000000000000000000..340e51356e8330d558d49ceef0a13ce11478c79b GIT binary patch literal 244 zcmbQi_`!$4mNPlOI5)r8Fe@t~x4=9xE4jif#ULvuHQk~zB`?FQs;oRUwbaBsy~Nzy zG9^(jF(suawYZp3jR6b_N|TKBGV{{%83c_B1bJ8(Ras@;Fc``E+Fj#f0Z9s}y^ea> zuE?x&FW_FHnQCF|8p{GFiZt0f~YhpQ4gHO$hDGD3?zgfg#T{nRw;GA4FKoFKg9q5 literal 0 HcmV?d00001 diff --git a/client/keys/testdata/keys/keys.db/CURRENT b/client/keys/testdata/keys/keys.db/CURRENT index f74be168efe7..c5ea6dc2c1e0 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT +++ b/client/keys/testdata/keys/keys.db/CURRENT @@ -1 +1 @@ -MANIFEST-000072 +MANIFEST-000167 diff --git a/client/keys/testdata/keys/keys.db/CURRENT.bak b/client/keys/testdata/keys/keys.db/CURRENT.bak index bcf10793aaa2..6da0b2c731cc 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT.bak +++ b/client/keys/testdata/keys/keys.db/CURRENT.bak @@ -1 +1 @@ -MANIFEST-000070 +MANIFEST-000165 diff --git a/client/keys/testdata/keys/keys.db/LOG b/client/keys/testdata/keys/keys.db/LOG index 628161ffe65a..c42df220de73 100644 --- a/client/keys/testdata/keys/keys.db/LOG +++ b/client/keys/testdata/keys/keys.db/LOG @@ -1,377 +1,876 @@ -=============== Feb 18, 2021 (IST) =============== -19:55:21.746342 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:55:21.749786 db@open opening -19:55:21.749971 version@stat F·[] S·0B[] Sc·[] -19:55:21.750906 db@janitor F·2 G·0 -19:55:21.750924 db@open done T·1.122724ms -19:55:21.750937 db@close closing -19:55:21.751010 db@close done T·59.508µs -=============== Feb 18, 2021 (IST) =============== -19:55:34.470289 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:55:34.470381 version@stat F·[] S·0B[] Sc·[] -19:55:34.470398 db@open opening -19:55:34.470435 journal@recovery F·1 -19:55:34.470534 journal@recovery recovering @1 -19:55:34.470797 version@stat F·[] S·0B[] Sc·[] -19:55:34.475040 db@janitor F·2 G·0 -19:55:34.475058 db@open done T·4.651192ms -19:55:34.475068 db@close closing -19:55:34.475099 db@close done T·29.747µs -=============== Feb 18, 2021 (IST) =============== -19:55:55.559301 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:55:55.559405 version@stat F·[] S·0B[] Sc·[] -19:55:55.559423 db@open opening -19:55:55.559462 journal@recovery F·1 -19:55:55.560430 journal@recovery recovering @2 -19:55:55.560885 version@stat F·[] S·0B[] Sc·[] -19:55:55.564548 db@janitor F·2 G·0 -19:55:55.564566 db@open done T·5.132791ms -19:55:55.564576 db@close closing -19:55:55.564620 db@close done T·40.809µs -=============== Feb 18, 2021 (IST) =============== -19:56:02.009665 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:56:02.009975 version@stat F·[] S·0B[] Sc·[] -19:56:02.010033 db@open opening -19:56:02.010189 journal@recovery F·1 -19:56:02.011047 journal@recovery recovering @4 -19:56:02.011583 version@stat F·[] S·0B[] Sc·[] -19:56:02.016108 db@janitor F·2 G·0 -19:56:02.016120 db@open done T·6.072306ms -19:56:02.252918 db@close closing -19:56:02.252954 db@close done T·34.003µs -=============== Feb 18, 2021 (IST) =============== -19:56:08.674814 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:56:08.675058 version@stat F·[] S·0B[] Sc·[] -19:56:08.675088 db@open opening -19:56:08.675200 journal@recovery F·1 -19:56:08.675324 journal@recovery recovering @6 -19:56:08.677956 memdb@flush created L0@8 N·2 S·472B "cos..ess,v2":"tes..nfo,v1" -19:56:08.678065 version@stat F·[1] S·472B[472B] Sc·[0.25] -19:56:08.682869 db@janitor F·3 G·0 -19:56:08.682881 db@open done T·7.786465ms -19:56:08.682890 db@close closing -19:56:08.682914 db@close done T·23.78µs -=============== Feb 18, 2021 (IST) =============== -19:56:15.429130 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:56:15.429502 version@stat F·[1] S·472B[472B] Sc·[0.25] -19:56:15.429567 db@open opening -19:56:15.429708 journal@recovery F·1 -19:56:15.430627 journal@recovery recovering @9 -19:56:15.431649 version@stat F·[1] S·472B[472B] Sc·[0.25] -19:56:15.436312 db@janitor F·3 G·0 -19:56:15.436327 db@open done T·6.74915ms -19:56:15.692407 db@close closing -19:56:15.692462 db@close done T·53.032µs -=============== Feb 18, 2021 (IST) =============== -19:57:03.867735 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:57:03.868070 version@stat F·[1] S·472B[472B] Sc·[0.25] -19:57:03.868090 db@open opening -19:57:03.868198 journal@recovery F·1 -19:57:03.868564 journal@recovery recovering @11 -19:57:03.871006 memdb@flush created L0@13 N·2 S·474B "cos..ess,v5":"tes..nfo,v4" -19:57:03.871329 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:03.873977 db@janitor F·4 G·0 -19:57:03.873999 db@open done T·5.895918ms -19:57:03.874050 db@close closing -19:57:03.874097 db@close done T·44.46µs -=============== Feb 18, 2021 (IST) =============== -19:57:03.874184 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:57:03.874267 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:03.874281 db@open opening -19:57:03.874316 journal@recovery F·1 -19:57:03.875087 journal@recovery recovering @14 -19:57:03.875231 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:03.877724 db@janitor F·4 G·0 -19:57:03.877734 db@open done T·3.449027ms -19:57:03.877775 db@close closing -19:57:03.877798 db@close done T·21.916µs -=============== Feb 18, 2021 (IST) =============== -19:57:13.250092 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:57:13.250195 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.250219 db@open opening -19:57:13.250258 journal@recovery F·1 -19:57:13.250369 journal@recovery recovering @16 -19:57:13.250677 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.254378 db@janitor F·4 G·0 -19:57:13.254393 db@open done T·4.167045ms -19:57:13.254459 db@close closing -19:57:13.254494 db@close done T·34.322µs -=============== Feb 18, 2021 (IST) =============== -19:57:13.254566 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:57:13.254640 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.254655 db@open opening -19:57:13.254689 journal@recovery F·1 -19:57:13.255206 journal@recovery recovering @18 -19:57:13.255349 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.258000 db@janitor F·4 G·0 -19:57:13.258010 db@open done T·3.35032ms -19:57:13.258061 db@close closing -19:57:13.258093 db@close done T·30.599µs -=============== Feb 18, 2021 (IST) =============== -19:57:13.258142 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:57:13.258207 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.258221 db@open opening -19:57:13.258258 journal@recovery F·1 -19:57:13.258565 journal@recovery recovering @20 -19:57:13.258972 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.261719 db@janitor F·4 G·0 -19:57:13.261731 db@open done T·3.504128ms -19:57:13.261763 db@close closing -19:57:13.261783 db@close done T·19.411µs -=============== Feb 18, 2021 (IST) =============== -19:57:13.261838 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:57:13.261899 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.261911 db@open opening -19:57:13.261945 journal@recovery F·1 -19:57:13.262432 journal@recovery recovering @22 -19:57:13.263487 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:57:13.266236 db@janitor F·4 G·0 -19:57:13.266258 db@open done T·4.343035ms -19:57:13.268002 db@close closing -19:57:13.268033 db@close done T·30.43µs -=============== Feb 18, 2021 (IST) =============== -19:58:46.390844 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -19:58:46.390931 version@stat F·[2] S·946B[946B] Sc·[0.50] -19:58:46.390945 db@open opening -19:58:46.390978 journal@recovery F·1 -19:58:46.391193 journal@recovery recovering @24 -19:58:46.392281 memdb@flush created L0@26 N·2 S·319B "cos..ess,v8":"mul..nfo,v7" -19:58:46.392402 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -19:58:46.395177 db@janitor F·5 G·0 -19:58:46.395188 db@open done T·4.239206ms -19:58:51.803805 db@close closing -19:58:51.804111 db@close done T·299.418µs -=============== Feb 18, 2021 (IST) =============== -20:02:37.179459 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -20:02:37.179558 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -20:02:37.179574 db@open opening -20:02:37.179619 journal@recovery F·1 -20:02:37.179879 journal@recovery recovering @27 -20:02:37.180415 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -20:02:37.184816 db@janitor F·5 G·0 -20:02:37.184842 db@open done T·5.255578ms -20:02:40.778667 db@close closing -20:02:40.778890 db@close done T·218.287µs -=============== Feb 18, 2021 (IST) =============== -20:04:06.448046 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -20:04:06.448157 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -20:04:06.448174 db@open opening -20:04:06.448214 journal@recovery F·1 -20:04:06.448314 journal@recovery recovering @29 -20:04:06.448570 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -20:04:06.452972 db@janitor F·5 G·0 -20:04:06.452994 db@open done T·4.807108ms -20:04:06.453109 db@close closing -20:04:06.453163 db@close done T·50.43µs -=============== Feb 18, 2021 (IST) =============== -20:29:40.048262 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -20:29:40.049987 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -20:29:40.050003 db@open opening -20:29:40.050044 journal@recovery F·1 -20:29:40.050260 journal@recovery recovering @31 -20:29:40.050808 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -20:29:40.053723 db@janitor F·5 G·0 -20:29:40.053740 db@open done T·3.728083ms -20:29:41.898517 db@close closing -20:29:41.898693 db@close done T·164.864µs -=============== Feb 18, 2021 (IST) =============== -21:07:19.610996 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -21:07:19.611389 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -21:07:19.611408 db@open opening -21:07:19.611451 journal@recovery F·1 -21:07:19.611895 journal@recovery recovering @33 -21:07:19.612326 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -21:07:19.615103 db@janitor F·5 G·0 -21:07:19.615117 db@open done T·3.701842ms -=============== Feb 18, 2021 (IST) =============== -21:22:17.908927 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -21:22:17.909297 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -21:22:17.909321 db@open opening -21:22:17.909376 journal@recovery F·1 -21:22:17.909609 journal@recovery recovering @35 -21:22:17.910230 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -21:22:17.913089 db@janitor F·5 G·0 -21:22:17.913115 db@open done T·3.7861ms -=============== Feb 19, 2021 (IST) =============== -14:35:40.001538 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:35:40.002006 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:35:40.002028 db@open opening -14:35:40.002079 journal@recovery F·1 -14:35:40.002413 journal@recovery recovering @37 -14:35:40.003107 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:35:40.006189 db@janitor F·5 G·0 -14:35:40.006204 db@open done T·4.169376ms -14:35:41.622336 db@close closing -14:35:41.622423 db@close done T·87.082µs -=============== Feb 19, 2021 (IST) =============== -14:42:56.814630 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:42:56.814763 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:42:56.814786 db@open opening -14:42:56.814845 journal@recovery F·1 -14:42:56.815210 journal@recovery recovering @39 -14:42:56.815839 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:42:56.820271 db@janitor F·5 G·0 -14:42:56.820313 db@open done T·5.505688ms -14:42:59.007273 db@close closing -14:42:59.007430 db@close done T·160.414µs -=============== Feb 19, 2021 (IST) =============== -14:43:38.020230 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:43:38.020347 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:43:38.020369 db@open opening -14:43:38.020419 journal@recovery F·1 -14:43:38.020729 journal@recovery recovering @41 -14:43:38.021514 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:43:38.024483 db@janitor F·5 G·0 -14:43:38.024497 db@open done T·4.121329ms -=============== Feb 19, 2021 (IST) =============== -14:44:02.293151 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:44:02.294326 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:44:02.294353 db@open opening -14:44:02.294403 journal@recovery F·1 -14:44:02.294719 journal@recovery recovering @43 -14:44:02.295476 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:44:02.298593 db@janitor F·5 G·0 -14:44:02.298621 db@open done T·4.251319ms -14:44:03.615728 db@close closing -14:44:03.615809 db@close done T·79.173µs -=============== Feb 19, 2021 (IST) =============== -14:45:02.325906 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:45:02.326045 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:45:02.326066 db@open opening -14:45:02.326125 journal@recovery F·1 -14:45:02.326548 journal@recovery recovering @45 -14:45:02.327179 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:45:02.331737 db@janitor F·5 G·0 -14:45:02.331761 db@open done T·5.679085ms -14:45:03.790521 db@close closing -14:45:03.790819 db@close done T·291.566µs -=============== Feb 19, 2021 (IST) =============== -14:45:20.989589 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:45:20.989762 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:45:20.989788 db@open opening -14:45:20.989852 journal@recovery F·1 -14:45:20.991585 journal@recovery recovering @47 -14:45:20.991942 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:45:20.994916 db@janitor F·5 G·0 -14:45:20.994937 db@open done T·5.136054ms -14:45:20.995464 db@close closing -14:45:20.995512 db@close done T·46.824µs -=============== Feb 19, 2021 (IST) =============== -14:45:49.932890 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:45:49.933054 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:45:49.933075 db@open opening -14:45:49.933125 journal@recovery F·1 -14:45:49.933518 journal@recovery recovering @49 -14:45:49.934218 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:45:49.937610 db@janitor F·5 G·0 -14:45:49.937641 db@open done T·4.551123ms -14:45:52.068809 db@close closing -14:45:52.068913 db@close done T·100.268µs -=============== Feb 19, 2021 (IST) =============== -14:47:19.401175 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:47:19.401307 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:47:19.401325 db@open opening -14:47:19.401377 journal@recovery F·1 -14:47:19.401847 journal@recovery recovering @51 -14:47:19.402402 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:47:19.406692 db@janitor F·5 G·0 -14:47:19.406711 db@open done T·5.375705ms -14:47:21.044284 db@close closing -14:47:21.044388 db@close done T·101.194µs -=============== Feb 19, 2021 (IST) =============== -14:48:21.413725 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:48:21.413872 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:48:21.413895 db@open opening -14:48:21.413957 journal@recovery F·1 -14:48:21.414275 journal@recovery recovering @53 -14:48:21.414984 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:48:21.419314 db@janitor F·5 G·0 -14:48:21.419328 db@open done T·5.42456ms -14:48:23.502854 db@close closing -14:48:23.502936 db@close done T·79.035µs -=============== Feb 19, 2021 (IST) =============== -14:54:11.839440 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:54:11.839856 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:54:11.839878 db@open opening -14:54:11.839932 journal@recovery F·1 -14:54:11.840206 journal@recovery recovering @55 -14:54:11.841010 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:54:11.844094 db@janitor F·5 G·0 -14:54:11.844112 db@open done T·4.226897ms -14:54:13.782398 db@close closing -14:54:13.782490 db@close done T·89.573µs -=============== Feb 19, 2021 (IST) =============== -14:54:22.511807 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:54:22.511948 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:54:22.511970 db@open opening -14:54:22.512018 journal@recovery F·1 -14:54:22.512458 journal@recovery recovering @57 -14:54:22.513208 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:54:22.517444 db@janitor F·5 G·0 -14:54:22.517460 db@open done T·5.483271ms -14:54:23.975752 db@close closing -14:54:23.975839 db@close done T·85.523µs -=============== Feb 19, 2021 (IST) =============== -14:56:23.671326 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -14:56:23.671451 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:56:23.671471 db@open opening -14:56:23.671523 journal@recovery F·1 -14:56:23.672021 journal@recovery recovering @59 -14:56:23.672512 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -14:56:23.675973 db@janitor F·5 G·0 -14:56:23.675999 db@open done T·4.513247ms -14:56:41.226250 db@close closing -14:56:41.226327 db@close done T·74.817µs -=============== Feb 19, 2021 (IST) =============== -15:58:32.661888 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -15:58:32.661976 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -15:58:32.661993 db@open opening -15:58:32.662032 journal@recovery F·1 -15:58:32.662272 journal@recovery recovering @61 -15:58:32.662998 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -15:58:32.665560 db@janitor F·5 G·0 -15:58:32.665575 db@open done T·3.57577ms -15:58:34.373361 db@close closing -15:58:34.373547 db@close done T·181.217µs -=============== Feb 19, 2021 (IST) =============== -15:58:39.417932 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -15:58:39.418051 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -15:58:39.418067 db@open opening -15:58:39.418104 journal@recovery F·1 -15:58:39.418335 journal@recovery recovering @63 -15:58:39.418784 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -15:58:39.423506 db@janitor F·5 G·0 -15:58:39.423534 db@open done T·5.453295ms -15:58:46.716446 db@close closing -15:58:46.716501 db@close done T·53.532µs -=============== Feb 23, 2021 (IST) =============== -00:16:24.952717 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -00:16:24.953346 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -00:16:24.953363 db@open opening -00:16:24.953401 journal@recovery F·1 -00:16:24.953995 journal@recovery recovering @65 -00:16:24.954332 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -00:16:24.957437 db@janitor F·5 G·0 -00:16:24.957454 db@open done T·4.085773ms -00:16:24.957713 db@close closing -00:16:24.957753 db@close done T·37.55µs -=============== Feb 23, 2021 (IST) =============== -16:24:20.149172 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -16:24:20.149548 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -16:24:20.149567 db@open opening -16:24:20.149614 journal@recovery F·1 -16:24:20.151223 journal@recovery recovering @67 -16:24:20.151678 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -16:24:20.154840 db@janitor F·5 G·0 -16:24:20.154853 db@open done T·5.280143ms -=============== Feb 23, 2021 (IST) =============== -16:24:26.059591 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -16:24:26.059706 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -16:24:26.059721 db@open opening -16:24:26.059757 journal@recovery F·1 -16:24:26.060898 journal@recovery recovering @69 -16:24:26.061653 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] -16:24:26.064929 db@janitor F·5 G·0 -16:24:26.064942 db@open done T·5.215816ms -16:24:26.065074 db@close closing -16:24:26.065124 db@close done T·47.02µs +=============== Sep 12, 2020 (BST) =============== +14:56:38.444867 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:56:38.447630 db@open opening +14:56:38.447826 version@stat F·[] S·0B[] Sc·[] +14:56:38.449162 db@janitor F·2 G·0 +14:56:38.449180 db@open done T·1.537964ms +14:56:38.449193 db@close closing +14:56:38.449264 db@close done T·69.313µs +=============== Sep 12, 2020 (BST) =============== +14:56:49.081871 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:56:49.081975 version@stat F·[] S·0B[] Sc·[] +14:56:49.081994 db@open opening +14:56:49.082040 journal@recovery F·1 +14:56:49.082399 journal@recovery recovering @1 +14:56:49.083134 version@stat F·[] S·0B[] Sc·[] +14:56:49.088411 db@janitor F·2 G·0 +14:56:49.088430 db@open done T·6.428462ms +14:56:49.088440 db@close closing +14:56:49.088491 db@close done T·48.589µs +=============== Sep 12, 2020 (BST) =============== +14:56:55.214003 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:56:55.214144 version@stat F·[] S·0B[] Sc·[] +14:56:55.214165 db@open opening +14:56:55.214215 journal@recovery F·1 +14:56:55.214329 journal@recovery recovering @2 +14:56:55.214750 version@stat F·[] S·0B[] Sc·[] +14:56:55.221347 db@janitor F·2 G·0 +14:56:55.221365 db@open done T·7.194565ms +14:56:55.608587 db@close closing +14:56:55.608644 db@close done T·54.685µs +=============== Sep 12, 2020 (BST) =============== +14:57:07.211101 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:57:07.211224 version@stat F·[] S·0B[] Sc·[] +14:57:07.211243 db@open opening +14:57:07.211287 journal@recovery F·1 +14:57:07.211388 journal@recovery recovering @4 +14:57:07.213734 memdb@flush created L0@6 N·2 S·470B "cos..ess,v2":"val..nfo,v1" +14:57:07.214142 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:07.218723 db@janitor F·3 G·0 +14:57:07.218743 db@open done T·7.488657ms +14:57:07.218804 db@close closing +14:57:07.218842 db@close done T·36.603µs +=============== Sep 12, 2020 (BST) =============== +14:57:16.418006 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:57:16.418133 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.418153 db@open opening +14:57:16.418199 journal@recovery F·1 +14:57:16.418508 journal@recovery recovering @7 +14:57:16.418891 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.425395 db@janitor F·3 G·0 +14:57:16.425423 db@open done T·7.257565ms +14:57:16.425482 db@close closing +14:57:16.425522 db@close done T·38.172µs +=============== Sep 12, 2020 (BST) =============== +14:57:16.425854 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:57:16.425965 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.425983 db@open opening +14:57:16.426027 journal@recovery F·1 +14:57:16.426133 journal@recovery recovering @9 +14:57:16.426324 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.431088 db@janitor F·3 G·0 +14:57:16.431103 db@open done T·5.115335ms +14:57:16.431142 db@close closing +14:57:16.431179 db@close done T·35.705µs +=============== Sep 12, 2020 (BST) =============== +14:57:16.431287 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:57:16.431376 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.431394 db@open opening +14:57:16.431437 journal@recovery F·1 +14:57:16.431721 journal@recovery recovering @11 +14:57:16.432205 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.437468 db@janitor F·3 G·0 +14:57:16.437486 db@open done T·6.087128ms +14:57:16.437529 db@close closing +14:57:16.437571 db@close done T·40.188µs +=============== Sep 12, 2020 (BST) =============== +14:57:16.437907 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:57:16.438006 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.438024 db@open opening +14:57:16.438067 journal@recovery F·1 +14:57:16.438573 journal@recovery recovering @13 +14:57:16.439155 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.443451 db@janitor F·3 G·0 +14:57:16.443466 db@open done T·5.437579ms +14:57:16.443511 db@close closing +14:57:16.443634 db@close done T·118.642µs +=============== Sep 12, 2020 (BST) =============== +14:57:16.443733 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:57:16.443847 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.443864 db@open opening +14:57:16.443915 journal@recovery F·1 +14:57:16.444629 journal@recovery recovering @15 +14:57:16.445570 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:16.450978 db@janitor F·3 G·0 +14:57:16.451001 db@open done T·7.132193ms +14:57:16.451050 db@close closing +14:57:16.451089 db@close done T·37.371µs +=============== Sep 12, 2020 (BST) =============== +14:57:19.439656 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +14:57:19.439775 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:19.439793 db@open opening +14:57:19.439845 journal@recovery F·1 +14:57:19.440199 journal@recovery recovering @17 +14:57:19.440624 version@stat F·[1] S·470B[470B] Sc·[0.25] +14:57:19.445819 db@janitor F·3 G·0 +14:57:19.445837 db@open done T·6.03822ms +14:57:19.828985 db@close closing +14:57:19.829058 db@close done T·71.028µs +=============== Sep 12, 2020 (BST) =============== +15:07:04.002859 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:04.002990 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:04.003010 db@open opening +15:07:04.003081 journal@recovery F·1 +15:07:04.003191 journal@recovery recovering @19 +15:07:04.003591 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:04.008917 db@janitor F·3 G·0 +15:07:04.008942 db@open done T·5.916433ms +15:07:04.009005 db@close closing +15:07:04.009050 db@close done T·42.762µs +=============== Sep 12, 2020 (BST) =============== +15:07:15.240666 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:15.240802 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.240825 db@open opening +15:07:15.240871 journal@recovery F·1 +15:07:15.241288 journal@recovery recovering @21 +15:07:15.241702 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.249270 db@janitor F·3 G·0 +15:07:15.249299 db@open done T·8.459432ms +15:07:15.249363 db@close closing +15:07:15.249404 db@close done T·39.294µs +=============== Sep 12, 2020 (BST) =============== +15:07:15.249761 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:15.249850 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.249868 db@open opening +15:07:15.249911 journal@recovery F·1 +15:07:15.250026 journal@recovery recovering @23 +15:07:15.250195 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.254923 db@janitor F·3 G·0 +15:07:15.254943 db@open done T·5.069716ms +15:07:15.254987 db@close closing +15:07:15.255026 db@close done T·37.365µs +=============== Sep 12, 2020 (BST) =============== +15:07:15.255136 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:15.255218 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.255235 db@open opening +15:07:15.255277 journal@recovery F·1 +15:07:15.255617 journal@recovery recovering @25 +15:07:15.256091 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.262240 db@janitor F·3 G·0 +15:07:15.262260 db@open done T·7.018813ms +15:07:15.262310 db@close closing +15:07:15.262353 db@close done T·41.276µs +=============== Sep 12, 2020 (BST) =============== +15:07:15.262707 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:15.262808 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.262829 db@open opening +15:07:15.262874 journal@recovery F·1 +15:07:15.263408 journal@recovery recovering @27 +15:07:15.263994 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.268793 db@janitor F·3 G·0 +15:07:15.268810 db@open done T·5.975152ms +15:07:15.268861 db@close closing +15:07:15.268900 db@close done T·37.419µs +=============== Sep 12, 2020 (BST) =============== +15:07:15.268989 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:15.269096 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.269117 db@open opening +15:07:15.269165 journal@recovery F·1 +15:07:15.269858 journal@recovery recovering @29 +15:07:15.270587 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:15.275935 db@janitor F·3 G·0 +15:07:15.275951 db@open done T·6.828156ms +15:07:15.275999 db@close closing +15:07:15.276033 db@close done T·32.757µs +=============== Sep 12, 2020 (BST) =============== +15:07:21.660414 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:21.660547 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.660568 db@open opening +15:07:21.660655 journal@recovery F·1 +15:07:21.660960 journal@recovery recovering @31 +15:07:21.661682 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.667796 db@janitor F·3 G·0 +15:07:21.667813 db@open done T·7.237366ms +15:07:21.667869 db@close closing +15:07:21.667914 db@close done T·43.496µs +=============== Sep 12, 2020 (BST) =============== +15:07:21.668253 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:21.668354 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.668372 db@open opening +15:07:21.668418 journal@recovery F·1 +15:07:21.668529 journal@recovery recovering @33 +15:07:21.668930 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.674796 db@janitor F·3 G·0 +15:07:21.674817 db@open done T·6.440491ms +15:07:21.674861 db@close closing +15:07:21.674898 db@close done T·35.584µs +=============== Sep 12, 2020 (BST) =============== +15:07:21.675013 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:21.675115 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.675131 db@open opening +15:07:21.675179 journal@recovery F·1 +15:07:21.675707 journal@recovery recovering @35 +15:07:21.676833 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.681212 db@janitor F·3 G·0 +15:07:21.681226 db@open done T·6.089677ms +15:07:21.681270 db@close closing +15:07:21.681299 db@close done T·27.867µs +=============== Sep 12, 2020 (BST) =============== +15:07:21.681691 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:21.681799 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.681817 db@open opening +15:07:21.681882 journal@recovery F·1 +15:07:21.683119 journal@recovery recovering @37 +15:07:21.684000 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.689926 db@janitor F·3 G·0 +15:07:21.689940 db@open done T·8.117662ms +15:07:21.689984 db@close closing +15:07:21.690027 db@close done T·42.379µs +=============== Sep 12, 2020 (BST) =============== +15:07:21.690104 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:21.690189 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.690205 db@open opening +15:07:21.690247 journal@recovery F·1 +15:07:21.690536 journal@recovery recovering @39 +15:07:21.690899 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:21.695207 db@janitor F·3 G·0 +15:07:21.695223 db@open done T·5.013121ms +15:07:21.695265 db@close closing +15:07:21.695320 db@close done T·53.965µs +=============== Sep 12, 2020 (BST) =============== +15:07:24.335083 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:07:24.335214 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:24.335233 db@open opening +15:07:24.335282 journal@recovery F·1 +15:07:24.336367 journal@recovery recovering @41 +15:07:24.336786 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:07:24.342965 db@janitor F·3 G·0 +15:07:24.342984 db@open done T·7.745647ms +15:07:24.725175 db@close closing +15:07:24.725234 db@close done T·57.895µs +=============== Nov 2, 2020 (GMT) =============== +00:08:43.299526 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +00:08:43.299860 version@stat F·[1] S·470B[470B] Sc·[0.25] +00:08:43.299875 db@open opening +00:08:43.299900 journal@recovery F·1 +00:08:43.300467 journal@recovery recovering @43 +00:08:43.301378 version@stat F·[1] S·470B[470B] Sc·[0.25] +00:08:43.307882 db@janitor F·3 G·0 +00:08:43.307911 db@open done T·8.03178ms +00:08:43.308144 db@close closing +00:08:43.308231 db@close done T·85.824µs +=============== Nov 2, 2020 (GMT) =============== +00:09:14.493119 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +00:09:14.493237 version@stat F·[1] S·470B[470B] Sc·[0.25] +00:09:14.493272 db@open opening +00:09:14.493296 journal@recovery F·1 +00:09:14.493370 journal@recovery recovering @45 +00:09:14.493648 version@stat F·[1] S·470B[470B] Sc·[0.25] +00:09:14.499436 db@janitor F·3 G·0 +00:09:14.499452 db@open done T·6.170984ms +00:09:14.499537 db@close closing +00:09:14.499592 db@close done T·52.707µs +=============== Jan 22, 2021 (GMT) =============== +12:47:15.935887 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:47:15.937333 version@stat F·[1] S·470B[470B] Sc·[0.25] +12:47:15.937343 db@open opening +12:47:15.937370 journal@recovery F·1 +12:47:15.937642 journal@recovery recovering @47 +12:47:15.937942 version@stat F·[1] S·470B[470B] Sc·[0.25] +12:47:15.944262 db@janitor F·3 G·0 +12:47:15.944270 db@open done T·6.922789ms +12:47:15.944460 db@close closing +12:47:15.944492 db@close done T·30.723µs +=============== Jan 22, 2021 (GMT) =============== +15:23:04.060521 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:23:04.060694 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:23:04.060708 db@open opening +15:23:04.060734 journal@recovery F·1 +15:23:04.061045 journal@recovery recovering @49 +15:23:04.061463 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:23:04.067352 db@janitor F·3 G·0 +15:23:04.067386 db@open done T·6.675171ms +15:23:11.819265 db@close closing +15:23:11.819317 db@close done T·51.057µs +=============== Jan 22, 2021 (GMT) =============== +15:23:14.037455 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:23:14.037524 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:23:14.037535 db@open opening +15:23:14.037560 journal@recovery F·1 +15:23:14.037629 journal@recovery recovering @51 +15:23:14.037951 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:23:14.045002 db@janitor F·3 G·0 +15:23:14.045020 db@open done T·7.475686ms +15:23:22.065063 db@close closing +15:23:22.065111 db@close done T·47.074µs +=============== Jan 22, 2021 (GMT) =============== +15:23:43.145956 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:23:43.146094 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:23:43.146107 db@open opening +15:23:43.146132 journal@recovery F·1 +15:23:43.146447 journal@recovery recovering @53 +15:23:43.146912 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:23:43.153059 db@janitor F·3 G·0 +15:23:43.153108 db@open done T·6.977141ms +15:23:43.153245 db@close closing +15:23:43.153290 db@close done T·43.663µs +=============== Jan 22, 2021 (GMT) =============== +15:25:14.027169 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:25:14.027240 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:25:14.027250 db@open opening +15:25:14.027274 journal@recovery F·1 +15:25:14.027627 journal@recovery recovering @55 +15:25:14.028059 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:25:14.033292 db@janitor F·3 G·0 +15:25:14.033304 db@open done T·6.047911ms +15:25:19.981971 db@close closing +15:25:19.982011 db@close done T·39.165µs +=============== Jan 22, 2021 (GMT) =============== +15:25:51.137523 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:25:51.138542 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:25:51.138553 db@open opening +15:25:51.138579 journal@recovery F·1 +15:25:51.138632 journal@recovery recovering @57 +15:25:51.138981 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:25:51.144970 db@janitor F·3 G·0 +15:25:51.144983 db@open done T·6.422769ms +15:25:51.145031 db@close closing +15:25:51.145071 db@close done T·39.108µs +=============== Jan 22, 2021 (GMT) =============== +15:25:56.504732 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:25:56.504809 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:25:56.504824 db@open opening +15:25:56.504872 journal@recovery F·1 +15:25:56.505474 journal@recovery recovering @59 +15:25:56.505571 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:25:56.512054 db@janitor F·3 G·0 +15:25:56.512061 db@open done T·7.232269ms +15:25:56.710823 db@close closing +15:25:56.710860 db@close done T·36.326µs +=============== Jan 22, 2021 (GMT) =============== +15:26:02.847640 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +15:26:02.847733 version@stat F·[1] S·470B[470B] Sc·[0.25] +15:26:02.847745 db@open opening +15:26:02.847771 journal@recovery F·1 +15:26:02.848002 journal@recovery recovering @61 +15:26:02.850382 memdb@flush created L0@63 N·2 S·472B "cos..ess,v5":"tes..nfo,v4" +15:26:02.850491 version@stat F·[2] S·942B[942B] Sc·[0.50] +15:26:02.854544 db@janitor F·4 G·0 +15:26:02.854552 db@open done T·6.802972ms +15:26:09.729296 db@close closing +15:26:09.729392 db@close done T·95.18µs +=============== Feb 6, 2021 (GMT) =============== +12:21:53.904083 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:21:53.904380 version@stat F·[2] S·942B[942B] Sc·[0.50] +12:21:53.904391 db@open opening +12:21:53.904417 journal@recovery F·1 +12:21:53.905225 journal@recovery recovering @64 +12:21:53.905589 version@stat F·[2] S·942B[942B] Sc·[0.50] +12:21:53.910965 db@janitor F·4 G·0 +12:21:53.910976 db@open done T·6.578518ms +12:21:53.911304 db@close closing +12:21:53.911387 db@close done T·82.205µs +=============== Feb 6, 2021 (GMT) =============== +12:22:02.353974 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:22:02.354077 version@stat F·[2] S·942B[942B] Sc·[0.50] +12:22:02.354089 db@open opening +12:22:02.354116 journal@recovery F·1 +12:22:02.354419 journal@recovery recovering @66 +12:22:02.354608 version@stat F·[2] S·942B[942B] Sc·[0.50] +12:22:02.359491 db@janitor F·4 G·0 +12:22:02.359504 db@open done T·5.408186ms +12:22:02.359514 db@close closing +12:22:02.359542 db@close done T·27.662µs +=============== Feb 6, 2021 (GMT) =============== +12:22:07.888198 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:22:07.888300 version@stat F·[2] S·942B[942B] Sc·[0.50] +12:22:07.888310 db@open opening +12:22:07.888338 journal@recovery F·1 +12:22:07.888397 journal@recovery recovering @68 +12:22:07.888494 version@stat F·[2] S·942B[942B] Sc·[0.50] +12:22:07.895048 db@janitor F·4 G·0 +12:22:07.895060 db@open done T·6.746979ms +12:22:08.093013 db@close closing +12:22:08.093057 db@close done T·43.222µs +=============== Feb 18, 2021 (GMT) =============== +07:32:13.660053 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +07:32:13.661098 version@stat F·[2] S·942B[942B] Sc·[0.50] +07:32:13.661111 db@open opening +07:32:13.661140 journal@recovery F·1 +07:32:13.661439 journal@recovery recovering @70 +07:32:13.663498 memdb@flush created L0@72 N·2 S·465B "cia..nfo,v7":"cos..ess,v8" +07:32:13.663598 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +07:32:13.668369 db@janitor F·5 G·0 +07:32:13.668400 db@open done T·7.285777ms +07:32:13.668491 db@close closing +07:32:13.668557 db@close done T·65.011µs +=============== Feb 18, 2021 (GMT) =============== +07:32:20.349460 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +07:32:20.349568 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +07:32:20.349618 db@open opening +07:32:20.349691 journal@recovery F·1 +07:32:20.349769 journal@recovery recovering @73 +07:32:20.349867 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +07:32:20.355997 db@janitor F·5 G·0 +07:32:20.356005 db@open done T·6.383828ms +07:32:20.553221 db@close closing +07:32:20.553251 db@close done T·28.713µs +=============== Feb 18, 2021 (GMT) =============== +07:32:30.022753 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +07:32:30.022830 version@stat F·[3] S·1KiB[1KiB] Sc·[0.75] +07:32:30.022842 db@open opening +07:32:30.022870 journal@recovery F·1 +07:32:30.023106 journal@recovery recovering @75 +07:32:30.025727 memdb@flush created L0@77 N·2 S·462B "cos..ess,v11":"foo.info,v10" +07:32:30.025896 version@stat F·[4] S·1KiB[1KiB] Sc·[1.00] +07:32:30.031203 db@janitor F·6 G·0 +07:32:30.031214 db@open done T·8.368455ms +07:32:30.031222 db@close closing +07:32:30.031249 db@close done T·26.625µs +=============== Feb 18, 2021 (GMT) =============== +07:32:36.137856 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +07:32:36.137945 version@stat F·[4] S·1KiB[1KiB] Sc·[1.00] +07:32:36.137955 db@open opening +07:32:36.137988 journal@recovery F·1 +07:32:36.138053 journal@recovery recovering @78 +07:32:36.138160 version@stat F·[4] S·1KiB[1KiB] Sc·[1.00] +07:32:36.144271 db@janitor F·6 G·0 +07:32:36.144281 db@open done T·6.322633ms +07:32:36.144342 table@compaction L0·4 -> L1·0 S·1KiB Q·12 +07:32:36.145937 table@build created L1@82 N·8 S·1KiB "cia..nfo,v7":"val..nfo,v1" +07:32:36.145957 version@stat F·[0 1] S·1KiB[0B 1KiB] Sc·[0.00 0.00] +07:32:36.147223 table@compaction committed F-3 S-606B Ke·0 D·0 T·2.864358ms +07:32:36.147251 table@remove removed @77 +07:32:36.147265 table@remove removed @72 +07:32:36.147280 table@remove removed @63 +07:32:36.147394 table@remove removed @6 +07:32:36.341754 db@close closing +07:32:36.341789 db@close done T·34.217µs +=============== Feb 23, 2021 (GMT) =============== +11:59:56.652297 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +11:59:56.653267 version@stat F·[0 1] S·1KiB[0B 1KiB] Sc·[0.00 0.00] +11:59:56.653279 db@open opening +11:59:56.653333 journal@recovery F·1 +11:59:56.653684 journal@recovery recovering @80 +11:59:56.655439 memdb@flush created L0@83 N·2 S·491B "bar.info,v13":"cos..ess,v14" +11:59:56.655563 version@stat F·[1 1] S·1KiB[491B 1KiB] Sc·[0.25 0.00] +11:59:56.659803 db@janitor F·4 G·0 +11:59:56.659812 db@open done T·6.529102ms +11:59:56.659952 db@close closing +11:59:56.660013 db@close done T·59.126µs +=============== Feb 23, 2021 (GMT) =============== +12:01:34.578182 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:01:34.578308 version@stat F·[1 1] S·1KiB[491B 1KiB] Sc·[0.25 0.00] +12:01:34.578348 db@open opening +12:01:34.578422 journal@recovery F·1 +12:01:34.578796 journal@recovery recovering @84 +12:01:34.579157 version@stat F·[1 1] S·1KiB[491B 1KiB] Sc·[0.25 0.00] +12:01:34.583888 db@janitor F·4 G·0 +12:01:34.583925 db@open done T·5.547338ms +12:01:34.583962 db@close closing +12:01:34.584011 db@close done T·46.636µs +=============== Feb 23, 2021 (GMT) =============== +12:01:34.584060 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:01:34.584136 version@stat F·[1 1] S·1KiB[491B 1KiB] Sc·[0.25 0.00] +12:01:34.584166 db@open opening +12:01:34.584195 journal@recovery F·1 +12:01:34.584799 journal@recovery recovering @86 +12:01:34.584896 version@stat F·[1 1] S·1KiB[491B 1KiB] Sc·[0.25 0.00] +12:01:34.590435 db@janitor F·4 G·0 +12:01:34.590445 db@open done T·6.275747ms +12:01:44.922399 db@close closing +12:01:44.922453 db@close done T·53.361µs +=============== Feb 23, 2021 (GMT) =============== +12:01:53.346191 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:01:53.346299 version@stat F·[1 1] S·1KiB[491B 1KiB] Sc·[0.25 0.00] +12:01:53.346310 db@open opening +12:01:53.346427 journal@recovery F·1 +12:01:53.346591 journal@recovery recovering @88 +12:01:53.350436 memdb@flush created L0@90 N·2 S·259B "cos..ess,v17":"led..nfo,v16" +12:01:53.350863 version@stat F·[2 1] S·1KiB[750B 1KiB] Sc·[0.50 0.00] +12:01:53.356998 db@janitor F·5 G·0 +12:01:53.357009 db@open done T·10.694071ms +12:01:53.357177 db@close closing +12:01:53.357258 db@close done T·79.894µs +=============== Feb 23, 2021 (GMT) =============== +12:01:57.771688 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:01:57.771807 version@stat F·[2 1] S·1KiB[750B 1KiB] Sc·[0.50 0.00] +12:01:57.771818 db@open opening +12:01:57.771844 journal@recovery F·1 +12:01:57.771911 journal@recovery recovering @91 +12:01:57.772211 version@stat F·[2 1] S·1KiB[750B 1KiB] Sc·[0.50 0.00] +12:01:57.777712 db@janitor F·5 G·0 +12:01:57.777726 db@open done T·5.899191ms +12:01:57.777794 db@close closing +12:01:57.777821 db@close done T·26.301µs +=============== Feb 23, 2021 (GMT) =============== +12:02:01.179234 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:01.179444 version@stat F·[2 1] S·1KiB[750B 1KiB] Sc·[0.50 0.00] +12:02:01.179471 db@open opening +12:02:01.179568 journal@recovery F·1 +12:02:01.180395 journal@recovery recovering @93 +12:02:01.180499 version@stat F·[2 1] S·1KiB[750B 1KiB] Sc·[0.50 0.00] +12:02:01.186898 db@janitor F·5 G·0 +12:02:01.186908 db@open done T·7.433758ms +12:02:01.376649 db@close closing +12:02:01.376744 db@close done T·94.311µs +=============== Feb 23, 2021 (GMT) =============== +12:02:08.325782 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:08.325880 version@stat F·[2 1] S·1KiB[750B 1KiB] Sc·[0.50 0.00] +12:02:08.325892 db@open opening +12:02:08.325919 journal@recovery F·1 +12:02:08.326096 journal@recovery recovering @95 +12:02:08.328874 memdb@flush created L0@97 N·2 S·189B "cos..ess,d19":"tes..nfo,d20" +12:02:08.329781 version@stat F·[3 1] S·2KiB[939B 1KiB] Sc·[0.75 0.00] +12:02:08.335685 db@janitor F·6 G·0 +12:02:08.335726 db@open done T·9.800531ms +12:02:08.335812 db@close closing +12:02:08.335913 db@close done T·98.185µs +=============== Feb 23, 2021 (GMT) =============== +12:02:10.989199 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:10.989372 version@stat F·[3 1] S·2KiB[939B 1KiB] Sc·[0.75 0.00] +12:02:10.989381 db@open opening +12:02:10.989413 journal@recovery F·1 +12:02:10.989493 journal@recovery recovering @98 +12:02:10.989823 version@stat F·[3 1] S·2KiB[939B 1KiB] Sc·[0.75 0.00] +12:02:10.997764 db@janitor F·6 G·0 +12:02:10.997775 db@open done T·8.391051ms +12:02:11.186825 db@close closing +12:02:11.186873 db@close done T·46.355µs +=============== Feb 23, 2021 (GMT) =============== +12:02:13.779564 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:13.779705 version@stat F·[3 1] S·2KiB[939B 1KiB] Sc·[0.75 0.00] +12:02:13.779716 db@open opening +12:02:13.779766 journal@recovery F·1 +12:02:13.780050 journal@recovery recovering @100 +12:02:13.782794 memdb@flush created L0@102 N·2 S·186B "cia..nfo,d23":"cos..ess,d22" +12:02:13.782888 version@stat F·[4 1] S·2KiB[1KiB 1KiB] Sc·[1.00 0.00] +12:02:13.787114 db@janitor F·7 G·0 +12:02:13.787129 db@open done T·7.382544ms +12:02:13.787201 table@compaction L0·4 -> L1·1 S·2KiB Q·24 +12:02:13.787271 db@close closing +12:02:13.789006 table@build created L1@105 N·8 S·1KiB "bar.info,v13":"val..nfo,v1" +12:02:13.789011 table@build exiting +12:02:13.789013 table@build revert @105 +12:02:13.789055 db@close done T·1.783005ms +=============== Feb 23, 2021 (GMT) =============== +12:02:19.245131 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:19.245285 version@stat F·[4 1] S·2KiB[1KiB 1KiB] Sc·[1.00 0.00] +12:02:19.245315 db@open opening +12:02:19.245368 journal@recovery F·1 +12:02:19.245465 journal@recovery recovering @103 +12:02:19.245858 version@stat F·[4 1] S·2KiB[1KiB 1KiB] Sc·[1.00 0.00] +12:02:19.251449 db@janitor F·7 G·0 +12:02:19.251465 db@open done T·6.140479ms +12:02:19.251485 table@compaction L0·4 -> L1·1 S·2KiB Q·24 +12:02:19.251521 db@close closing +12:02:19.251592 db@close done T·70.226µs +=============== Feb 23, 2021 (GMT) =============== +12:02:21.580113 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:21.580210 version@stat F·[4 1] S·2KiB[1KiB 1KiB] Sc·[1.00 0.00] +12:02:21.580222 db@open opening +12:02:21.580272 journal@recovery F·1 +12:02:21.580647 journal@recovery recovering @105 +12:02:21.580747 version@stat F·[4 1] S·2KiB[1KiB 1KiB] Sc·[1.00 0.00] +12:02:21.587123 db@janitor F·7 G·0 +12:02:21.587130 db@open done T·6.905846ms +12:02:21.587221 table@compaction L0·4 -> L1·1 S·2KiB Q·24 +12:02:21.589889 table@build created L1@109 N·8 S·1KiB "bar.info,v13":"val..nfo,v1" +12:02:21.589929 version@stat F·[0 1] S·1KiB[0B 1KiB] Sc·[0.00 0.00] +12:02:21.591275 table@compaction committed F-4 S-1KiB Ke·0 D·8 T·4.039289ms +12:02:21.591357 table@remove removed @102 +12:02:21.591414 table@remove removed @97 +12:02:21.591428 table@remove removed @90 +12:02:21.591440 table@remove removed @83 +12:02:21.591472 table@remove removed @82 +12:02:21.777758 db@close closing +12:02:21.777800 db@close done T·40.787µs +=============== Feb 23, 2021 (GMT) =============== +12:02:22.900722 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:22.900859 version@stat F·[0 1] S·1KiB[0B 1KiB] Sc·[0.00 0.00] +12:02:22.900892 db@open opening +12:02:22.900963 journal@recovery F·1 +12:02:22.901083 journal@recovery recovering @107 +12:02:22.904868 memdb@flush created L0@110 N·2 S·193B "cos..ess,d25":"val..nfo,d26" +12:02:22.905267 version@stat F·[1 1] S·1KiB[193B 1KiB] Sc·[0.25 0.00] +12:02:22.909786 db@janitor F·4 G·0 +12:02:22.909799 db@open done T·8.899965ms +12:02:22.909931 db@close closing +12:02:22.910008 db@close done T·74.647µs +=============== Feb 23, 2021 (GMT) =============== +12:02:53.139966 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:53.140102 version@stat F·[1 1] S·1KiB[193B 1KiB] Sc·[0.25 0.00] +12:02:53.140135 db@open opening +12:02:53.140206 journal@recovery F·1 +12:02:53.140586 journal@recovery recovering @111 +12:02:53.141053 version@stat F·[1 1] S·1KiB[193B 1KiB] Sc·[0.25 0.00] +12:02:53.147675 db@janitor F·4 G·0 +12:02:53.147687 db@open done T·7.546001ms +12:02:53.147750 db@close closing +12:02:53.147818 db@close done T·67.754µs +=============== Feb 23, 2021 (GMT) =============== +12:02:53.147913 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:02:53.147982 version@stat F·[1 1] S·1KiB[193B 1KiB] Sc·[0.25 0.00] +12:02:53.147993 db@open opening +12:02:53.148043 journal@recovery F·1 +12:02:53.148101 journal@recovery recovering @113 +12:02:53.148192 version@stat F·[1 1] S·1KiB[193B 1KiB] Sc·[0.25 0.00] +12:02:53.152906 db@janitor F·4 G·0 +12:02:53.152912 db@open done T·4.91707ms +12:02:53.156922 db@close closing +12:02:53.156949 db@close done T·25.968µs +=============== Feb 23, 2021 (GMT) =============== +12:03:24.147022 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:03:24.147113 version@stat F·[1 1] S·1KiB[193B 1KiB] Sc·[0.25 0.00] +12:03:24.147123 db@open opening +12:03:24.147195 journal@recovery F·1 +12:03:24.147542 journal@recovery recovering @115 +12:03:24.150459 memdb@flush created L0@117 N·2 S·244B "cos..ess,v29":"pub..nfo,v28" +12:03:24.150556 version@stat F·[2 1] S·1KiB[437B 1KiB] Sc·[0.50 0.00] +12:03:24.156079 db@janitor F·5 G·0 +12:03:24.156116 db@open done T·8.964543ms +12:03:24.156215 db@close closing +12:03:24.156330 db@close done T·113.154µs +=============== Feb 23, 2021 (GMT) =============== +12:03:33.230269 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:03:33.230428 version@stat F·[2 1] S·1KiB[437B 1KiB] Sc·[0.50 0.00] +12:03:33.230456 db@open opening +12:03:33.230505 journal@recovery F·1 +12:03:33.230859 journal@recovery recovering @118 +12:03:33.231123 version@stat F·[2 1] S·1KiB[437B 1KiB] Sc·[0.50 0.00] +12:03:33.237886 db@janitor F·5 G·0 +12:03:33.237932 db@open done T·7.464889ms +12:03:33.238009 db@close closing +12:03:33.238077 db@close done T·67.991µs +=============== Feb 23, 2021 (GMT) =============== +12:03:33.238135 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:03:33.238190 version@stat F·[2 1] S·1KiB[437B 1KiB] Sc·[0.50 0.00] +12:03:33.238200 db@open opening +12:03:33.238226 journal@recovery F·1 +12:03:33.238295 journal@recovery recovering @120 +12:03:33.238459 version@stat F·[2 1] S·1KiB[437B 1KiB] Sc·[0.50 0.00] +12:03:33.242714 db@janitor F·5 G·0 +12:03:33.242723 db@open done T·4.520893ms +12:03:33.246526 db@close closing +12:03:33.246576 db@close done T·49.286µs +=============== Feb 23, 2021 (GMT) =============== +12:03:36.732039 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:03:36.732132 version@stat F·[2 1] S·1KiB[437B 1KiB] Sc·[0.50 0.00] +12:03:36.732143 db@open opening +12:03:36.732193 journal@recovery F·1 +12:03:36.732321 journal@recovery recovering @122 +12:03:36.734960 memdb@flush created L0@124 N·2 S·244B "cos..ess,v32":"pub..nfo,v31" +12:03:36.735282 version@stat F·[3 1] S·1KiB[681B 1KiB] Sc·[0.75 0.00] +12:03:36.740852 db@janitor F·6 G·0 +12:03:36.740890 db@open done T·8.717358ms +12:03:36.741044 db@close closing +12:03:36.741134 db@close done T·87.869µs +=============== Feb 23, 2021 (GMT) =============== +12:03:56.009876 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:03:56.009989 version@stat F·[3 1] S·1KiB[681B 1KiB] Sc·[0.75 0.00] +12:03:56.010002 db@open opening +12:03:56.010034 journal@recovery F·1 +12:03:56.010178 journal@recovery recovering @125 +12:03:56.011128 version@stat F·[3 1] S·1KiB[681B 1KiB] Sc·[0.75 0.00] +12:03:56.018052 db@janitor F·6 G·0 +12:03:56.018064 db@open done T·8.05417ms +12:03:56.018173 db@close closing +12:03:56.018224 db@close done T·49.879µs +=============== Feb 23, 2021 (GMT) =============== +12:03:58.983153 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:03:58.983257 version@stat F·[3 1] S·1KiB[681B 1KiB] Sc·[0.75 0.00] +12:03:58.983268 db@open opening +12:03:58.983297 journal@recovery F·1 +12:03:58.983885 journal@recovery recovering @127 +12:03:58.983986 version@stat F·[3 1] S·1KiB[681B 1KiB] Sc·[0.75 0.00] +12:03:58.991844 db@janitor F·6 G·0 +12:03:58.991851 db@open done T·8.580014ms +12:03:59.181560 db@close closing +12:03:59.181637 db@close done T·76.045µs +=============== Feb 23, 2021 (GMT) =============== +12:04:10.259722 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:04:10.259852 version@stat F·[3 1] S·1KiB[681B 1KiB] Sc·[0.75 0.00] +12:04:10.259869 db@open opening +12:04:10.259919 journal@recovery F·1 +12:04:10.260104 journal@recovery recovering @129 +12:04:10.264224 memdb@flush created L0@131 N·2 S·187B "cos..ess,d34":"foo.info,d35" +12:04:10.264492 version@stat F·[4 1] S·1KiB[868B 1KiB] Sc·[1.00 0.00] +12:04:10.268582 db@janitor F·7 G·0 +12:04:10.268595 db@open done T·8.720601ms +12:04:10.268655 table@compaction L0·4 -> L1·1 S·1KiB Q·36 +12:04:10.268669 db@close closing +12:04:10.268830 db@close done T·159.948µs +=============== Feb 23, 2021 (GMT) =============== +12:04:10.268891 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:04:10.269025 version@stat F·[4 1] S·1KiB[868B 1KiB] Sc·[1.00 0.00] +12:04:10.269034 db@open opening +12:04:10.269089 journal@recovery F·1 +12:04:10.269152 journal@recovery recovering @132 +12:04:10.269259 version@stat F·[4 1] S·1KiB[868B 1KiB] Sc·[1.00 0.00] +12:04:10.274436 db@janitor F·7 G·0 +12:04:10.274466 db@open done T·5.404186ms +12:04:10.274543 table@compaction L0·4 -> L1·1 S·1KiB Q·36 +12:04:10.277245 table@build created L1@136 N·8 S·825B "bar.info,v13":"pub..nfo,v31" +12:04:10.277287 version@stat F·[0 1] S·825B[0B 825B] Sc·[0.00 0.00] +12:04:10.278388 db@close closing +12:04:10.280880 table@commit exiting +12:04:10.280907 db@close done T·2.542424ms +=============== Feb 23, 2021 (GMT) =============== +12:04:12.868499 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:04:12.868628 version@stat F·[0 1] S·825B[0B 825B] Sc·[0.00 0.00] +12:04:12.868640 db@open opening +12:04:12.868670 journal@recovery F·1 +12:04:12.868785 journal@recovery recovering @134 +12:04:12.870434 memdb@flush created L0@137 N·2 S·244B "cos..ess,v38":"pub..nfo,v37" +12:04:12.871017 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:04:12.876243 db@janitor F·9 G·5 +12:04:12.876251 db@janitor removing table-124 +12:04:12.876290 db@janitor removing table-110 +12:04:12.876302 db@janitor removing table-109 +12:04:12.876330 db@janitor removing table-117 +12:04:12.876340 db@janitor removing table-131 +12:04:12.876381 db@open done T·7.712682ms +12:04:12.876440 db@close closing +12:04:12.876498 db@close done T·55.873µs +=============== Feb 23, 2021 (GMT) =============== +12:09:38.966259 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:09:38.966450 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:09:38.966463 db@open opening +12:09:38.966490 journal@recovery F·1 +12:09:38.966746 journal@recovery recovering @138 +12:09:38.967252 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:09:38.974464 db@janitor F·4 G·0 +12:09:38.974477 db@open done T·8.005768ms +12:09:56.196454 db@close closing +12:09:56.196575 db@close done T·142.606µs +=============== Feb 23, 2021 (GMT) =============== +12:10:09.568902 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:10:09.568981 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:10:09.568993 db@open opening +12:10:09.569022 journal@recovery F·1 +12:10:09.569291 journal@recovery recovering @140 +12:10:09.569781 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:10:09.575840 db@janitor F·4 G·0 +12:10:09.575848 db@open done T·6.851269ms +12:10:23.290522 db@close closing +12:10:23.290590 db@close done T·66.518µs +=============== Feb 23, 2021 (GMT) =============== +12:11:01.674005 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:11:01.674086 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:11:01.674098 db@open opening +12:11:01.674128 journal@recovery F·1 +12:11:01.674359 journal@recovery recovering @142 +12:11:01.674814 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:11:01.680965 db@janitor F·4 G·0 +12:11:01.680980 db@open done T·6.874747ms +12:11:06.655715 db@close closing +12:11:06.655759 db@close done T·43.852µs +=============== Feb 23, 2021 (GMT) =============== +12:19:52.269690 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:19:52.269780 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:19:52.269792 db@open opening +12:19:52.269826 journal@recovery F·1 +12:19:52.270051 journal@recovery recovering @144 +12:19:52.270585 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:19:52.276899 db@janitor F·4 G·0 +12:19:52.276939 db@open done T·7.116495ms +12:19:59.249868 db@close closing +12:19:59.249968 db@close done T·99.117µs +=============== Feb 23, 2021 (GMT) =============== +12:20:30.569407 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:20:30.569504 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:20:30.569516 db@open opening +12:20:30.569545 journal@recovery F·1 +12:20:30.569730 journal@recovery recovering @146 +12:20:30.570245 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:20:30.577100 db@janitor F·4 G·0 +12:20:30.577111 db@open done T·7.591098ms +=============== Feb 23, 2021 (GMT) =============== +12:20:35.223490 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:20:35.223588 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:20:35.223601 db@open opening +12:20:35.223630 journal@recovery F·1 +12:20:35.223986 journal@recovery recovering @148 +12:20:35.224401 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:20:35.229848 db@janitor F·4 G·0 +12:20:35.229856 db@open done T·6.250812ms +12:20:41.049391 db@close closing +12:20:41.049441 db@close done T·49.18µs +=============== Feb 23, 2021 (GMT) =============== +12:21:45.804793 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +12:21:45.804915 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:21:45.804928 db@open opening +12:21:45.804961 journal@recovery F·1 +12:21:45.805201 journal@recovery recovering @150 +12:21:45.805681 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +12:21:45.810888 db@janitor F·4 G·0 +12:21:45.810920 db@open done T·5.985873ms +12:21:49.489917 db@close closing +12:21:49.490008 db@close done T·89.528µs +=============== Feb 26, 2021 (GMT) =============== +11:30:44.083018 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +11:30:44.084062 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:30:44.084075 db@open opening +11:30:44.084102 journal@recovery F·1 +11:30:44.084383 journal@recovery recovering @152 +11:30:44.084768 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:30:44.090432 db@janitor F·4 G·0 +11:30:44.090476 db@open done T·6.381184ms +11:30:44.090566 db@close closing +11:30:44.090613 db@close done T·44.34µs +=============== Feb 26, 2021 (GMT) =============== +11:32:36.352559 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +11:32:36.352641 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:32:36.352653 db@open opening +11:32:36.352681 journal@recovery F·1 +11:32:36.352756 journal@recovery recovering @154 +11:32:36.353034 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:32:36.360804 db@janitor F·4 G·0 +11:32:36.360816 db@open done T·8.15837ms +11:32:36.360904 db@close closing +11:32:36.360960 db@close done T·54.048µs +=============== Feb 26, 2021 (GMT) =============== +11:32:48.449675 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +11:32:48.449787 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:32:48.449820 db@open opening +11:32:48.449847 journal@recovery F·1 +11:32:48.449955 journal@recovery recovering @156 +11:32:48.450282 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:32:48.456194 db@janitor F·4 G·0 +11:32:48.456235 db@open done T·6.384513ms +11:32:48.456367 db@close closing +11:32:48.456478 db@close done T·109.034µs +=============== Feb 26, 2021 (GMT) =============== +11:34:15.269223 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +11:34:15.269382 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:34:15.269414 db@open opening +11:34:15.269464 journal@recovery F·1 +11:34:15.269563 journal@recovery recovering @158 +11:34:15.269872 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:34:15.275610 db@janitor F·4 G·0 +11:34:15.275622 db@open done T·6.200818ms +11:34:15.275707 db@close closing +11:34:15.275752 db@close done T·44.471µs +=============== Feb 26, 2021 (GMT) =============== +11:34:32.038701 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +11:34:32.038798 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:34:32.038810 db@open opening +11:34:32.038837 journal@recovery F·1 +11:34:32.039081 journal@recovery recovering @160 +11:34:32.039560 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +11:34:32.045125 db@janitor F·4 G·0 +11:34:32.045132 db@open done T·6.318174ms +11:34:52.928799 db@close closing +11:34:52.928908 db@close done T·94.101µs +=============== Feb 26, 2021 (GMT) =============== +19:42:33.585125 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +19:42:33.585220 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +19:42:33.585232 db@open opening +19:42:33.585283 journal@recovery F·1 +19:42:33.585544 journal@recovery recovering @162 +19:42:33.585964 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +19:42:33.592890 db@janitor F·4 G·0 +19:42:33.592928 db@open done T·7.666705ms +19:42:33.592996 db@close closing +19:42:33.593063 db@close done T·63.906µs +=============== Feb 27, 2021 (GMT) =============== +17:05:01.817733 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +17:05:01.817819 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +17:05:01.817830 db@open opening +17:05:01.817855 journal@recovery F·1 +17:05:01.818108 journal@recovery recovering @164 +17:05:01.818567 version@stat F·[1 1] S·1KiB[244B 825B] Sc·[0.25 0.00] +17:05:01.824986 db@janitor F·4 G·0 +17:05:01.825024 db@open done T·7.162696ms +17:05:01.825107 db@close closing +17:05:01.825221 db@close done T·111.618µs diff --git a/client/keys/testdata/keys/keys.db/MANIFEST-000072 b/client/keys/testdata/keys/keys.db/MANIFEST-000072 deleted file mode 100644 index 1314730128bdcddf823927cd7f68f9c4947843e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 299 zcmYk!u~LID9Ds2`>rn@nj-8!33Z!Il(ZTaEViG86658YsAv}vp^XxQQ2aH03?O{##8an_)Kchd{JeNs-X_uJGk##5)1BLD9L9Wto`Mt< zf((Ey#-{O&nWWL$17oF6Dd$!=hgQ*VYuzho)7I1-O6HYBci)SP>L957=rdAk&I(pz z#X~*~l_CA1I%I{cusrRq>djdN;UJ&Y#L5zL zGE+cedYO4?`3zDFV8G7M$@qoQHaWjIH^100D=Q= ztUNWf)Wkf!#N6C6B~dRiC8a2}xR_B5VuoNrX_7J6R7O>(sf- Date: Sat, 27 Feb 2021 17:27:30 +0000 Subject: [PATCH 25/27] crypto/keyring: reinstate the InfoImporter interface InfoImporter is implemented by those Keyring implementations that support import of Info objects. --- client/keys/migrate.go | 8 ++++++-- crypto/keyring/keyring.go | 10 ++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index e811dcc6a53a..9a1f0cdae5e5 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -111,8 +111,12 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { // TypeLocal needs an additional step to ask password. // The other keyring types are handled by ImportInfo. if keyType != keyring.TypeLocal { - err = migrator.ImportInfo(oldInfo) - if err != nil { + infoImporter, ok := migrator.(keyring.InfoImporter) + if !ok { + return fmt.Errorf("the Keyring implementation does not support import operations of Info types.") + } + + if err = infoImporter.ImportInfo(oldInfo); err != nil { return err } diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index f3b34794026d..45b43ac2319a 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -107,17 +107,19 @@ type Signer interface { SignByAddress(address sdk.Address, msg []byte) ([]byte, types.PubKey, error) } -// Importer is implemented by key stores that support import of info, public and private keys. +// Importer is implemented by key stores that support import of public and private keys. type Importer interface { // ImportPrivKey imports ASCII armored passphrase-encrypted private keys. ImportPrivKey(uid, armor, passphrase string) error // ImportPubKey imports ASCII armored public keys. ImportPubKey(uid string, armor string) error +} - // ImportInfo takes a keyring.Info (in practise, from an old keyring), and - // writes it to the current keyring. We use it to migrate Type{Multi,Ledger,Offline} - // keyring.Infos. +// InfoImporter is implemented by key stores that support import of Info types. +type InfoImporter interface { + // ImportInfo import a keyring.Info into the current keyring. + // It is used to migrate multisig, ledger, and public key Info structure. ImportInfo(oldInfo Info) error } From 8b85b5c010447bc7056a656c44c7658341d0c1c9 Mon Sep 17 00:00:00 2001 From: SaReN Date: Sat, 27 Feb 2021 23:07:10 +0530 Subject: [PATCH 26/27] Update error message --- client/keys/migrate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index 9a1f0cdae5e5..c866eeb450c5 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -113,7 +113,7 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { if keyType != keyring.TypeLocal { infoImporter, ok := migrator.(keyring.InfoImporter) if !ok { - return fmt.Errorf("the Keyring implementation does not support import operations of Info types.") + return fmt.Errorf("the Keyring implementation does not support import operations of Info types") } if err = infoImporter.ImportInfo(oldInfo); err != nil { From f5df8f1761c2d884fbd517b7c830dc0e8863802a Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Mon, 1 Mar 2021 12:00:12 +0000 Subject: [PATCH 27/27] Update client/keys/migrate.go --- client/keys/migrate.go | 1 - 1 file changed, 1 deletion(-) diff --git a/client/keys/migrate.go b/client/keys/migrate.go index c866eeb450c5..4848ec281162 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -141,7 +141,6 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { } } - cmd.PrintErrln("Migration complete.") return err