Trait aptos_data_client::ResponseCallback
source · [−]pub trait ResponseCallback: Debug + Send + 'static {
fn notify_bad_response(&self, error: ResponseError);
}Expand description
A callback that lets the consumer provide error feedback about a response. Typically, this will contain a reference to the underlying data client and any additional request context needed to update internal scoring.
This feedback mechanism is required because a Data Client is not always able to fully verify that a given data response is valid (e.g., it is unable to verify all proofs).
This trait provides a simple feedback mechanism for users of the Data Client to alert it to bad responses so that the peers responsible for providing this data can be penalized.