Skip to content

Commit ce3673b

Browse files
authoredJan 30, 2022
cosmos/gorocksdb in the imports (#214)
Use the cosmos/gorocksdb fork directly so we don't require replace directives downstream in go.mod
1 parent a45e570 commit ce3673b

11 files changed

+11
-22
lines changed
 

‎.github/workflows/lint.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ jobs:
1313
container: tendermintdev/docker-tm-db-testing
1414
steps:
1515
- uses: actions/checkout@v2
16-
- uses: golangci/golangci-lint-action@v2.5.2
16+
- uses: golangci/golangci-lint-action@v2
1717
with:
18-
# Required: the version of golangci-lint is required and must be
19-
# specified without patch version: we always use the latest patch
20-
# version.
21-
version: v1.30
2218
args: --timeout 10m
2319
github-token: ${{ secrets.github_token }}

‎.golangci.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ linters:
1616
# - godox
1717
- gofmt
1818
- goimports
19-
- golint
19+
- revive
2020
- gosec
2121
- gosimple
2222
- govet
2323
- ineffassign
2424
# - interfacer
2525
- lll
2626
- misspell
27-
- maligned
2827
- nakedret
2928
- prealloc
3029
# - scopelint

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Go 1.13+
2424

2525
- **[BoltDB](https://github.com/etcd-io/bbolt) [experimental]:** A [fork](https://github.com/etcd-io/bbolt) of [BoltDB](https://github.com/boltdb/bolt). Uses B+trees for on-disk storage, which have good performance for read-heavy workloads and range scans. Supports serializable ACID transactions.
2626

27-
- **[RocksDB](https://github.com/tecbot/gorocksdb) [experimental]:** A [Go wrapper](https://github.com/tecbot/gorocksdb) around [RocksDB](https://rocksdb.org). Similarly to LevelDB (above) it uses LSM-trees for on-disk storage, but is optimized for fast storage media such as SSDs and memory. Supports atomic transactions, but not full ACID transactions.
27+
- **[RocksDB](https://github.com/cosmos/gorocksdb) [experimental]:** A [Go wrapper](https://github.com/cosmos/gorocksdb) around [RocksDB](https://rocksdb.org). Similarly to LevelDB (above) it uses LSM-trees for on-disk storage, but is optimized for fast storage media such as SSDs and memory. Supports atomic transactions, but not full ACID transactions.
2828

2929
- **[BadgerDB](https://github.com/dgraph-io/badger) [experimental]:** A key-value database written as a pure-Go alternative to e.g. LevelDB and RocksDB, with LSM-tree storage. Makes use of multiple goroutines for performance, and includes advanced features such as serializable ACID transactions, write batches, compression, and more.
3030

‎common_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ func benchmarkRandomReadsWrites(b *testing.B, db DB) {
127127
val := internal[idx]
128128
idxBytes := int642Bytes(idx)
129129
valBytes := int642Bytes(val)
130-
//fmt.Printf("Set %X -> %X\n", idxBytes, valBytes)
131130
err := db.Set(idxBytes, valBytes)
132131
if err != nil {
133132
// require.NoError() is very expensive (according to profiler), so check manually
@@ -145,7 +144,6 @@ func benchmarkRandomReadsWrites(b *testing.B, db DB) {
145144
// require.NoError() is very expensive (according to profiler), so check manually
146145
b.Fatal(b, err)
147146
}
148-
//fmt.Printf("Get %X -> %X\n", idxBytes, valBytes)
149147
if valExp == 0 {
150148
if !bytes.Equal(valBytes, nil) {
151149
b.Errorf("Expected %v for %v, got %X", nil, idx, valBytes)

‎db.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const (
2828
// - may be faster is some use-cases (random reads - indexer)
2929
// - use boltdb build tag (go build -tags boltdb)
3030
BoltDBBackend BackendType = "boltdb"
31-
// RocksDBBackend represents rocksdb (uses github.com/tecbot/gorocksdb)
31+
// RocksDBBackend represents rocksdb (uses github.com/cosmos/gorocksdb)
3232
// - EXPERIMENTAL
3333
// - requires gcc
3434
// - use rocksdb build tag (go build -tags rocksdb)

‎go.mod

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ module github.com/tendermint/tm-db
33
go 1.17
44

55
require (
6+
github.com/cosmos/gorocksdb v1.2.0
67
github.com/dgraph-io/badger/v2 v2.2007.2
78
github.com/gogo/protobuf v1.3.2
89
github.com/google/btree v1.0.0
910
github.com/jmhodges/levigo v1.0.0
1011
github.com/stretchr/testify v1.7.0
1112
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca
12-
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c
1313
go.etcd.io/bbolt v1.3.6
1414
google.golang.org/grpc v1.44.0
1515
)
@@ -35,7 +35,3 @@ require (
3535

3636
// Breaking changes were released with the wrong tag (use v0.6.6 or later).
3737
retract v0.6.5
38-
39-
// Note: gorocksdb bindings for OptimisticTransactionDB are not merged upstream, so we use a fork
40-
// See https://github.com/tecbot/gorocksdb/pull/216
41-
replace github.com/tecbot/gorocksdb => github.com/cosmos/gorocksdb v1.1.1

‎go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH
2121
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
2222
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
2323
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
24-
github.com/cosmos/gorocksdb v1.1.1 h1:N0OqpEKXgsi2qtDm8T1+AlNMXkTm6s1jowYf7/4pH5I=
25-
github.com/cosmos/gorocksdb v1.1.1/go.mod h1:b/U29r/CtguX3TF7mKG1Jjn4APDqh4wECshxXdiWHpA=
24+
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
25+
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
2626
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
2727
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2828
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

‎rocksdb.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"path/filepath"
88
"runtime"
99

10-
"github.com/tecbot/gorocksdb"
10+
"github.com/cosmos/gorocksdb"
1111
)
1212

1313
func init() {

‎rocksdb_batch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package db
44

5-
import "github.com/tecbot/gorocksdb"
5+
import "github.com/cosmos/gorocksdb"
66

77
type rocksDBBatch struct {
88
db *RocksDB

‎rocksdb_iterator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package db
55
import (
66
"bytes"
77

8-
"github.com/tecbot/gorocksdb"
8+
"github.com/cosmos/gorocksdb"
99
)
1010

1111
type rocksDBIterator struct {

‎util_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestPrefixIteratorMatches1N(t *testing.T) {
113113
// Bad!
114114
checkNext(t, itr, false)
115115

116-
//Once invalid...
116+
// Once invalid...
117117
checkInvalid(t, itr)
118118
})
119119
}

0 commit comments

Comments
 (0)
Please sign in to comment.