mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Fix bitfield signing (#1466)
* Apply suggestions from #1364 code review - use CoreState, not CoreOccupied - query for availability chunks, not the whole PoV - create a stub `fn availability_cores` * link to issue documenting unimplemented * implement get_availability_cores by adding a new runtime api request * back out an unrelated change properly part of #1404 * av-store: handle QueryChunkAvailability * simplify QueryDataAvailability * remove extraneous whitespace * compact primitive imports
This commit is contained in:
committed by
GitHub
parent
756f95c407
commit
4b2cb04e56
@@ -242,7 +242,7 @@ pub enum AvailabilityStoreMessage {
|
||||
|
||||
/// Query whether a `AvailableData` exists within the AV Store.
|
||||
///
|
||||
/// This is useful in cases like bitfield signing, when existence
|
||||
/// This is useful in cases when existence
|
||||
/// matters, but we don't want to necessarily pass around multiple
|
||||
/// megabytes of data to get a single bit of information.
|
||||
QueryDataAvailability(Hash, oneshot::Sender<bool>),
|
||||
@@ -250,6 +250,13 @@ pub enum AvailabilityStoreMessage {
|
||||
/// Query an `ErasureChunk` from the AV store.
|
||||
QueryChunk(Hash, ValidatorIndex, oneshot::Sender<Option<ErasureChunk>>),
|
||||
|
||||
/// Query whether an `ErasureChunk` exists within the AV Store.
|
||||
///
|
||||
/// This is useful in cases like bitfield signing, when existence
|
||||
/// matters, but we don't want to necessarily pass around large
|
||||
/// quantities of data to get a single bit of information.
|
||||
QueryChunkAvailability(Hash, ValidatorIndex, oneshot::Sender<bool>),
|
||||
|
||||
/// Store an `ErasureChunk` in the AV store.
|
||||
///
|
||||
/// Return `Ok(())` if the store operation succeeded, `Err(())` if it failed.
|
||||
@@ -269,6 +276,7 @@ impl AvailabilityStoreMessage {
|
||||
Self::QueryAvailableData(hash, _) => Some(*hash),
|
||||
Self::QueryDataAvailability(hash, _) => Some(*hash),
|
||||
Self::QueryChunk(hash, _, _) => Some(*hash),
|
||||
Self::QueryChunkAvailability(hash, _, _) => Some(*hash),
|
||||
Self::StoreChunk(hash, _, _, _) => Some(*hash),
|
||||
Self::StoreAvailableData(hash, _, _, _, _) => Some(*hash),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user