Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce private attributes of the storage nodes #2580

Merged
merged 6 commits into from
Oct 11, 2023

Conversation

cthulhu-rider
Copy link
Contributor

@cthulhu-rider cthulhu-rider commented Sep 14, 2023

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Merging #2580 (a7fd4f8) into master (1006609) will decrease coverage by 0.03%.
The diff coverage is 24.33%.

❗ Current head a7fd4f8 differs from pull request most recent head b87545a. Consider uploading reports for the commit b87545a to get more accurate results

@@            Coverage Diff             @@
##           master    #2580      +/-   ##
==========================================
- Coverage   29.74%   29.71%   -0.03%     
==========================================
  Files         408      411       +3     
  Lines       31215    31431     +216     
==========================================
+ Hits         9284     9341      +57     
- Misses      21119    21279     +160     
+ Partials      812      811       -1     
Files Coverage Δ
pkg/innerring/nns.go 100.00% <100.00%> (ø)
.../netmap/nodevalidation/privatedomains/validator.go 100.00% <100.00%> (ø)
cmd/neofs-adm/internal/modules/morph/n3client.go 0.00% <0.00%> (ø)
pkg/innerring/innerring.go 0.00% <0.00%> (ø)
cmd/neofs-adm/internal/modules/morph/root.go 52.94% <68.75%> (+2.94%) ⬆️
pkg/morph/client/client.go 0.00% <0.00%> (ø)
...ofs-adm/internal/modules/morph/verified_domains.go 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch from 871b6f9 to 3e2169b Compare September 15, 2023 06:16
@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch 6 times, most recently from e9c205e to 3b0d613 Compare September 25, 2023 10:15
@cthulhu-rider cthulhu-rider added the blocked Can't be done because of something label Sep 25, 2023
@cthulhu-rider cthulhu-rider marked this pull request as ready for review September 25, 2023 10:20
docs/private-node-attributes.md Outdated Show resolved Hide resolved
docs/private-node-attributes.md Outdated Show resolved Hide resolved
docs/private-node-attributes.md Outdated Show resolved Hide resolved
docs/private-node-attributes.md Outdated Show resolved Hide resolved
Copy link
Member

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

Please adjust the scheme to have a fixed key that contains arbitrary NeoFS NNS domain (that can be registered by anyone and that's the key). This domain then should have a list of TXT records with addresses derived from node keys. IR will check for presence in this list.

@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch 2 times, most recently from d087255 to bb00094 Compare September 27, 2023 12:22
@cthulhu-rider cthulhu-rider removed the blocked Can't be done because of something label Sep 27, 2023
@cthulhu-rider cthulhu-rider marked this pull request as draft September 27, 2023 12:37
@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch from bb00094 to 3fc9e32 Compare September 27, 2023 12:39
@cthulhu-rider
Copy link
Contributor Author

changes are done

https://github.com/nspcc-dev/neofs-contract/releases/tag/v0.18.0 is now available, but it pulls https://github.com/nspcc-dev/neo-go/releases/tag/v0.102.0 along. So, lets wait for #2587 first

@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch 3 times, most recently from d747829 to 5562ada Compare September 28, 2023 10:41
@cthulhu-rider cthulhu-rider marked this pull request as ready for review September 28, 2023 10:45

### Domain record format

For each public key, a record is created - a structure with at least 3 fields:
Copy link
Member

Choose a reason for hiding this comment

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

But why talking about structures when in fact it's just https://pkg.go.dev/github.com/nspcc-dev/neofs-contract/rpc/nns#Contract.AddRecord ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AddRecord only creates the record, then we read the structures. This may be useful for alternative integrations

For each public key, a record is created - a structure with at least 3 fields:
1. `ByteString` with name of the corresponding domain
2. `Integer` that should be `16` (TXT records)
3. `ByteString` with Neo address of the storage node's public key
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

pkg/innerring/nns.go Outdated Show resolved Hide resolved
pkg/innerring/nns.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/nns.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/verified_domains.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/verified_domains.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/verified_domains.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/verified_domains.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/morph/verified_domains.go Outdated Show resolved Hide resolved
@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch 4 times, most recently from 23f9c70 to 50401cf Compare October 10, 2023 15:43
@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch 2 times, most recently from de115ad to cc4add1 Compare October 10, 2023 17:09
@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch from cc4add1 to be4c57d Compare October 10, 2023 17:17
From now, the Inner Ring checks any incoming node for permission to
associate itself with optional private node group (kind of subnet).
Access lists are stored in the NeoFS NNS.

Closes #2280.

Signed-off-by: Leonard Lyubich <[email protected]>
Add commands to get and set list of the storage nodes allowed to use
domain of the private node group.

Refs #2280.

Signed-off-by: Leonard Lyubich <[email protected]>
Previously, Inner Ring called `getAllRecords` method to lookup for the
particular entry. In particular, this method was used during validation
of verified nodes' domains. Implementation was pretty complex due to
low-levelness. The `resolve` method is much simpler, but it returns all
records on each call. Taking into account that each domain can have no
more than 255 records, this drawback is considered insignificant.

From now, Inner Ring calls `resolve` method to check domain record
existence. This is done as simple as possible through RPC interface
provided by NeoFS Contracts lib.

Refs #2280.

Signed-off-by: Leonard Lyubich <[email protected]>
Similar motivation as in 8b0e5ed.

Refs #2280.

Signed-off-by: Leonard Lyubich <[email protected]>
From now verified nodes' domain records are prefixed with `address=` in
order to comply the Neo specification.

Signed-off-by: Leonard Lyubich <[email protected]>
@cthulhu-rider cthulhu-rider force-pushed the feature/2280-node-attr-validation branch from be4c57d to b87545a Compare October 10, 2023 17:19
@roman-khimov roman-khimov merged commit 1d7bd26 into master Oct 11, 2023
8 checks passed
@roman-khimov roman-khimov deleted the feature/2280-node-attr-validation branch October 11, 2023 09:51
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.

Verifiable attributes
2 participants