Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pkg/db): remove cleveldb, fsdb and rocksdb #1714

Merged
merged 9 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ updates:
everything-else:
patterns:
- "*"
exclude-patterns:
# NOTE: grocksdb should be updated manually, to match the version
# available on Ubuntu's latest LTS release; and updated in conjunction
# with the ubuntu version on .github/workflows/db-tests.yml
- "github.com/linxGnu/grocksdb"
open-pull-requests-limit: 10
pull-request-branch-name:
separator: "-"
Expand Down
54 changes: 0 additions & 54 deletions .github/workflows/db-tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v4
env:
# Don't attempt to compile/resolve C packages (grocksdb, cleveldb).
# Don't attempt to compile/resolve C packages.
CGO_ENABLED: 0
with:
# sync with misc/devdeps/go.mod
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tm2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- _test.pkg.amino
- _test.pkg.bft
- _test.pkg.others
# _test.pkg.db needs special dependencies -- see db-tests.
- _test.pkg.db
runs-on: ubuntu-latest
timeout-minutes: 21
steps:
Expand Down
6 changes: 0 additions & 6 deletions contribs/gnodev/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions contribs/gnokeykc/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@ require (
github.com/gorilla/websocket v1.5.1
github.com/gotuna/gotuna v0.6.0
github.com/jaekwon/testify v1.6.1
github.com/jmhodges/levigo v1.0.0
github.com/libp2p/go-buffer-pool v0.1.0
github.com/linxGnu/grocksdb v1.6.20
github.com/mattn/go-runewidth v0.0.15
github.com/pelletier/go-toml v1.9.5
github.com/peterbourgon/ff/v3 v3.4.0
github.com/pmezard/go-difflib v1.0.0
github.com/rogpeppe/go-internal v1.11.0
github.com/rs/cors v1.10.1
github.com/stretchr/testify v1.8.4
go.etcd.io/bbolt v1.3.8
go.uber.org/multierr v1.10.0
go.uber.org/zap v1.26.0
go.uber.org/zap/exp v0.2.0
Expand Down
14 changes: 0 additions & 14 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions misc/loop/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions tm2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,4 @@ GOTEST_FLAGS ?= -v -p 1 -timeout=30m
_test.pkg.others:; go test $(GOTEST_FLAGS) `go list ./pkg/... | grep -Ev 'pkg/(amino|bft|db|iavl/benchmarks)(/|$$)'`
_test.pkg.amino:; go test $(GOTEST_FLAGS) ./pkg/amino/...
_test.pkg.bft:; go test $(GOTEST_FLAGS) ./pkg/bft/...

CGO_ENABLED ?= 0
_test.pkg.db:
@[ -z "$$CGO_ENABLED" ] && echo 'Disabling cgo for database tests. Use CGO_ENABLED=1 to enable it if you have the correct libs' || true
CGO_ENABLED=$(CGO_ENABLED) go test $(GOTEST_FLAGS) ./pkg/db/... ./pkg/iavl/benchmarks/...
_test.pkg.db:; go test $(GOTEST_FLAGS) ./pkg/db/... ./pkg/iavl/benchmarks/...
20 changes: 4 additions & 16 deletions tm2/pkg/bft/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ var (
)

const (
levelDBName = "goleveldb"
clevelDBName = "cleveldb"
boltDBName = "boltdb"
levelDBName = "goleveldb"
)

const (
Expand Down Expand Up @@ -243,19 +241,11 @@ type BaseConfig struct {
// and verifying their commits
FastSyncMode bool `toml:"fast_sync" comment:"If this node is many blocks behind the tip of the chain, FastSync\n allows them to catchup quickly by downloading blocks in parallel\n and verifying their commits"`

// Database backend: goleveldb | cleveldb | boltdb
// Database backend: goleveldb
// * goleveldb (github.com/gnolang/goleveldb - most popular implementation)
// - pure go
// - stable
// * cleveldb (uses levigo wrapper)
// - fast
// - requires gcc
// - use cleveldb build tag (go build -tags cleveldb)
// * boltdb (uses etcd's fork of bolt - go.etcd.io/bbolt)
// - EXPERIMENTAL
// - may be faster is some use-cases (random reads - indexer)
// - use boltdb build tag (go build -tags boltdb)
DBBackend string `toml:"db_backend" comment:"Database backend: goleveldb | cleveldb | boltdb\n * goleveldb (github.com/gnolang/goleveldb - most popular implementation)\n - pure go\n - stable\n * cleveldb (uses levigo wrapper)\n - fast\n - requires gcc\n - use cleveldb build tag (go build -tags cleveldb)\n * boltdb (uses etcd's fork of bolt - go.etcd.io/bbolt)\n - EXPERIMENTAL\n - may be faster is some use-cases (random reads - indexer)\n - use boltdb build tag (go build -tags boltdb)"`
DBBackend string `toml:"db_backend" comment:"Database backend: goleveldb\n * goleveldb (github.com/gnolang/goleveldb - most popular implementation)\n - pure go\n - stable"`

// Database directory
DBPath string `toml:"db_dir" comment:"Database directory"`
Expand Down Expand Up @@ -365,9 +355,7 @@ func (cfg BaseConfig) ValidateBasic() error {
}

// Verify the DB backend
if cfg.DBBackend != levelDBName &&
cfg.DBBackend != clevelDBName &&
cfg.DBBackend != boltDBName {
if cfg.DBBackend != levelDBName {
return errInvalidDBBackend
}

Expand Down
6 changes: 0 additions & 6 deletions tm2/pkg/db/_all/all.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
// Package all imports all available databases. It is useful mostly in tests.
//
// cgo databases (rocksdb, cleveldb) will be excluded if CGO_ENABLED=0.
package all

import (
// Keep in sync with list of non-cgo backends.
// Add cgo backends in all_cgo.go.
_ "github.com/gnolang/gno/tm2/pkg/db/boltdb"
_ "github.com/gnolang/gno/tm2/pkg/db/fsdb"
_ "github.com/gnolang/gno/tm2/pkg/db/goleveldb"
_ "github.com/gnolang/gno/tm2/pkg/db/memdb"
)
10 changes: 0 additions & 10 deletions tm2/pkg/db/_all/all_cgo.go

This file was deleted.

5 changes: 0 additions & 5 deletions tm2/pkg/db/_tags/boltdb.go

This file was deleted.

5 changes: 0 additions & 5 deletions tm2/pkg/db/_tags/cleveldb.go

This file was deleted.

5 changes: 0 additions & 5 deletions tm2/pkg/db/_tags/fsdb.go

This file was deleted.

5 changes: 0 additions & 5 deletions tm2/pkg/db/_tags/rocksdb.go

This file was deleted.

Loading
Loading