Skip to content
Draft
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Changelog for NeoFS Node
- IR `experimental.allow_ec` config option (#3570)
- SN `pprof.enable_block` and `pprof.enable_mutex` options (#3655)
- `neofs-adm fschain load-report` command (#3649)
- SN now supports new `getInfo` and `createV2` methods of the Container contract (#3670)
- IR now supports container creation requests submitted via new `createV2` contract method (#3670)
- IR structures containers in the contract iteratively (#3670)

### Fixed
- Write cache using too much CPU (#3642)
Expand All @@ -28,6 +31,7 @@ Changelog for NeoFS Node
- Pre-0.46.0 write cache format migration (#3647)

### Updated
- `github.com/nspcc-dev/neofs-contract` dependency to `XXX` (#3670)

### Updating from v0.49.1
Erasure coding is available in experimental mode. To enable it, set
Expand Down
15 changes: 2 additions & 13 deletions cmd/neofs-node/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,26 +385,15 @@ func (x *containersInChain) List(id user.ID) ([]cid.ID, error) {
}

func (x *containersInChain) Put(cnr containerSDK.Container, pub, sig []byte, st *session.Container) (cid.ID, error) {
data := cnr.Marshal()
d := cnr.ReadDomain()

var prm cntClient.PutPrm
prm.SetContainer(data)
prm.SetName(d.Name())
prm.SetZone(d.Zone())
prm.SetContainer(cnr)
prm.SetKey(pub)
prm.SetSignature(sig)
if st != nil {
prm.SetToken(st.Marshal())
}
if v := cnr.Attribute("__NEOFS__METAINFO_CONSISTENCY"); v == "optimistic" || v == "strict" {
prm.EnableMeta()
}
if err := x.cCli.Put(prm); err != nil {
return cid.ID{}, err
}

return cid.NewFromMarshalledContainer(data), nil
return x.cCli.Put(prm)
}

func (x *containersInChain) Delete(id cid.ID, pub, sig []byte, st *session.Container) error {
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ require (
github.com/nspcc-dev/bbolt v0.0.0-20250911202005-807225ebb0c8
github.com/nspcc-dev/hrw/v2 v2.0.4
github.com/nspcc-dev/locode-db v0.8.1
github.com/nspcc-dev/neo-go v0.113.0
github.com/nspcc-dev/neo-go v0.114.0
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240827150555-5ce597aa14ea
github.com/nspcc-dev/neofs-contract v0.24.0
github.com/nspcc-dev/neofs-contract v0.25.1-0.20251118090121-b2011710f11d
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.15.0.20251015122943-b38583ddd311
github.com/nspcc-dev/tzhash v1.8.3
github.com/panjf2000/ants/v2 v2.11.3
Expand All @@ -46,7 +46,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.24.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/consensys/gnark-crypto v0.19.0 // indirect
github.com/consensys/gnark-crypto v0.19.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
Expand All @@ -70,7 +70,7 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nspcc-dev/dbft v0.4.0 // indirect
github.com/nspcc-dev/go-ordered-json v0.0.0-20250911084817-6fb4472993d1 // indirect
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20250923153235-ffb84619d02f // indirect
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20251112080609-3c8e29c66609 // indirect
github.com/nspcc-dev/rfc6979 v0.2.4 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI
github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
github.com/consensys/gnark-crypto v0.19.0 h1:zXCqeY2txSaMl6G5wFpZzMWJU9HPNh8qxPnYJ1BL9vA=
github.com/consensys/gnark-crypto v0.19.0/go.mod h1:rT23F0XSZqE0mUA0+pRtnL56IbPxs6gp4CeRsBk4XS0=
github.com/consensys/gnark-crypto v0.19.1 h1:FWO1JDs7A2OajswzwMG7f8l2Zrxc/yOkxSTByKTc3O0=
github.com/consensys/gnark-crypto v0.19.1/go.mod h1:rT23F0XSZqE0mUA0+pRtnL56IbPxs6gp4CeRsBk4XS0=
github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI=
github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M=
github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE=
Expand Down Expand Up @@ -191,14 +191,14 @@ github.com/nspcc-dev/hrw/v2 v2.0.4 h1:o3Zh/2aF+IgGpvt414f46Ya20WG9u9vWxVd16ErFI8
github.com/nspcc-dev/hrw/v2 v2.0.4/go.mod h1:dUjOx27zTTvoPmT5EG25vSSWL2tKS7ndAa2TPTiZwFo=
github.com/nspcc-dev/locode-db v0.8.1 h1:BadCnDPfIbQXbi+X/m7DRhbiau81QelM/bD4QiiCGsI=
github.com/nspcc-dev/locode-db v0.8.1/go.mod h1:PtAASXSG4D4Oz0js9elzTyTr8GLpOJO20qFL881Nims=
github.com/nspcc-dev/neo-go v0.113.0 h1:Xedd5hlN+sCQuaCFBm+0PPDWgHuw7c6/zNlhgqwBVfA=
github.com/nspcc-dev/neo-go v0.113.0/go.mod h1:wcWOspKlqzay5XGkCUV1x0AVB/ZAmiKu3RhcB+O7DVM=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20250923153235-ffb84619d02f h1:EOV4T/lbNIdUwAYBay3XbV3fL2Tq4TUvwg+GnwDX5aw=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20250923153235-ffb84619d02f/go.mod h1:X2spkE8hK/l08CYulOF19fpK5n3p2xO0L1GnJFIywQg=
github.com/nspcc-dev/neo-go v0.114.0 h1:JxyLGlQGtzrfWvhdrUa35BGzBaadwPtLdNL5ehfOF2k=
github.com/nspcc-dev/neo-go v0.114.0/go.mod h1:visra3tXvGBgBfhMizRGEB+bUI5a/zoeqr5WQRKXFGQ=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20251112080609-3c8e29c66609 h1:9jH0IXFw8rjBgBVWSJbWeEHf7XDjANBnmEas49rdAH8=
github.com/nspcc-dev/neo-go/pkg/interop v0.0.0-20251112080609-3c8e29c66609/go.mod h1:X2spkE8hK/l08CYulOF19fpK5n3p2xO0L1GnJFIywQg=
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240827150555-5ce597aa14ea h1:mK0EMGLvunXcFyq7fBURS/CsN4MH+4nlYiqn6pTwWAU=
github.com/nspcc-dev/neofs-api-go/v2 v2.14.1-0.20240827150555-5ce597aa14ea/go.mod h1:YzhD4EZmC9Z/PNyd7ysC7WXgIgURc9uCG1UWDeV027Y=
github.com/nspcc-dev/neofs-contract v0.24.0 h1:lQHtfRc00WEhW9qcnVNbM2sMa4oCBQ5v7vcunJKk9rA=
github.com/nspcc-dev/neofs-contract v0.24.0/go.mod h1:PPxjwRiK6hhXPXduvyojEqLMHNpgPaF+rULPhdFlzDg=
github.com/nspcc-dev/neofs-contract v0.25.1-0.20251118090121-b2011710f11d h1:RVatfw2zdmLOekUwZlF3U+WSRRcnkLrRVi5IacPvpTU=
github.com/nspcc-dev/neofs-contract v0.25.1-0.20251118090121-b2011710f11d/go.mod h1:uqTaIPQCIouOyflW4aRQAyl4w88GhxYosJ74wvS4AEQ=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.15.0.20251015122943-b38583ddd311 h1:iHjokyLIiOW7zvaNZZPmch0c1tghwkfOniL+JOt+F7M=
github.com/nspcc-dev/neofs-sdk-go v1.0.0-rc.15.0.20251015122943-b38583ddd311/go.mod h1:Vukuf6qDOQESOWAx5yOjYtVC5wdsQp3hiZrxbJIa2fs=
github.com/nspcc-dev/rfc6979 v0.2.4 h1:NBgsdCjhLpEPJZqmC9rciMZDcSY297po2smeaRjw57k=
Expand Down
13 changes: 10 additions & 3 deletions pkg/innerring/innerring.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ type (
withoutMainNet bool

// runtime processors
netmapProcessor *netmap.Processor
netmapProcessor *netmap.Processor
containerProcessor *container.Processor

workers []func(context.Context)

Expand Down Expand Up @@ -229,6 +230,12 @@ func (s *Server) Start(ctx context.Context, intError chan<- error) (err error) {
go s.fsChainListener.ListenWithError(ctx, fsChainErr) // listen for neo:fs events
go s.mainnetListener.ListenWithError(ctx, mainnnetErr) // listen for neo:mainnet events

go func() {
if err := s.containerProcessor.AddContainerStructs(ctx); err != nil {
fsChainErr <- fmt.Errorf("structurize containers in the contract: %w", err)
}
}()

s.startWorkers(ctx)

return nil
Expand Down Expand Up @@ -820,7 +827,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *config.Config, errChan chan<
}

// container processor
containerProcessor, err := container.New(&container.Params{
server.containerProcessor, err = container.New(&container.Params{
Log: log,
PoolSize: cfg.Workers.Container,
AlphabetState: server,
Expand All @@ -833,7 +840,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *config.Config, errChan chan<
return nil, err
}

err = bindFSChainProcessor(containerProcessor, server)
err = bindFSChainProcessor(server.containerProcessor, server)
if err != nil {
return nil, err
}
Expand Down
11 changes: 10 additions & 1 deletion pkg/innerring/processors/container/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ import (
"go.uber.org/zap"
)

func (cp *Processor) handleCreationRequest(ev event.Event) {
err := cp.pool.Submit(func() { cp.processCreateContainerRequest(ev.(containerEvent.CreateContainerV2Request)) })
if err != nil {
// there system can be moved into controlled degradation stage
cp.log.Warn("container processor worker pool drained",
zap.Int("capacity", cp.pool.Cap()))
}
}

func (cp *Processor) handlePut(ev event.Event) {
req, ok := ev.(containerEvent.CreateContainerRequest)
if !ok {
Expand All @@ -35,7 +44,7 @@ func (cp *Processor) handlePut(ev event.Event) {

// send an event to the worker pool

err := cp.pool.Submit(func() { cp.processContainerPut(req) })
err := cp.pool.Submit(func() { cp.processContainerPut(req, id) })
if err != nil {
// there system can be moved into controlled degradation stage
cp.log.Warn("container processor worker pool drained",
Expand Down
Loading
Loading