Skip to content

Commit

Permalink
remove all dbs except for goleveldb + memdb
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl committed Feb 29, 2024
1 parent a7ff77f commit 26e5cdc
Show file tree
Hide file tree
Showing 31 changed files with 11 additions and 1,692 deletions.
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@v3
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 @@ -55,7 +55,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
3 changes: 0 additions & 3 deletions contribs/gnodev/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 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 @@ -18,17 +18,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.24.0
go.uber.org/zap/exp v0.1.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.

3 changes: 0 additions & 3 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

0 comments on commit 26e5cdc

Please sign in to comment.