Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 1 addition & 10 deletions client/asset/btc/txdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"decred.org/dcrdex/client/asset"
"decred.org/dcrdex/dex"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

type ExtendedWalletTx struct {
Expand Down Expand Up @@ -122,15 +122,6 @@ func (db *BadgerTxDB) Connect(ctx context.Context) (*sync.WaitGroup, error) {
opts := badger.DefaultOptions(db.filePath).WithLogger(&badgerLoggerWrapper{db.log})
var err error
db.DB, err = badger.Open(opts)
if err == badger.ErrTruncateNeeded {
// Probably a Windows thing.
// https://github.com/dgraph-io/badger/issues/744
db.log.Warnf("newTxHistoryStore badger db: %v", err)
// Try again with value log truncation enabled.
opts.Truncate = true
db.log.Warnf("Attempting to reopen badger DB with the Truncate option set...")
db.DB, err = badger.Open(opts)
}
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion client/asset/eth/txdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"decred.org/dcrdex/dex"
"decred.org/dcrdex/dex/encode"
"decred.org/dcrdex/dex/lexi"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
)
Expand Down
11 changes: 1 addition & 10 deletions client/asset/eth/txdb_legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"decred.org/dcrdex/dex"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
"github.com/ethereum/go-ethereum/common"
)

Expand Down Expand Up @@ -99,15 +99,6 @@ func newBadgerTxDB(filePath string, log dex.Logger) (*badgerTxDB, error) {
opts := badger.DefaultOptions(filePath).WithLogger(&badgerLoggerWrapper{log})
var err error
bdb, err := badger.Open(opts)
if err == badger.ErrTruncateNeeded {
// Probably a Windows thing.
// https://github.com/dgraph-io/badger/issues/744
log.Warnf("error opening badger db: %v", err)
// Try again with value log truncation enabled.
opts.Truncate = true
log.Warnf("Attempting to reopen badger DB with the Truncate option set...")
bdb, err = badger.Open(opts)
}
if err != nil {
return nil, err
}
Expand Down
11 changes: 1 addition & 10 deletions client/asset/kvdb/kvdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"decred.org/dcrdex/dex"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

type KeyValueDB interface {
Expand All @@ -33,15 +33,6 @@ func NewFileDB(filePath string, log dex.Logger) (KeyValueDB, error) {
// .WithValueLogFileSize(sz int64), bytes, default 1 GB, must be 1MB <= sz <= 1GB
opts := badger.DefaultOptions(filePath).WithLogger(&badgerLoggerWrapper{log})
db, err := badger.Open(opts)
if err == badger.ErrTruncateNeeded {
// Probably a Windows thing.
// https://github.com/dgraph-io/badger/issues/744
log.Warnf("NewFileDB badger db: %v", err)
// Try again with value log truncation enabled.
opts.Truncate = true
log.Warnf("Attempting to reopen badger DB with the Truncate option set...")
db, err = badger.Open(opts)
}
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion dex/lexi/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"decred.org/dcrdex/dex"
"decred.org/dcrdex/dex/encode"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

func newTestDB(t *testing.T) (*DB, func()) {
Expand Down
2 changes: 1 addition & 1 deletion dex/lexi/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"fmt"

"decred.org/dcrdex/dex"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion dex/lexi/keyprefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"encoding/binary"
"encoding/hex"

"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

const prefixSize = 2
Expand Down
11 changes: 1 addition & 10 deletions dex/lexi/lexi.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"time"

"decred.org/dcrdex/dex"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

// ErrKeyNotFound is an alias for badger.ErrKeyNotFound so that the caller
Expand Down Expand Up @@ -50,15 +50,6 @@ type Config struct {
func New(cfg *Config) (*DB, error) {
opts := badger.DefaultOptions(cfg.Path).WithLogger(&badgerLoggerWrapper{cfg.Log.SubLogger("BADG")})
bdb, err := badger.Open(opts)
if err == badger.ErrTruncateNeeded {
// Probably a Windows thing.
// https://github.com/dgraph-io/badger/issues/744
cfg.Log.Warnf("Error opening badger db: %v", err)
// Try again with value log truncation enabled.
opts.Truncate = true
cfg.Log.Warnf("Attempting to reopen badger DB with the Truncate option set...")
bdb, err = badger.Open(opts)
}
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion dex/lexi/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package lexi

import (
"decred.org/dcrdex/dex"
"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

// badgerLoggerWrapper wraps dex.Logger and translates Warnf to Warningf to
Expand Down
2 changes: 1 addition & 1 deletion dex/lexi/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"errors"
"fmt"

"github.com/dgraph-io/badger"
"github.com/dgraph-io/badger/v4"
)

// Table is a prefixed section of the k-v DB. A Table can have indexes, such
Expand Down
18 changes: 11 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ require (
github.com/decred/go-socks v1.1.0
github.com/decred/slog v1.2.0
github.com/decred/vspd/types/v2 v2.1.0
github.com/dgraph-io/badger v1.6.2
github.com/dgraph-io/badger/v4 v4.9.0
github.com/ethereum/go-ethereum v1.16.7
github.com/fatih/color v1.16.0
github.com/gcash/bchd v0.19.0
Expand Down Expand Up @@ -94,19 +94,26 @@ require (
github.com/decred/dcrd/txscript/v3 v3.0.0 // indirect
github.com/decred/dcrdata/v7 v7.0.0 // indirect
github.com/decred/dcrtime v0.0.0-20191018193024-8d8b4ef0458e // indirect
github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect
github.com/emicklei/dot v1.6.2 // indirect
github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/google/flatbuffers v25.2.10+incompatible // indirect
github.com/google/trillian v1.4.1 // indirect
github.com/gorilla/schema v1.1.0 // indirect
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c // indirect
github.com/marcopeereboom/sbox v1.1.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/otel v1.37.0 // indirect
go.opentelemetry.io/otel/metric v1.37.0 // indirect
go.opentelemetry.io/otel/trace v1.37.0 // indirect
)

replace github.com/btcsuite/btcd/btcec/v2 v2.3.4 => github.com/martonp/btcd/btcec/v2 v2.0.0-20250528172049-6b252bb1b6a1

require (
decred.org/cspp/v2 v2.4.0 // indirect
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/StackExchange/wmi v1.2.1 // indirect
Expand All @@ -118,7 +125,6 @@ require (
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
github.com/btcsuite/golangcrypto v0.0.0-20150304025918-53f62d9b43e8 // indirect
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/companyzero/sntrup4591761 v0.0.0-20220309191932-9e0f3af2f07a // indirect
github.com/consensys/gnark-crypto v0.18.0 // indirect
Expand All @@ -135,16 +141,14 @@ require (
github.com/decred/politeia v1.5.0
github.com/decred/vspd/client/v4 v4.0.2 // indirect
github.com/decred/vspd/types/v3 v3.0.0 // indirect
github.com/dgraph-io/ristretto v0.0.2 // indirect
github.com/dustin/go-humanize v1.0.1-0.20210705192016-249ff6c91207 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect
github.com/ethereum/go-verkle v0.2.2 // indirect
github.com/ferranbt/fastssz v0.1.4 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gofrs/flock v0.12.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v1.0.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/holiman/billy v0.0.0-20250707135307-f2f9b9aae7db // indirect
Expand All @@ -153,7 +157,7 @@ require (
github.com/jrick/bitset v1.0.0 // indirect
github.com/jrick/wsrpc/v2 v2.3.8 // indirect
github.com/kkdai/bstream v1.0.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
Expand Down
Loading
Loading