Skip to content

Commit

Permalink
feat(tm2/crypto/keys): In the gnokey CLI, add command to update the p…
Browse files Browse the repository at this point in the history
…assword (#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 <jeff@thefirst.org>
Co-authored-by: Morgan <morgan@morganbaz.com>
  • Loading branch information
jefft0 and thehowl authored Oct 16, 2024
1 parent 5444859 commit 641d2fd
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 11 deletions.
13 changes: 13 additions & 0 deletions docs/gno-tooling/cli/gnokey/working-with-key-pairs.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ gno.land keychain & client
SUBCOMMANDS
add adds key to the keybase
delete deletes a key from the keybase
rotate rotate the password of a key in the keybase to a new password
generate generates a bip39 mnemonic
export exports private key armor
import imports encrypted private key armor
Expand Down Expand Up @@ -161,6 +162,18 @@ you can recover it using the key's mnemonic, or by importing it if it was export
at a previous point in time.
:::


## Rotating the password of a private key to a new password
To rotate the password of a private key from the `gnokey` keystore to a new password, we need to know the name or
address of the key to remove.
After we have this information, we can run the following command:

```bash
gnokey rotate MyKey
```

After entering the current key decryption password and the new password, the password of the key will be updated in the keystore.

## Exporting a private key
Private keys stored in the `gnokey` keystore can be exported to a desired place
on the user's filesystem.
Expand Down
1 change: 1 addition & 0 deletions gno.land/pkg/keyscli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func NewRootCmd(io commands.IO, base client.BaseOptions) *commands.Command {
cmd.AddSubCommands(
client.NewAddCmd(cfg, io),
client.NewDeleteCmd(cfg, io),
client.NewRotateCmd(cfg, io),
client.NewGenerateCmd(cfg, io),
client.NewExportCmd(cfg, io),
client.NewImportCmd(cfg, io),
Expand Down
1 change: 1 addition & 0 deletions tm2/pkg/crypto/keys/client/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func NewRootCmdWithBaseConfig(io commands.IO, base BaseOptions) *commands.Comman
NewExportCmd(cfg, io),
NewImportCmd(cfg, io),
NewListCmd(cfg, io),
NewRotateCmd(cfg, io),
NewSignCmd(cfg, io),
NewVerifyCmd(cfg, io),
NewQueryCmd(cfg, io),
Expand Down
75 changes: 75 additions & 0 deletions tm2/pkg/crypto/keys/client/rotate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package client

import (
"context"
"flag"
"fmt"

"github.com/gnolang/gno/tm2/pkg/commands"
"github.com/gnolang/gno/tm2/pkg/crypto/keys"
)

type RotateCfg struct {
RootCfg *BaseCfg

Force bool
}

func NewRotateCmd(rootCfg *BaseCfg, io commands.IO) *commands.Command {
cfg := &RotateCfg{
RootCfg: rootCfg,
}

return commands.NewCommand(
commands.Metadata{
Name: "rotate",
ShortUsage: "rotate [flags] <key-name>",
ShortHelp: "rotate the password of a key in the keybase to a new password",
},
cfg,
func(_ context.Context, args []string) error {
return execRotate(cfg, args, io)
},
)
}

func (c *RotateCfg) RegisterFlags(fs *flag.FlagSet) {
}

func execRotate(cfg *RotateCfg, args []string, io commands.IO) error {
if len(args) != 1 {
return flag.ErrHelp
}

nameOrBech32 := args[0]

kb, err := keys.NewKeyBaseFromDir(cfg.RootCfg.Home)
if err != nil {
return err
}

oldpass, err := io.GetPassword("Enter the current password:", cfg.RootCfg.InsecurePasswordStdin)
if err != nil {
return err
}

newpass, err := io.GetCheckPassword(
[2]string{
"Enter the new password to encrypt your key to disk:",
"Repeat the password:",
},
cfg.RootCfg.InsecurePasswordStdin,
)
if err != nil {
return fmt.Errorf("unable to parse provided password, %w", err)
}

getNewpass := func() (string, error) { return newpass, nil }
err = kb.Rotate(nameOrBech32, oldpass, getNewpass)
if err != nil {
return err
}
io.ErrPrintln("Password rotated")

return nil
}
95 changes: 95 additions & 0 deletions tm2/pkg/crypto/keys/client/rotate_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
package client

import (
"strings"
"testing"

"github.com/gnolang/gno/tm2/pkg/commands"
"github.com/gnolang/gno/tm2/pkg/crypto/keys"
"github.com/gnolang/gno/tm2/pkg/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func Test_execRotate(t *testing.T) {
t.Parallel()

// make new test dir
kbHome, kbCleanUp := testutils.NewTestCaseDir(t)
defer kbCleanUp()

// initialize test options
cfg := &RotateCfg{
RootCfg: &BaseCfg{
BaseOptions: BaseOptions{
Home: kbHome,
InsecurePasswordStdin: true,
},
},
}

io := commands.NewTestIO()

// Add test accounts to keybase.
kb, err := keys.NewKeyBaseFromDir(kbHome)
assert.NoError(t, err)

keyName := "rotateApp_Key1"
p1, p2 := "1234", "foobar"
mnemonic := "equip will roof matter pink blind book anxiety banner elbow sun young"

_, err = kb.CreateAccount(keyName, mnemonic, "", p1, 0, 0)
assert.NoError(t, err)

{
// test: Key not found
args := []string{"blah"}
io.SetIn(strings.NewReader(p1 + "\n" + p2 + "\n" + p2 + "\n"))
err = execRotate(cfg, args, io)
require.Error(t, err)
require.Equal(t, "Key blah not found", err.Error())
}

{
// test: Wrong password
args := []string{keyName}
io.SetIn(strings.NewReader("blah" + "\n" + p2 + "\n" + p2 + "\n"))
err = execRotate(cfg, args, io)
require.Error(t, err)
require.Equal(t, "invalid account password", err.Error())
}

{
// test: New passwords don't match
args := []string{keyName}
io.SetIn(strings.NewReader(p1 + "\n" + p2 + "\n" + "blah" + "\n"))
err = execRotate(cfg, args, io)
require.Error(t, err)
require.Equal(t, "unable to parse provided password, passphrases don't match", err.Error())
}

{
// Rotate the password
args := []string{keyName}
io.SetIn(strings.NewReader(p1 + "\n" + p2 + "\n" + p2 + "\n"))
err = execRotate(cfg, args, io)
require.NoError(t, err)
}

{
// test: The old password shouldn't work
args := []string{keyName}
io.SetIn(strings.NewReader(p1 + "\n" + p1 + "\n" + p1 + "\n"))
err = execRotate(cfg, args, io)
require.Error(t, err)
require.Equal(t, "invalid account password", err.Error())
}

{
// Updating the new password to itself should work
args := []string{keyName}
io.SetIn(strings.NewReader(p2 + "\n" + p2 + "\n" + p2 + "\n"))
err = execRotate(cfg, args, io)
require.NoError(t, err)
}
}
4 changes: 2 additions & 2 deletions tm2/pkg/crypto/keys/keybase.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,13 @@ func (kb dbKeybase) Delete(nameOrBech32, passphrase string, skipPass bool) error
return nil
}

// Update changes the passphrase with which an already stored key is
// Rotate changes the passphrase with which an already stored key is
// encrypted.
//
// oldpass must be the current passphrase used for encryption,
// getNewpass is a function to get the passphrase to permanently replace
// the current passphrase
func (kb dbKeybase) Update(nameOrBech32, oldpass string, getNewpass func() (string, error)) error {
func (kb dbKeybase) Rotate(nameOrBech32, oldpass string, getNewpass func() (string, error)) error {
info, err := kb.GetByNameOrAddress(nameOrBech32)
if err != nil {
return err
Expand Down
12 changes: 6 additions & 6 deletions tm2/pkg/crypto/keys/keybase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ func assertPassword(t *testing.T, cstore Keybase, name, pass, badpass string) {
t.Helper()

getNewpass := func() (string, error) { return pass, nil }
err := cstore.Update(name, badpass, getNewpass)
err := cstore.Rotate(name, badpass, getNewpass)
require.NotNil(t, err)
err = cstore.Update(name, pass, getNewpass)
err = cstore.Rotate(name, pass, getNewpass)
require.Nil(t, err, "%+v", err)
}

Expand Down Expand Up @@ -280,7 +280,7 @@ func TestExportImportPubKey(t *testing.T) {
require.NotNil(t, err)
}

// TestAdvancedKeyManagement verifies update, import, export functionality
// TestAdvancedKeyManagement verifies rotate, import, export functionality
func TestAdvancedKeyManagement(t *testing.T) {
t.Parallel()

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

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

// then it changes the password when correct
err = cstore.Update(n1, p1, getNewpass)
err = cstore.Rotate(n1, p1, getNewpass)
require.NoError(t, err)
// p2 is now the proper one!
assertPassword(t, cstore, n1, p2, p1)
Expand Down
4 changes: 2 additions & 2 deletions tm2/pkg/crypto/keys/lazy_keybase.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ func (lkb lazyKeybase) CreateMulti(name string, pubkey crypto.PubKey) (info Info
return NewDBKeybase(db).CreateMulti(name, pubkey)
}

func (lkb lazyKeybase) Update(name, oldpass string, getNewpass func() (string, error)) error {
func (lkb lazyKeybase) Rotate(name, oldpass string, getNewpass func() (string, error)) error {
db, err := db.NewDB(lkb.name, dbBackend, lkb.dir)
if err != nil {
return err
}
defer db.Close()

return NewDBKeybase(db).Update(name, oldpass, getNewpass)
return NewDBKeybase(db).Rotate(name, oldpass, getNewpass)
}

func (lkb lazyKeybase) Import(name string, armor string) (err error) {
Expand Down
2 changes: 1 addition & 1 deletion tm2/pkg/crypto/keys/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Keybase interface {
CreateMulti(name string, pubkey crypto.PubKey) (info Info, err error)

// The following operations will *only* work on locally-stored keys
Update(name, oldpass string, getNewpass func() (string, error)) error
Rotate(name, oldpass string, getNewpass func() (string, error)) error
Import(name string, armor string) (err error)
ImportPrivKey(name, armor, decryptPassphrase, encryptPassphrase string) error
ImportPrivKeyUnsafe(name, armor, encryptPassphrase string) error
Expand Down

1 comment on commit 641d2fd

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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.