You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NeoFS nodes have two separate pools of endpoint addresses:
to listen side chain events,
to send side chain RPC requests.
Node might listen events from one endpoint but send RPC request to another. There is an issue with that approach.
Sidechain blocks are not distributed uniformly among RPC nodes. There is a case when NeoFS node receives notification from block which is not processed by other RPC node, where NeoFS sends requests.
c.log.Error("could not update node state on new epoch",
zap.Uint64("epoch", e),
zap.String("error", err.Error()),
)
return
}
c.handleLocalNodeInfo(ni)
In this example NeoFS node tries to fetch new network map on NewEpoch event. If RPC node did not process block with new epoch yet, then fetch invocation will fail and new network map will not be processed by the node.
error neofs-node/netmap.go:156 could not update node state on new epoch {"epoch": 2529, "error": "could not perform test invocation (snapshotByEpoch): chain/client: contract execution finished with state FAULT; exception: at instruction 3593 (THROW): unhandled exception: \"incorrect diff\""}
To avoid such cases I propose to use single endpoint for listening and sending events. In case of errors, switch to another endpoint both in listener and in the client.
Define components that will implement both Listener interface and necessary neo-go client functions. This component will use monitor routine to check health of nodes and switch between endpoints in case of failures like Storage nodes do not switch between RPC endpoints #746.
NeoFS nodes have two separate pools of endpoint addresses:
Node might listen events from one endpoint but send RPC request to another. There is an issue with that approach.
Sidechain blocks are not distributed uniformly among RPC nodes. There is a case when NeoFS node receives notification from block which is not processed by other RPC node, where NeoFS sends requests.
Example:
neofs-node/cmd/neofs-node/netmap.go
Lines 144 to 157 in 96efe0f
In this example NeoFS node tries to fetch new network map on
NewEpoch
event. If RPC node did not process block with new epoch yet, then fetch invocation will fail and new network map will not be processed by the node.To avoid such cases I propose to use single endpoint for listening and sending events. In case of errors, switch to another endpoint both in listener and in the client.
WSClient encapsulates ordinary client that we use in morph package.
Drop multiclient component from RPC
Provide seamless switch from one endpoint to another in runtime
In case of network errors during RPC requests or closed channel in subscriber, switch to another endpoint.
The text was updated successfully, but these errors were encountered: