Skip to content
Merged
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
106 changes: 0 additions & 106 deletions cmd/internal/configvalidator/validate.go

This file was deleted.

8 changes: 0 additions & 8 deletions cmd/neofs-adm/internal/modules/fschain/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,18 @@ const (
storageGasConfigFlag = "storage.initial_gas"
contractsInitFlag = "contracts"
maxObjectSizeInitFlag = "network.max_object_size"
maxObjectSizeCLIFlag = "max-object-size"
epochDurationInitFlag = "network.epoch_duration"
epochDurationCLIFlag = "epoch-duration"
incomeRateInitFlag = "network.basic_income_rate"
incomeRateCLIFlag = "basic-income-rate"
containerFeeInitFlag = "network.fee.container"
containerAliasFeeInitFlag = "network.fee.container_alias"
containerFeeCLIFlag = "container-fee"
containerAliasFeeCLIFlag = "container-alias-fee"
homomorphicHashDisabledInitFlag = "network.homomorphic_hash_disabled"
homomorphicHashDisabledCLIFlag = "homomorphic-disabled"
withdrawFeeInitFlag = "network.fee.withdraw"
withdrawFeeCLIFlag = "withdraw-fee"
containerDumpFlag = "dump"
containerContractFlag = "container-contract"
containerIDsFlag = "cid"
refillGasAmountFlag = "gas"
walletAccountFlag = "account"
notaryDepositTillFlag = "till"
protoConfigPath = "protocol"
walletAddressFlag = "wallet-address"
domainFlag = "domain"
neoAddressesFlag = "neo-addresses"
Expand Down
3 changes: 0 additions & 3 deletions cmd/neofs-node/config/engine/shard/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/shard/mode"
)

// SmallSizeLimitDefault is the default limit of small objects payload in bytes.
const SmallSizeLimitDefault = 1 << 20

// ShardDetails contains configuration for a single shard of a storage node.
type ShardDetails struct {
Mode mode.Mode `mapstructure:"mode"`
Expand Down
2 changes: 0 additions & 2 deletions cmd/neofs-node/config/engine/shard/writecache/writecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
)

