linera-protocol
linera-protocol copied to clipboard
Deduplicate handling of different error types returned from remote nodes.
trafficstars
There are different places in the updater and client where we handle errors returned by remote nodes, e.g.:
- missing blobs published by the proposal,
- missing blobs used in the certificate,
- missing chain description blobs,
- missing events,
- missing incoming messages,
- wrong block height,
- wrong round.
In all these places we need to update the remote node and try again, which currently is done it some duplicated code.
We should try and create a single function (as far as possible) that maybe takes a closure, executes it, and on error updates the remote node and tries again.