From d87146a79758d92415456b105a62b6708a7e223c Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:17:16 +0200 Subject: [PATCH 01/17] chore: make autofile wasm-friendly h/t @ilgooz (pair-programming session) Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- tm2/pkg/autofile/autofile.go | 19 +++++++------------ tm2/pkg/autofile/autofile_unix.go | 21 +++++++++++++++++++++ tm2/pkg/autofile/autofile_wasm.go | 7 +++++++ 3 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 tm2/pkg/autofile/autofile_unix.go create mode 100644 tm2/pkg/autofile/autofile_wasm.go diff --git a/tm2/pkg/autofile/autofile.go b/tm2/pkg/autofile/autofile.go index 205554a7644..b81e4368e8c 100644 --- a/tm2/pkg/autofile/autofile.go +++ b/tm2/pkg/autofile/autofile.go @@ -2,9 +2,7 @@ package autofile import ( "os" - "os/signal" "sync" - "syscall" "time" "github.com/gnolang/gno/tm2/pkg/random" @@ -63,19 +61,16 @@ func OpenAutoFile(path string) (*AutoFile, error) { closeTicker: time.NewTicker(autoFileClosePeriod), closeTickerStopc: make(chan struct{}), } + if err := af.openFile(); err != nil { af.Close() return nil, err } - // Close file on SIGHUP. - af.hupc = make(chan os.Signal, 1) - signal.Notify(af.hupc, syscall.SIGHUP) - go func() { - for range af.hupc { - af.closeFile() - } - }() + // see autofile_*.go implementations, following different build constraints. + if err := af.setupCloseHandler(); err != nil { + return nil, err + } go af.closeFileRoutine() @@ -158,10 +153,10 @@ func (af *AutoFile) openFile() error { } // fileInfo, err := file.Stat() // if err != nil { - // return err + // return err // } // if fileInfo.Mode() != autoFilePerms { - // return errors.NewErrPermissionsChanged(file.Name(), fileInfo.Mode(), autoFilePerms) + // return errors.NewErrPermissionsChanged(file.Name(), fileInfo.Mode(), autoFilePerms) // } af.file = file return nil diff --git a/tm2/pkg/autofile/autofile_unix.go b/tm2/pkg/autofile/autofile_unix.go new file mode 100644 index 00000000000..5076d7d58c8 --- /dev/null +++ b/tm2/pkg/autofile/autofile_unix.go @@ -0,0 +1,21 @@ +//go:build !js || !wasm + +package autofile + +import ( + "os" + "os/signal" + "syscall" +) + +func (af *AutoFile) setupCloseHandler() error { + // Close file on SIGHUP. + af.hupc = make(chan os.Signal, 1) + signal.Notify(af.hupc, syscall.SIGHUP) + go func() { + for range af.hupc { + af.closeFile() + } + }() + return nil +} diff --git a/tm2/pkg/autofile/autofile_wasm.go b/tm2/pkg/autofile/autofile_wasm.go new file mode 100644 index 00000000000..8d9e5de86c9 --- /dev/null +++ b/tm2/pkg/autofile/autofile_wasm.go @@ -0,0 +1,7 @@ +//go:build js && wasm + +package autofile + +func (af *AutoFile) setupCloseHandler() error { + return nil +} From 886013606294d41228c34536628e11aad0fde83a Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:20:43 +0200 Subject: [PATCH 02/17] ci: setup wasm check on gnovm --- .github/workflows/gnovm.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gnovm.yml b/.github/workflows/gnovm.yml index 79bff34866e..9fca101084e 100644 --- a/.github/workflows/gnovm.yml +++ b/.github/workflows/gnovm.yml @@ -23,10 +23,14 @@ jobs: strategy: fail-fast: false matrix: - go-version: [ "1.19.x", "1.20.x" ] - goarch: [ "amd64" ] - goos: [ "linux" ] - program: [ "gno" ] + go-version: # two latest versions + - "1.19.x" + - "1.20.x" + goenv: # TODO: replace with pairs, so it's easier to read in the GH interface. + - "GOARCH=amd64 GOOS=linux" + - "GOARCH=js GOOS=wasm" + program: + - "gno" runs-on: ubuntu-latest timeout-minutes: 5 steps: @@ -36,7 +40,7 @@ jobs: - uses: actions/checkout@v3 - name: go install working-directory: gnovm - run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ./cmd/${{ matrix.program }} + run: ${{ matrix.goenv }} go install ./cmd/${{ matrix.program }} test: strategy: From 6ae74889a406fadb738e890256c9d5fc040ed58c Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:22:42 +0200 Subject: [PATCH 03/17] chore: fixup --- .github/workflows/gnovm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gnovm.yml b/.github/workflows/gnovm.yml index 9fca101084e..0fce8292816 100644 --- a/.github/workflows/gnovm.yml +++ b/.github/workflows/gnovm.yml @@ -28,7 +28,7 @@ jobs: - "1.20.x" goenv: # TODO: replace with pairs, so it's easier to read in the GH interface. - "GOARCH=amd64 GOOS=linux" - - "GOARCH=js GOOS=wasm" + - "GOARCH=wasm GOOS=js" program: - "gno" runs-on: ubuntu-latest From 5b8953da3e365db3882fc9e4eee5c4a1007f214a Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:42:10 +0200 Subject: [PATCH 04/17] chore: skip leveldb import for wasm Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- .../example/kvstore/persistent_kvstore.go | 4 +- tm2/pkg/crypto/keys/lazy_keybase.go | 46 +++++++++---------- tm2/pkg/db/go_level_db.go | 2 + tm2/pkg/iavl/nodedb.go | 8 ---- 4 files changed, 27 insertions(+), 33 deletions(-) diff --git a/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go b/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go index 09c827d1433..61efda293c5 100644 --- a/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go +++ b/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go @@ -10,7 +10,7 @@ import ( "github.com/gnolang/gno/tm2/pkg/bft/abci/example/errors" abci "github.com/gnolang/gno/tm2/pkg/bft/abci/types" "github.com/gnolang/gno/tm2/pkg/crypto" - dbm "github.com/gnolang/gno/tm2/pkg/db" + "github.com/gnolang/gno/tm2/pkg/db" "github.com/gnolang/gno/tm2/pkg/log" ) @@ -34,7 +34,7 @@ type PersistentKVStoreApplication struct { func NewPersistentKVStoreApplication(dbDir string) *PersistentKVStoreApplication { name := "kvstore" - db, err := dbm.NewGoLevelDB(name, dbDir) + db, err := db.NewDB(name, db.CLevelDBBackend, dbDir) if err != nil { panic(err) } diff --git a/tm2/pkg/crypto/keys/lazy_keybase.go b/tm2/pkg/crypto/keys/lazy_keybase.go index 2b2719bfdba..260b7cd6957 100644 --- a/tm2/pkg/crypto/keys/lazy_keybase.go +++ b/tm2/pkg/crypto/keys/lazy_keybase.go @@ -5,7 +5,7 @@ import ( "github.com/gnolang/gno/tm2/pkg/crypto" "github.com/gnolang/gno/tm2/pkg/crypto/hd" - dbm "github.com/gnolang/gno/tm2/pkg/db" + "github.com/gnolang/gno/tm2/pkg/db" "github.com/gnolang/gno/tm2/pkg/os" ) @@ -26,7 +26,7 @@ func NewLazyDBKeybase(name, dir string) Keybase { } func (lkb lazyKeybase) List() ([]Info, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -36,7 +36,7 @@ func (lkb lazyKeybase) List() ([]Info, error) { } func (lkb lazyKeybase) GetByNameOrAddress(nameOrBech32 string) (Info, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func (lkb lazyKeybase) GetByNameOrAddress(nameOrBech32 string) (Info, error) { } func (lkb lazyKeybase) GetByName(name string) (Info, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -56,7 +56,7 @@ func (lkb lazyKeybase) GetByName(name string) (Info, error) { } func (lkb lazyKeybase) GetByAddress(address crypto.Address) (Info, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -66,7 +66,7 @@ func (lkb lazyKeybase) GetByAddress(address crypto.Address) (Info, error) { } func (lkb lazyKeybase) Delete(name, passphrase string, skipPass bool) error { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return err } @@ -76,7 +76,7 @@ func (lkb lazyKeybase) Delete(name, passphrase string, skipPass bool) error { } func (lkb lazyKeybase) Sign(name, passphrase string, msg []byte) ([]byte, crypto.PubKey, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, nil, err } @@ -86,7 +86,7 @@ func (lkb lazyKeybase) Sign(name, passphrase string, msg []byte) ([]byte, crypto } func (lkb lazyKeybase) Verify(name string, msg, sig []byte) error { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return err } @@ -96,7 +96,7 @@ func (lkb lazyKeybase) Verify(name string, msg, sig []byte) error { } func (lkb lazyKeybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd string, account uint32, index uint32) (Info, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -106,7 +106,7 @@ func (lkb lazyKeybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd } func (lkb lazyKeybase) CreateAccountBip44(name, mnemonic, bip39Passwd, encryptPasswd string, params hd.BIP44Params) (Info, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -116,7 +116,7 @@ func (lkb lazyKeybase) CreateAccountBip44(name, mnemonic, bip39Passwd, encryptPa } func (lkb lazyKeybase) CreateLedger(name string, algo SigningAlgo, hrp string, account, index uint32) (info Info, err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func (lkb lazyKeybase) CreateLedger(name string, algo SigningAlgo, hrp string, a } func (lkb lazyKeybase) CreateOffline(name string, pubkey crypto.PubKey) (info Info, err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -136,7 +136,7 @@ func (lkb lazyKeybase) CreateOffline(name string, pubkey crypto.PubKey) (info In } func (lkb lazyKeybase) CreateMulti(name string, pubkey crypto.PubKey) (info Info, err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -146,7 +146,7 @@ func (lkb lazyKeybase) CreateMulti(name string, pubkey crypto.PubKey) (info Info } func (lkb lazyKeybase) Update(name, oldpass string, getNewpass func() (string, error)) error { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return err } @@ -156,7 +156,7 @@ func (lkb lazyKeybase) Update(name, oldpass string, getNewpass func() (string, e } func (lkb lazyKeybase) Import(name string, armor string) (err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return err } @@ -171,7 +171,7 @@ func (lkb lazyKeybase) ImportPrivKey( decryptPassphrase, encryptPassphrase string, ) error { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return err } @@ -185,7 +185,7 @@ func (lkb lazyKeybase) ImportPrivKeyUnsafe( armor string, encryptPassphrase string, ) error { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return err } @@ -195,7 +195,7 @@ func (lkb lazyKeybase) ImportPrivKeyUnsafe( } func (lkb lazyKeybase) ImportPubKey(name string, armor string) (err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return err } @@ -205,7 +205,7 @@ func (lkb lazyKeybase) ImportPubKey(name string, armor string) (err error) { } func (lkb lazyKeybase) Export(name string) (armor string, err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return "", err } @@ -215,7 +215,7 @@ func (lkb lazyKeybase) Export(name string) (armor string, err error) { } func (lkb lazyKeybase) ExportPubKey(name string) (armor string, err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return "", err } @@ -225,7 +225,7 @@ func (lkb lazyKeybase) ExportPubKey(name string) (armor string, err error) { } func (lkb lazyKeybase) ExportPrivateKeyObject(name string, passphrase string) (crypto.PrivKey, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return nil, err } @@ -237,7 +237,7 @@ func (lkb lazyKeybase) ExportPrivateKeyObject(name string, passphrase string) (c func (lkb lazyKeybase) ExportPrivKey(name string, decryptPassphrase string, encryptPassphrase string, ) (armor string, err error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return "", err } @@ -247,7 +247,7 @@ func (lkb lazyKeybase) ExportPrivKey(name string, decryptPassphrase string, } func (lkb lazyKeybase) ExportPrivKeyUnsafe(name string, decryptPassphrase string) (string, error) { - db, err := dbm.NewGoLevelDB(lkb.name, lkb.dir) + db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) if err != nil { return "", err } diff --git a/tm2/pkg/db/go_level_db.go b/tm2/pkg/db/go_level_db.go index 80e1e5f5c1e..10c31d6e1a1 100644 --- a/tm2/pkg/db/go_level_db.go +++ b/tm2/pkg/db/go_level_db.go @@ -1,3 +1,5 @@ +//go:build !wasm || !js + package db import ( diff --git a/tm2/pkg/iavl/nodedb.go b/tm2/pkg/iavl/nodedb.go index 4c8e41a30b0..3e59b3480e9 100644 --- a/tm2/pkg/iavl/nodedb.go +++ b/tm2/pkg/iavl/nodedb.go @@ -117,14 +117,6 @@ func (ndb *nodeDB) SaveNode(node *Node) { // Has checks if a hash exists in the database. func (ndb *nodeDB) Has(hash []byte) bool { key := ndb.nodeKey(hash) - - if ldb, ok := ndb.db.(*dbm.GoLevelDB); ok { - exists, err := ldb.DB().Has(key, nil) - if err != nil { - panic("Got error from leveldb: " + err.Error()) - } - return exists - } return ndb.db.Get(key) != nil } From 9f7b4e036897e78b6aa7c602bd38a5fb972ead4c Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:50:12 +0200 Subject: [PATCH 05/17] Update tm2/pkg/autofile/autofile_wasm.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: İlker G. Öztürk --- tm2/pkg/autofile/autofile_wasm.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tm2/pkg/autofile/autofile_wasm.go b/tm2/pkg/autofile/autofile_wasm.go index 8d9e5de86c9..3d328ef9992 100644 --- a/tm2/pkg/autofile/autofile_wasm.go +++ b/tm2/pkg/autofile/autofile_wasm.go @@ -1,4 +1,5 @@ //go:build js && wasm +// +build js,wasm package autofile From fcb6fdd33094d3dd4f3f9149109337121fbd5fa6 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 12:58:31 +0200 Subject: [PATCH 06/17] chore: use memdb for wasm Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- .../example/kvstore/persistent_kvstore.go | 2 +- tm2/pkg/crypto/keys/lazy_keybase.go | 44 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go b/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go index 61efda293c5..4d8edefa06b 100644 --- a/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go +++ b/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go @@ -34,7 +34,7 @@ type PersistentKVStoreApplication struct { func NewPersistentKVStoreApplication(dbDir string) *PersistentKVStoreApplication { name := "kvstore" - db, err := db.NewDB(name, db.CLevelDBBackend, dbDir) + db, err := db.NewDB(name, dbBackend, dbDir) if err != nil { panic(err) } diff --git a/tm2/pkg/crypto/keys/lazy_keybase.go b/tm2/pkg/crypto/keys/lazy_keybase.go index 260b7cd6957..23c5878bc9a 100644 --- a/tm2/pkg/crypto/keys/lazy_keybase.go +++ b/tm2/pkg/crypto/keys/lazy_keybase.go @@ -26,7 +26,7 @@ func NewLazyDBKeybase(name, dir string) Keybase { } func (lkb lazyKeybase) List() ([]Info, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -36,7 +36,7 @@ func (lkb lazyKeybase) List() ([]Info, error) { } func (lkb lazyKeybase) GetByNameOrAddress(nameOrBech32 string) (Info, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func (lkb lazyKeybase) GetByNameOrAddress(nameOrBech32 string) (Info, error) { } func (lkb lazyKeybase) GetByName(name string) (Info, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -56,7 +56,7 @@ func (lkb lazyKeybase) GetByName(name string) (Info, error) { } func (lkb lazyKeybase) GetByAddress(address crypto.Address) (Info, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -66,7 +66,7 @@ func (lkb lazyKeybase) GetByAddress(address crypto.Address) (Info, error) { } func (lkb lazyKeybase) Delete(name, passphrase string, skipPass bool) error { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return err } @@ -76,7 +76,7 @@ func (lkb lazyKeybase) Delete(name, passphrase string, skipPass bool) error { } func (lkb lazyKeybase) Sign(name, passphrase string, msg []byte) ([]byte, crypto.PubKey, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, nil, err } @@ -86,7 +86,7 @@ func (lkb lazyKeybase) Sign(name, passphrase string, msg []byte) ([]byte, crypto } func (lkb lazyKeybase) Verify(name string, msg, sig []byte) error { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return err } @@ -96,7 +96,7 @@ func (lkb lazyKeybase) Verify(name string, msg, sig []byte) error { } func (lkb lazyKeybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd string, account uint32, index uint32) (Info, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -106,7 +106,7 @@ func (lkb lazyKeybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd } func (lkb lazyKeybase) CreateAccountBip44(name, mnemonic, bip39Passwd, encryptPasswd string, params hd.BIP44Params) (Info, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -116,7 +116,7 @@ func (lkb lazyKeybase) CreateAccountBip44(name, mnemonic, bip39Passwd, encryptPa } func (lkb lazyKeybase) CreateLedger(name string, algo SigningAlgo, hrp string, account, index uint32) (info Info, err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func (lkb lazyKeybase) CreateLedger(name string, algo SigningAlgo, hrp string, a } func (lkb lazyKeybase) CreateOffline(name string, pubkey crypto.PubKey) (info Info, err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -136,7 +136,7 @@ func (lkb lazyKeybase) CreateOffline(name string, pubkey crypto.PubKey) (info In } func (lkb lazyKeybase) CreateMulti(name string, pubkey crypto.PubKey) (info Info, err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -146,7 +146,7 @@ func (lkb lazyKeybase) CreateMulti(name string, pubkey crypto.PubKey) (info Info } func (lkb lazyKeybase) Update(name, oldpass string, getNewpass func() (string, error)) error { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return err } @@ -156,7 +156,7 @@ func (lkb lazyKeybase) Update(name, oldpass string, getNewpass func() (string, e } func (lkb lazyKeybase) Import(name string, armor string) (err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return err } @@ -171,7 +171,7 @@ func (lkb lazyKeybase) ImportPrivKey( decryptPassphrase, encryptPassphrase string, ) error { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return err } @@ -185,7 +185,7 @@ func (lkb lazyKeybase) ImportPrivKeyUnsafe( armor string, encryptPassphrase string, ) error { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return err } @@ -195,7 +195,7 @@ func (lkb lazyKeybase) ImportPrivKeyUnsafe( } func (lkb lazyKeybase) ImportPubKey(name string, armor string) (err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return err } @@ -205,7 +205,7 @@ func (lkb lazyKeybase) ImportPubKey(name string, armor string) (err error) { } func (lkb lazyKeybase) Export(name string) (armor string, err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return "", err } @@ -215,7 +215,7 @@ func (lkb lazyKeybase) Export(name string) (armor string, err error) { } func (lkb lazyKeybase) ExportPubKey(name string) (armor string, err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return "", err } @@ -225,7 +225,7 @@ func (lkb lazyKeybase) ExportPubKey(name string) (armor string, err error) { } func (lkb lazyKeybase) ExportPrivateKeyObject(name string, passphrase string) (crypto.PrivKey, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return nil, err } @@ -237,7 +237,7 @@ func (lkb lazyKeybase) ExportPrivateKeyObject(name string, passphrase string) (c func (lkb lazyKeybase) ExportPrivKey(name string, decryptPassphrase string, encryptPassphrase string, ) (armor string, err error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return "", err } @@ -247,7 +247,7 @@ func (lkb lazyKeybase) ExportPrivKey(name string, decryptPassphrase string, } func (lkb lazyKeybase) ExportPrivKeyUnsafe(name string, decryptPassphrase string) (string, error) { - db, err := db.NewDB(lkb.name, db.CLevelDBBackend, lkb.dir) + db, err := db.NewDB(lkb.name, dbBackend, lkb.dir) if err != nil { return "", err } From 7166b653a3479537c09f0dd3197ec461c14a8e77 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:00:09 +0200 Subject: [PATCH 07/17] chore: use memdb for wasm Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- tm2/pkg/bft/abci/example/kvstore/os_default.go | 8 ++++++++ tm2/pkg/bft/abci/example/kvstore/os_wasm.go | 8 ++++++++ tm2/pkg/crypto/keys/os_default.go | 8 ++++++++ tm2/pkg/crypto/keys/os_wasm.go | 8 ++++++++ 4 files changed, 32 insertions(+) create mode 100644 tm2/pkg/bft/abci/example/kvstore/os_default.go create mode 100644 tm2/pkg/bft/abci/example/kvstore/os_wasm.go create mode 100644 tm2/pkg/crypto/keys/os_default.go create mode 100644 tm2/pkg/crypto/keys/os_wasm.go diff --git a/tm2/pkg/bft/abci/example/kvstore/os_default.go b/tm2/pkg/bft/abci/example/kvstore/os_default.go new file mode 100644 index 00000000000..4f4ebe01a13 --- /dev/null +++ b/tm2/pkg/bft/abci/example/kvstore/os_default.go @@ -0,0 +1,8 @@ +//go:build !wasm || !js +// +build !wasm !js + +package kvstore + +import "github.com/gnolang/gno/tm2/pkg/db" + +const dbBackend db.BackendType = db.CLevelDBBackend diff --git a/tm2/pkg/bft/abci/example/kvstore/os_wasm.go b/tm2/pkg/bft/abci/example/kvstore/os_wasm.go new file mode 100644 index 00000000000..33be8be1f7c --- /dev/null +++ b/tm2/pkg/bft/abci/example/kvstore/os_wasm.go @@ -0,0 +1,8 @@ +//go:build wasm && js +// +build wasm,js + +package kvstore + +import "github.com/gnolang/gno/tm2/pkg/db" + +const dbBackend db.BackendType = db.MemDBBackend diff --git a/tm2/pkg/crypto/keys/os_default.go b/tm2/pkg/crypto/keys/os_default.go new file mode 100644 index 00000000000..4c5daa5a0bf --- /dev/null +++ b/tm2/pkg/crypto/keys/os_default.go @@ -0,0 +1,8 @@ +//go:build !wasm || !js +// +build !wasm !js + +package keys + +import "github.com/gnolang/gno/tm2/pkg/db" + +const dbBackend db.BackendType = db.CLevelDBBackend diff --git a/tm2/pkg/crypto/keys/os_wasm.go b/tm2/pkg/crypto/keys/os_wasm.go new file mode 100644 index 00000000000..40504939226 --- /dev/null +++ b/tm2/pkg/crypto/keys/os_wasm.go @@ -0,0 +1,8 @@ +//go:build wasm && js +// +build wasm,js + +package keys + +import "github.com/gnolang/gno/tm2/pkg/db" + +const dbBackend db.BackendType = db.MemDBBackend From a626142d1da284cf32b68743822f56545103531d Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:09:45 +0200 Subject: [PATCH 08/17] chore: fix build constraints Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- tm2/pkg/autofile/autofile_unix.go | 3 ++- tm2/pkg/bft/abci/example/kvstore/os_default.go | 4 ++-- tm2/pkg/bft/abci/example/kvstore/os_wasm.go | 4 ++-- tm2/pkg/crypto/keys/os_default.go | 4 ++-- tm2/pkg/db/go_level_db.go | 3 ++- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tm2/pkg/autofile/autofile_unix.go b/tm2/pkg/autofile/autofile_unix.go index 5076d7d58c8..4bf6c15d4f7 100644 --- a/tm2/pkg/autofile/autofile_unix.go +++ b/tm2/pkg/autofile/autofile_unix.go @@ -1,4 +1,5 @@ -//go:build !js || !wasm +//go:build !js && !wasm +// +build !js,!wasm package autofile diff --git a/tm2/pkg/bft/abci/example/kvstore/os_default.go b/tm2/pkg/bft/abci/example/kvstore/os_default.go index 4f4ebe01a13..3ad6af4c866 100644 --- a/tm2/pkg/bft/abci/example/kvstore/os_default.go +++ b/tm2/pkg/bft/abci/example/kvstore/os_default.go @@ -1,5 +1,5 @@ -//go:build !wasm || !js -// +build !wasm !js +//go:build !wasm && !js +// +build !wasm,!js package kvstore diff --git a/tm2/pkg/bft/abci/example/kvstore/os_wasm.go b/tm2/pkg/bft/abci/example/kvstore/os_wasm.go index 33be8be1f7c..88b0be75d26 100644 --- a/tm2/pkg/bft/abci/example/kvstore/os_wasm.go +++ b/tm2/pkg/bft/abci/example/kvstore/os_wasm.go @@ -1,5 +1,5 @@ -//go:build wasm && js -// +build wasm,js +//go:build js && wasm +// +build js,wasm package kvstore diff --git a/tm2/pkg/crypto/keys/os_default.go b/tm2/pkg/crypto/keys/os_default.go index 4c5daa5a0bf..fc4cda8523d 100644 --- a/tm2/pkg/crypto/keys/os_default.go +++ b/tm2/pkg/crypto/keys/os_default.go @@ -1,5 +1,5 @@ -//go:build !wasm || !js -// +build !wasm !js +//go:build !wasm && !js +// +build !wasm,!js package keys diff --git a/tm2/pkg/db/go_level_db.go b/tm2/pkg/db/go_level_db.go index 10c31d6e1a1..fc4ff483a47 100644 --- a/tm2/pkg/db/go_level_db.go +++ b/tm2/pkg/db/go_level_db.go @@ -1,4 +1,5 @@ -//go:build !wasm || !js +//go:build !wasm && !js +// +build !wasm,!js package db From ffc6cf03911f256ac6b99382ddd7118ed3da47f7 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:29:58 +0200 Subject: [PATCH 09/17] chore: improve comments Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- tm2/pkg/db/db.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tm2/pkg/db/db.go b/tm2/pkg/db/db.go index 228072fba55..9cc3e066768 100644 --- a/tm2/pkg/db/db.go +++ b/tm2/pkg/db/db.go @@ -11,7 +11,6 @@ type BackendType string const ( // GoLevelDBBackend represents goleveldb (github.com/syndtr/goleveldb - most // popular implementation) - // - pure go // - stable GoLevelDBBackend BackendType = "goleveldb" // CLevelDBBackend represents cleveldb (uses levigo wrapper) @@ -19,11 +18,11 @@ const ( // - requires gcc // - use cleveldb build tag (go build -tags cleveldb) CLevelDBBackend BackendType = "cleveldb" - // MemDBBackend represents in-memoty key value store, which is mostly used + // MemDBBackend represents in-memory key value store, which is mostly used // for testing. MemDBBackend BackendType = "memdb" // FSDBBackend represents filesystem database - // - EXPERIMENTAL + // - EXPERIMENTAL // - slow FSDBBackend BackendType = "fsdb" // BoltDBBackend represents bolt (uses etcd's fork of bolt - From f2d6709e81bf7641e88a3fcb9363ad8cdcc4a878 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:32:45 +0200 Subject: [PATCH 10/17] chore: fixup Signed-off-by: Manfred Touron <94029+moul@users.noreply.github.com> --- tm2/pkg/bft/abci/example/kvstore/os_default.go | 2 +- tm2/pkg/crypto/keys/os_default.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tm2/pkg/bft/abci/example/kvstore/os_default.go b/tm2/pkg/bft/abci/example/kvstore/os_default.go index 3ad6af4c866..2bc9d16ba71 100644 --- a/tm2/pkg/bft/abci/example/kvstore/os_default.go +++ b/tm2/pkg/bft/abci/example/kvstore/os_default.go @@ -5,4 +5,4 @@ package kvstore import "github.com/gnolang/gno/tm2/pkg/db" -const dbBackend db.BackendType = db.CLevelDBBackend +const dbBackend db.BackendType = db.GoLevelDBBackend diff --git a/tm2/pkg/crypto/keys/os_default.go b/tm2/pkg/crypto/keys/os_default.go index fc4cda8523d..175c4861b4e 100644 --- a/tm2/pkg/crypto/keys/os_default.go +++ b/tm2/pkg/crypto/keys/os_default.go @@ -5,4 +5,4 @@ package keys import "github.com/gnolang/gno/tm2/pkg/db" -const dbBackend db.BackendType = db.CLevelDBBackend +const dbBackend db.BackendType = db.GoLevelDBBackend From 76a0ec4240c45f4052609b3064786cc88ca635ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20G=2E=20=C3=96zt=C3=BCrk?= Date: Tue, 1 Aug 2023 16:48:12 +0300 Subject: [PATCH 11/17] refactor: change syndtr/goleveldb with gnolang/goleveldb --- go.mod | 4 +- go.sum | 52 +++++++++++++++---- .../staging.gno.land/overlay/config.toml | 2 +- .../test2.gno.land/overlay/config.toml | 2 +- .../test3.gno.land/overlay/config.toml | 2 +- tm2/pkg/bft/config/config.go | 2 +- tm2/pkg/bft/config/toml.go | 2 +- tm2/pkg/db/db.go | 2 +- tm2/pkg/db/go_level_db.go | 12 ++--- tm2/pkg/db/go_level_db_test.go | 2 +- 10 files changed, 58 insertions(+), 24 deletions(-) diff --git a/go.mod b/go.mod index 9042d49acfa..12c9947ddd8 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/fortytw2/leaktest v1.3.0 github.com/gdamore/tcell/v2 v2.1.0 github.com/gnolang/cors v1.8.1 + github.com/gnolang/goleveldb v0.0.0-20230801134443-a29c535aa920 github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 github.com/golang/protobuf v1.5.3 github.com/google/gofuzz v1.2.0 @@ -27,7 +28,6 @@ require ( github.com/peterbourgon/ff/v3 v3.4.0 github.com/pmezard/go-difflib v1.0.0 github.com/stretchr/testify v1.8.4 - github.com/syndtr/goleveldb v1.0.0 github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c go.etcd.io/bbolt v1.3.7 go.uber.org/multierr v1.9.0 @@ -52,7 +52,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect - github.com/golang/snappy v0.0.3 // indirect + github.com/golang/snappy v0.0.4 // indirect github.com/google/flatbuffers v1.12.1 // indirect github.com/gorilla/securecookie v1.1.1 // indirect github.com/gorilla/sessions v1.2.1 // indirect diff --git a/go.sum b/go.sum index 85e172493fa..e584ffc702b 100644 --- a/go.sum +++ b/go.sum @@ -27,6 +27,9 @@ github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -59,16 +62,20 @@ github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+ne github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell/v2 v2.1.0 h1:UnSmozHgBkQi2PGsFr+rpdXuAPRRucMegpQp3Z3kDro= github.com/gdamore/tcell/v2 v2.1.0/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= github.com/gnolang/cors v1.8.1 h1:D3y1DMoWcgGpCefHwD4UHjy1w1163sfczZyy7b5wH8o= github.com/gnolang/cors v1.8.1/go.mod h1:g7HJhHH+N1r+oRrb7ckR2J6xp5es4EizpAP0JpfgVgU= +github.com/gnolang/goleveldb v0.0.0-20230801134443-a29c535aa920 h1:VYVLWPLVGrMPw7W2yJTpVx4jDzfRTmMe3MRJLuPIHOI= +github.com/gnolang/goleveldb v0.0.0-20230801134443-a29c535aa920/go.mod h1:2JB85cEYJstUlOkV5Z+VIU+7lx2qfXeMg2O3kdE54d8= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 h1:GKvsK3oLWG9B1GL7WP/VqwM6C92j5tIvB844oggL9Lk= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216/go.mod h1:xJhtEL7ahjM1WJipt89gel8tHzfIl/LyMY+lCYh38d8= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= @@ -85,11 +92,12 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -100,6 +108,7 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/gorilla/csrf v1.7.0/go.mod h1:+a/4tCmqhG6/w4oafeAZ9pEa3/NZOWYVbD9fV0FwIQA= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -113,6 +122,7 @@ github.com/gotuna/gotuna v0.6.0 h1:N1lQKXEi/lwRp8u3sccTYLhzOffA4QasExz/1M5Riws= github.com/gotuna/gotuna v0.6.0/go.mod h1:F/ecRt29ChB6Ycy1AFIBpBiMNK0j7Heq+gFbLWquhjc= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jaekwon/testify v1.6.1 h1:4AtAJcR9GzXN5W4DdY7ie74iCPiJV1JJUJL90t2ZUyw= github.com/jaekwon/testify v1.6.1/go.mod h1:Oun0RXIHI7osufabQ60i4Lqkj0GXLbqI1I7kgzBNm1U= @@ -147,18 +157,24 @@ github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWV github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -184,11 +200,11 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ 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.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/syndtr/goleveldb v1.0.0 h1:fBdIW9lB4Iz0n9khmH8w27SJ3QEJ7+IgjPEwGSZiFdE= -github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -231,6 +247,9 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -250,18 +269,30 @@ golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -270,14 +301,16 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= +golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -306,6 +339,7 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/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/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/misc/deployments/staging.gno.land/overlay/config.toml b/misc/deployments/staging.gno.land/overlay/config.toml index a580ed7db7f..57344fef294 100644 --- a/misc/deployments/staging.gno.land/overlay/config.toml +++ b/misc/deployments/staging.gno.land/overlay/config.toml @@ -16,7 +16,7 @@ moniker = "45-79-178-97" fast_sync = true # Database backend: goleveldb | cleveldb | boltdb -# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# * goleveldb (github.com/gnolang/goleveldb - most popular implementation) # - pure go # - stable # * cleveldb (uses levigo wrapper) diff --git a/misc/deployments/test2.gno.land/overlay/config.toml b/misc/deployments/test2.gno.land/overlay/config.toml index 465e39b474f..edf04ba4431 100644 --- a/misc/deployments/test2.gno.land/overlay/config.toml +++ b/misc/deployments/test2.gno.land/overlay/config.toml @@ -16,7 +16,7 @@ moniker = "45-79-178-97" fast_sync = true # Database backend: goleveldb | cleveldb | boltdb -# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# * goleveldb (github.com/gnolang/goleveldb - most popular implementation) # - pure go # - stable # * cleveldb (uses levigo wrapper) diff --git a/misc/deployments/test3.gno.land/overlay/config.toml b/misc/deployments/test3.gno.land/overlay/config.toml index 465e39b474f..edf04ba4431 100644 --- a/misc/deployments/test3.gno.land/overlay/config.toml +++ b/misc/deployments/test3.gno.land/overlay/config.toml @@ -16,7 +16,7 @@ moniker = "45-79-178-97" fast_sync = true # Database backend: goleveldb | cleveldb | boltdb -# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# * goleveldb (github.com/gnolang/goleveldb - most popular implementation) # - pure go # - stable # * cleveldb (uses levigo wrapper) diff --git a/tm2/pkg/bft/config/config.go b/tm2/pkg/bft/config/config.go index 576bf0ff76f..6f148c3b5c1 100644 --- a/tm2/pkg/bft/config/config.go +++ b/tm2/pkg/bft/config/config.go @@ -174,7 +174,7 @@ type BaseConfig struct { FastSyncMode bool `toml:"fast_sync"` // Database backend: goleveldb | cleveldb | boltdb - // * goleveldb (github.com/syndtr/goleveldb - most popular implementation) + // * goleveldb (github.com/gnolang/goleveldb - most popular implementation) // - pure go // - stable // * cleveldb (uses levigo wrapper) diff --git a/tm2/pkg/bft/config/toml.go b/tm2/pkg/bft/config/toml.go index abb2ab33e17..a35e5674631 100644 --- a/tm2/pkg/bft/config/toml.go +++ b/tm2/pkg/bft/config/toml.go @@ -70,7 +70,7 @@ moniker = "{{ .BaseConfig.Moniker }}" fast_sync = {{ .BaseConfig.FastSyncMode }} # Database backend: goleveldb | cleveldb | boltdb -# * goleveldb (github.com/syndtr/goleveldb - most popular implementation) +# * goleveldb (github.com/gnolang/goleveldb - most popular implementation) # - pure go # - stable # * cleveldb (uses levigo wrapper) diff --git a/tm2/pkg/db/db.go b/tm2/pkg/db/db.go index 9cc3e066768..6ffa7bf2eb1 100644 --- a/tm2/pkg/db/db.go +++ b/tm2/pkg/db/db.go @@ -9,7 +9,7 @@ type BackendType string // These are valid backend types. const ( - // GoLevelDBBackend represents goleveldb (github.com/syndtr/goleveldb - most + // GoLevelDBBackend represents goleveldb (github.com/gnolang/goleveldb - most // popular implementation) // - stable GoLevelDBBackend BackendType = "goleveldb" diff --git a/tm2/pkg/db/go_level_db.go b/tm2/pkg/db/go_level_db.go index fc4ff483a47..6058c1289a3 100644 --- a/tm2/pkg/db/go_level_db.go +++ b/tm2/pkg/db/go_level_db.go @@ -9,10 +9,10 @@ import ( "fmt" "path/filepath" - "github.com/syndtr/goleveldb/leveldb" - "github.com/syndtr/goleveldb/leveldb/errors" - "github.com/syndtr/goleveldb/leveldb/iterator" - "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/gnolang/goleveldb/leveldb" + "github.com/gnolang/goleveldb/leveldb/errors" + "github.com/gnolang/goleveldb/leveldb/iterator" + "github.com/gnolang/goleveldb/leveldb/opt" ) func init() { @@ -292,7 +292,7 @@ func (itr *goLevelDBIterator) Valid() bool { // Implements Iterator. func (itr *goLevelDBIterator) Key() []byte { // Key returns a copy of the current key. - // See https://github.com/syndtr/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88 + // See https://github.com/gnolang/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88 itr.assertNoError() itr.assertIsValid() return cp(itr.source.Key()) @@ -301,7 +301,7 @@ func (itr *goLevelDBIterator) Key() []byte { // Implements Iterator. func (itr *goLevelDBIterator) Value() []byte { // Value returns a copy of the current value. - // See https://github.com/syndtr/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88 + // See https://github.com/gnolang/goleveldb/blob/52c212e6c196a1404ea59592d3f1c227c9f034b2/leveldb/iterator/iter.go#L88 itr.assertNoError() itr.assertIsValid() return cp(itr.source.Value()) diff --git a/tm2/pkg/db/go_level_db_test.go b/tm2/pkg/db/go_level_db_test.go index 6eb7c5ab2c6..298d9d97583 100644 --- a/tm2/pkg/db/go_level_db_test.go +++ b/tm2/pkg/db/go_level_db_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/syndtr/goleveldb/leveldb/opt" + "github.com/gnolang/goleveldb/leveldb/opt" ) func TestGoLevelDBNewGoLevelDB(t *testing.T) { From f9fe54c5e765d7b36b5b3e6256f6e5fde7468697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20G=2E=20=C3=96zt=C3=BCrk?= Date: Tue, 1 Aug 2023 16:55:31 +0300 Subject: [PATCH 12/17] revert some changes --- tm2/pkg/bft/abci/example/kvstore/os_default.go | 8 -------- tm2/pkg/bft/abci/example/kvstore/os_wasm.go | 8 -------- tm2/pkg/crypto/keys/os_default.go | 8 -------- tm2/pkg/crypto/keys/os_wasm.go | 8 -------- tm2/pkg/db/go_level_db.go | 3 --- 5 files changed, 35 deletions(-) delete mode 100644 tm2/pkg/bft/abci/example/kvstore/os_default.go delete mode 100644 tm2/pkg/bft/abci/example/kvstore/os_wasm.go delete mode 100644 tm2/pkg/crypto/keys/os_default.go delete mode 100644 tm2/pkg/crypto/keys/os_wasm.go diff --git a/tm2/pkg/bft/abci/example/kvstore/os_default.go b/tm2/pkg/bft/abci/example/kvstore/os_default.go deleted file mode 100644 index 2bc9d16ba71..00000000000 --- a/tm2/pkg/bft/abci/example/kvstore/os_default.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build !wasm && !js -// +build !wasm,!js - -package kvstore - -import "github.com/gnolang/gno/tm2/pkg/db" - -const dbBackend db.BackendType = db.GoLevelDBBackend diff --git a/tm2/pkg/bft/abci/example/kvstore/os_wasm.go b/tm2/pkg/bft/abci/example/kvstore/os_wasm.go deleted file mode 100644 index 88b0be75d26..00000000000 --- a/tm2/pkg/bft/abci/example/kvstore/os_wasm.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build js && wasm -// +build js,wasm - -package kvstore - -import "github.com/gnolang/gno/tm2/pkg/db" - -const dbBackend db.BackendType = db.MemDBBackend diff --git a/tm2/pkg/crypto/keys/os_default.go b/tm2/pkg/crypto/keys/os_default.go deleted file mode 100644 index 175c4861b4e..00000000000 --- a/tm2/pkg/crypto/keys/os_default.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build !wasm && !js -// +build !wasm,!js - -package keys - -import "github.com/gnolang/gno/tm2/pkg/db" - -const dbBackend db.BackendType = db.GoLevelDBBackend diff --git a/tm2/pkg/crypto/keys/os_wasm.go b/tm2/pkg/crypto/keys/os_wasm.go deleted file mode 100644 index 40504939226..00000000000 --- a/tm2/pkg/crypto/keys/os_wasm.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build wasm && js -// +build wasm,js - -package keys - -import "github.com/gnolang/gno/tm2/pkg/db" - -const dbBackend db.BackendType = db.MemDBBackend diff --git a/tm2/pkg/db/go_level_db.go b/tm2/pkg/db/go_level_db.go index 6058c1289a3..e269e5a9f8c 100644 --- a/tm2/pkg/db/go_level_db.go +++ b/tm2/pkg/db/go_level_db.go @@ -1,6 +1,3 @@ -//go:build !wasm && !js -// +build !wasm,!js - package db import ( From a535c757b7f3e57d1315382adb358ef7bd070778 Mon Sep 17 00:00:00 2001 From: Manfred Touron <94029+moul@users.noreply.github.com> Date: Wed, 2 Aug 2023 01:20:22 +0200 Subject: [PATCH 13/17] Update misc/deployments/staging.gno.land/overlay/config.toml --- misc/deployments/staging.gno.land/overlay/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/deployments/staging.gno.land/overlay/config.toml b/misc/deployments/staging.gno.land/overlay/config.toml index 57344fef294..a02bb45bbb7 100644 --- a/misc/deployments/staging.gno.land/overlay/config.toml +++ b/misc/deployments/staging.gno.land/overlay/config.toml @@ -16,7 +16,7 @@ moniker = "45-79-178-97" fast_sync = true # Database backend: goleveldb | cleveldb | boltdb -# * goleveldb (github.com/gnolang/goleveldb - most popular implementation) +# * goleveldb (github.com/gnolang/goleveldb, fork of github.com/syndtr/goleveldb) - most popular implementation) # - pure go # - stable # * cleveldb (uses levigo wrapper) From f75a4f09f9ba5e05c1ebeb3755fbafd10a405269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20G=2E=20=C3=96zt=C3=BCrk?= Date: Wed, 2 Aug 2023 09:58:37 +0300 Subject: [PATCH 14/17] fix: db backend --- tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go | 2 ++ tm2/pkg/crypto/keys/lazy_keybase.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go b/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go index 4d8edefa06b..2e0adb5656f 100644 --- a/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go +++ b/tm2/pkg/bft/abci/example/kvstore/persistent_kvstore.go @@ -19,6 +19,8 @@ const ( ValidatorKeyPrefix string = "/val/" ) +const dbBackend = db.GoLevelDBBackend + // ----------------------------------------- var _ abci.Application = (*PersistentKVStoreApplication)(nil) diff --git a/tm2/pkg/crypto/keys/lazy_keybase.go b/tm2/pkg/crypto/keys/lazy_keybase.go index 23c5878bc9a..f7f9e229980 100644 --- a/tm2/pkg/crypto/keys/lazy_keybase.go +++ b/tm2/pkg/crypto/keys/lazy_keybase.go @@ -9,6 +9,8 @@ import ( "github.com/gnolang/gno/tm2/pkg/os" ) +const dbBackend = db.GoLevelDBBackend + var _ Keybase = lazyKeybase{} type lazyKeybase struct { From c5cc1f44f2b180495e4749ccdadfdd69b423f391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20G=2E=20=C3=96zt=C3=BCrk?= Date: Wed, 2 Aug 2023 10:14:45 +0300 Subject: [PATCH 15/17] chore: bump gnolang/golevledb version to v0.1.0 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 12c9947ddd8..faa0ba51f2f 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/fortytw2/leaktest v1.3.0 github.com/gdamore/tcell/v2 v2.1.0 github.com/gnolang/cors v1.8.1 - github.com/gnolang/goleveldb v0.0.0-20230801134443-a29c535aa920 + github.com/gnolang/goleveldb v0.1.0 github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 github.com/golang/protobuf v1.5.3 github.com/google/gofuzz v1.2.0 diff --git a/go.sum b/go.sum index e584ffc702b..58b6a0fefdf 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/gdamore/tcell/v2 v2.1.0 h1:UnSmozHgBkQi2PGsFr+rpdXuAPRRucMegpQp3Z3kDr github.com/gdamore/tcell/v2 v2.1.0/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= github.com/gnolang/cors v1.8.1 h1:D3y1DMoWcgGpCefHwD4UHjy1w1163sfczZyy7b5wH8o= github.com/gnolang/cors v1.8.1/go.mod h1:g7HJhHH+N1r+oRrb7ckR2J6xp5es4EizpAP0JpfgVgU= -github.com/gnolang/goleveldb v0.0.0-20230801134443-a29c535aa920 h1:VYVLWPLVGrMPw7W2yJTpVx4jDzfRTmMe3MRJLuPIHOI= -github.com/gnolang/goleveldb v0.0.0-20230801134443-a29c535aa920/go.mod h1:2JB85cEYJstUlOkV5Z+VIU+7lx2qfXeMg2O3kdE54d8= +github.com/gnolang/goleveldb v0.1.0 h1:OLAX7fOtLaQIsZRGyvNdRuh4ulPTSWnpeeBQDnGWo54= +github.com/gnolang/goleveldb v0.1.0/go.mod h1:2JB85cEYJstUlOkV5Z+VIU+7lx2qfXeMg2O3kdE54d8= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 h1:GKvsK3oLWG9B1GL7WP/VqwM6C92j5tIvB844oggL9Lk= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216/go.mod h1:xJhtEL7ahjM1WJipt89gel8tHzfIl/LyMY+lCYh38d8= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= From 9b8302763a5010d125624b997490029b621b4ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20G=2E=20=C3=96zt=C3=BCrk?= Date: Fri, 4 Aug 2023 09:20:05 +0300 Subject: [PATCH 16/17] chore: bump gnolang/golevledb version to v0.0.9 --- go.mod | 2 +- go.sum | 48 +++++++----------------------------------------- 2 files changed, 8 insertions(+), 42 deletions(-) diff --git a/go.mod b/go.mod index faa0ba51f2f..eefa2f91115 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/fortytw2/leaktest v1.3.0 github.com/gdamore/tcell/v2 v2.1.0 github.com/gnolang/cors v1.8.1 - github.com/gnolang/goleveldb v0.1.0 + github.com/gnolang/goleveldb v0.0.9 github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 github.com/golang/protobuf v1.5.3 github.com/google/gofuzz v1.2.0 diff --git a/go.sum b/go.sum index 58b6a0fefdf..94404e246da 100644 --- a/go.sum +++ b/go.sum @@ -27,9 +27,6 @@ github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= @@ -62,20 +59,18 @@ github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+ne github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= github.com/gdamore/tcell/v2 v2.1.0 h1:UnSmozHgBkQi2PGsFr+rpdXuAPRRucMegpQp3Z3kDro= github.com/gdamore/tcell/v2 v2.1.0/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= github.com/gnolang/cors v1.8.1 h1:D3y1DMoWcgGpCefHwD4UHjy1w1163sfczZyy7b5wH8o= github.com/gnolang/cors v1.8.1/go.mod h1:g7HJhHH+N1r+oRrb7ckR2J6xp5es4EizpAP0JpfgVgU= -github.com/gnolang/goleveldb v0.1.0 h1:OLAX7fOtLaQIsZRGyvNdRuh4ulPTSWnpeeBQDnGWo54= -github.com/gnolang/goleveldb v0.1.0/go.mod h1:2JB85cEYJstUlOkV5Z+VIU+7lx2qfXeMg2O3kdE54d8= +github.com/gnolang/goleveldb v0.0.9 h1:Q7rGko9oXMKtQA+Apeeed5a3sjba/mcDhzJGoTVLCKE= +github.com/gnolang/goleveldb v0.0.9/go.mod h1:Dz6p9bmpy/FBESTgduiThZt5mToVDipcHGzj/zUOo8E= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216 h1:GKvsK3oLWG9B1GL7WP/VqwM6C92j5tIvB844oggL9Lk= github.com/gnolang/overflow v0.0.0-20170615021017-4d914c927216/go.mod h1:xJhtEL7ahjM1WJipt89gel8tHzfIl/LyMY+lCYh38d8= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= @@ -92,7 +87,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -108,7 +102,6 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/gorilla/csrf v1.7.0/go.mod h1:+a/4tCmqhG6/w4oafeAZ9pEa3/NZOWYVbD9fV0FwIQA= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -122,7 +115,6 @@ github.com/gotuna/gotuna v0.6.0 h1:N1lQKXEi/lwRp8u3sccTYLhzOffA4QasExz/1M5Riws= github.com/gotuna/gotuna v0.6.0/go.mod h1:F/ecRt29ChB6Ycy1AFIBpBiMNK0j7Heq+gFbLWquhjc= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jaekwon/testify v1.6.1 h1:4AtAJcR9GzXN5W4DdY7ie74iCPiJV1JJUJL90t2ZUyw= github.com/jaekwon/testify v1.6.1/go.mod h1:Oun0RXIHI7osufabQ60i4Lqkj0GXLbqI1I7kgzBNm1U= @@ -157,24 +149,18 @@ github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWV github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= -github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -200,9 +186,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ 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.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= @@ -247,9 +231,6 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -269,30 +250,18 @@ golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.10.0 h1:3R7pNqamzBraeqj/Tj8qt1aQ2HpmlC+Cx/qL/7hn4/c= golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -301,16 +270,14 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df h1:5Pf6pFKu98ODmgnpvkJ3kFUOQGGLIzLIkbzUHp47618= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -339,7 +306,6 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/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/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 2e4a88c64435a5b446a1eb3ef5eb8bc844a32a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0lker=20G=2E=20=C3=96zt=C3=BCrk?= Date: Fri, 4 Aug 2023 09:25:22 +0300 Subject: [PATCH 17/17] fmt --- tm2/pkg/db/go_level_db_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tm2/pkg/db/go_level_db_test.go b/tm2/pkg/db/go_level_db_test.go index 298d9d97583..a85bb6e8713 100644 --- a/tm2/pkg/db/go_level_db_test.go +++ b/tm2/pkg/db/go_level_db_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/require" "github.com/gnolang/goleveldb/leveldb/opt" + "github.com/stretchr/testify/require" ) func TestGoLevelDBNewGoLevelDB(t *testing.T) {