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

Check LOCODE derived node attributes #412

Closed
alexvanin opened this issue Feb 25, 2021 · 1 comment · Fixed by #597
Closed

Check LOCODE derived node attributes #412

alexvanin opened this issue Feb 25, 2021 · 1 comment · Fixed by #597
Assignees
Labels
neofs-ir Inner Ring node application issues

Comments

@alexvanin
Copy link
Contributor

If the node provides some attributes, they must be valid or not conflicting. If there is LOCODE attribute, it must be valid. If there are other geographical attributes that can be derived from LOCODE, they must be logically valid and be set in the same format. If those conditions are not met, the node must be denied entering the network.

For now there can be two ways:

  1. Don't allow any LOCODE derivable attributes without LOCODE attribute set
  2. If LOCODE is not set, check derivable attributes for correctness

The second one seems to be a more solid choice.

Originally posted by @realloc in #397 (comment)

@alexvanin
Copy link
Contributor Author

Inner ring node must have sanity checks of attributes, for sure. However check of LOCODE derived attributes might be a bit too much. There are many corner cases: some omitted attributes from LOCODE base, comparing strings with and without dyacritics, etc.

Probably the best way to solve LOCODE sanity check is to forbid all LOCODE derived attributes in bootstrap txs.

Proposal for sanity check algorithm for LOCODE:

  1. If derived locode attributes are present -- ignore this bootstrap tx.
  2. If LOCODE attribute is present -- add derived attributes from db.
  3. End.

@cthulhu-rider cthulhu-rider self-assigned this Jun 9, 2021
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this issue Jun 9, 2021
`Validator.VerifyAndUpdate` method does not add location code attribute.

Signed-off-by: Leonard Lyubich <[email protected]>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this issue Jun 9, 2021
…d attributes

Make `Validator.VerifyAndUpdate` method to return an error if at least one
of LOCODE-derived attributes is set explicitly. Thus, IR will not confirm
the candidates for the network map who independently set these attributes.

Cover `Validator.VerifyAndUpdate` method with unit tests.

Signed-off-by: Leonard Lyubich <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neofs-ir Inner Ring node application issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants