Skip to content

Commit 641d2fd

Browse files
jefft0thehowl
andauthoredOct 16, 2024··
feat(tm2/crypto/keys): In the gnokey CLI, add command to update the password (#2700)
The `Keybase` API supports a method to [change the password of a key](https://github.com/gnolang/gno/blob/8a62a28f672d3311163bee75f5e8f10ba3d4d52b/tm2/pkg/crypto/keys/keybase.go#L450). It is currently called `Update` which is confusing. This PR renames the API function to `Rotate` and adds the "rotate" command to the gnokey CLI. BREAKING CHANGE: The Keybase API function `Update` is renamed to `Rotate`. (Note: I haven't seen code using this function, so it should be minimal impact.) <details><summary>Contributors' checklist...</summary> - [x] Added new tests, or not needed, or not feasible - [x] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [x] Updated the official documentation or not needed - [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description </details> --------- Signed-off-by: Jeff Thompson <[email protected]> Co-authored-by: Morgan <[email protected]>
1 parent 5444859 commit 641d2fd

File tree

9 files changed

+196
-11
lines changed

9 files changed

+196
-11
lines changed
 

‎docs/gno-tooling/cli/gnokey/working-with-key-pairs.md

+13
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ gno.land keychain & client
3838
SUBCOMMANDS
3939
add adds key to the keybase
4040
delete deletes a key from the keybase
41+
rotate rotate the password of a key in the keybase to a new password
4142
generate generates a bip39 mnemonic
4243
export exports private key armor
4344
import imports encrypted private key armor
@@ -161,6 +162,18 @@ you can recover it using the key's mnemonic, or by importing it if it was export
161162
at a previous point in time.
162163
:::
163164

165+
166+
## Rotating the password of a private key to a new password
167+
To rotate the password of a private key from the `gnokey` keystore to a new password, we need to know the name or
168+
address of the key to remove.
169+
After we have this information, we can run the following command:
170+
171+
```bash
172+
gnokey rotate MyKey
173+
```
174+
175+
After entering the current key decryption password and the new password, the password of the key will be updated in the keystore.
176+
164177
## Exporting a private key
165178
Private keys stored in the `gnokey` keystore can be exported to a desired place
166179
on the user's filesystem.

‎gno.land/pkg/keyscli/root.go

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func NewRootCmd(io commands.IO, base client.BaseOptions) *commands.Command {
3030
cmd.AddSubCommands(
3131
client.NewAddCmd(cfg, io),
3232
client.NewDeleteCmd(cfg, io),
33+
client.NewRotateCmd(cfg, io),
3334
client.NewGenerateCmd(cfg, io),
3435
client.NewExportCmd(cfg, io),
3536
client.NewImportCmd(cfg, io),

‎tm2/pkg/crypto/keys/client/root.go

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func NewRootCmdWithBaseConfig(io commands.IO, base BaseOptions) *commands.Comman
4343
NewExportCmd(cfg, io),
4444
NewImportCmd(cfg, io),
4545
NewListCmd(cfg, io),
46+
NewRotateCmd(cfg, io),
4647
NewSignCmd(cfg, io),
4748
NewVerifyCmd(cfg, io),
4849
NewQueryCmd(cfg, io),

‎tm2/pkg/crypto/keys/client/rotate.go

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package client
2+
3+
import (
4+
"context"
5+
"flag"
6+
"fmt"
7+
8+
"github.com/gnolang/gno/tm2/pkg/commands"
9+
"github.com/gnolang/gno/tm2/pkg/crypto/keys"
10+
)
11+
12+
type RotateCfg struct {
13+
RootCfg *BaseCfg
14+
15+
Force bool
16+
}
17+
18+
func NewRotateCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command {
19+
cfg := &RotateCfg{
20+
RootCfg: rootCfg,
21+
}
22+
23+
return commands.NewCommand(
24+
commands.Metadata{
25+
Name: "rotate",
26+
ShortUsage: "rotate [flags] <key-name>",
27+
ShortHelp: "rotate the password of a key in the keybase to a new password",
28+
},
29+
cfg,
30+
func(_ context.Context, args []string) error {
31+
return execRotate(cfg, args, io)
32+
},
33+
)
34+
}
35+
36+
func (c *RotateCfg) RegisterFlags(fs *flag.FlagSet) {
37+
}
38+
39+
func execRotate(cfg *RotateCfg, args []string, io commands.IO) error {
40+
if len(args) != 1 {
41+
return flag.ErrHelp
42+
}
43+
44+
nameOrBech32 := args[0]
45+
46+
kb, err := keys.NewKeyBaseFromDir(cfg.RootCfg.Home)
47+
if err != nil {
48+
return err
49+
}
50+
51+
oldpass, err := io.GetPassword("Enter the current password:", cfg.RootCfg.InsecurePasswordStdin)
52+
if err != nil {
53+
return err
54+
}
55+
56+
newpass, err := io.GetCheckPassword(
57+
[2]string{
58+
"Enter the new password to encrypt your key to disk:",
59+
"Repeat the password:",
60+
},
61+
cfg.RootCfg.InsecurePasswordStdin,
62+
)
63+
if err != nil {
64+
return fmt.Errorf("unable to parse provided password, %w", err)
65+
}
66+
67+
getNewpass := func() (string, error) { return newpass, nil }
68+
err = kb.Rotate(nameOrBech32, oldpass, getNewpass)
69+
if err != nil {
70+
return err
71+
}
72+
io.ErrPrintln("Password rotated")
73+
74+
return nil
75+
}
+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
package client
2+
3+
import (
4+
"strings"
5+
"testing"
6+
7+
"github.com/gnolang/gno/tm2/pkg/commands"
8+
"github.com/gnolang/gno/tm2/pkg/crypto/keys"
9+
"github.com/gnolang/gno/tm2/pkg/testutils"
10+
"github.com/stretchr/testify/assert"
11+
"github.com/stretchr/testify/require"
12+
)
13+
14+
func Test_execRotate(t *testing.T) {
15+
t.Parallel()
16+
17+
// make new test dir
18+
kbHome, kbCleanUp := testutils.NewTestCaseDir(t)
19+
defer kbCleanUp()
20+
21+
// initialize test options
22+
cfg := &RotateCfg{
23+
RootCfg: &BaseCfg{
24+
BaseOptions: BaseOptions{
25+
Home: kbHome,
26+
InsecurePasswordStdin: true,
27+
},
28+
},
29+
}
30+
31+
io := commands.NewTestIO()
32+
33+
// Add test accounts to keybase.
34+
kb, err := keys.NewKeyBaseFromDir(kbHome)
35+
assert.NoError(t, err)
36+
37+
keyName := "rotateApp_Key1"
38+
p1, p2 := "1234", "foobar"
39+
mnemonic := "equip will roof matter pink blind book anxiety banner elbow sun young"
40+
41+
_, err = kb.CreateAccount(keyName, mnemonic, "", p1, 0, 0)
42+
assert.NoError(t, err)
43+
44+
{
45+
// test: Key not found
46+
args := []string{"blah"}
47+
io.SetIn(strings.NewReader(p1 + "\n" + p2 + "\n" + p2 + "\n"))
48+
err = execRotate(cfg, args, io)
49+
require.Error(t, err)
50+
require.Equal(t, "Key blah not found", err.Error())
51+
}
52+
53+
{
54+
// test: Wrong password
55+
args := []string{keyName}
56+
io.SetIn(strings.NewReader("blah" + "\n" + p2 + "\n" + p2 + "\n"))
57+
err = execRotate(cfg, args, io)
58+
require.Error(t, err)
59+
require.Equal(t, "invalid account password", err.Error())
60+
}
61+
62+
{
63+
// test: New passwords don't match
64+
args := []string{keyName}
65+
io.SetIn(strings.NewReader(p1 + "\n" + p2 + "\n" + "blah" + "\n"))
66+
err = execRotate(cfg, args, io)
67+
require.Error(t, err)
68+
require.Equal(t, "unable to parse provided password, passphrases don't match", err.Error())
69+
}
70+
71+
{
72+
// Rotate the password
73+
args := []string{keyName}
74+
io.SetIn(strings.NewReader(p1 + "\n" + p2 + "\n" + p2 + "\n"))
75+
err = execRotate(cfg, args, io)
76+
require.NoError(t, err)
77+
}
78+
79+
{
80+
// test: The old password shouldn't work
81+
args := []string{keyName}
82+
io.SetIn(strings.NewReader(p1 + "\n" + p1 + "\n" + p1 + "\n"))
83+
err = execRotate(cfg, args, io)
84+
require.Error(t, err)
85+
require.Equal(t, "invalid account password", err.Error())
86+
}
87+
88+
{
89+
// Updating the new password to itself should work
90+
args := []string{keyName}
91+
io.SetIn(strings.NewReader(p2 + "\n" + p2 + "\n" + p2 + "\n"))
92+
err = execRotate(cfg, args, io)
93+
require.NoError(t, err)
94+
}
95+
}

‎tm2/pkg/crypto/keys/keybase.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,13 @@ func (kb dbKeybase) Delete(nameOrBech32, passphrase string, skipPass bool) error
441441
return nil
442442
}
443443

444-
// Update changes the passphrase with which an already stored key is
444+
// Rotate changes the passphrase with which an already stored key is
445445
// encrypted.
446446
//
447447
// oldpass must be the current passphrase used for encryption,
448448
// getNewpass is a function to get the passphrase to permanently replace
449449
// the current passphrase
450-
func (kb dbKeybase) Update(nameOrBech32, oldpass string, getNewpass func() (string, error)) error {
450+
func (kb dbKeybase) Rotate(nameOrBech32, oldpass string, getNewpass func() (string, error)) error {
451451
info, err := kb.GetByNameOrAddress(nameOrBech32)
452452
if err != nil {
453453
return err

‎tm2/pkg/crypto/keys/keybase_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ func assertPassword(t *testing.T, cstore Keybase, name, pass, badpass string) {
199199
t.Helper()
200200

201201
getNewpass := func() (string, error) { return pass, nil }
202-
err := cstore.Update(name, badpass, getNewpass)
202+
err := cstore.Rotate(name, badpass, getNewpass)
203203
require.NotNil(t, err)
204-
err = cstore.Update(name, pass, getNewpass)
204+
err = cstore.Rotate(name, pass, getNewpass)
205205
require.Nil(t, err, "%+v", err)
206206
}
207207

@@ -280,7 +280,7 @@ func TestExportImportPubKey(t *testing.T) {
280280
require.NotNil(t, err)
281281
}
282282

283-
// TestAdvancedKeyManagement verifies update, import, export functionality
283+
// TestAdvancedKeyManagement verifies rotate, import, export functionality
284284
func TestAdvancedKeyManagement(t *testing.T) {
285285
t.Parallel()
286286

@@ -297,14 +297,14 @@ func TestAdvancedKeyManagement(t *testing.T) {
297297
require.Nil(t, err, "%+v", err)
298298
assertPassword(t, cstore, n1, p1, p2)
299299

300-
// update password requires the existing password
300+
// rotate password requires the existing password
301301
getNewpass := func() (string, error) { return p2, nil }
302-
err = cstore.Update(n1, "jkkgkg", getNewpass)
302+
err = cstore.Rotate(n1, "jkkgkg", getNewpass)
303303
require.NotNil(t, err)
304304
assertPassword(t, cstore, n1, p1, p2)
305305

306306
// then it changes the password when correct
307-
err = cstore.Update(n1, p1, getNewpass)
307+
err = cstore.Rotate(n1, p1, getNewpass)
308308
require.NoError(t, err)
309309
// p2 is now the proper one!
310310
assertPassword(t, cstore, n1, p2, p1)

‎tm2/pkg/crypto/keys/lazy_keybase.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ func (lkb lazyKeybase) CreateMulti(name string, pubkey crypto.PubKey) (info Info
179179
return NewDBKeybase(db).CreateMulti(name, pubkey)
180180
}
181181

182-
func (lkb lazyKeybase) Update(name, oldpass string, getNewpass func() (string, error)) error {
182+
func (lkb lazyKeybase) Rotate(name, oldpass string, getNewpass func() (string, error)) error {
183183
db, err := db.NewDB(lkb.name, dbBackend, lkb.dir)
184184
if err != nil {
185185
return err
186186
}
187187
defer db.Close()
188188

189-
return NewDBKeybase(db).Update(name, oldpass, getNewpass)
189+
return NewDBKeybase(db).Rotate(name, oldpass, getNewpass)
190190
}
191191

192192
func (lkb lazyKeybase) Import(name string, armor string) (err error) {

‎tm2/pkg/crypto/keys/types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type Keybase interface {
4343
CreateMulti(name string, pubkey crypto.PubKey) (info Info, err error)
4444

4545
// The following operations will *only* work on locally-stored keys
46-
Update(name, oldpass string, getNewpass func() (string, error)) error
46+
Rotate(name, oldpass string, getNewpass func() (string, error)) error
4747
Import(name string, armor string) (err error)
4848
ImportPrivKey(name, armor, decryptPassphrase, encryptPassphrase string) error
4949
ImportPrivKeyUnsafe(name, armor, encryptPassphrase string) error

1 commit comments

Comments
 (1)

github-actions[bot] commented on Oct 16, 2024

@github-actions[bot]

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Go Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 641d2fd Previous: 679301a Ratio
BenchmarkBinary/EmptyStruct:encode 973.5 ns/op 96 B/op 2 allocs/op 437.5 ns/op 96 B/op 2 allocs/op 2.23
BenchmarkBinary/EmptyStruct:encode - ns/op 973.5 ns/op 437.5 ns/op 2.23
BenchmarkBinary/EmptyStruct:decode 603.7 ns/op 0 B/op 0 allocs/op 235.9 ns/op 0 B/op 0 allocs/op 2.56
BenchmarkBinary/EmptyStruct:decode - ns/op 603.7 ns/op 235.9 ns/op 2.56
BenchmarkBinary/PrimitivesStruct:encode 9551 ns/op 1724 B/op 60 allocs/op 5812 ns/op 1724 B/op 60 allocs/op 1.64
BenchmarkBinary/PrimitivesStruct:encode - ns/op 9551 ns/op 5812 ns/op 1.64
BenchmarkBinary/PrimitivesStruct:decode 6162 ns/op 137 B/op 7 allocs/op 3725 ns/op 137 B/op 7 allocs/op 1.65
BenchmarkBinary/PrimitivesStruct:decode - ns/op 6162 ns/op 3725 ns/op 1.65
BenchmarkBinary/ShortArraysStruct:encode 1657 ns/op 192 B/op 4 allocs/op 925 ns/op 192 B/op 4 allocs/op 1.79
BenchmarkBinary/ShortArraysStruct:encode - ns/op 1657 ns/op 925 ns/op 1.79
BenchmarkBinary/ShortArraysStruct:decode 780.5 ns/op 0 B/op 0 allocs/op 345.7 ns/op 0 B/op 0 allocs/op 2.26
BenchmarkBinary/ShortArraysStruct:decode - ns/op 780.5 ns/op 345.7 ns/op 2.26
BenchmarkBinary/ArraysStruct:decode 16861 ns/op 790 B/op 40 allocs/op 13560 ns/op 789 B/op 40 allocs/op 1.24
BenchmarkBinary/ArraysStruct:decode - ns/op 16861 ns/op 13560 ns/op 1.24
BenchmarkBinary/PointersStruct:encode 10715 ns/op 1702 B/op 59 allocs/op 6700 ns/op 1702 B/op 59 allocs/op 1.60
BenchmarkBinary/PointersStruct:encode - ns/op 10715 ns/op 6700 ns/op 1.60
BenchmarkBinary/PointersStruct:decode 9221 ns/op 286 B/op 26 allocs/op 5647 ns/op 286 B/op 26 allocs/op 1.63
BenchmarkBinary/PointersStruct:decode - ns/op 9221 ns/op 5647 ns/op 1.63
BenchmarkBinary/EmbeddedSt1:encode 10518 ns/op 2037 B/op 65 allocs/op 6554 ns/op 2037 B/op 65 allocs/op 1.60
BenchmarkBinary/EmbeddedSt1:encode - ns/op 10518 ns/op 6554 ns/op 1.60
BenchmarkBinary/EmbeddedSt1:decode 6814 ns/op 300 B/op 8 allocs/op 4122 ns/op 300 B/op 8 allocs/op 1.65
BenchmarkBinary/EmbeddedSt1:decode - ns/op 6814 ns/op 4122 ns/op 1.65
BenchmarkBinary/AminoMarshalerStruct1:encode 5083 ns/op 512 B/op 16 allocs/op 3233 ns/op 512 B/op 16 allocs/op 1.57
BenchmarkBinary/AminoMarshalerStruct1:encode - ns/op 5083 ns/op 3233 ns/op 1.57
BenchmarkBinary/AminoMarshalerStruct1:decode 4548 ns/op 200 B/op 8 allocs/op 2837 ns/op 200 B/op 8 allocs/op 1.60
BenchmarkBinary/AminoMarshalerStruct1:decode - ns/op 4548 ns/op 2837 ns/op 1.60
BenchmarkBinary/AminoMarshalerStruct2:encode 9953 ns/op 1783 B/op 53 allocs/op 7202 ns/op 1783 B/op 53 allocs/op 1.38
BenchmarkBinary/AminoMarshalerStruct2:encode - ns/op 9953 ns/op 7202 ns/op 1.38
BenchmarkBinary/AminoMarshalerStruct2:decode 9557 ns/op 832 B/op 31 allocs/op 6478 ns/op 832 B/op 31 allocs/op 1.48
BenchmarkBinary/AminoMarshalerStruct2:decode - ns/op 9557 ns/op 6478 ns/op 1.48
BenchmarkBinary/AminoMarshalerStruct3:encode 4462 ns/op 352 B/op 12 allocs/op 2730 ns/op 352 B/op 12 allocs/op 1.63
BenchmarkBinary/AminoMarshalerStruct3:encode - ns/op 4462 ns/op 2730 ns/op 1.63
BenchmarkBinary/AminoMarshalerStruct3:decode 4209 ns/op 200 B/op 8 allocs/op 2582 ns/op 200 B/op 8 allocs/op 1.63
BenchmarkBinary/AminoMarshalerStruct3:decode - ns/op 4209 ns/op 2582 ns/op 1.63
BenchmarkBinary/AminoMarshalerInt4:encode 4801 ns/op 464 B/op 14 allocs/op 2975 ns/op 464 B/op 14 allocs/op 1.61
BenchmarkBinary/AminoMarshalerInt4:encode - ns/op 4801 ns/op 2975 ns/op 1.61
BenchmarkBinary/AminoMarshalerInt4:decode 4323 ns/op 200 B/op 8 allocs/op 2644 ns/op 200 B/op 8 allocs/op 1.64
BenchmarkBinary/AminoMarshalerInt4:decode - ns/op 4323 ns/op 2644 ns/op 1.64
BenchmarkBinary/AminoMarshalerInt5:encode 5244 ns/op 399 B/op 15 allocs/op 3319 ns/op 399 B/op 15 allocs/op 1.58
BenchmarkBinary/AminoMarshalerInt5:encode - ns/op 5244 ns/op 3319 ns/op 1.58
BenchmarkBinary/AminoMarshalerInt5:decode 4488 ns/op 231 B/op 10 allocs/op 2793 ns/op 231 B/op 10 allocs/op 1.61
BenchmarkBinary/AminoMarshalerInt5:decode - ns/op 4488 ns/op 2793 ns/op 1.61
BenchmarkBinary/AminoMarshalerStruct6:encode 8097 ns/op 904 B/op 29 allocs/op 5417 ns/op 904 B/op 29 allocs/op 1.49
BenchmarkBinary/AminoMarshalerStruct6:encode - ns/op 8097 ns/op 5417 ns/op 1.49
BenchmarkBinary/AminoMarshalerStruct6:decode 7949 ns/op 464 B/op 20 allocs/op 5172 ns/op 464 B/op 20 allocs/op 1.54
BenchmarkBinary/AminoMarshalerStruct6:decode - ns/op 7949 ns/op 5172 ns/op 1.54
BenchmarkBinary/AminoMarshalerStruct7:encode 7525 ns/op 696 B/op 24 allocs/op 4803 ns/op 696 B/op 24 allocs/op 1.57
BenchmarkBinary/AminoMarshalerStruct7:encode - ns/op 7525 ns/op 4803 ns/op 1.57
BenchmarkBinary/AminoMarshalerStruct7:decode 7702 ns/op 432 B/op 20 allocs/op 4932 ns/op 432 B/op 20 allocs/op 1.56
BenchmarkBinary/AminoMarshalerStruct7:decode - ns/op 7702 ns/op 4932 ns/op 1.56
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 69383730 ns/op 5130 B/op 9 allocs/op 34774626 ns/op 5126 B/op 9 allocs/op 2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 69383730 ns/op 34774626 ns/op 2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 138711293 ns/op 5139 B/op 9 allocs/op 34774626 ns/op 5126 B/op 9 allocs/op 3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 138711293 ns/op 34774626 ns/op 3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 277473245 ns/op 5158 B/op 9 allocs/op 34774626 ns/op 5126 B/op 9 allocs/op 7.98
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 277473245 ns/op 34774626 ns/op 7.98
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 554764352 ns/op 5196 B/op 10 allocs/op 34774626 ns/op 5126 B/op 9 allocs/op 15.95
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 554764352 ns/op 34774626 ns/op 15.95
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 1109290083 ns/op 5736 B/op 15 allocs/op 34774626 ns/op 5126 B/op 9 allocs/op 31.90
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 1109290083 ns/op 34774626 ns/op 31.90
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op 15 allocs/op 9 allocs/op 1.67
BenchmarkBcryptGenerateFromPassword/benchmark-security-param 2219536939 ns/op 5528 B/op 13 allocs/op 34774626 ns/op 5126 B/op 9 allocs/op 63.83
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op 2219536939 ns/op 34774626 ns/op 63.83
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op 13 allocs/op 9 allocs/op 1.44
BenchmarkSigning 97445 ns/op 1856 B/op 36 allocs/op 31111 ns/op 64 B/op 1 allocs/op 3.13
BenchmarkSigning - ns/op 97445 ns/op 31111 ns/op 3.13
BenchmarkSigning - B/op 1856 B/op 64 B/op 29
BenchmarkSigning - allocs/op 36 allocs/op 1 allocs/op 36
BenchmarkSigning 99627 ns/op 1856 B/op 36 allocs/op 31111 ns/op 64 B/op 1 allocs/op 3.20
BenchmarkSigning - ns/op 99627 ns/op 31111 ns/op 3.20
BenchmarkSigning - B/op 1856 B/op 64 B/op 29
BenchmarkSigning - allocs/op 36 allocs/op 1 allocs/op 36
BenchmarkVerification 188069 ns/op 864 B/op 19 allocs/op 73474 ns/op 0 B/op 0 allocs/op 2.56
BenchmarkVerification - ns/op 188069 ns/op 73474 ns/op 2.56
BenchmarkVerification - B/op 864 B/op 0 B/op +∞
BenchmarkVerification - allocs/op 19 allocs/op 0 allocs/op +∞
BenchmarkVerification 193971 ns/op 864 B/op 19 allocs/op 73474 ns/op 0 B/op 0 allocs/op 2.64
BenchmarkVerification - ns/op 193971 ns/op 73474 ns/op 2.64
BenchmarkVerification - B/op 864 B/op 0 B/op +∞
BenchmarkVerification - allocs/op 19 allocs/op 0 allocs/op +∞
BenchmarkRandomBytes/random 88.89 ns/op 16 B/op 1 allocs/op 46.88 ns/op 4 B/op 1 allocs/op 1.90
BenchmarkRandomBytes/random - ns/op 88.89 ns/op 46.88 ns/op 1.90
BenchmarkRandomBytes/random - B/op 16 B/op 4 B/op 4
BenchmarkRandomBytes/random 135.1 ns/op 32 B/op 1 allocs/op 46.88 ns/op 4 B/op 1 allocs/op 2.88
BenchmarkRandomBytes/random - ns/op 135.1 ns/op 46.88 ns/op 2.88
BenchmarkRandomBytes/random - B/op 32 B/op 4 B/op 8
BenchmarkRandomBytes/random 331.3 ns/op 112 B/op 1 allocs/op 46.88 ns/op 4 B/op 1 allocs/op 7.07
BenchmarkRandomBytes/random - ns/op 331.3 ns/op 46.88 ns/op 7.07
BenchmarkRandomBytes/random - B/op 112 B/op 4 B/op 28
BenchmarkRandomBytes/random 2824 ns/op 1024 B/op 1 allocs/op 46.88 ns/op 4 B/op 1 allocs/op 60.24
BenchmarkRandomBytes/random - ns/op 2824 ns/op 46.88 ns/op 60.24
BenchmarkRandomBytes/random - B/op 1024 B/op 4 B/op 256
BenchmarkSmall/boltdb-1000-100-16-40/update 1402634 ns/op 46555 B/op 401 allocs/op 843765 ns/op 36903 B/op 364 allocs/op 1.66
BenchmarkSmall/boltdb-1000-100-16-40/update - ns/op 1402634 ns/op 843765 ns/op 1.66
BenchmarkSmall/boltdb-1000-100-16-40/update - B/op 46555 B/op 36903 B/op 1.26
BenchmarkSmall/goleveldb-1000-100-16-40/block 13746210 ns/op 4406203 B/op 46898 allocs/op 11334793 ns/op 3288144 B/op 35620 allocs/op 1.21
BenchmarkSmall/goleveldb-1000-100-16-40/block - ns/op 13746210 ns/op 11334793 ns/op 1.21
BenchmarkSmall/goleveldb-1000-100-16-40/block - B/op 4406203 B/op 3288144 B/op 1.34
BenchmarkSmall/goleveldb-1000-100-16-40/block - allocs/op 46898 allocs/op 35620 allocs/op 1.32
BenchmarkSmall/memdb-1000-100-16-40/block 20737727 ns/op 9069661 B/op 165088 allocs/op 15591488 ns/op 6576384 B/op 116691 allocs/op 1.33
BenchmarkSmall/memdb-1000-100-16-40/block - ns/op 20737727 ns/op 15591488 ns/op 1.33
BenchmarkSmall/memdb-1000-100-16-40/block - B/op 9069661 B/op 6576384 B/op 1.38
BenchmarkSmall/memdb-1000-100-16-40/block - allocs/op 165088 allocs/op 116691 allocs/op 1.41
BenchmarkMedium/boltdb-100000-100-16-40/update 6673256 ns/op 129759 B/op 1013 allocs/op 4814868 ns/op 95463 B/op 810 allocs/op 1.39
BenchmarkMedium/boltdb-100000-100-16-40/update - ns/op 6673256 ns/op 4814868 ns/op 1.39
BenchmarkMedium/boltdb-100000-100-16-40/update - B/op 129759 B/op 95463 B/op 1.36
BenchmarkMedium/boltdb-100000-100-16-40/update - allocs/op 1013 allocs/op 810 allocs/op 1.25
BenchmarkMedium/memdb-100000-100-16-40/update 1369540 ns/op 373984 B/op 7409 allocs/op 1059697 ns/op 257418 B/op 4965 allocs/op 1.29
BenchmarkMedium/memdb-100000-100-16-40/update - ns/op 1369540 ns/op 1059697 ns/op 1.29
BenchmarkMedium/memdb-100000-100-16-40/update - B/op 373984 B/op 257418 B/op 1.45
BenchmarkMedium/memdb-100000-100-16-40/update - allocs/op 7409 allocs/op 4965 allocs/op 1.49
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - B/op 48984 B/op 39205 B/op 1.25
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - allocs/op 592 allocs/op 455 allocs/op 1.30
BenchmarkHash/ripemd160 3956 ns/op 25 B/op 1 allocs/op 1019 ns/op 25 B/op 1 allocs/op 3.88
BenchmarkHash/ripemd160 - ns/op 3956 ns/op 1019 ns/op 3.88
BenchmarkHash/sha2-256 1773 ns/op 33 B/op 1 allocs/op 506.9 ns/op 33 B/op 1 allocs/op 3.50
BenchmarkHash/sha2-256 - ns/op 1773 ns/op 506.9 ns/op 3.50
BenchmarkHash/sha3-256 2077 ns/op 33 B/op 1 allocs/op 763.6 ns/op 33 B/op 1 allocs/op 2.72
BenchmarkHash/sha3-256 - ns/op 2077 ns/op 763.6 ns/op 2.72
BenchmarkSwitchBroadcast 17373 ns/op 1760 B/op 53 allocs/op 11733 ns/op 1762 B/op 53 allocs/op 1.48
BenchmarkSwitchBroadcast - ns/op 17373 ns/op 11733 ns/op 1.48
BenchmarkReadSecretConnection 3349 ns/op 0 B/op 0 allocs/op 2777 ns/op 0 B/op 0 allocs/op 1.21
BenchmarkReadSecretConnection - ns/op 3349 ns/op 2777 ns/op 1.21
BenchmarkCacheStoreIterator50000 - allocs/op 5247 allocs/op 4313 allocs/op 1.22

This comment was automatically generated by workflow using github-action-benchmark.

CC: @ajnavarro @thehowl @zivkovicmilos

Please sign in to comment.