Skip to content

Feat/meta/sn#3991

Open
carpawell wants to merge 7 commits into
masterfrom
feat/meta/sn
Open

Feat/meta/sn#3991
carpawell wants to merge 7 commits into
masterfrom
feat/meta/sn

Conversation

@carpawell
Copy link
Copy Markdown
Member

No description provided.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 17.57877% with 497 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.10%. Comparing base (3b4a1dd) to head (18d4a4f).

Files with missing lines Patch % Lines
cmd/neofs-node/meta.go 5.63% 134 Missing ⚠️
pkg/services/meta/meta.go 25.43% 81 Missing and 4 partials ⚠️
pkg/services/sidechain/sidechain.go 0.00% 80 Missing ⚠️
pkg/services/object/put/distributed.go 14.03% 48 Missing and 1 partial ⚠️
pkg/core/object/replicate.go 12.19% 36 Missing ⚠️
pkg/services/meta/blocks.go 0.00% 36 Missing ⚠️
pkg/services/meta/storage.go 7.69% 24 Missing ⚠️
pkg/services/object/put/streamer.go 31.81% 14 Missing and 1 partial ⚠️
pkg/services/meta/notifications.go 0.00% 14 Missing ⚠️
pkg/network/address.go 0.00% 7 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3991      +/-   ##
==========================================
- Coverage   27.80%   27.10%   -0.71%     
==========================================
  Files         681      683       +2     
  Lines       46758    46235     -523     
==========================================
- Hits        13003    12533     -470     
- Misses      32517    32523       +6     
+ Partials     1238     1179      -59     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@cthulhu-rider cthulhu-rider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not finished

Comment thread pkg/core/metachain/meta/meta_test.go
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread cmd/neofs-node/meta_new.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated

func (m *Meta) blockHandler(ctx context.Context, buff <-chan *block.Header) {
for {
if len(buff) >= blockBuffSize-1 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doubt it can be >

btw is it possible to do by channel writer(s). Would be more natural to me

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doubt it can be >

why? we read an item, do some magic that may take time, and then check again what size we have now, a new item may have come

btw is it possible to do by channel writer(s). Would be more natural to me

writer does not belong to this repo, it is sent to neo-go code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then check again

buff can initially have blockBuffSize-1 which is a capacity. This does not mean queue is full. Wouldnt be a big problem, but still

Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/meta.go Outdated
Comment thread pkg/services/meta_new/meta.go Outdated
m.l.Debug("sending transaction to chain...", zap.String("txHash", tx.Hash().StringLE()))
now := time.Now()
err := m.chain.AddTx(tx)
took := time.Since(now)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timing is useless if log is not debug. Costs mb small, but nevertheless

why do we actually care about it btw? Any chance to have a context limit?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole performance is still questionable; it needs investigation, metrics, logs, etc, can be dropped later. it can also be a metric. do you this all of the above make sense when we are talking about meta performance? we literally do nothing for 25ms at least for every object

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be dropped later

we need a reminder then

Comment thread pkg/services/meta_new/meta.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Comment thread pkg/services/meta_new/blocks.go Outdated
Copy link
Copy Markdown
Contributor

@cthulhu-rider cthulhu-rider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

finished. Lets fix everything and merge

@AnnaShaleva may u pls check chain configuration?

Comment thread pkg/services/meta/meta.go Outdated
Comment thread pkg/services/meta/meta.go Outdated
Comment thread pkg/services/meta/storage.go Outdated
Comment thread pkg/services/meta/storage.go Outdated
Comment thread pkg/services/meta/storage.go Outdated
Comment thread pkg/services/meta/storage.go
Comment thread pkg/services/object/put/distributed.go Outdated
Comment thread pkg/services/object/put/distributed.go
Comment thread cmd/neofs-node/meta.go Outdated
Comment thread cmd/neofs-node/meta.go
Comment thread cmd/neofs-node/meta.go Outdated
Comment thread cmd/neofs-node/meta.go
Comment thread cmd/neofs-node/meta.go
Comment thread pkg/services/meta/meta.go
// notification work; it is required to always read notifications without
// any blocking or making additional RPC.
notificationBuffSize = 100
notificationBuffSize = 10000
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it approved by @roman-khimov?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an address + pointer buff channel, what cons may we have? ~703KB of memory

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can change it to any value. do you have a suggestion? i just had an experience with deadlock with neo-go subscription, so this is why this big value was chosen

Copy link
Copy Markdown
Member

@AnnaShaleva AnnaShaleva Jun 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I'm asking. Increasing buffer size is not a solution to the deadlock problem. It will make the problem more hidden, that's it.

If there's a deadlock, it should be fixed in some other (explicit) way.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increasing buffer size is not a solution to the deadlock problem

we are balancing b/w notification handling speed and storage speed. i guess it is another thing for exploring in load testing (yet not answered)

Comment thread pkg/services/object/put/streamer.go
Comment thread pkg/services/sidechain/sidechain.go

// Height returns current side chaih block height.
func (s *SideChain) Height() uint32 {
return s.core.HeaderHeight()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header height differs from block height. What exactly do you need here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header height differs from block height

in which way? you mean a 1-block difference in values? i need it for async, but the same VUB calculation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean a 1-block difference in values?

Not only. It can be large difference if, e.g. the node is in the process of syncing or stale. Headers synchronisation is a separate process, different from blocks synchronisation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only thing i can suggest is to block any operation before the node is in sync

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The decision is up to you, I'm just warning. Either way, you should either adjust the documentation and method name or adjust the return value.

Comment thread pkg/services/sidechain/sidechain.go Outdated
10_000_000 meant nothing, GAS factor is 1_0000_0000. Also, new value means
something at least.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Copy link
Copy Markdown
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing. Other than that looks legit as a prototype.

Comment thread cmd/neofs-node/meta.go Outdated
config.HFCockatrice.String(): 0,
config.HFDomovoi.String(): 0,
config.HFEchidna.String(): 0,
config.HFFaun.String(): 0,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a compatibility unit-test: check that hardforks starting from Aspid ending with config.HFLatestStable are enabled in the resulting chainCfg. On subsequent NeoGo update if latest stable hardfork is changed, you'll know about it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread pkg/innerring/innerring.go Outdated
configneogo.HFCockatrice.String(): 0,
configneogo.HFDomovoi.String(): 0,
configneogo.HFEchidna.String(): 0,
configneogo.HFFaun.String(): 0,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto for this config.

Comment thread pkg/util/network.go Outdated
@@ -0,0 +1,21 @@
package util
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

util is always a bad name, think about a better one. CC @roman-khimov

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not the package i created, i just extended it. but agree, moved to another network package

carpawell and others added 5 commits June 4, 2026 19:02
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
It is available starting from v0.119.0. This should speed broadcast up, which is
critical for metadata chain.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
@carpawell
Copy link
Copy Markdown
Member Author

Tests are failing. Other than that looks legit as a prototype.

They should be adopted, yes. And there are other problems. Config check and changelog are not accepted to the experimental things.

Just drop the old one, use new instead, no functional changed in the new one.

Signed-off-by: Pavel Karpy <carpawell@nspcc.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants