linera-protocol icon indicating copy to clipboard operation
linera-protocol copied to clipboard

Migrate parts of NodeError to linera-rpc

Open ma2bd opened this issue 2 years ago • 1 comments

A few errors in NodeError are networking errors that don't really belong there. The simplest option of all could be to use NodeError::NetworkError { error: String } instead.

ma2bd avatar Dec 28 '22 17:12 ma2bd

communicate_with_quorum currently takes a call operator that returns a Result<_, NodeError> (async). It feels like there are two or three nested categories of node errors:

  • The validator itself encounters an error, serializes it and sends it as a response.
  • Something goes wrong with networking or serialization, e.g. gRPC.
  • The validator's response is invalid: A certificate for the wrong chain, an inconsistent chain info, etc.

Maybe the first one should be a (serializable) RemoteError. And the second and third one should be NodeError (or ValidatorError) variants in addition to NodeError::Remote(RemoteError) (not necessarily serializable).

The third category is also the kind of error where the client might want to decide to ignore that validator in the future.

afck avatar Sep 12 '24 09:09 afck