mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
backing: Remove redundant erasure encoding (#7469)
* Remove redundant erasure encoding Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * Review feedback Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> * fix comments Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> --------- Signed-off-by: Andrei Sandu <andrei-mihail@parity.io>
This commit is contained in:
@@ -462,9 +462,10 @@ pub enum AvailabilityStoreMessage {
|
||||
tx: oneshot::Sender<Result<(), ()>>,
|
||||
},
|
||||
|
||||
/// Store a `AvailableData` and all of its chunks in the AV store.
|
||||
/// Computes and checks the erasure root of `AvailableData` before storing all of its chunks in
|
||||
/// the AV store.
|
||||
///
|
||||
/// Return `Ok(())` if the store operation succeeded, `Err(())` if it failed.
|
||||
/// Return `Ok(())` if the store operation succeeded, `Err(StoreAvailableData)` if it failed.
|
||||
StoreAvailableData {
|
||||
/// A hash of the candidate this `available_data` belongs to.
|
||||
candidate_hash: CandidateHash,
|
||||
@@ -472,11 +473,21 @@ pub enum AvailabilityStoreMessage {
|
||||
n_validators: u32,
|
||||
/// The `AvailableData` itself.
|
||||
available_data: AvailableData,
|
||||
/// Erasure root we expect to get after chunking.
|
||||
expected_erasure_root: Hash,
|
||||
/// Sending side of the channel to send result to.
|
||||
tx: oneshot::Sender<Result<(), ()>>,
|
||||
tx: oneshot::Sender<Result<(), StoreAvailableDataError>>,
|
||||
},
|
||||
}
|
||||
|
||||
/// The error result type of a [`AvailabilityStoreMessage::StoreAvailableData`] request.
|
||||
#[derive(Error, Debug, Clone, PartialEq, Eq)]
|
||||
#[allow(missing_docs)]
|
||||
pub enum StoreAvailableDataError {
|
||||
#[error("The computed erasure root did not match expected one")]
|
||||
InvalidErasureRoot,
|
||||
}
|
||||
|
||||
/// A response channel for the result of a chain API request.
|
||||
pub type ChainApiResponseChannel<T> = oneshot::Sender<Result<T, crate::errors::ChainApiError>>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user