const (
// MaxSizeDefault is the default value of the object payload size limit.
MaxSizeDefault = 64 << 20
// SizeLimitDefault is the default write-cache size limit.
SizeLimitDefault = 1 << 30
)
Expand Down
3 changes: 0 additions & 3 deletions cmd/neofs-node/config/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package nodeconfig
import (
"fmt"
"sort"
"time"

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

// Node contains configuration for a node.
Expand Down
14 changes: 0 additions & 14 deletions pkg/core/client/util.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package client

import (
"bytes"
"fmt"

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

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

return nil
}

// AssertKeyResponseCallback returns client response callback which checks if the response was signed by the expected key.
// Returns ErrWrongPublicKey in case of key mismatch.
func AssertKeyResponseCallback(expectedKey []byte) func(client.ResponseMetaInfo) error {
return func(info client.ResponseMetaInfo) error {
if !bytes.Equal(info.ResponderKey(), expectedKey) {
return ErrWrongPublicKey
}

return nil
}
}
8 changes: 0 additions & 8 deletions pkg/innerring/innerring.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"net"
"sync"
"sync/atomic"

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

var buffers sync.Pool
buffers.New = func() any {
b := make([]byte, cache.DefaultBufferSize)
return &b
}

// create settlement processor
settlementProcessor := settlement.New(
settlement.Prm{
Expand Down
63 changes: 0 additions & 63 deletions pkg/local_object_storage/metabase/iterators.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"math"

"github.com/nspcc-dev/bbolt"
Expand Down Expand Up @@ -177,68 +176,6 @@ func (db *DB) iterateExpired(tx *bbolt.Tx, curEpoch uint64, h ExpiredObjectHandl
return err
}

// IterateCoveredByTombstones iterates over all objects in DB which are covered
// by tombstone with string address from tss. Locked objects are not included
// (do not confuse with objects of type LOCK).
//
// If h returns ErrInterruptIterator, nil returns immediately.
// Returns other errors of h directly.
//
// Does not modify tss.
func (db *DB) IterateCoveredByTombstones(tss map[string]oid.Address, h func(oid.Address) error) error {
db.modeMtx.RLock()
defer db.modeMtx.RUnlock()

if db.mode.NoMetabase() {
return ErrDegradedMode
}

currEpoch := db.epochState.CurrentEpoch()

return db.boltDB.View(func(tx *bbolt.Tx) error {
return db.iterateCoveredByTombstones(tx, currEpoch, tss, h)
})
}

func (db *DB) iterateCoveredByTombstones(tx *bbolt.Tx, currEpoch uint64, tss map[string]oid.Address, h func(oid.Address) error) error {
bktGraveyard := tx.Bucket(graveyardBucketName)

err := bktGraveyard.ForEach(func(k, v []byte) error {
var addr oid.Address
if err := decodeAddressFromKey(&addr, v[:addressKeySize]); err != nil {
return err
}
if _, ok := tss[addr.EncodeToString()]; ok {
var addr oid.Address

err := decodeAddressFromKey(&addr, k)
if err != nil {
return fmt.Errorf("could not parse address of the object under tombstone: %w", err)
}

metaBucket := tx.Bucket(metaBucketKey(addr.Container()))
var metaCursor *bbolt.Cursor
if metaBucket != nil {
metaCursor = metaBucket.Cursor()
}

if objectLocked(tx, currEpoch, metaCursor, addr.Container(), addr.Object()) {
return nil
}

return h(addr)
}

return nil
})

if errors.Is(err, ErrInterruptIterator) {
err = nil
}

return err
}

func mkFilterPhysicalPrefix() []byte {
var prefix = make([]byte, 1+len(object.FilterPhysical)+1+len(binPropMarker)+1)

Expand Down
35 changes: 0 additions & 35 deletions pkg/local_object_storage/metabase/iterators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,3 @@ func putWithExpiration(t *testing.T, db *meta.DB, typ object.Type, expiresAt uin

return object2.AddressOf(obj)
}

func TestDB_IterateCoveredByTombstones(t *testing.T) {
db := newDB(t)

ts := oidtest.Address()
protected1 := oidtest.Address()
protected2 := oidtest.Address()
protectedLocked := oidtest.Address()
garbage := oidtest.Address()

var err error

_, _, err = db.Inhume(ts, 0, false, protected1, protected2, protectedLocked)
require.NoError(t, err)

_, _, err = db.MarkGarbage(false, false, garbage)
require.NoError(t, err)

var handled []oid.Address

tss := map[string]oid.Address{
ts.EncodeToString(): ts,
}

err = db.IterateCoveredByTombstones(tss, func(addr oid.Address) error {
handled = append(handled, addr)
return nil
})
require.NoError(t, err)

require.Len(t, handled, 3)
require.Contains(t, handled, protected1)
require.Contains(t, handled, protected2)
require.Contains(t, handled, protectedLocked)
}
4 changes: 1 addition & 3 deletions pkg/local_object_storage/metabase/put.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import (
)

var (
ErrUnknownObjectType = errors.New("unknown object type")
ErrIncorrectSplitInfoUpdate = errors.New("updating split info on object without it")
ErrIncorrectRootObject = errors.New("invalid root object")
ErrIncorrectRootObject = errors.New("invalid root object")
)

// Put updates metabase indexes for the given object.
Expand Down
4 changes: 1 addition & 3 deletions pkg/local_object_storage/shard/dump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ func checkRestore(t *testing.T, sh *shard.Shard, path string, r io.Reader, objec

func TestDumpIgnoreErrors(t *testing.T) {
const (
wcSmallObjectSize = 512 // goes to write-cache memory
wcBigObjectSize = wcSmallObjectSize << 1 // goes to write-cache FSTree
bsSmallObjectSize = wcSmallObjectSize << 2
wcSmallObjectSize = 512 // goes to write-cache memory

objCount = 10
headerSize = 400
Expand Down
25 changes: 10 additions & 15 deletions pkg/morph/client/netmap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,16 @@ type Client struct {
}

const (
addNodeMethod = "addNode"
addPeerMethod = "addPeer"
configMethod = "config"
epochMethod = "epoch"
lastEpochBlockMethod = "lastEpochBlock"
epochBlockMethod = "getEpochBlock"
listNodesMethod = "listNodes"
innerRingListMethod = "innerRingList"
netMapCandidatesMethod = "netmapCandidates"
netMapMethod = "netmap"
newEpochMethod = "newEpoch"
setConfigMethod = "setConfig"
updateInnerRingMethod = "updateInnerRing"
snapshotMethod = "snapshot"
updateStateMethod = "updateState"
addNodeMethod = "addNode"
configMethod = "config"
epochMethod = "epoch"
lastEpochBlockMethod = "lastEpochBlock"
epochBlockMethod = "getEpochBlock"
innerRingListMethod = "innerRingList"
newEpochMethod = "newEpoch"
setConfigMethod = "setConfig"
updateInnerRingMethod = "updateInnerRing"
updateStateMethod = "updateState"

configListMethod = "listConfig"
)
Expand Down
Loading
Loading