Skip to content

Commit 1d5596e

Browse files
authored
Drop unused code (#3559)
2 parents f7ccdb8 + f5724a4 commit 1d5596e

File tree

25 files changed

+12
-1265
lines changed

25 files changed

+12
-1265
lines changed

cmd/internal/configvalidator/validate.go

Lines changed: 0 additions & 106 deletions
This file was deleted.

cmd/neofs-adm/internal/modules/fschain/root.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,18 @@ const (
2323
storageGasConfigFlag = "storage.initial_gas"
2424
contractsInitFlag = "contracts"
2525
maxObjectSizeInitFlag = "network.max_object_size"
26-
maxObjectSizeCLIFlag = "max-object-size"
2726
epochDurationInitFlag = "network.epoch_duration"
28-
epochDurationCLIFlag = "epoch-duration"
2927
incomeRateInitFlag = "network.basic_income_rate"
30-
incomeRateCLIFlag = "basic-income-rate"
3128
containerFeeInitFlag = "network.fee.container"
3229
containerAliasFeeInitFlag = "network.fee.container_alias"
33-
containerFeeCLIFlag = "container-fee"
34-
containerAliasFeeCLIFlag = "container-alias-fee"
3530
homomorphicHashDisabledInitFlag = "network.homomorphic_hash_disabled"
36-
homomorphicHashDisabledCLIFlag = "homomorphic-disabled"
3731
withdrawFeeInitFlag = "network.fee.withdraw"
38-
withdrawFeeCLIFlag = "withdraw-fee"
3932
containerDumpFlag = "dump"
4033
containerContractFlag = "container-contract"
4134
containerIDsFlag = "cid"
4235
refillGasAmountFlag = "gas"
4336
walletAccountFlag = "account"
4437
notaryDepositTillFlag = "till"
45-
protoConfigPath = "protocol"
4638
walletAddressFlag = "wallet-address"
4739
domainFlag = "domain"
4840
neoAddressesFlag = "neo-addresses"

cmd/neofs-node/config/engine/shard/shard.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import (
1212
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard/mode"
1313
)
1414

15-
// SmallSizeLimitDefault is the default limit of small objects payload in bytes.
16-
const SmallSizeLimitDefault = 1 << 20
17-
1815
// ShardDetails contains configuration for a single shard of a storage node.
1916
type ShardDetails struct {
2017
Mode mode.Mode `mapstructure:"mode"`

cmd/neofs-node/config/engine/shard/writecache/writecache.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
)
66

77
const (
8-
// MaxSizeDefault is the default value of the object payload size limit.
9-
MaxSizeDefault = 64 << 20
108
// SizeLimitDefault is the default write-cache size limit.
119
SizeLimitDefault = 1 << 30
1210
)

cmd/neofs-node/config/node/node.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package nodeconfig
33
import (
44
"fmt"
55
"sort"
6-
"time"
76

87
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
98
"github.com/nspcc-dev/neofs-node/pkg/network"
@@ -13,8 +12,6 @@ import (
1312
const (
1413
// PersistentStatePathDefault is the default path for persistent state file.
1514
PersistentStatePathDefault = ".neofs-storage-state"
16-
// NotificationTimeoutDefault is the default timeout for object notification operation.
17-
NotificationTimeoutDefault = 5 * time.Second
1815
)
1916

2017
// Node contains configuration for a node.

pkg/core/client/util.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package client
22

33
import (
4-
"bytes"
54
"fmt"
65

76
"github.com/nspcc-dev/neofs-node/pkg/network"
8-
"github.com/nspcc-dev/neofs-sdk-go/client"
97
)
108

119
// NodeInfoFromRawNetmapElement fills NodeInfo structure from the interface of raw netmap member's descriptor.
@@ -28,15 +26,3 @@ func NodeInfoFromRawNetmapElement(dst *NodeInfo, info interface {
2826

2927
return nil
3028
}
31-
32-
// AssertKeyResponseCallback returns client response callback which checks if the response was signed by the expected key.
33-
// Returns ErrWrongPublicKey in case of key mismatch.
34-
func AssertKeyResponseCallback(expectedKey []byte) func(client.ResponseMetaInfo) error {
35-
return func(info client.ResponseMetaInfo) error {
36-
if !bytes.Equal(info.ResponderKey(), expectedKey) {
37-
return ErrWrongPublicKey
38-
}
39-
40-
return nil
41-
}
42-
}

pkg/innerring/innerring.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"fmt"
66
"net"
7-
"sync"
87
"sync/atomic"
98

109
"github.com/nspcc-dev/neo-go/pkg/core/block"
@@ -40,7 +39,6 @@ import (
4039
nmClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
4140
repClient "github.com/nspcc-dev/neofs-node/pkg/morph/client/reputation"
4241
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
43-
"github.com/nspcc-dev/neofs-node/pkg/network/cache"
4442
control "github.com/nspcc-dev/neofs-node/pkg/services/control/ir"
4543
controlsrv "github.com/nspcc-dev/neofs-node/pkg/services/control/ir/server"
4644
reputationcommon "github.com/nspcc-dev/neofs-node/pkg/services/reputation/common"
@@ -697,12 +695,6 @@ func New(ctx context.Context, log *zap.Logger, cfg *config.Config, errChan chan<
697695
cfg.Indexer.CacheTimeout,
698696
)
699697

700-
var buffers sync.Pool
701-
buffers.New = func() any {
702-
b := make([]byte, cache.DefaultBufferSize)
703-
return &b
704-
}
705-
706698
// create settlement processor
707699
settlementProcessor := settlement.New(
708700
settlement.Prm{

pkg/local_object_storage/metabase/iterators.go

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"encoding/binary"
66
"errors"
7-
"fmt"
87
"math"
98

109
"github.com/nspcc-dev/bbolt"
@@ -186,68 +185,6 @@ func (db *DB) iterateExpired(tx *bbolt.Tx, curEpoch uint64, h ExpiredObjectHandl
186185
return err
187186
}
188187

189-
// IterateCoveredByTombstones iterates over all objects in DB which are covered
190-
// by tombstone with string address from tss. Locked objects are not included
191-
// (do not confuse with objects of type LOCK).
192-
//
193-
// If h returns ErrInterruptIterator, nil returns immediately.
194-
// Returns other errors of h directly.
195-
//
196-
// Does not modify tss.
197-
func (db *DB) IterateCoveredByTombstones(tss map[string]oid.Address, h func(oid.Address) error) error {
198-
db.modeMtx.RLock()
199-
defer db.modeMtx.RUnlock()
200-
201-
if db.mode.NoMetabase() {
202-
return ErrDegradedMode
203-
}
204-
205-
currEpoch := db.epochState.CurrentEpoch()
206-
207-
return db.boltDB.View(func(tx *bbolt.Tx) error {
208-
return db.iterateCoveredByTombstones(tx, currEpoch, tss, h)
209-
})
210-
}
211-
212-
func (db *DB) iterateCoveredByTombstones(tx *bbolt.Tx, currEpoch uint64, tss map[string]oid.Address, h func(oid.Address) error) error {
213-
bktGraveyard := tx.Bucket(graveyardBucketName)
214-
215-
err := bktGraveyard.ForEach(func(k, v []byte) error {
216-
var addr oid.Address
217-
if err := decodeAddressFromKey(&addr, v[:addressKeySize]); err != nil {
218-
return err
219-
}
220-
if _, ok := tss[addr.EncodeToString()]; ok {
221-
var addr oid.Address
222-
223-
err := decodeAddressFromKey(&addr, k)
224-
if err != nil {
225-
return fmt.Errorf("could not parse address of the object under tombstone: %w", err)
226-
}
227-
228-
metaBucket := tx.Bucket(metaBucketKey(addr.Container()))
229-
var metaCursor *bbolt.Cursor
230-
if metaBucket != nil {
231-
metaCursor = metaBucket.Cursor()
232-
}
233-
234-
if objectLocked(tx, currEpoch, metaCursor, addr.Container(), addr.Object()) {
235-
return nil
236-
}
237-
238-
return h(addr)
239-
}
240-
241-
return nil
242-
})
243-
244-
if errors.Is(err, ErrInterruptIterator) {
245-
err = nil
246-
}
247-
248-
return err
249-
}
250-
251188
func mkFilterPhysicalPrefix() []byte {
252189
var prefix = make([]byte, 1+len(object.FilterPhysical)+1+len(binPropMarker)+1)
253190

pkg/local_object_storage/metabase/iterators_test.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -62,38 +62,3 @@ func putWithExpiration(t *testing.T, db *meta.DB, typ object.Type, expiresAt uin
6262

6363
return object2.AddressOf(obj)
6464
}
65-
66-
func TestDB_IterateCoveredByTombstones(t *testing.T) {
67-
db := newDB(t)
68-
69-
ts := oidtest.Address()
70-
protected1 := oidtest.Address()
71-
protected2 := oidtest.Address()
72-
protectedLocked := oidtest.Address()
73-
garbage := oidtest.Address()
74-
75-
var err error
76-
77-
_, _, err = db.Inhume(ts, 0, false, protected1, protected2, protectedLocked)
78-
require.NoError(t, err)
79-
80-
_, _, err = db.MarkGarbage(false, false, garbage)
81-
require.NoError(t, err)
82-
83-
var handled []oid.Address
84-
85-
tss := map[string]oid.Address{
86-
ts.EncodeToString(): ts,
87-
}
88-
89-
err = db.IterateCoveredByTombstones(tss, func(addr oid.Address) error {
90-
handled = append(handled, addr)
91-
return nil
92-
})
93-
require.NoError(t, err)
94-
95-
require.Len(t, handled, 3)
96-
require.Contains(t, handled, protected1)
97-
require.Contains(t, handled, protected2)
98-
require.Contains(t, handled, protectedLocked)
99-
}

pkg/local_object_storage/metabase/put.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ import (
1818
)
1919

2020
var (
21-
ErrUnknownObjectType = errors.New("unknown object type")
22-
ErrIncorrectSplitInfoUpdate = errors.New("updating split info on object without it")
23-
ErrIncorrectRootObject = errors.New("invalid root object")
21+
ErrIncorrectRootObject = errors.New("invalid root object")
2422
)
2523

2624
// Put updates metabase indexes for the given object.

0 commit comments

Comments
 (0)