nspcc-dev / nspcc-dev/neofs-node
Refactor node validation in Inner Ring code
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 38
- Forks
- 51
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 38
Description
currently Inner Ring verifies and updates descriptors of the storage nodes to be set in the NeoFS network map via https://pkg.go.dev/github.com/nspcc-dev/neofs-node/pkg/innerring/processors/netmap#NodeValidator
it's implemented through several independed packages https://github.com/nspcc-dev/neofs-node/tree/master/pkg/innerring/processors/netmap/nodevalidation
there are two disadvantages in such approach:
- since each "small" validator may change descriptor through pointer (e.g. LOCODE one), they must be strictly ordered, so https://pkg.go.dev/github.com/nspcc-dev/neofs-node@v0.38.0/pkg/innerring/processors/netmap/nodevalidation#CompositeValidator becomes unusable. We've already encountered such problem in 4c55307421e75e81a098490eada5dd48e2e20fc2
- previous point also happens because different validators work with the same parts. For example,
locode,structureandattribute(coming with #2280) work with attributes but stay out of sync, so they must repeat similar checks
i propose to refactor this part of code to make it more simple (e.g. gather in one package) and safe. Power of interfaces will allow us to make it easy to understand and test
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with NodeValidator in pkg/innerring/processors/netmap and the independent validators under pkg/innerring/processors/netmap/nodevalidation. Read CompositeValidator and commit 4c55307421e75e81a098490eada5dd48e2e20fc2, then trace how locode, structure, and attribute validators modify descriptors. Done means the validation is simpler, safe from ordering and shared-attribute issues, and easy to understand and test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- distributed-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100