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

Storage node can update its network state to any value #1797

Closed
cthulhu-rider opened this issue Sep 19, 2022 · 1 comment · Fixed by #1798
Closed

Storage node can update its network state to any value #1797

cthulhu-rider opened this issue Sep 19, 2022 · 1 comment · Fixed by #1798
Assignees
Labels
bug Something isn't working neofs-ir Inner Ring node application issues U4 Nothing urgent

Comments

@cthulhu-rider
Copy link
Contributor

Similar problem with state updating. It works similar to network registration but with other request - UpdateState.

Expected Behavior

Inner Ring does not allow to set node's state other than ONLINE or OFFLINE.

Current Behavior

Inner Ring allows to set any state.

Possible Solution

Check the state during processing.

Steps to Reproduce (for bugs)

  1. make NeoFS CLI to send unsupported states. For example replace
    common.ExitOnErr(cmd, "", fmt.Errorf("unsupported status %s", st))
    with status = 321
  2. build dirty NeoFS CLI $ make bin/neofs-cli
  3. run NeoFS Developer Environment with the built version using make up/basic
  4. exec $ ./bin/neofs-cli --endpoint s01.neofs.devenv:8081 --wallet ../devenv/services/storage/wallet01.json control set-status --status aaa
  5. see Inner Ring logs
info	netmap/handlers.go:66	notification	{"type": "update peer state", "key": "022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131"}
debug	client/notary.go:404	notary request with prepared main TX invoked	{"fallback_valid_for": 40, "tx_hash": "c06e69162f87fd6609fd3a8861c1ed926657363f11d9c914a9a426195ba824cd"}
debug	subscriber/subscriber.go:136	new notification event from sidechain	{"name": "UpdateStateSuccess"}

Regression

No. Bug is very old.

Your Environment

  • NeoFS Storage node: neofs-node@v0.32.0
  • NeoFS CLI: neofs-cli@v0.32.0
  • NeoFS Developer Environment: neofs-dev-env@c4ceb1c5854816cebcf23580853fda294c2d2c60
@cthulhu-rider cthulhu-rider added bug Something isn't working triage neofs-ir Inner Ring node application issues labels Sep 19, 2022
@cthulhu-rider cthulhu-rider self-assigned this Sep 19, 2022
@cthulhu-rider
Copy link
Contributor Author

While Inner Ring is a last resort of verification, maybe we need to check states also before calling the Netmap contract in order to not produce invalid requests.

@alexchetaev alexchetaev added the U3 Regular label Sep 19, 2022
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this issue Sep 19, 2022
… server

In previous implementation storage node interpreted all status values
sent in `SetNetmapStatus` RPC as `OFFLINE` except `ONLINE` and
`MAINTENANCE`. This could lead to incorrect processing of new values,
and also didn't allow detection of problems with sending garbage values.

Make implementation of `NodeState` interface used by Control API server
to deny requests with statuses other than protocol-declared enum.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this issue Sep 19, 2022
… server

In previous implementation storage node interpreted all status values
sent in `SetNetmapStatus` RPC as `OFFLINE` except `ONLINE` and
`MAINTENANCE`. This could lead to incorrect processing of new values,
and also didn't allow detection of problems with sending garbage values.

Make implementation of `NodeState` interface used by Control API server
to deny requests with statuses other than protocol-declared enum.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this issue Sep 28, 2022
… server

In previous implementation storage node interpreted all status values
sent in `SetNetmapStatus` RPC as `OFFLINE` except `ONLINE` and
`MAINTENANCE`. This could lead to incorrect processing of new values,
and also didn't allow detection of problems with sending garbage values.

Make implementation of `NodeState` interface used by Control API server
to deny requests with statuses other than protocol-declared enum.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
@alexchetaev alexchetaev added U4 Nothing urgent 2022Q3 and removed U3 Regular labels Sep 30, 2022
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this issue Sep 30, 2022
… server

In previous implementation storage node interpreted all status values
sent in `SetNetmapStatus` RPC as `OFFLINE` except `ONLINE` and
`MAINTENANCE`. This could lead to incorrect processing of new values,
and also didn't allow detection of problems with sending garbage values.

Make implementation of `NodeState` interface used by Control API server
to deny requests with statuses other than protocol-declared enum.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this issue Oct 4, 2022
… server

In previous implementation storage node interpreted all status values
sent in `SetNetmapStatus` RPC as `OFFLINE` except `ONLINE` and
`MAINTENANCE`. This could lead to incorrect processing of new values,
and also didn't allow detection of problems with sending garbage values.

Make implementation of `NodeState` interface used by Control API server
to deny requests with statuses other than protocol-declared enum.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this issue Oct 19, 2022
… server

In previous implementation storage node interpreted all status values
sent in `SetNetmapStatus` RPC as `OFFLINE` except `ONLINE` and
`MAINTENANCE`. This could lead to incorrect processing of new values,
and also didn't allow detection of problems with sending garbage values.

Make implementation of `NodeState` interface used by Control API server
to deny requests with statuses other than protocol-declared enum.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working neofs-ir Inner Ring node application issues U4 Nothing urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants