Enum pallet_offences_subspace::Event
source · pub enum Event {
Offence {
- kind: Kind,
+ kind: Kind,
timeslot: Vec<u8>,
},
}
Expand description
Events type.
-Variants§
Offence
There is an offence reported of the given kind
happened at the session_index
and
+
Variants§
Offence
There is an offence reported of the given kind
happened at the session_index
and
(kind-specific) time slot. This event is not deposited for duplicate slashes.
[kind, timeslot].
Trait Implementations§
source§impl Decode for Event
impl Decode for Event
source§fn decode<__CodecInputEdqy: Input>(
diff --git a/pallet_offences_subspace/struct.Pallet.html b/pallet_offences_subspace/struct.Pallet.html
index 7422071ccd..34671b868e 100644
--- a/pallet_offences_subspace/struct.Pallet.html
+++ b/pallet_offences_subspace/struct.Pallet.html
@@ -1,14 +1,14 @@
Pallet in pallet_offences_subspace - Rust Struct pallet_offences_subspace::Pallet
source · pub struct Pallet<T>(/* private fields */);
Expand description
The Pallet
struct, the main type that implements traits and standalone
functions within the pallet.
-Implementations§
source§impl<T: Config> Pallet<T>
sourcepub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where
+
Implementations§
Trait Implementations§
source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read more§fn on_finalize(_n: BlockNumber)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
- offenders: &[FarmerPublicKey],
- time_slot: &O::TimeSlot
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
+ offenders: &[FarmerPublicKey],
+ time_slot: &O::TimeSlot
) -> bool
Returns true iff all of the given offenders have been previously reported
at the given time slot. This function is useful to prevent the sending of
duplicate offence reports.source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Returns a Vec<TrackedStorageKey>
indicating the storage keys that
diff --git a/pallet_offences_subspace/trait.Config.html b/pallet_offences_subspace/trait.Config.html
index b63490f23a..f26ce81831 100644
--- a/pallet_offences_subspace/trait.Config.html
+++ b/pallet_offences_subspace/trait.Config.html
@@ -1,6 +1,6 @@
Config in pallet_offences_subspace - Rust Trait pallet_offences_subspace::Config
source · pub trait Config: Config {
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>;
- type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>;
+ type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in
which it is embedded in. A type, function, or constant in this trait is essentially left to be
@@ -8,5 +8,5 @@
Consequently, a runtime that wants to include this pallet must implement this trait.
The pallet’s config trait.
Required Associated Types§
sourcetype RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
-sourcetype OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
A handler called for every offence report.
+sourcetype OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
A handler called for every offence report.
Implementors§
\ No newline at end of file
diff --git a/pallet_offences_subspace/type.ConcurrentReportsIndex.html b/pallet_offences_subspace/type.ConcurrentReportsIndex.html
index d1f1725c63..71693ca477 100644
--- a/pallet_offences_subspace/type.ConcurrentReportsIndex.html
+++ b/pallet_offences_subspace/type.ConcurrentReportsIndex.html
@@ -1,3 +1,3 @@
-ConcurrentReportsIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ConcurrentReportsIndex
source · pub type ConcurrentReportsIndex<T: Config> = StorageDoubleMap<_GeneratedPrefixForStorageConcurrentReportsIndex<T>, Twox64Concat, Kind, Twox64Concat, Vec<u8>, Vec<<T as Config>::Hash>, ValueQuery>;
Expand description
A vector of reports of the same kind that happened at the same time slot.
+ConcurrentReportsIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ConcurrentReportsIndex
source · pub type ConcurrentReportsIndex<T: Config> = StorageDoubleMap<_GeneratedPrefixForStorageConcurrentReportsIndex<T>, Twox64Concat, Kind, Twox64Concat, Vec<u8>, Vec<<T as Config>::Hash>, ValueQuery>;
Expand description
A vector of reports of the same kind that happened at the same time slot.
Storage type is [StorageDoubleMap
] with key1 type Kind, key2 type OpaqueTimeSlot and value type Vec < ReportIdOf < T > >.
Aliased Type§
struct ConcurrentReportsIndex<T: Config>(/* private fields */);
\ No newline at end of file
diff --git a/pallet_offences_subspace/type.Module.html b/pallet_offences_subspace/type.Module.html
index 3b47fd8a51..4de33170e4 100644
--- a/pallet_offences_subspace/type.Module.html
+++ b/pallet_offences_subspace/type.Module.html
@@ -1,14 +1,14 @@
Module in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::Module
source · pub type Module<T> = Pallet<T>;
👎Deprecated: use Pallet
insteadExpand description
Type alias to Pallet
, to be used by construct_runtime
.
Generated by pallet
attribute macro.
-Aliased Type§
struct Module<T>(/* private fields */);
Implementations§
source§impl<T: Config> Pallet<T>
sourcepub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where
+
Aliased Type§
struct Module<T>(/* private fields */);
Implementations§
Trait Implementations§
source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read more§fn on_finalize(_n: BlockNumber)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
- offenders: &[FarmerPublicKey],
- time_slot: &O::TimeSlot
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
+ offenders: &[FarmerPublicKey],
+ time_slot: &O::TimeSlot
) -> bool
Returns true iff all of the given offenders have been previously reported
at the given time slot. This function is useful to prevent the sending of
duplicate offence reports.source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Returns a Vec<TrackedStorageKey>
indicating the storage keys that
diff --git a/pallet_offences_subspace/type.Reports.html b/pallet_offences_subspace/type.Reports.html
index aba59a4e51..0d823dd207 100644
--- a/pallet_offences_subspace/type.Reports.html
+++ b/pallet_offences_subspace/type.Reports.html
@@ -1,3 +1,3 @@
-Reports in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::Reports
source · pub type Reports<T: Config> = StorageMap<_GeneratedPrefixForStorageReports<T>, Twox64Concat, <T as Config>::Hash, OffenceDetails<FarmerPublicKey>>;
Expand description
The primary structure that holds all offence records keyed by report identifiers.
+Reports in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::Reports
source · pub type Reports<T: Config> = StorageMap<_GeneratedPrefixForStorageReports<T>, Twox64Concat, <T as Config>::Hash, OffenceDetails<FarmerPublicKey>>;
Expand description
The primary structure that holds all offence records keyed by report identifiers.
Storage type is [StorageMap
] with key type ReportIdOf < T >
and value type OffenceDetails < FarmerPublicKey >
.
Aliased Type§
struct Reports<T: Config>(/* private fields */);
\ No newline at end of file
diff --git a/pallet_offences_subspace/type.ReportsByKindIndex.html b/pallet_offences_subspace/type.ReportsByKindIndex.html
index 436b31526e..7470258358 100644
--- a/pallet_offences_subspace/type.ReportsByKindIndex.html
+++ b/pallet_offences_subspace/type.ReportsByKindIndex.html
@@ -1,4 +1,4 @@
-ReportsByKindIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ReportsByKindIndex
source · pub type ReportsByKindIndex<T> = StorageMap<_GeneratedPrefixForStorageReportsByKindIndex<T>, Twox64Concat, Kind, Vec<u8>, ValueQuery>;
Expand description
Enumerates all reports of a kind along with the time they happened.
+ReportsByKindIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ReportsByKindIndex
source · pub type ReportsByKindIndex<T> = StorageMap<_GeneratedPrefixForStorageReportsByKindIndex<T>, Twox64Concat, Kind, Vec<u8>, ValueQuery>;
Expand description
Enumerates all reports of a kind along with the time they happened.
All reports are sorted by the time of offence.
Note that the actual type of this mapping is Vec<u8>
, this is because values of
different types are not supported at the moment so we are doing the manual serialization.
diff --git a/pallet_subspace/equivocation/struct.EquivocationHandler.html b/pallet_subspace/equivocation/struct.EquivocationHandler.html
index 0d5a3e6ca0..c1a4f99de6 100644
--- a/pallet_subspace/equivocation/struct.EquivocationHandler.html
+++ b/pallet_subspace/equivocation/struct.EquivocationHandler.html
@@ -4,12 +4,12 @@
subsystems together.
Trait Implementations§
source§impl<R, L> Default for EquivocationHandler<R, L>
source§impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where
T: Config + SendTransactionTypes<Call<T>>,
- R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
+ R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
L: Get<u64>,
§type ReportLongevity = L
The longevity, in blocks, that the equivocation report is valid for. When using the staking
pallet this should be equal to the bonding duration (in blocks, not eras).source§fn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
Report an offence proved by the given reporters.source§fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.source§fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>
Report an offence proved by the given reporters.source§fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.source§fn submit_equivocation_report(
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Create and dispatch an equivocation report extrinsic.Auto Trait Implementations§
§impl<R, L> RefUnwindSafe for EquivocationHandler<R, L>where
L: RefUnwindSafe,
R: RefUnwindSafe,
§impl<R, L> Send for EquivocationHandler<R, L>where
diff --git a/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html b/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
index 12986b7470..d1ef849246 100644
--- a/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
+++ b/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
@@ -5,7 +5,7 @@
When a farmer released two or more solutions at the same slot.
Fields§
§slot: Slot
A Subspace slot in which this incident happened.
§offender: PublicKey
Identity of the farmer that produced the equivocation.
-Trait Implementations§
source§impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
source§fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
This method tests for self
and other
values to be equal, and is used
+Trait Implementations§
source§impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
source§fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl<PublicKey: Eq> Eq for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey> StructuralEq for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey> StructuralPartialEq for SubspaceEquivocationOffence<PublicKey>
Auto Trait Implementations§
§impl<PublicKey> RefUnwindSafe for SubspaceEquivocationOffence<PublicKey>where
PublicKey: RefUnwindSafe,
§impl<PublicKey> Send for SubspaceEquivocationOffence<PublicKey>where
diff --git a/pallet_subspace/equivocation/trait.HandleEquivocation.html b/pallet_subspace/equivocation/trait.HandleEquivocation.html
index f3846f0b07..82eedb6d53 100644
--- a/pallet_subspace/equivocation/trait.HandleEquivocation.html
+++ b/pallet_subspace/equivocation/trait.HandleEquivocation.html
@@ -3,11 +3,11 @@
// Required methods
fn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
- ) -> Result<(), OffenceError>;
- fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool;
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+ ) -> Result<(), OffenceError>;
+ fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool;
fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult;
}Expand description
A trait with utility methods for handling equivocation reports in Subspace. The trait provides
methods for reporting an offence triggered by a valid equivocation report, checking the current
@@ -16,17 +16,17 @@
Required Associated Types§
sourcetype ReportLongevity: Get<u64>
The longevity, in blocks, that the equivocation report is valid for. When using the staking
pallet this should be equal to the bonding duration (in blocks, not eras).
Required Methods§
sourcefn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
Report an offence proved by the given reporters.
-sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>Report an offence proved by the given reporters.
+sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
sourcefn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Create and dispatch an equivocation report extrinsic.
Implementations on Foreign Types§
source§impl<T: Config> HandleEquivocation<T> for ()
§type ReportLongevity = ()
source§fn report_offence(
- _offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
source§fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
- _equivocation_proof: EquivocationProof<HeaderFor<T>>
+ _offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>
source§fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
+ _equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Implementors§
source§impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where
T: Config + SendTransactionTypes<Call<T>>,
- R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
+ R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
L: Get<u64>,
§type ReportLongevity = L
\ No newline at end of file
diff --git a/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html b/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
index 408bdd1663..94fc9f77b2 100644
--- a/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
+++ b/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
@@ -1,5 +1,5 @@
report_equivocation in pallet_subspace::pallet::dispatchables - Rust Function pallet_subspace::pallet::dispatchables::report_equivocation
source · pub fn report_equivocation<T: Config>(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
)
Expand description
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
diff --git a/pallet_subspace/pallet/dispatchables/fn.vote.html b/pallet_subspace/pallet/dispatchables/fn.vote.html
index c29e912834..13184f6a2a 100644
--- a/pallet_subspace/pallet/dispatchables/fn.vote.html
+++ b/pallet_subspace/pallet/dispatchables/fn.vote.html
@@ -1,5 +1,5 @@
vote in pallet_subspace::pallet::dispatchables - Rust Function pallet_subspace::pallet::dispatchables::vote
source · pub fn vote<T: Config>(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
)
Expand description
Farmer vote, currently only used for extra rewards to farmers.
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
diff --git a/pallet_subspace/pallet/enum.AllowAuthoringBy.html b/pallet_subspace/pallet/enum.AllowAuthoringBy.html
index 7309992c8c..6d2cd08bab 100644
--- a/pallet_subspace/pallet/enum.AllowAuthoringBy.html
+++ b/pallet_subspace/pallet/enum.AllowAuthoringBy.html
@@ -1,11 +1,11 @@
AllowAuthoringBy in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::AllowAuthoringBy
source · pub enum AllowAuthoringBy {
Anyone,
FirstFarmer,
- RootFarmer(FarmerPublicKey),
+ RootFarmer(FarmerPublicKey),
}
Variants§
§Anyone
Anyone can author new blocks at genesis.
§FirstFarmer
Author of the first block will be able to author blocks going forward unless unlocked
for everyone.
-§RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
+§RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
Trait Implementations§
source§impl Debug for AllowAuthoringBy
source§impl Decode for AllowAuthoringBy
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/pallet_subspace/pallet/enum.Call.html b/pallet_subspace/pallet/enum.Call.html
index ff59545976..c4ecd9f7db 100644
--- a/pallet_subspace/pallet/enum.Call.html
+++ b/pallet_subspace/pallet/enum.Call.html
@@ -1,6 +1,6 @@
Call in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::Call
source · pub enum Call<T: Config> {
report_equivocation {
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
},
store_segment_headers {
segment_headers: Vec<SegmentHeader>,
@@ -10,7 +10,7 @@
voting_solution_range_override: Option<u64>,
},
vote {
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
},
enable_rewards {
height: Option<BlockNumberFor<T>>,
@@ -19,15 +19,15 @@
enable_authoring_by_anyone {},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
-Variants§
§report_equivocation
Fields
§equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+Variants§
§report_equivocation
§store_segment_headers
Fields
§segment_headers: Vec<SegmentHeader>
§enable_solution_range_adjustment
§vote
Fields
§signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
See Pallet::vote
.
+§vote
See Pallet::vote
.
§enable_rewards
§enable_storage_access
Fields
Fields
Implementations§
source§impl<T: Config> Call<T>
sourcepub fn new_call_variant_report_equivocation(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> Self
Create a call with the variant report_equivocation
.
sourcepub fn new_call_variant_store_segment_headers(
segment_headers: Vec<SegmentHeader>
@@ -37,7 +37,7 @@
voting_solution_range_override: Option<u64>
) -> Self
Create a call with the variant enable_solution_range_adjustment
.
sourcepub fn new_call_variant_vote(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> Self
Create a call with the variant vote
.
sourcepub fn new_call_variant_enable_rewards(
height: Option<BlockNumberFor<T>>
@@ -59,8 +59,8 @@
by ==
.
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
- Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
- Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
+ Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
+ Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
Option<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
The origin type of the runtime, (i.e. frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
diff --git a/pallet_subspace/pallet/enum.Event.html b/pallet_subspace/pallet/enum.Event.html
index a8b1edf719..e6ea6a9178 100644
--- a/pallet_subspace/pallet/enum.Event.html
+++ b/pallet_subspace/pallet/enum.Event.html
@@ -3,7 +3,7 @@
segment_header: SegmentHeader,
},
FarmerVote {
- public_key: FarmerPublicKey,
+ public_key: FarmerPublicKey,
reward_address: T::AccountId,
height: BlockNumberFor<T>,
parent_hash: T::Hash,
@@ -11,7 +11,7 @@
// some variants omitted
}Expand description
Events type.
Variants§
§SegmentHeaderStored
Fields
§segment_header: SegmentHeader
Segment header was stored in blockchain history.
-§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
+§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
Trait Implementations§
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -29,7 +29,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -39,34 +39,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/pallet_subspace/pallet/type.Module.html b/pallet_subspace/pallet/type.Module.html
index 4561060388..e3f53ff887 100644
--- a/pallet_subspace/pallet/type.Module.html
+++ b/pallet_subspace/pallet/type.Module.html
@@ -6,12 +6,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -30,7 +30,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -40,34 +40,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
index 97165e94f8..18e5dc74cf 100644
--- a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
+++ b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
@@ -8,7 +8,7 @@
Block: BlockT,
Backend: BackendT<Block>,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + LockImportRun<Block, Backend> + Finalizer<Block, Backend> + AuxStore + Send + Sync + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
AS: AuxStore + Send + Sync + 'static,
SO: SyncOracle + Send + Sync + 'static,Expand description
Crate an archiver task that will listen for importing blocks and archive blocks at K
depth,
producing pieces and segment headers (segment headers are then added back to the blockchain as
diff --git a/sc_consensus_subspace/block_import/enum.Error.html b/sc_consensus_subspace/block_import/enum.Error.html
index 68f3349afd..b066274acb 100644
--- a/sc_consensus_subspace/block_import/enum.Error.html
+++ b/sc_consensus_subspace/block_import/enum.Error.html
@@ -1,6 +1,6 @@
Error in sc_consensus_subspace::block_import - Rust Enum sc_consensus_subspace::block_import::Error
source · pub enum Error<Header: HeaderT> {
Show 35 variants
InnerBlockImportError(Error),
- DigestItemError(Error),
+ DigestItemError(Error),
ParentUnavailable(Header::Hash, Header::Hash),
GenesisUnavailable,
SlotMustIncrease(Slot, Slot),
@@ -31,7 +31,7 @@
SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>),
SegmentHeaderNotFound(SegmentIndex),
DifferentSegmentCommitment(SegmentIndex),
- FarmerInBlockList(FarmerPublicKey),
+ FarmerInBlockList(FarmerPublicKey),
NoBlockWeight(Header::Hash),
SegmentCommitmentNotFound(SegmentIndex),
SectorExpired {
@@ -47,7 +47,7 @@
RuntimeApi(ApiError),
}
Expand description
Errors encountered by the Subspace authorship task.
Variants§
§InnerBlockImportError(Error)
Inner block import error
-§DigestItemError(Error)
Error during digest item extraction
+§DigestItemError(Error)
Error during digest item extraction
Parent unavailable. Cannot import
Genesis block unavailable. Cannot import
§SlotMustIncrease(Slot, Slot)
Slot number must increase
@@ -76,7 +76,7 @@
§SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>)
Stored segment header extrinsic was not found
§SegmentHeaderNotFound(SegmentIndex)
Segment header not found
§DifferentSegmentCommitment(SegmentIndex)
Different segment commitment found
-§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
+§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
§NoBlockWeight(Header::Hash)
No block weight for parent header
§SegmentCommitmentNotFound(SegmentIndex)
Segment commitment not found
§SectorExpired
Fields
§expiration_history_size: HistorySize
Expiration history size
@@ -92,7 +92,7 @@
Trait Implementations§
source§impl<Header: HeaderT> Error for Error<Header>where
Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl<Header> From<VerificationError<Header>> for Error<Header>where
+ Header: HeaderT,
source§impl<Header> From<VerificationError<Header>> for Error<Header>where
Header: HeaderT,
source§fn from(error: VerificationError<Header>) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl<Header> !RefUnwindSafe for Error<Header>
§impl<Header> Send for Error<Header>
§impl<Header> Sync for Error<Header>
§impl<Header> Unpin for Error<Header>where
<Header as Header>::Hash: Unpin,
§impl<Header> !UnwindSafe for Error<Header>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
index f58a5f04e3..7248b3f6ef 100644
--- a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
+++ b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
@@ -4,7 +4,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
sourcepub fn new(
@@ -13,14 +13,14 @@
subspace_link: SubspaceLink<Block>,
create_inherent_data_providers: CIDP,
segment_headers_store: SegmentHeadersStore<AS>,
- pot_verifier: PotVerifier
+ pot_verifier: PotVerifier
) -> Self
Produce a Subspace block-import object to be used later on in the construction of an import-queue.
Trait Implementations§
source§impl<PosTable, Block, Client, Inner, CIDP, AS> BlockImport<Block> for SubspaceBlockImport<PosTable, Block, Client, Inner, CIDP, AS>where
PosTable: Table,
Block: BlockT,
Inner: BlockImport<Block, Error = Error> + Send + Sync,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore + Send + Sync,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
source§fn import_block<'life0, 'async_trait>(
diff --git a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
index 4a189d1df9..59d156b8c7 100644
--- a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
@@ -1,9 +1,9 @@
NewSlotNotification in sc_consensus_subspace::slot_worker - Rust pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for NewSlotNotification
§impl Send for NewSlotNotification
§impl Sync for NewSlotNotification
§impl Unpin for NewSlotNotification
§impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
A handle to a BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
A handle to a SyncOracle
.§type JustificationSyncLink = L
A handle to a JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
Data associated with a slot claim.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
§env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@
§telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
§offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
§impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::
fn decode<__CodecInputEdqy: Input>(
diff --git a/pallet_offences_subspace/struct.Pallet.html b/pallet_offences_subspace/struct.Pallet.html
index 7422071ccd..34671b868e 100644
--- a/pallet_offences_subspace/struct.Pallet.html
+++ b/pallet_offences_subspace/struct.Pallet.html
@@ -1,14 +1,14 @@
Pallet in pallet_offences_subspace - Rust Struct pallet_offences_subspace::Pallet
source · pub struct Pallet<T>(/* private fields */);
Expand description
The Pallet
struct, the main type that implements traits and standalone
functions within the pallet.
-Implementations§
source§impl<T: Config> Pallet<T>
sourcepub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where
+
Implementations§
Trait Implementations§
source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read more§fn on_finalize(_n: BlockNumber)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
- offenders: &[FarmerPublicKey],
- time_slot: &O::TimeSlot
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
+ offenders: &[FarmerPublicKey],
+ time_slot: &O::TimeSlot
) -> bool
Returns true iff all of the given offenders have been previously reported
at the given time slot. This function is useful to prevent the sending of
duplicate offence reports.source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Returns a Vec<TrackedStorageKey>
indicating the storage keys that
diff --git a/pallet_offences_subspace/trait.Config.html b/pallet_offences_subspace/trait.Config.html
index b63490f23a..f26ce81831 100644
--- a/pallet_offences_subspace/trait.Config.html
+++ b/pallet_offences_subspace/trait.Config.html
@@ -1,6 +1,6 @@
Config in pallet_offences_subspace - Rust Trait pallet_offences_subspace::Config
source · pub trait Config: Config {
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>;
- type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>;
+ type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in
which it is embedded in. A type, function, or constant in this trait is essentially left to be
@@ -8,5 +8,5 @@
Consequently, a runtime that wants to include this pallet must implement this trait.
The pallet’s config trait.
Required Associated Types§
sourcetype RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
-sourcetype OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
A handler called for every offence report.
+sourcetype OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
A handler called for every offence report.
Implementors§
\ No newline at end of file
diff --git a/pallet_offences_subspace/type.ConcurrentReportsIndex.html b/pallet_offences_subspace/type.ConcurrentReportsIndex.html
index d1f1725c63..71693ca477 100644
--- a/pallet_offences_subspace/type.ConcurrentReportsIndex.html
+++ b/pallet_offences_subspace/type.ConcurrentReportsIndex.html
@@ -1,3 +1,3 @@
-ConcurrentReportsIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ConcurrentReportsIndex
source · pub type ConcurrentReportsIndex<T: Config> = StorageDoubleMap<_GeneratedPrefixForStorageConcurrentReportsIndex<T>, Twox64Concat, Kind, Twox64Concat, Vec<u8>, Vec<<T as Config>::Hash>, ValueQuery>;
Expand description
A vector of reports of the same kind that happened at the same time slot.
+ConcurrentReportsIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ConcurrentReportsIndex
source · pub type ConcurrentReportsIndex<T: Config> = StorageDoubleMap<_GeneratedPrefixForStorageConcurrentReportsIndex<T>, Twox64Concat, Kind, Twox64Concat, Vec<u8>, Vec<<T as Config>::Hash>, ValueQuery>;
Expand description
A vector of reports of the same kind that happened at the same time slot.
Storage type is [StorageDoubleMap
] with key1 type Kind, key2 type OpaqueTimeSlot and value type Vec < ReportIdOf < T > >.
Aliased Type§
struct ConcurrentReportsIndex<T: Config>(/* private fields */);
\ No newline at end of file
diff --git a/pallet_offences_subspace/type.Module.html b/pallet_offences_subspace/type.Module.html
index 3b47fd8a51..4de33170e4 100644
--- a/pallet_offences_subspace/type.Module.html
+++ b/pallet_offences_subspace/type.Module.html
@@ -1,14 +1,14 @@
Module in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::Module
source · pub type Module<T> = Pallet<T>;
👎Deprecated: use Pallet
insteadExpand description
Type alias to Pallet
, to be used by construct_runtime
.
Generated by pallet
attribute macro.
-Aliased Type§
struct Module<T>(/* private fields */);
Implementations§
source§impl<T: Config> Pallet<T>
sourcepub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where
+
Aliased Type§
struct Module<T>(/* private fields */);
Implementations§
Trait Implementations§
source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read more§fn on_finalize(_n: BlockNumber)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
- offenders: &[FarmerPublicKey],
- time_slot: &O::TimeSlot
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
Report an offence
and reward given reporters
.source§fn is_known_offence(
+ offenders: &[FarmerPublicKey],
+ time_slot: &O::TimeSlot
) -> bool
Returns true iff all of the given offenders have been previously reported
at the given time slot. This function is useful to prevent the sending of
duplicate offence reports.source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Returns a Vec<TrackedStorageKey>
indicating the storage keys that
diff --git a/pallet_offences_subspace/type.Reports.html b/pallet_offences_subspace/type.Reports.html
index aba59a4e51..0d823dd207 100644
--- a/pallet_offences_subspace/type.Reports.html
+++ b/pallet_offences_subspace/type.Reports.html
@@ -1,3 +1,3 @@
-Reports in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::Reports
source · pub type Reports<T: Config> = StorageMap<_GeneratedPrefixForStorageReports<T>, Twox64Concat, <T as Config>::Hash, OffenceDetails<FarmerPublicKey>>;
Expand description
The primary structure that holds all offence records keyed by report identifiers.
+Reports in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::Reports
source · pub type Reports<T: Config> = StorageMap<_GeneratedPrefixForStorageReports<T>, Twox64Concat, <T as Config>::Hash, OffenceDetails<FarmerPublicKey>>;
Expand description
The primary structure that holds all offence records keyed by report identifiers.
Storage type is [StorageMap
] with key type ReportIdOf < T >
and value type OffenceDetails < FarmerPublicKey >
.
Aliased Type§
struct Reports<T: Config>(/* private fields */);
\ No newline at end of file
diff --git a/pallet_offences_subspace/type.ReportsByKindIndex.html b/pallet_offences_subspace/type.ReportsByKindIndex.html
index 436b31526e..7470258358 100644
--- a/pallet_offences_subspace/type.ReportsByKindIndex.html
+++ b/pallet_offences_subspace/type.ReportsByKindIndex.html
@@ -1,4 +1,4 @@
-ReportsByKindIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ReportsByKindIndex
source · pub type ReportsByKindIndex<T> = StorageMap<_GeneratedPrefixForStorageReportsByKindIndex<T>, Twox64Concat, Kind, Vec<u8>, ValueQuery>;
Expand description
Enumerates all reports of a kind along with the time they happened.
+ReportsByKindIndex in pallet_offences_subspace - Rust Type Alias pallet_offences_subspace::ReportsByKindIndex
source · pub type ReportsByKindIndex<T> = StorageMap<_GeneratedPrefixForStorageReportsByKindIndex<T>, Twox64Concat, Kind, Vec<u8>, ValueQuery>;
Expand description
Enumerates all reports of a kind along with the time they happened.
All reports are sorted by the time of offence.
Note that the actual type of this mapping is Vec<u8>
, this is because values of
different types are not supported at the moment so we are doing the manual serialization.
diff --git a/pallet_subspace/equivocation/struct.EquivocationHandler.html b/pallet_subspace/equivocation/struct.EquivocationHandler.html
index 0d5a3e6ca0..c1a4f99de6 100644
--- a/pallet_subspace/equivocation/struct.EquivocationHandler.html
+++ b/pallet_subspace/equivocation/struct.EquivocationHandler.html
@@ -4,12 +4,12 @@
subsystems together.
Trait Implementations§
source§impl<R, L> Default for EquivocationHandler<R, L>
source§impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where
T: Config + SendTransactionTypes<Call<T>>,
- R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
+ R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
L: Get<u64>,
§type ReportLongevity = L
The longevity, in blocks, that the equivocation report is valid for. When using the staking
pallet this should be equal to the bonding duration (in blocks, not eras).source§fn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
Report an offence proved by the given reporters.source§fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.source§fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>
Report an offence proved by the given reporters.source§fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.source§fn submit_equivocation_report(
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Create and dispatch an equivocation report extrinsic.Auto Trait Implementations§
§impl<R, L> RefUnwindSafe for EquivocationHandler<R, L>where
L: RefUnwindSafe,
R: RefUnwindSafe,
§impl<R, L> Send for EquivocationHandler<R, L>where
diff --git a/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html b/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
index 12986b7470..d1ef849246 100644
--- a/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
+++ b/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
@@ -5,7 +5,7 @@
When a farmer released two or more solutions at the same slot.
Fields§
§slot: Slot
A Subspace slot in which this incident happened.
§offender: PublicKey
Identity of the farmer that produced the equivocation.
-Trait Implementations§
source§impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
source§fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
This method tests for self
and other
values to be equal, and is used
+Trait Implementations§
source§impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
source§fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl<PublicKey: Eq> Eq for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey> StructuralEq for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey> StructuralPartialEq for SubspaceEquivocationOffence<PublicKey>
Auto Trait Implementations§
§impl<PublicKey> RefUnwindSafe for SubspaceEquivocationOffence<PublicKey>where
PublicKey: RefUnwindSafe,
§impl<PublicKey> Send for SubspaceEquivocationOffence<PublicKey>where
diff --git a/pallet_subspace/equivocation/trait.HandleEquivocation.html b/pallet_subspace/equivocation/trait.HandleEquivocation.html
index f3846f0b07..82eedb6d53 100644
--- a/pallet_subspace/equivocation/trait.HandleEquivocation.html
+++ b/pallet_subspace/equivocation/trait.HandleEquivocation.html
@@ -3,11 +3,11 @@
// Required methods
fn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
- ) -> Result<(), OffenceError>;
- fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool;
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+ ) -> Result<(), OffenceError>;
+ fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool;
fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult;
}Expand description
A trait with utility methods for handling equivocation reports in Subspace. The trait provides
methods for reporting an offence triggered by a valid equivocation report, checking the current
@@ -16,17 +16,17 @@
Required Associated Types§
sourcetype ReportLongevity: Get<u64>
The longevity, in blocks, that the equivocation report is valid for. When using the staking
pallet this should be equal to the bonding duration (in blocks, not eras).
Required Methods§
sourcefn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
Report an offence proved by the given reporters.
-sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>Report an offence proved by the given reporters.
+sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
sourcefn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Create and dispatch an equivocation report extrinsic.
Implementations on Foreign Types§
source§impl<T: Config> HandleEquivocation<T> for ()
§type ReportLongevity = ()
source§fn report_offence(
- _offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
source§fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
- _equivocation_proof: EquivocationProof<HeaderFor<T>>
+ _offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>
source§fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
+ _equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Implementors§
source§impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where
T: Config + SendTransactionTypes<Call<T>>,
- R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
+ R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
L: Get<u64>,
§type ReportLongevity = L
\ No newline at end of file
diff --git a/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html b/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
index 408bdd1663..94fc9f77b2 100644
--- a/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
+++ b/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
@@ -1,5 +1,5 @@
report_equivocation in pallet_subspace::pallet::dispatchables - Rust Function pallet_subspace::pallet::dispatchables::report_equivocation
source · pub fn report_equivocation<T: Config>(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
)
Expand description
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
diff --git a/pallet_subspace/pallet/dispatchables/fn.vote.html b/pallet_subspace/pallet/dispatchables/fn.vote.html
index c29e912834..13184f6a2a 100644
--- a/pallet_subspace/pallet/dispatchables/fn.vote.html
+++ b/pallet_subspace/pallet/dispatchables/fn.vote.html
@@ -1,5 +1,5 @@
vote in pallet_subspace::pallet::dispatchables - Rust Function pallet_subspace::pallet::dispatchables::vote
source · pub fn vote<T: Config>(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
)
Expand description
Farmer vote, currently only used for extra rewards to farmers.
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
diff --git a/pallet_subspace/pallet/enum.AllowAuthoringBy.html b/pallet_subspace/pallet/enum.AllowAuthoringBy.html
index 7309992c8c..6d2cd08bab 100644
--- a/pallet_subspace/pallet/enum.AllowAuthoringBy.html
+++ b/pallet_subspace/pallet/enum.AllowAuthoringBy.html
@@ -1,11 +1,11 @@
AllowAuthoringBy in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::AllowAuthoringBy
source · pub enum AllowAuthoringBy {
Anyone,
FirstFarmer,
- RootFarmer(FarmerPublicKey),
+ RootFarmer(FarmerPublicKey),
}
Variants§
§Anyone
Anyone can author new blocks at genesis.
§FirstFarmer
Author of the first block will be able to author blocks going forward unless unlocked
for everyone.
-§RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
+§RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
Trait Implementations§
source§impl Debug for AllowAuthoringBy
source§impl Decode for AllowAuthoringBy
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/pallet_subspace/pallet/enum.Call.html b/pallet_subspace/pallet/enum.Call.html
index ff59545976..c4ecd9f7db 100644
--- a/pallet_subspace/pallet/enum.Call.html
+++ b/pallet_subspace/pallet/enum.Call.html
@@ -1,6 +1,6 @@
Call in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::Call
source · pub enum Call<T: Config> {
report_equivocation {
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
},
store_segment_headers {
segment_headers: Vec<SegmentHeader>,
@@ -10,7 +10,7 @@
voting_solution_range_override: Option<u64>,
},
vote {
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
},
enable_rewards {
height: Option<BlockNumberFor<T>>,
@@ -19,15 +19,15 @@
enable_authoring_by_anyone {},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
-Variants§
§report_equivocation
Fields
§equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+Variants§
§report_equivocation
§store_segment_headers
Fields
§segment_headers: Vec<SegmentHeader>
§enable_solution_range_adjustment
§vote
Fields
§signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
See Pallet::vote
.
+§vote
See Pallet::vote
.
§enable_rewards
§enable_storage_access
Fields
Fields
Implementations§
source§impl<T: Config> Call<T>
sourcepub fn new_call_variant_report_equivocation(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> Self
Create a call with the variant report_equivocation
.
sourcepub fn new_call_variant_store_segment_headers(
segment_headers: Vec<SegmentHeader>
@@ -37,7 +37,7 @@
voting_solution_range_override: Option<u64>
) -> Self
Create a call with the variant enable_solution_range_adjustment
.
sourcepub fn new_call_variant_vote(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> Self
Create a call with the variant vote
.
sourcepub fn new_call_variant_enable_rewards(
height: Option<BlockNumberFor<T>>
@@ -59,8 +59,8 @@
by ==
.
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
- Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
- Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
+ Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
+ Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
Option<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
The origin type of the runtime, (i.e. frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
diff --git a/pallet_subspace/pallet/enum.Event.html b/pallet_subspace/pallet/enum.Event.html
index a8b1edf719..e6ea6a9178 100644
--- a/pallet_subspace/pallet/enum.Event.html
+++ b/pallet_subspace/pallet/enum.Event.html
@@ -3,7 +3,7 @@
segment_header: SegmentHeader,
},
FarmerVote {
- public_key: FarmerPublicKey,
+ public_key: FarmerPublicKey,
reward_address: T::AccountId,
height: BlockNumberFor<T>,
parent_hash: T::Hash,
@@ -11,7 +11,7 @@
// some variants omitted
}Expand description
Events type.
Variants§
§SegmentHeaderStored
Fields
§segment_header: SegmentHeader
Segment header was stored in blockchain history.
-§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
+§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
Trait Implementations§
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -29,7 +29,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -39,34 +39,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/pallet_subspace/pallet/type.Module.html b/pallet_subspace/pallet/type.Module.html
index 4561060388..e3f53ff887 100644
--- a/pallet_subspace/pallet/type.Module.html
+++ b/pallet_subspace/pallet/type.Module.html
@@ -6,12 +6,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -30,7 +30,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -40,34 +40,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
index 97165e94f8..18e5dc74cf 100644
--- a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
+++ b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
@@ -8,7 +8,7 @@
Block: BlockT,
Backend: BackendT<Block>,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + LockImportRun<Block, Backend> + Finalizer<Block, Backend> + AuxStore + Send + Sync + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
AS: AuxStore + Send + Sync + 'static,
SO: SyncOracle + Send + Sync + 'static,Expand description
Crate an archiver task that will listen for importing blocks and archive blocks at K
depth,
producing pieces and segment headers (segment headers are then added back to the blockchain as
diff --git a/sc_consensus_subspace/block_import/enum.Error.html b/sc_consensus_subspace/block_import/enum.Error.html
index 68f3349afd..b066274acb 100644
--- a/sc_consensus_subspace/block_import/enum.Error.html
+++ b/sc_consensus_subspace/block_import/enum.Error.html
@@ -1,6 +1,6 @@
Error in sc_consensus_subspace::block_import - Rust Enum sc_consensus_subspace::block_import::Error
source · pub enum Error<Header: HeaderT> {
Show 35 variants
InnerBlockImportError(Error),
- DigestItemError(Error),
+ DigestItemError(Error),
ParentUnavailable(Header::Hash, Header::Hash),
GenesisUnavailable,
SlotMustIncrease(Slot, Slot),
@@ -31,7 +31,7 @@
SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>),
SegmentHeaderNotFound(SegmentIndex),
DifferentSegmentCommitment(SegmentIndex),
- FarmerInBlockList(FarmerPublicKey),
+ FarmerInBlockList(FarmerPublicKey),
NoBlockWeight(Header::Hash),
SegmentCommitmentNotFound(SegmentIndex),
SectorExpired {
@@ -47,7 +47,7 @@
RuntimeApi(ApiError),
}
Expand description
Errors encountered by the Subspace authorship task.
Variants§
§InnerBlockImportError(Error)
Inner block import error
-§DigestItemError(Error)
Error during digest item extraction
+§DigestItemError(Error)
Error during digest item extraction
Parent unavailable. Cannot import
Genesis block unavailable. Cannot import
§SlotMustIncrease(Slot, Slot)
Slot number must increase
@@ -76,7 +76,7 @@
§SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>)
Stored segment header extrinsic was not found
§SegmentHeaderNotFound(SegmentIndex)
Segment header not found
§DifferentSegmentCommitment(SegmentIndex)
Different segment commitment found
-§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
+§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
§NoBlockWeight(Header::Hash)
No block weight for parent header
§SegmentCommitmentNotFound(SegmentIndex)
Segment commitment not found
§SectorExpired
Fields
§expiration_history_size: HistorySize
Expiration history size
@@ -92,7 +92,7 @@
Trait Implementations§
source§impl<Header: HeaderT> Error for Error<Header>where
Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl<Header> From<VerificationError<Header>> for Error<Header>where
+ Header: HeaderT,
source§impl<Header> From<VerificationError<Header>> for Error<Header>where
Header: HeaderT,
source§fn from(error: VerificationError<Header>) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl<Header> !RefUnwindSafe for Error<Header>
§impl<Header> Send for Error<Header>
§impl<Header> Sync for Error<Header>
§impl<Header> Unpin for Error<Header>where
<Header as Header>::Hash: Unpin,
§impl<Header> !UnwindSafe for Error<Header>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
index f58a5f04e3..7248b3f6ef 100644
--- a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
+++ b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
@@ -4,7 +4,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
sourcepub fn new(
@@ -13,14 +13,14 @@
subspace_link: SubspaceLink<Block>,
create_inherent_data_providers: CIDP,
segment_headers_store: SegmentHeadersStore<AS>,
- pot_verifier: PotVerifier
+ pot_verifier: PotVerifier
) -> Self
Produce a Subspace block-import object to be used later on in the construction of an import-queue.
Trait Implementations§
source§impl<PosTable, Block, Client, Inner, CIDP, AS> BlockImport<Block> for SubspaceBlockImport<PosTable, Block, Client, Inner, CIDP, AS>where
PosTable: Table,
Block: BlockT,
Inner: BlockImport<Block, Error = Error> + Send + Sync,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore + Send + Sync,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
source§fn import_block<'life0, 'async_trait>(
diff --git a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
index 4a189d1df9..59d156b8c7 100644
--- a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
@@ -1,9 +1,9 @@
NewSlotNotification in sc_consensus_subspace::slot_worker - Rust pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for NewSlotNotification
§impl Send for NewSlotNotification
§impl Sync for NewSlotNotification
§impl Unpin for NewSlotNotification
§impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
A handle to a BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
A handle to a SyncOracle
.§type JustificationSyncLink = L
A handle to a JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
Data associated with a slot claim.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
§env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@
§telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
§offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
§impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::
Struct pallet_offences_subspace::Pallet
source · pub struct Pallet<T>(/* private fields */);
Expand description
The Pallet
struct, the main type that implements traits and standalone
functions within the pallet.
Implementations§
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where
+
pub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where +
Implementations§
Trait Implementations§
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
fn report_offence(offence: O) -> Result<(), OffenceError>
offence
and reward given reporters
.source§fn is_known_offence(
- offenders: &[FarmerPublicKey],
- time_slot: &O::TimeSlot
+sufficient, and should not be overridden without very good reason.
fn is_known_offence( - offenders: &[FarmerPublicKey], - time_slot: &O::TimeSlot +sufficient, and should not be overridden without very good reason.
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
fn report_offence(offence: O) -> Result<(), OffenceError>
offence
and reward given reporters
.source§fn is_known_offence(
+ offenders: &[FarmerPublicKey],
+ time_slot: &O::TimeSlot
) -> bool
fn is_known_offence( + offenders: &[FarmerPublicKey], + time_slot: &O::TimeSlot ) -> bool
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
diff --git a/pallet_offences_subspace/trait.Config.html b/pallet_offences_subspace/trait.Config.html
index b63490f23a..f26ce81831 100644
--- a/pallet_offences_subspace/trait.Config.html
+++ b/pallet_offences_subspace/trait.Config.html
@@ -1,6 +1,6 @@
Trait pallet_offences_subspace::Config
source · pub trait Config: Config {
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>;
- type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>;
+ type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be @@ -8,5 +8,5 @@
Consequently, a runtime that wants to include this pallet must implement this trait. The pallet’s config trait.
Required Associated Types§
sourcetype RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
-sourcetype OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
A handler called for every offence report.
+sourcetype OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
type OnOffenceHandler: OnOffenceHandler<FarmerPublicKey>
A handler called for every offence report.
Implementors§
Type Alias pallet_offences_subspace::ConcurrentReportsIndex
source · pub type ConcurrentReportsIndex<T: Config> = StorageDoubleMap<_GeneratedPrefixForStorageConcurrentReportsIndex<T>, Twox64Concat, Kind, Twox64Concat, Vec<u8>, Vec<<T as Config>::Hash>, ValueQuery>;
Expand description
A vector of reports of the same kind that happened at the same time slot.
+Type Alias pallet_offences_subspace::ConcurrentReportsIndex
source · pub type ConcurrentReportsIndex<T: Config> = StorageDoubleMap<_GeneratedPrefixForStorageConcurrentReportsIndex<T>, Twox64Concat, Kind, Twox64Concat, Vec<u8>, Vec<<T as Config>::Hash>, ValueQuery>;
Expand description
A vector of reports of the same kind that happened at the same time slot.
Storage type is [StorageDoubleMap
] with key1 type Kind, key2 type OpaqueTimeSlot and value type Vec < ReportIdOf < T > >.
Aliased Type§
struct ConcurrentReportsIndex<T: Config>(/* private fields */);
Type Alias pallet_offences_subspace::Module
source · pub type Module<T> = Pallet<T>;
Pallet
insteadExpand description
Type alias to Pallet
, to be used by construct_runtime
.
Generated by pallet
attribute macro.
Aliased Type§
struct Module<T>(/* private fields */);
Implementations§
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where
+
pub fn reports<KArg>(k: KArg) -> Option<OffenceDetails<FarmerPublicKey>>where +
Aliased Type§
struct Module<T>(/* private fields */);
Implementations§
Trait Implementations§
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
fn report_offence(offence: O) -> Result<(), OffenceError>
offence
and reward given reporters
.source§fn is_known_offence(
- offenders: &[FarmerPublicKey],
- time_slot: &O::TimeSlot
+sufficient, and should not be overridden without very good reason.
fn is_known_offence( - offenders: &[FarmerPublicKey], - time_slot: &O::TimeSlot +sufficient, and should not be overridden without very good reason.
source§impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
impl<T: Config, O: Offence<FarmerPublicKey>> ReportOffence<Public, O> for Pallet<T>
source§fn report_offence(offence: O) -> Result<(), OffenceError>
fn report_offence(offence: O) -> Result<(), OffenceError>
offence
and reward given reporters
.source§fn is_known_offence(
+ offenders: &[FarmerPublicKey],
+ time_slot: &O::TimeSlot
) -> bool
fn is_known_offence( + offenders: &[FarmerPublicKey], + time_slot: &O::TimeSlot ) -> bool
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
diff --git a/pallet_offences_subspace/type.Reports.html b/pallet_offences_subspace/type.Reports.html
index aba59a4e51..0d823dd207 100644
--- a/pallet_offences_subspace/type.Reports.html
+++ b/pallet_offences_subspace/type.Reports.html
@@ -1,3 +1,3 @@
-Type Alias pallet_offences_subspace::Reports
source · pub type Reports<T: Config> = StorageMap<_GeneratedPrefixForStorageReports<T>, Twox64Concat, <T as Config>::Hash, OffenceDetails<FarmerPublicKey>>;
Expand description
The primary structure that holds all offence records keyed by report identifiers.
+Type Alias pallet_offences_subspace::Reports
source · pub type Reports<T: Config> = StorageMap<_GeneratedPrefixForStorageReports<T>, Twox64Concat, <T as Config>::Hash, OffenceDetails<FarmerPublicKey>>;
Expand description
The primary structure that holds all offence records keyed by report identifiers.
Storage type is [StorageMap
] with key type ReportIdOf < T >
and value type OffenceDetails < FarmerPublicKey >
.
Aliased Type§
struct Reports<T: Config>(/* private fields */);
Type Alias pallet_offences_subspace::ReportsByKindIndex
source · pub type ReportsByKindIndex<T> = StorageMap<_GeneratedPrefixForStorageReportsByKindIndex<T>, Twox64Concat, Kind, Vec<u8>, ValueQuery>;
Expand description
Enumerates all reports of a kind along with the time they happened.
+Type Alias pallet_offences_subspace::ReportsByKindIndex
source · pub type ReportsByKindIndex<T> = StorageMap<_GeneratedPrefixForStorageReportsByKindIndex<T>, Twox64Concat, Kind, Vec<u8>, ValueQuery>;
Expand description
Enumerates all reports of a kind along with the time they happened.
All reports are sorted by the time of offence.
Note that the actual type of this mapping is Vec<u8>
, this is because values of
different types are not supported at the moment so we are doing the manual serialization.
Trait Implementations§
source§impl<R, L> Default for EquivocationHandler<R, L>
impl<R, L> Default for EquivocationHandler<R, L>
source§impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where
T: Config + SendTransactionTypes<Call<T>>,
- R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
+ R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
L: Get<u64>,
impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where T: Config + SendTransactionTypes<Call<T>>, - R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>, + R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>, L: Get<u64>,
§type ReportLongevity = L
type ReportLongevity = L
source§fn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
fn report_offence( - offence: SubspaceEquivocationOffence<FarmerPublicKey> -) -> Result<(), OffenceError>
source§fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>
fn submit_equivocation_report( - equivocation_proof: EquivocationProof<HeaderFor<T>> + offence: SubspaceEquivocationOffence<FarmerPublicKey> +) -> Result<(), OffenceError>
source§fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
fn submit_equivocation_report( + equivocation_proof: EquivocationProof<HeaderFor<T>> ) -> DispatchResult
Auto Trait Implementations§
impl<R, L> RefUnwindSafe for EquivocationHandler<R, L>where L: RefUnwindSafe, R: RefUnwindSafe,
impl<R, L> Send for EquivocationHandler<R, L>where
diff --git a/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html b/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
index 12986b7470..d1ef849246 100644
--- a/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
+++ b/pallet_subspace/equivocation/struct.SubspaceEquivocationOffence.html
@@ -5,7 +5,7 @@
When a farmer released two or more solutions at the same slot.
Fields§
§slot: Slot
A Subspace slot in which this incident happened.
offender: PublicKey
Identity of the farmer that produced the equivocation.
-Trait Implementations§
source§impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
source§fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
self
and other
values to be equal, and is used
+Trait Implementations§
source§impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey: Debug> Debug for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey: Clone> Offence<PublicKey> for SubspaceEquivocationOffence<PublicKey>
source§impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey: PartialEq> PartialEq<SubspaceEquivocationOffence<PublicKey>> for SubspaceEquivocationOffence<PublicKey>
source§fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
fn eq(&self, other: &SubspaceEquivocationOffence<PublicKey>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<PublicKey: Eq> Eq for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey> StructuralEq for SubspaceEquivocationOffence<PublicKey>
impl<PublicKey> StructuralPartialEq for SubspaceEquivocationOffence<PublicKey>
Auto Trait Implementations§
impl<PublicKey> RefUnwindSafe for SubspaceEquivocationOffence<PublicKey>where PublicKey: RefUnwindSafe,
impl<PublicKey> Send for SubspaceEquivocationOffence<PublicKey>where
diff --git a/pallet_subspace/equivocation/trait.HandleEquivocation.html b/pallet_subspace/equivocation/trait.HandleEquivocation.html
index f3846f0b07..82eedb6d53 100644
--- a/pallet_subspace/equivocation/trait.HandleEquivocation.html
+++ b/pallet_subspace/equivocation/trait.HandleEquivocation.html
@@ -3,11 +3,11 @@
// Required methods
fn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
- ) -> Result<(), OffenceError>;
- fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool;
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+ ) -> Result<(), OffenceError>;
+ fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool;
fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult;
}Expand description
A trait with utility methods for handling equivocation reports in Subspace. The trait provides
methods for reporting an offence triggered by a valid equivocation report, checking the current
@@ -16,17 +16,17 @@
Required Associated Types§
sourcetype ReportLongevity: Get<u64>
The longevity, in blocks, that the equivocation report is valid for. When using the staking
pallet this should be equal to the bonding duration (in blocks, not eras).
Required Methods§
sourcefn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
Report an offence proved by the given reporters.
-sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
+ offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>Report an offence proved by the given reporters.
+sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
sourcefn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Create and dispatch an equivocation report extrinsic.
Implementations on Foreign Types§
source§impl<T: Config> HandleEquivocation<T> for ()
§type ReportLongevity = ()
source§fn report_offence(
- _offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
source§fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
- _equivocation_proof: EquivocationProof<HeaderFor<T>>
+ _offence: SubspaceEquivocationOffence<FarmerPublicKey>
+) -> Result<(), OffenceError>
source§fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
source§fn submit_equivocation_report(
+ _equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
Implementors§
source§impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where
T: Config + SendTransactionTypes<Call<T>>,
- R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
+ R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
L: Get<u64>,
§type ReportLongevity = L
\ No newline at end of file
diff --git a/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html b/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
index 408bdd1663..94fc9f77b2 100644
--- a/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
+++ b/pallet_subspace/pallet/dispatchables/fn.report_equivocation.html
@@ -1,5 +1,5 @@
report_equivocation in pallet_subspace::pallet::dispatchables - Rust Function pallet_subspace::pallet::dispatchables::report_equivocation
source · pub fn report_equivocation<T: Config>(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
)
Expand description
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
diff --git a/pallet_subspace/pallet/dispatchables/fn.vote.html b/pallet_subspace/pallet/dispatchables/fn.vote.html
index c29e912834..13184f6a2a 100644
--- a/pallet_subspace/pallet/dispatchables/fn.vote.html
+++ b/pallet_subspace/pallet/dispatchables/fn.vote.html
@@ -1,5 +1,5 @@
vote in pallet_subspace::pallet::dispatchables - Rust Function pallet_subspace::pallet::dispatchables::vote
source · pub fn vote<T: Config>(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
)
Expand description
Farmer vote, currently only used for extra rewards to farmers.
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
diff --git a/pallet_subspace/pallet/enum.AllowAuthoringBy.html b/pallet_subspace/pallet/enum.AllowAuthoringBy.html
index 7309992c8c..6d2cd08bab 100644
--- a/pallet_subspace/pallet/enum.AllowAuthoringBy.html
+++ b/pallet_subspace/pallet/enum.AllowAuthoringBy.html
@@ -1,11 +1,11 @@
AllowAuthoringBy in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::AllowAuthoringBy
source · pub enum AllowAuthoringBy {
Anyone,
FirstFarmer,
- RootFarmer(FarmerPublicKey),
+ RootFarmer(FarmerPublicKey),
}
Variants§
§Anyone
Anyone can author new blocks at genesis.
§FirstFarmer
Author of the first block will be able to author blocks going forward unless unlocked
for everyone.
-§RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
+§RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
Trait Implementations§
source§impl Debug for AllowAuthoringBy
source§impl Decode for AllowAuthoringBy
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/pallet_subspace/pallet/enum.Call.html b/pallet_subspace/pallet/enum.Call.html
index ff59545976..c4ecd9f7db 100644
--- a/pallet_subspace/pallet/enum.Call.html
+++ b/pallet_subspace/pallet/enum.Call.html
@@ -1,6 +1,6 @@
Call in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::Call
source · pub enum Call<T: Config> {
report_equivocation {
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
},
store_segment_headers {
segment_headers: Vec<SegmentHeader>,
@@ -10,7 +10,7 @@
voting_solution_range_override: Option<u64>,
},
vote {
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
},
enable_rewards {
height: Option<BlockNumberFor<T>>,
@@ -19,15 +19,15 @@
enable_authoring_by_anyone {},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
-Variants§
§report_equivocation
Fields
§equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+Variants§
§report_equivocation
§store_segment_headers
Fields
§segment_headers: Vec<SegmentHeader>
§enable_solution_range_adjustment
§vote
Fields
§signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
See Pallet::vote
.
+§vote
See Pallet::vote
.
§enable_rewards
§enable_storage_access
Fields
Fields
Implementations§
source§impl<T: Config> Call<T>
sourcepub fn new_call_variant_report_equivocation(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> Self
Create a call with the variant report_equivocation
.
sourcepub fn new_call_variant_store_segment_headers(
segment_headers: Vec<SegmentHeader>
@@ -37,7 +37,7 @@
voting_solution_range_override: Option<u64>
) -> Self
Create a call with the variant enable_solution_range_adjustment
.
sourcepub fn new_call_variant_vote(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> Self
Create a call with the variant vote
.
sourcepub fn new_call_variant_enable_rewards(
height: Option<BlockNumberFor<T>>
@@ -59,8 +59,8 @@
by ==
.
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
- Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
- Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
+ Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
+ Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
Option<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
The origin type of the runtime, (i.e. frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
diff --git a/pallet_subspace/pallet/enum.Event.html b/pallet_subspace/pallet/enum.Event.html
index a8b1edf719..e6ea6a9178 100644
--- a/pallet_subspace/pallet/enum.Event.html
+++ b/pallet_subspace/pallet/enum.Event.html
@@ -3,7 +3,7 @@
segment_header: SegmentHeader,
},
FarmerVote {
- public_key: FarmerPublicKey,
+ public_key: FarmerPublicKey,
reward_address: T::AccountId,
height: BlockNumberFor<T>,
parent_hash: T::Hash,
@@ -11,7 +11,7 @@
// some variants omitted
}Expand description
Events type.
Variants§
§SegmentHeaderStored
Fields
§segment_header: SegmentHeader
Segment header was stored in blockchain history.
-§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
+§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
Trait Implementations§
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -29,7 +29,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -39,34 +39,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/pallet_subspace/pallet/type.Module.html b/pallet_subspace/pallet/type.Module.html
index 4561060388..e3f53ff887 100644
--- a/pallet_subspace/pallet/type.Module.html
+++ b/pallet_subspace/pallet/type.Module.html
@@ -6,12 +6,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -30,7 +30,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -40,34 +40,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
index 97165e94f8..18e5dc74cf 100644
--- a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
+++ b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
@@ -8,7 +8,7 @@
Block: BlockT,
Backend: BackendT<Block>,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + LockImportRun<Block, Backend> + Finalizer<Block, Backend> + AuxStore + Send + Sync + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
AS: AuxStore + Send + Sync + 'static,
SO: SyncOracle + Send + Sync + 'static,Expand description
Crate an archiver task that will listen for importing blocks and archive blocks at K
depth,
producing pieces and segment headers (segment headers are then added back to the blockchain as
diff --git a/sc_consensus_subspace/block_import/enum.Error.html b/sc_consensus_subspace/block_import/enum.Error.html
index 68f3349afd..b066274acb 100644
--- a/sc_consensus_subspace/block_import/enum.Error.html
+++ b/sc_consensus_subspace/block_import/enum.Error.html
@@ -1,6 +1,6 @@
Error in sc_consensus_subspace::block_import - Rust Enum sc_consensus_subspace::block_import::Error
source · pub enum Error<Header: HeaderT> {
Show 35 variants
InnerBlockImportError(Error),
- DigestItemError(Error),
+ DigestItemError(Error),
ParentUnavailable(Header::Hash, Header::Hash),
GenesisUnavailable,
SlotMustIncrease(Slot, Slot),
@@ -31,7 +31,7 @@
SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>),
SegmentHeaderNotFound(SegmentIndex),
DifferentSegmentCommitment(SegmentIndex),
- FarmerInBlockList(FarmerPublicKey),
+ FarmerInBlockList(FarmerPublicKey),
NoBlockWeight(Header::Hash),
SegmentCommitmentNotFound(SegmentIndex),
SectorExpired {
@@ -47,7 +47,7 @@
RuntimeApi(ApiError),
}
Expand description
Errors encountered by the Subspace authorship task.
Variants§
§InnerBlockImportError(Error)
Inner block import error
-§DigestItemError(Error)
Error during digest item extraction
+§DigestItemError(Error)
Error during digest item extraction
Parent unavailable. Cannot import
Genesis block unavailable. Cannot import
§SlotMustIncrease(Slot, Slot)
Slot number must increase
@@ -76,7 +76,7 @@
§SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>)
Stored segment header extrinsic was not found
§SegmentHeaderNotFound(SegmentIndex)
Segment header not found
§DifferentSegmentCommitment(SegmentIndex)
Different segment commitment found
-§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
+§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
§NoBlockWeight(Header::Hash)
No block weight for parent header
§SegmentCommitmentNotFound(SegmentIndex)
Segment commitment not found
§SectorExpired
Fields
§expiration_history_size: HistorySize
Expiration history size
@@ -92,7 +92,7 @@
Trait Implementations§
source§impl<Header: HeaderT> Error for Error<Header>where
Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl<Header> From<VerificationError<Header>> for Error<Header>where
+ Header: HeaderT,
source§impl<Header> From<VerificationError<Header>> for Error<Header>where
Header: HeaderT,
source§fn from(error: VerificationError<Header>) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl<Header> !RefUnwindSafe for Error<Header>
§impl<Header> Send for Error<Header>
§impl<Header> Sync for Error<Header>
§impl<Header> Unpin for Error<Header>where
<Header as Header>::Hash: Unpin,
§impl<Header> !UnwindSafe for Error<Header>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
index f58a5f04e3..7248b3f6ef 100644
--- a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
+++ b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
@@ -4,7 +4,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
sourcepub fn new(
@@ -13,14 +13,14 @@
subspace_link: SubspaceLink<Block>,
create_inherent_data_providers: CIDP,
segment_headers_store: SegmentHeadersStore<AS>,
- pot_verifier: PotVerifier
+ pot_verifier: PotVerifier
) -> Self
Produce a Subspace block-import object to be used later on in the construction of an import-queue.
Trait Implementations§
source§impl<PosTable, Block, Client, Inner, CIDP, AS> BlockImport<Block> for SubspaceBlockImport<PosTable, Block, Client, Inner, CIDP, AS>where
PosTable: Table,
Block: BlockT,
Inner: BlockImport<Block, Error = Error> + Send + Sync,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore + Send + Sync,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
source§fn import_block<'life0, 'async_trait>(
diff --git a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
index 4a189d1df9..59d156b8c7 100644
--- a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
@@ -1,9 +1,9 @@
NewSlotNotification in sc_consensus_subspace::slot_worker - Rust pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for NewSlotNotification
§impl Send for NewSlotNotification
§impl Sync for NewSlotNotification
§impl Unpin for NewSlotNotification
§impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
A handle to a BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
A handle to a SyncOracle
.§type JustificationSyncLink = L
A handle to a JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
Data associated with a slot claim.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
§env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@
§telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
§offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
§impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::
Expand description
A trait with utility methods for handling equivocation reports in Subspace. The trait provides methods for reporting an offence triggered by a valid equivocation report, checking the current @@ -16,17 +16,17 @@
sourcetype ReportLongevity: Get<u64>
type ReportLongevity: Get<u64>
The longevity, in blocks, that the equivocation report is valid for. When using the staking pallet this should be equal to the bonding duration (in blocks, not eras).
sourcefn report_offence(
- offence: SubspaceEquivocationOffence<FarmerPublicKey>
-) -> Result<(), OffenceError>
fn report_offence( - offence: SubspaceEquivocationOffence<FarmerPublicKey> -) -> Result<(), OffenceError>
Report an offence proved by the given reporters.
-sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
+ offence: SubspaceEquivocationOffence<FarmerPublicKey> +) -> Result<(), OffenceError>Report an offence proved by the given reporters.
+sourcefn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
fn is_known_offence(offenders: &[FarmerPublicKey], time_slot: &Slot) -> bool
Returns true if all of the offenders at the given time slot have already been reported.
sourcefn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> DispatchResult
fn submit_equivocation_report( - equivocation_proof: EquivocationProof<HeaderFor<T>> + equivocation_proof: EquivocationProof<HeaderFor<T>> ) -> DispatchResult
Create and dispatch an equivocation report extrinsic.
Implementations on Foreign Types§
source§impl<T: Config> HandleEquivocation<T> for ()
impl<T: Config> HandleEquivocation<T> for ()
type ReportLongevity = ()
fn report_offence( - _offence: SubspaceEquivocationOffence<FarmerPublicKey> -) -> Result<(), OffenceError>
fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
fn submit_equivocation_report( - _equivocation_proof: EquivocationProof<HeaderFor<T>> + _offence: SubspaceEquivocationOffence<FarmerPublicKey> +) -> Result<(), OffenceError>
fn is_known_offence(_offenders: &[FarmerPublicKey], _time_slot: &Slot) -> bool
fn submit_equivocation_report( + _equivocation_proof: EquivocationProof<HeaderFor<T>> ) -> DispatchResult
Implementors§
source§impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where
T: Config + SendTransactionTypes<Call<T>>,
- R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
+ R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>,
L: Get<u64>,
impl<T, R, L> HandleEquivocation<T> for EquivocationHandler<R, L>where T: Config + SendTransactionTypes<Call<T>>, - R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>, + R: ReportOffence<FarmerPublicKey, SubspaceEquivocationOffence<FarmerPublicKey>>, L: Get<u64>,
type ReportLongevity = L
Function pallet_subspace::pallet::dispatchables::report_equivocation
source · pub fn report_equivocation<T: Config>(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
)
Expand description
Report farmer equivocation/misbehavior. This method will verify the equivocation proof. If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will diff --git a/pallet_subspace/pallet/dispatchables/fn.vote.html b/pallet_subspace/pallet/dispatchables/fn.vote.html index c29e912834..13184f6a2a 100644 --- a/pallet_subspace/pallet/dispatchables/fn.vote.html +++ b/pallet_subspace/pallet/dispatchables/fn.vote.html @@ -1,5 +1,5 @@
Function pallet_subspace::pallet::dispatchables::vote
source · pub fn vote<T: Config>(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
)
Expand description
Farmer vote, currently only used for extra rewards to farmers.
Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable diff --git a/pallet_subspace/pallet/enum.AllowAuthoringBy.html b/pallet_subspace/pallet/enum.AllowAuthoringBy.html index 7309992c8c..6d2cd08bab 100644 --- a/pallet_subspace/pallet/enum.AllowAuthoringBy.html +++ b/pallet_subspace/pallet/enum.AllowAuthoringBy.html @@ -1,11 +1,11 @@
Enum pallet_subspace::pallet::AllowAuthoringBy
source · pub enum AllowAuthoringBy {
Anyone,
FirstFarmer,
- RootFarmer(FarmerPublicKey),
+ RootFarmer(FarmerPublicKey),
}
Variants§
Anyone
Anyone can author new blocks at genesis.
FirstFarmer
Author of the first block will be able to author blocks going forward unless unlocked for everyone.
-RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
+RootFarmer(FarmerPublicKey)
Specified root farmer is allowed to author blocks unless unlocked for everyone.
Trait Implementations§
source§impl Debug for AllowAuthoringBy
impl Debug for AllowAuthoringBy
source§impl Decode for AllowAuthoringBy
impl Decode for AllowAuthoringBy
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
§fn decode_into<I>(
diff --git a/pallet_subspace/pallet/enum.Call.html b/pallet_subspace/pallet/enum.Call.html
index ff59545976..c4ecd9f7db 100644
--- a/pallet_subspace/pallet/enum.Call.html
+++ b/pallet_subspace/pallet/enum.Call.html
@@ -1,6 +1,6 @@
Call in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::Call
source · pub enum Call<T: Config> {
report_equivocation {
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
},
store_segment_headers {
segment_headers: Vec<SegmentHeader>,
@@ -10,7 +10,7 @@
voting_solution_range_override: Option<u64>,
},
vote {
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
},
enable_rewards {
height: Option<BlockNumberFor<T>>,
@@ -19,15 +19,15 @@
enable_authoring_by_anyone {},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
-Variants§
§report_equivocation
Fields
§equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+Variants§
§report_equivocation
§store_segment_headers
Fields
§segment_headers: Vec<SegmentHeader>
§enable_solution_range_adjustment
§vote
Fields
§signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
See Pallet::vote
.
+§vote
See Pallet::vote
.
§enable_rewards
§enable_storage_access
Fields
Fields
Implementations§
source§impl<T: Config> Call<T>
sourcepub fn new_call_variant_report_equivocation(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> Self
Create a call with the variant report_equivocation
.
sourcepub fn new_call_variant_store_segment_headers(
segment_headers: Vec<SegmentHeader>
@@ -37,7 +37,7 @@
voting_solution_range_override: Option<u64>
) -> Self
Create a call with the variant enable_solution_range_adjustment
.
sourcepub fn new_call_variant_vote(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> Self
Create a call with the variant vote
.
sourcepub fn new_call_variant_enable_rewards(
height: Option<BlockNumberFor<T>>
@@ -59,8 +59,8 @@
by ==
.
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
- Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
- Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
+ Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
+ Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
Option<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
The origin type of the runtime, (i.e. frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
diff --git a/pallet_subspace/pallet/enum.Event.html b/pallet_subspace/pallet/enum.Event.html
index a8b1edf719..e6ea6a9178 100644
--- a/pallet_subspace/pallet/enum.Event.html
+++ b/pallet_subspace/pallet/enum.Event.html
@@ -3,7 +3,7 @@
segment_header: SegmentHeader,
},
FarmerVote {
- public_key: FarmerPublicKey,
+ public_key: FarmerPublicKey,
reward_address: T::AccountId,
height: BlockNumberFor<T>,
parent_hash: T::Hash,
@@ -11,7 +11,7 @@
// some variants omitted
}Expand description
Events type.
Variants§
§SegmentHeaderStored
Fields
§segment_header: SegmentHeader
Segment header was stored in blockchain history.
-§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
+§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
Trait Implementations§
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -29,7 +29,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -39,34 +39,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/pallet_subspace/pallet/type.Module.html b/pallet_subspace/pallet/type.Module.html
index 4561060388..e3f53ff887 100644
--- a/pallet_subspace/pallet/type.Module.html
+++ b/pallet_subspace/pallet/type.Module.html
@@ -6,12 +6,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -30,7 +30,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -40,34 +40,34 @@
Enable storage access for all users.
fn decode_into<I>(
diff --git a/pallet_subspace/pallet/enum.Call.html b/pallet_subspace/pallet/enum.Call.html
index ff59545976..c4ecd9f7db 100644
--- a/pallet_subspace/pallet/enum.Call.html
+++ b/pallet_subspace/pallet/enum.Call.html
@@ -1,6 +1,6 @@
Call in pallet_subspace::pallet - Rust Enum pallet_subspace::pallet::Call
source · pub enum Call<T: Config> {
report_equivocation {
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
},
store_segment_headers {
segment_headers: Vec<SegmentHeader>,
@@ -10,7 +10,7 @@
voting_solution_range_override: Option<u64>,
},
vote {
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
},
enable_rewards {
height: Option<BlockNumberFor<T>>,
@@ -19,15 +19,15 @@
enable_authoring_by_anyone {},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
-Variants§
§report_equivocation
Fields
§equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+Variants§
§report_equivocation
§store_segment_headers
Fields
§segment_headers: Vec<SegmentHeader>
§enable_solution_range_adjustment
§vote
Fields
§signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
See Pallet::vote
.
+§vote
See Pallet::vote
.
§enable_rewards
§enable_storage_access
Fields
Fields
Implementations§
source§impl<T: Config> Call<T>
sourcepub fn new_call_variant_report_equivocation(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> Self
Create a call with the variant report_equivocation
.
sourcepub fn new_call_variant_store_segment_headers(
segment_headers: Vec<SegmentHeader>
@@ -37,7 +37,7 @@
voting_solution_range_override: Option<u64>
) -> Self
Create a call with the variant enable_solution_range_adjustment
.
sourcepub fn new_call_variant_vote(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> Self
Create a call with the variant vote
.
sourcepub fn new_call_variant_enable_rewards(
height: Option<BlockNumberFor<T>>
@@ -59,8 +59,8 @@
by ==
.
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
- Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
- Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
+ Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
+ Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
Option<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
The origin type of the runtime, (i.e. frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
diff --git a/pallet_subspace/pallet/enum.Event.html b/pallet_subspace/pallet/enum.Event.html
index a8b1edf719..e6ea6a9178 100644
--- a/pallet_subspace/pallet/enum.Event.html
+++ b/pallet_subspace/pallet/enum.Event.html
@@ -3,7 +3,7 @@
segment_header: SegmentHeader,
},
FarmerVote {
- public_key: FarmerPublicKey,
+ public_key: FarmerPublicKey,
reward_address: T::AccountId,
height: BlockNumberFor<T>,
parent_hash: T::Hash,
@@ -11,7 +11,7 @@
// some variants omitted
}Expand description
Events type.
Variants§
§SegmentHeaderStored
Fields
§segment_header: SegmentHeader
Segment header was stored in blockchain history.
-§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
+§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
Trait Implementations§
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -29,7 +29,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -39,34 +39,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
-source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
+source§impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
-source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
+source§impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
+sourcepub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
Submit farmer vote vote that is essentially a header with bigger solution range than
acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read moreTrait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
Find the address for a block rewards based on the pre-runtime digests.source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
Find the addresses for voting rewards based on transactions found in the block.source§impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
Returns the current storage version as supported by the pallet.source§fn on_chain_storage_version() -> StorageVersion
Returns the on-chain storage version of the pallet as stored in the storage.source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
Block initialization hook. This is called at the very beginning of block execution. Read moresource§fn on_finalize(block_number: BlockNumberFor<T>)
Block finalization hook. This is called at the very end of block execution. Read more§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hook to consume a block’s idle time. This will run when the block is being finalized (before
[Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
Hook executed when a code change (aka. a “runtime upgrade”) is detected by FRAME. Read more§fn offchain_worker(_n: BlockNumber)
Implementing this function on a pallet allows you to perform long-running tasks that are
-dispatched as separate threads, and entirely independent of the main wasm runtime. Read more§fn integrity_test()
Check the integrity of this pallet’s configuration. Read moresource§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
See [Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
This function is being called after every block import (when fully synced). Read moresource§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
See [Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
Something that should happen at genesis.source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
See [Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
A handler for an offence of a particular kind. Read moresource§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
See [Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
Name of the Rust module containing the pallet.source§fn crate_version() -> CrateVersion
Version of the crate containing the pallet.source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
The error returned by check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
The inherent identifier used by this inherent.source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
Create an inherent out of the given InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
Determines whether this inherent is required in this block. Read moresource§fn check_inherent(
call: &Self::Call,
diff --git a/pallet_subspace/pallet/type.Module.html b/pallet_subspace/pallet/type.Module.html
index 4561060388..e3f53ff887 100644
--- a/pallet_subspace/pallet/type.Module.html
+++ b/pallet_subspace/pallet/type.Module.html
@@ -6,12 +6,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof.
If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will
@@ -30,7 +30,7 @@
Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -40,34 +40,34 @@
Enable storage access for all users.
Enum pallet_subspace::pallet::Call
source · pub enum Call<T: Config> {
report_equivocation {
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>,
},
store_segment_headers {
segment_headers: Vec<SegmentHeader>,
@@ -10,7 +10,7 @@
voting_solution_range_override: Option<u64>,
},
vote {
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>,
},
enable_rewards {
height: Option<BlockNumberFor<T>>,
@@ -19,15 +19,15 @@
enable_authoring_by_anyone {},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
-Variants§
report_equivocation
Fields
equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
Variants§
report_equivocation
store_segment_headers
Fields
segment_headers: Vec<SegmentHeader>
enable_solution_range_adjustment
vote
Fields
signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
See Pallet::vote
.
vote
See Pallet::vote
.
enable_rewards
enable_storage_access
Fields
Fields
Implementations§
source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
sourcepub fn new_call_variant_report_equivocation(
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> Self
pub fn new_call_variant_report_equivocation( - equivocation_proof: Box<EquivocationProof<HeaderFor<T>>> + equivocation_proof: Box<EquivocationProof<HeaderFor<T>>> ) -> Self
Create a call with the variant report_equivocation
.
sourcepub fn new_call_variant_store_segment_headers(
segment_headers: Vec<SegmentHeader>
@@ -37,7 +37,7 @@
voting_solution_range_override: Option<u64>
) -> Self
pub fn new_call_variant_store_segment_headers( segment_headers: Vec<SegmentHeader> @@ -37,7 +37,7 @@ voting_solution_range_override: Option<u64> ) -> Self
Create a call with the variant enable_solution_range_adjustment
.
sourcepub fn new_call_variant_vote(
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> Self
pub fn new_call_variant_vote( - signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>> + signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>> ) -> Self
Create a call with the variant vote
.
sourcepub fn new_call_variant_enable_rewards(
height: Option<BlockNumberFor<T>>
@@ -59,8 +59,8 @@
by ==
.
pub fn new_call_variant_enable_rewards(
height: Option<BlockNumberFor<T>>
@@ -59,8 +59,8 @@
by ==
.
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
- Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
- Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
+ Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static,
+ Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static,
Option<BlockNumberFor<T>>: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for Call<T>where PhantomData<(T,)>: TypeInfo + 'static, - Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static, - Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static, + Box<EquivocationProof<HeaderFor<T>>>: TypeInfo + 'static, + Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>: TypeInfo + 'static, Option<BlockNumberFor<T>>: TypeInfo + 'static, T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
diff --git a/pallet_subspace/pallet/enum.Event.html b/pallet_subspace/pallet/enum.Event.html
index a8b1edf719..e6ea6a9178 100644
--- a/pallet_subspace/pallet/enum.Event.html
+++ b/pallet_subspace/pallet/enum.Event.html
@@ -3,7 +3,7 @@
segment_header: SegmentHeader,
},
FarmerVote {
- public_key: FarmerPublicKey,
+ public_key: FarmerPublicKey,
reward_address: T::AccountId,
height: BlockNumberFor<T>,
parent_hash: T::Hash,
@@ -11,7 +11,7 @@
// some variants omitted
}Expand description
Events type.
Variants§
§SegmentHeaderStored
Fields
§segment_header: SegmentHeader
Segment header was stored in blockchain history.
-§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
+§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
Trait Implementations§
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
fn dispatch_bypass_filter(
self,
diff --git a/pallet_subspace/pallet/enum.Event.html b/pallet_subspace/pallet/enum.Event.html
index a8b1edf719..e6ea6a9178 100644
--- a/pallet_subspace/pallet/enum.Event.html
+++ b/pallet_subspace/pallet/enum.Event.html
@@ -3,7 +3,7 @@
segment_header: SegmentHeader,
},
FarmerVote {
- public_key: FarmerPublicKey,
+ public_key: FarmerPublicKey,
reward_address: T::AccountId,
height: BlockNumberFor<T>,
parent_hash: T::Hash,
@@ -11,7 +11,7 @@
// some variants omitted
}Expand description
Events type.
Variants§
§SegmentHeaderStored
Fields
§segment_header: SegmentHeader
Segment header was stored in blockchain history.
-§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
+§FarmerVote
Fields
§public_key: FarmerPublicKey
§reward_address: T::AccountId
§height: BlockNumberFor<T>
§parent_hash: T::Hash
Farmer vote.
Trait Implementations§
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
sourcepub fn validate_equivocation_report(
source: TransactionSource,
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> TransactionValidity
sourcepub fn pre_dispatch_equivocation_report(
- equivocation_proof: &EquivocationProof<HeaderFor<T>>
+ equivocation_proof: &EquivocationProof<HeaderFor<T>>
) -> Result<(), TransactionValidityError>
Expand description
Events type.
SegmentHeaderStored
Fields
segment_header: SegmentHeader
Segment header was stored in blockchain history.
-FarmerVote
Fields
public_key: FarmerPublicKey
reward_address: T::AccountId
height: BlockNumberFor<T>
parent_hash: T::Hash
Farmer vote.
+FarmerVote
Fields
public_key: FarmerPublicKey
reward_address: T::AccountId
height: BlockNumberFor<T>
parent_hash: T::Hash
Farmer vote.
source§impl<T: Config> Decode for Event<T>where
T::AccountId: Decode,
BlockNumberFor<T>: Decode,
diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html
index ac968c1586..feee76762a 100644
--- a/pallet_subspace/pallet/struct.Pallet.html
+++ b/pallet_subspace/pallet/struct.Pallet.html
@@ -5,12 +5,12 @@
equivocation reports.
impl<T: Config> Decode for Event<T>where T::AccountId: Decode, BlockNumberFor<T>: Decode, diff --git a/pallet_subspace/pallet/struct.Pallet.html b/pallet_subspace/pallet/struct.Pallet.html index ac968c1586..feee76762a 100644 --- a/pallet_subspace/pallet/struct.Pallet.html +++ b/pallet_subspace/pallet/struct.Pallet.html @@ -5,12 +5,12 @@ equivocation reports.
pub fn validate_equivocation_report( source: TransactionSource, - equivocation_proof: &EquivocationProof<HeaderFor<T>> + equivocation_proof: &EquivocationProof<HeaderFor<T>> ) -> TransactionValidity
pub fn pre_dispatch_equivocation_report( - equivocation_proof: &EquivocationProof<HeaderFor<T>> + equivocation_proof: &EquivocationProof<HeaderFor<T>> ) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
pub fn report_equivocation( origin: OriginFor<T>, - equivocation_proof: Box<EquivocationProof<HeaderFor<T>>> + equivocation_proof: Box<EquivocationProof<HeaderFor<T>>> ) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof. If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will @@ -29,7 +29,7 @@ Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
pub fn vote( origin: OriginFor<T>, - signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>> + signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>> ) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -39,34 +39,34 @@
pub fn enable_rewards( origin: OriginFor<T>, @@ -39,34 +39,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
pub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
pub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
pub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
pub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
pub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
pub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
pub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
pub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
pub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
pub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
pub fn submit_equivocation_report( - equivocation_proof: EquivocationProof<HeaderFor<T>> + equivocation_proof: EquivocationProof<HeaderFor<T>> ) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
pub fn submit_test_equivocation_report( - equivocation_proof: EquivocationProof<HeaderFor<T>> + equivocation_proof: EquivocationProof<HeaderFor<T>> ) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
pub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
pub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn pot_parameters() -> PotParameters
pub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
pub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
pub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
impl<T> Pallet<T>where T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
pub fn submit_vote( - signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId> + signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId> )
Submit farmer vote vote that is essentially a header with bigger solution range than acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
fn find_block_reward_address() -> Option<T::AccountId>
source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
fn find_voting_reward_addresses() -> Vec<T::AccountId>
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
source§fn on_finalize(block_number: BlockNumberFor<T>)
fn on_finalize(block_number: BlockNumberFor<T>)
Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
fn find_block_reward_address() -> Option<T::AccountId>
source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
fn find_voting_reward_addresses() -> Vec<T::AccountId>
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
source§fn on_finalize(block_number: BlockNumberFor<T>)
fn on_finalize(block_number: BlockNumberFor<T>)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
type Error = InherentError
check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
fn create_inherent(data: &InherentData) -> Option<Self::Call>
InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
fn is_inherent_required( +sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
fn create_inherent(data: &InherentData) -> Option<Self::Call>
InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
fn is_inherent_required( data: &InherentData ) -> Result<Option<Self::Error>, Self::Error>
source§fn check_inherent(
call: &Self::Call,
diff --git a/pallet_subspace/pallet/type.Module.html b/pallet_subspace/pallet/type.Module.html
index 4561060388..e3f53ff887 100644
--- a/pallet_subspace/pallet/type.Module.html
+++ b/pallet_subspace/pallet/type.Module.html
@@ -6,12 +6,12 @@
equivocation reports.
fn check_inherent( call: &Self::Call, diff --git a/pallet_subspace/pallet/type.Module.html b/pallet_subspace/pallet/type.Module.html index 4561060388..e3f53ff887 100644 --- a/pallet_subspace/pallet/type.Module.html +++ b/pallet_subspace/pallet/type.Module.html @@ -6,12 +6,12 @@ equivocation reports.
pub fn validate_equivocation_report( source: TransactionSource, - equivocation_proof: &EquivocationProof<HeaderFor<T>> + equivocation_proof: &EquivocationProof<HeaderFor<T>> ) -> TransactionValidity
pub fn pre_dispatch_equivocation_report( - equivocation_proof: &EquivocationProof<HeaderFor<T>> + equivocation_proof: &EquivocationProof<HeaderFor<T>> ) -> Result<(), TransactionValidityError>
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn report_equivocation(
origin: OriginFor<T>,
- equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
+ equivocation_proof: Box<EquivocationProof<HeaderFor<T>>>
) -> DispatchResultWithPostInfo
pub fn report_equivocation( origin: OriginFor<T>, - equivocation_proof: Box<EquivocationProof<HeaderFor<T>>> + equivocation_proof: Box<EquivocationProof<HeaderFor<T>>> ) -> DispatchResultWithPostInfo
Report farmer equivocation/misbehavior. This method will verify the equivocation proof. If valid, the offence will be reported.
This extrinsic must be called unsigned and it is expected that only block authors will @@ -30,7 +30,7 @@ Note: No effect on the solution range for the current era
sourcepub fn vote(
origin: OriginFor<T>,
- signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
+ signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>>
) -> DispatchResult
pub fn vote( origin: OriginFor<T>, - signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>> + signed_vote: Box<SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>> ) -> DispatchResult
Farmer vote, currently only used for extra rewards to farmers.
sourcepub fn enable_rewards(
origin: OriginFor<T>,
@@ -40,34 +40,34 @@
pub fn enable_rewards( origin: OriginFor<T>, @@ -40,34 +40,34 @@
Enable storage access for all users.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn genesis_slot() -> Slot
pub fn genesis_slot() -> Slot
An auto-generated getter for GenesisSlot
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn current_slot() -> Slot
pub fn current_slot() -> Slot
An auto-generated getter for CurrentSlot
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
pub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn solution_ranges() -> SolutionRanges
pub fn solution_ranges() -> SolutionRanges
An auto-generated getter for SolutionRanges
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn should_adjust_solution_range() -> bool
pub fn should_adjust_solution_range() -> bool
An auto-generated getter for ShouldAdjustSolutionRange
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where
KArg: EncodeLike<SegmentIndex>,
pub fn segment_commitment<KArg>(k: KArg) -> Option<SegmentCommitment>where KArg: EncodeLike<SegmentIndex>,
An auto-generated getter for SegmentCommitment
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn is_storage_access_enabled() -> bool
pub fn is_storage_access_enabled() -> bool
An auto-generated getter for IsStorageAccessEnabled
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
pub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn root_plot_public_key() -> Option<FarmerPublicKey>
pub fn root_plot_public_key() -> Option<FarmerPublicKey>
An auto-generated getter for RootPlotPublicKey
.
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub fn history_size() -> HistorySize
pub fn history_size() -> HistorySize
Total number of pieces in the blockchain
sourcepub fn submit_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
pub fn submit_equivocation_report( - equivocation_proof: EquivocationProof<HeaderFor<T>> + equivocation_proof: EquivocationProof<HeaderFor<T>> ) -> Option<()>
Submits an extrinsic to report an equivocation. This method will create an unsigned
extrinsic with a call to report_equivocation
and will push the transaction to the pool.
Only useful in an offchain context.
sourcepub fn submit_test_equivocation_report(
- equivocation_proof: EquivocationProof<HeaderFor<T>>
+ equivocation_proof: EquivocationProof<HeaderFor<T>>
) -> Option<()>
pub fn submit_test_equivocation_report( - equivocation_proof: EquivocationProof<HeaderFor<T>> + equivocation_proof: EquivocationProof<HeaderFor<T>> ) -> Option<()>
Just stores offender from equivocation report in block list, only used for tests.
-sourcepub fn pot_parameters() -> PotParameters
pub fn pot_parameters() -> PotParameters
Proof of time parameters
-sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
pub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn pot_parameters() -> PotParameters
pub fn pot_parameters() -> PotParameters
Proof of time parameters
+sourcepub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
pub fn is_in_block_list(farmer_public_key: &FarmerPublicKey) -> bool
Check if farmer_public_key
is in block list (due to equivocation)
sourcepub fn archived_history_size() -> u64
pub fn archived_history_size() -> u64
Size of the archived history of the blockchain in bytes
source§impl<T> Pallet<T>where
T: Config + SendTransactionTypes<Call<T>>,
impl<T> Pallet<T>where T: Config + SendTransactionTypes<Call<T>>,
sourcepub fn submit_vote(
- signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
+ signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>
)
pub fn submit_vote( - signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId> + signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId> )
Submit farmer vote vote that is essentially a header with bigger solution range than acceptable for block authoring.
-Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
fn find_block_reward_address() -> Option<T::AccountId>
source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
fn find_voting_reward_addresses() -> Vec<T::AccountId>
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
source§fn on_finalize(block_number: BlockNumberFor<T>)
fn on_finalize(block_number: BlockNumberFor<T>)
Trait Implementations§
source§impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindBlockRewardAddress<<T as Config>::AccountId> for Pallet<T>
source§fn find_block_reward_address() -> Option<T::AccountId>
fn find_block_reward_address() -> Option<T::AccountId>
source§impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
impl<T: Config> FindVotingRewardAddresses<<T as Config>::AccountId> for Pallet<T>
source§fn find_voting_reward_addresses() -> Vec<T::AccountId>
fn find_voting_reward_addresses() -> Vec<T::AccountId>
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type CurrentStorageVersion = NoStorageVersionSet
type CurrentStorageVersion = NoStorageVersionSet
source§fn current_storage_version() -> Self::CurrentStorageVersion
fn current_storage_version() -> Self::CurrentStorageVersion
source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
source§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
fn on_initialize(block_number: BlockNumberFor<T>) -> Weight
source§fn on_finalize(block_number: BlockNumberFor<T>)
fn on_finalize(block_number: BlockNumberFor<T>)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_initialize(n: BlockNumberFor<T>) -> Weight
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
impl<T: Config> OnOffenceHandler<Public> for Pallet<T>
source§fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
fn on_offence(offenders: &[OffenceDetails<FarmerPublicKey>])
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq<Pallet<T>> for Pallet<T>
impl<T> PartialEq<Pallet<T>> for Pallet<T>
source§impl<T: Config> ProvideInherent for Pallet<T>
impl<T: Config> ProvideInherent for Pallet<T>
§type Error = InherentError
type Error = InherentError
check_inherent
.source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
fn create_inherent(data: &InherentData) -> Option<Self::Call>
InherentData
. Read moresource§fn is_inherent_required(
+sufficient, and should not be overridden without very good reason.
fn is_inherent_required( +sufficient, and should not be overridden without very good reason.
source§impl<T: Config> ProvideInherent for Pallet<T>
impl<T: Config> ProvideInherent for Pallet<T>
source§const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
const INHERENT_IDENTIFIER: InherentIdentifier = INHERENT_IDENTIFIER
source§fn create_inherent(data: &InherentData) -> Option<Self::Call>
fn create_inherent(data: &InherentData) -> Option<Self::Call>
InherentData
. Read moresource§fn is_inherent_required(
data: &InherentData
) -> Result<Option<Self::Error>, Self::Error>
fn is_inherent_required( data: &InherentData ) -> Result<Option<Self::Error>, Self::Error>
source§fn check_inherent(
call: &Self::Call,
diff --git a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
index 97165e94f8..18e5dc74cf 100644
--- a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
+++ b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
@@ -8,7 +8,7 @@
Block: BlockT,
Backend: BackendT<Block>,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + LockImportRun<Block, Backend> + Finalizer<Block, Backend> + AuxStore + Send + Sync + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
AS: AuxStore + Send + Sync + 'static,
SO: SyncOracle + Send + Sync + 'static,Expand description
Crate an archiver task that will listen for importing blocks and archive blocks at K
depth,
producing pieces and segment headers (segment headers are then added back to the blockchain as
diff --git a/sc_consensus_subspace/block_import/enum.Error.html b/sc_consensus_subspace/block_import/enum.Error.html
index 68f3349afd..b066274acb 100644
--- a/sc_consensus_subspace/block_import/enum.Error.html
+++ b/sc_consensus_subspace/block_import/enum.Error.html
@@ -1,6 +1,6 @@
Error in sc_consensus_subspace::block_import - Rust Enum sc_consensus_subspace::block_import::Error
source · pub enum Error<Header: HeaderT> {
Show 35 variants
InnerBlockImportError(Error),
- DigestItemError(Error),
+ DigestItemError(Error),
ParentUnavailable(Header::Hash, Header::Hash),
GenesisUnavailable,
SlotMustIncrease(Slot, Slot),
@@ -31,7 +31,7 @@
SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>),
SegmentHeaderNotFound(SegmentIndex),
DifferentSegmentCommitment(SegmentIndex),
- FarmerInBlockList(FarmerPublicKey),
+ FarmerInBlockList(FarmerPublicKey),
NoBlockWeight(Header::Hash),
SegmentCommitmentNotFound(SegmentIndex),
SectorExpired {
@@ -47,7 +47,7 @@
RuntimeApi(ApiError),
}
Expand description
Errors encountered by the Subspace authorship task.
Variants§
§InnerBlockImportError(Error)
Inner block import error
-§DigestItemError(Error)
Error during digest item extraction
+§DigestItemError(Error)
Error during digest item extraction
Parent unavailable. Cannot import
Genesis block unavailable. Cannot import
§SlotMustIncrease(Slot, Slot)
Slot number must increase
@@ -76,7 +76,7 @@
§SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>)
Stored segment header extrinsic was not found
§SegmentHeaderNotFound(SegmentIndex)
Segment header not found
§DifferentSegmentCommitment(SegmentIndex)
Different segment commitment found
-§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
+§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
§NoBlockWeight(Header::Hash)
No block weight for parent header
§SegmentCommitmentNotFound(SegmentIndex)
Segment commitment not found
§SectorExpired
Fields
§expiration_history_size: HistorySize
Expiration history size
@@ -92,7 +92,7 @@
Trait Implementations§
source§impl<Header: HeaderT> Error for Error<Header>where
Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl<Header> From<VerificationError<Header>> for Error<Header>where
+ Header: HeaderT,
source§impl<Header> From<VerificationError<Header>> for Error<Header>where
Header: HeaderT,
source§fn from(error: VerificationError<Header>) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl<Header> !RefUnwindSafe for Error<Header>
§impl<Header> Send for Error<Header>
§impl<Header> Sync for Error<Header>
§impl<Header> Unpin for Error<Header>where
<Header as Header>::Hash: Unpin,
§impl<Header> !UnwindSafe for Error<Header>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
index f58a5f04e3..7248b3f6ef 100644
--- a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
+++ b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
@@ -4,7 +4,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
sourcepub fn new(
@@ -13,14 +13,14 @@
subspace_link: SubspaceLink<Block>,
create_inherent_data_providers: CIDP,
segment_headers_store: SegmentHeadersStore<AS>,
- pot_verifier: PotVerifier
+ pot_verifier: PotVerifier
) -> Self
Produce a Subspace block-import object to be used later on in the construction of an import-queue.
Trait Implementations§
source§impl<PosTable, Block, Client, Inner, CIDP, AS> BlockImport<Block> for SubspaceBlockImport<PosTable, Block, Client, Inner, CIDP, AS>where
PosTable: Table,
Block: BlockT,
Inner: BlockImport<Block, Error = Error> + Send + Sync,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore + Send + Sync,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
source§fn import_block<'life0, 'async_trait>(
diff --git a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
index 4a189d1df9..59d156b8c7 100644
--- a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
@@ -1,9 +1,9 @@
NewSlotNotification in sc_consensus_subspace::slot_worker - Rust pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for NewSlotNotification
§impl Send for NewSlotNotification
§impl Sync for NewSlotNotification
§impl Unpin for NewSlotNotification
§impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
A handle to a BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
A handle to a SyncOracle
.§type JustificationSyncLink = L
A handle to a JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
Data associated with a slot claim.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
§env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@
§telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
§offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
§impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::
fn check_inherent(
call: &Self::Call,
diff --git a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
index 97165e94f8..18e5dc74cf 100644
--- a/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
+++ b/sc_consensus_subspace/archiver/fn.create_subspace_archiver.html
@@ -8,7 +8,7 @@
Block: BlockT,
Backend: BackendT<Block>,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + LockImportRun<Block, Backend> + Finalizer<Block, Backend> + AuxStore + Send + Sync + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
AS: AuxStore + Send + Sync + 'static,
SO: SyncOracle + Send + Sync + 'static,Expand description
Crate an archiver task that will listen for importing blocks and archive blocks at K
depth,
producing pieces and segment headers (segment headers are then added back to the blockchain as
diff --git a/sc_consensus_subspace/block_import/enum.Error.html b/sc_consensus_subspace/block_import/enum.Error.html
index 68f3349afd..b066274acb 100644
--- a/sc_consensus_subspace/block_import/enum.Error.html
+++ b/sc_consensus_subspace/block_import/enum.Error.html
@@ -1,6 +1,6 @@
Error in sc_consensus_subspace::block_import - Rust Enum sc_consensus_subspace::block_import::Error
source · pub enum Error<Header: HeaderT> {
Show 35 variants
InnerBlockImportError(Error),
- DigestItemError(Error),
+ DigestItemError(Error),
ParentUnavailable(Header::Hash, Header::Hash),
GenesisUnavailable,
SlotMustIncrease(Slot, Slot),
@@ -31,7 +31,7 @@
SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>),
SegmentHeaderNotFound(SegmentIndex),
DifferentSegmentCommitment(SegmentIndex),
- FarmerInBlockList(FarmerPublicKey),
+ FarmerInBlockList(FarmerPublicKey),
NoBlockWeight(Header::Hash),
SegmentCommitmentNotFound(SegmentIndex),
SectorExpired {
@@ -47,7 +47,7 @@
RuntimeApi(ApiError),
}
Expand description
Errors encountered by the Subspace authorship task.
Variants§
§InnerBlockImportError(Error)
Inner block import error
-§DigestItemError(Error)
Error during digest item extraction
+§DigestItemError(Error)
Error during digest item extraction
Parent unavailable. Cannot import
Genesis block unavailable. Cannot import
§SlotMustIncrease(Slot, Slot)
Slot number must increase
@@ -76,7 +76,7 @@
§SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>)
Stored segment header extrinsic was not found
§SegmentHeaderNotFound(SegmentIndex)
Segment header not found
§DifferentSegmentCommitment(SegmentIndex)
Different segment commitment found
-§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
+§FarmerInBlockList(FarmerPublicKey)
Farmer in block list
§NoBlockWeight(Header::Hash)
No block weight for parent header
§SegmentCommitmentNotFound(SegmentIndex)
Segment commitment not found
§SectorExpired
Fields
§expiration_history_size: HistorySize
Expiration history size
@@ -92,7 +92,7 @@
Trait Implementations§
source§impl<Header: HeaderT> Error for Error<Header>where
Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl<Header> From<VerificationError<Header>> for Error<Header>where
+ Header: HeaderT,
source§impl<Header> From<VerificationError<Header>> for Error<Header>where
Header: HeaderT,
source§fn from(error: VerificationError<Header>) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl<Header> !RefUnwindSafe for Error<Header>
§impl<Header> Send for Error<Header>
§impl<Header> Sync for Error<Header>
§impl<Header> Unpin for Error<Header>where
<Header as Header>::Hash: Unpin,
§impl<Header> !UnwindSafe for Error<Header>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
index f58a5f04e3..7248b3f6ef 100644
--- a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
+++ b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
@@ -4,7 +4,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
sourcepub fn new(
@@ -13,14 +13,14 @@
subspace_link: SubspaceLink<Block>,
create_inherent_data_providers: CIDP,
segment_headers_store: SegmentHeadersStore<AS>,
- pot_verifier: PotVerifier
+ pot_verifier: PotVerifier
) -> Self
Produce a Subspace block-import object to be used later on in the construction of an import-queue.
Trait Implementations§
source§impl<PosTable, Block, Client, Inner, CIDP, AS> BlockImport<Block> for SubspaceBlockImport<PosTable, Block, Client, Inner, CIDP, AS>where
PosTable: Table,
Block: BlockT,
Inner: BlockImport<Block, Error = Error> + Send + Sync,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore + Send + Sync,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
source§fn import_block<'life0, 'async_trait>(
diff --git a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
index 4a189d1df9..59d156b8c7 100644
--- a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
@@ -1,9 +1,9 @@
NewSlotNotification in sc_consensus_subspace::slot_worker - Rust pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for NewSlotNotification
§impl Send for NewSlotNotification
§impl Sync for NewSlotNotification
§impl Unpin for NewSlotNotification
§impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
A handle to a BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
A handle to a SyncOracle
.§type JustificationSyncLink = L
A handle to a JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
Data associated with a slot claim.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
§env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@
§telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
§offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
§impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::
Expand description
Crate an archiver task that will listen for importing blocks and archive blocks at K
depth,
producing pieces and segment headers (segment headers are then added back to the blockchain as
diff --git a/sc_consensus_subspace/block_import/enum.Error.html b/sc_consensus_subspace/block_import/enum.Error.html
index 68f3349afd..b066274acb 100644
--- a/sc_consensus_subspace/block_import/enum.Error.html
+++ b/sc_consensus_subspace/block_import/enum.Error.html
@@ -1,6 +1,6 @@
Enum sc_consensus_subspace::block_import::Error
source · pub enum Error<Header: HeaderT> {
Show 35 variants
InnerBlockImportError(Error),
- DigestItemError(Error),
+ DigestItemError(Error),
ParentUnavailable(Header::Hash, Header::Hash),
GenesisUnavailable,
SlotMustIncrease(Slot, Slot),
@@ -31,7 +31,7 @@
SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>),
SegmentHeaderNotFound(SegmentIndex),
DifferentSegmentCommitment(SegmentIndex),
- FarmerInBlockList(FarmerPublicKey),
+ FarmerInBlockList(FarmerPublicKey),
NoBlockWeight(Header::Hash),
SegmentCommitmentNotFound(SegmentIndex),
SectorExpired {
@@ -47,7 +47,7 @@
RuntimeApi(ApiError),
}
Expand description
Errors encountered by the Subspace authorship task.
Variants§
InnerBlockImportError(Error)
Inner block import error
-DigestItemError(Error)
Error during digest item extraction
+DigestItemError(Error)
Error during digest item extraction
Parent unavailable. Cannot import
Genesis block unavailable. Cannot import
SlotMustIncrease(Slot, Slot)
Slot number must increase
@@ -76,7 +76,7 @@SegmentHeadersExtrinsicNotFound(Vec<SegmentHeader>)
Stored segment header extrinsic was not found
SegmentHeaderNotFound(SegmentIndex)
Segment header not found
DifferentSegmentCommitment(SegmentIndex)
Different segment commitment found
-FarmerInBlockList(FarmerPublicKey)
Farmer in block list
+FarmerInBlockList(FarmerPublicKey)
Farmer in block list
NoBlockWeight(Header::Hash)
No block weight for parent header
SegmentCommitmentNotFound(SegmentIndex)
Segment commitment not found
SectorExpired
Fields
expiration_history_size: HistorySize
Expiration history size
@@ -92,7 +92,7 @@Trait Implementations§
source§impl<Header: HeaderT> Error for Error<Header>where
Self: Debug + Display,
impl<Header: HeaderT> Error for Error<Header>where Self: Debug + Display,
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl<Header> From<VerificationError<Header>> for Error<Header>where
+ Header: HeaderT,
impl<Header> From<VerificationError<Header>> for Error<Header>where + Header: HeaderT,
source§impl<Header> From<VerificationError<Header>> for Error<Header>where
Header: HeaderT,
impl<Header> From<VerificationError<Header>> for Error<Header>where Header: HeaderT,
source§fn from(error: VerificationError<Header>) -> Self
fn from(error: VerificationError<Header>) -> Self
Auto Trait Implementations§
impl<Header> !RefUnwindSafe for Error<Header>
impl<Header> Send for Error<Header>
impl<Header> Sync for Error<Header>
impl<Header> Unpin for Error<Header>where <Header as Header>::Hash: Unpin,
impl<Header> !UnwindSafe for Error<Header>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
index f58a5f04e3..7248b3f6ef 100644
--- a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
+++ b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html
@@ -4,7 +4,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
impl<T> Any for Twhere diff --git a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html index f58a5f04e3..7248b3f6ef 100644 --- a/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html +++ b/sc_consensus_subspace/block_import/struct.SubspaceBlockImport.html @@ -4,7 +4,7 @@ PosTable: Table, Block: BlockT, Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore, - Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>, + Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>, CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static, AS: AuxStore + Send + Sync + 'static, BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
sourcepub fn new(
@@ -13,14 +13,14 @@
subspace_link: SubspaceLink<Block>,
create_inherent_data_providers: CIDP,
segment_headers_store: SegmentHeadersStore<AS>,
- pot_verifier: PotVerifier
+ pot_verifier: PotVerifier
) -> Self
pub fn new( @@ -13,14 +13,14 @@ subspace_link: SubspaceLink<Block>, create_inherent_data_providers: CIDP, segment_headers_store: SegmentHeadersStore<AS>, - pot_verifier: PotVerifier + pot_verifier: PotVerifier ) -> Self
Produce a Subspace block-import object to be used later on in the construction of an import-queue.
Trait Implementations§
source§impl<PosTable, Block, Client, Inner, CIDP, AS> BlockImport<Block> for SubspaceBlockImport<PosTable, Block, Client, Inner, CIDP, AS>where
PosTable: Table,
Block: BlockT,
Inner: BlockImport<Block, Error = Error> + Send + Sync,
Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore + Send + Sync,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>,
CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
impl<PosTable, Block, Client, Inner, CIDP, AS> BlockImport<Block> for SubspaceBlockImport<PosTable, Block, Client, Inner, CIDP, AS>where PosTable: Table, Block: BlockT, Inner: BlockImport<Block, Error = Error> + Send + Sync, Client: ProvideRuntimeApi<Block> + BlockBackend<Block> + HeaderBackend<Block> + AuxStore + Send + Sync, - Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>, + Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey> + ApiExt<Block>, CIDP: CreateInherentDataProviders<Block, SubspaceLink<Block>> + Send + Sync + 'static, AS: AuxStore + Send + Sync + 'static, BlockNumber: From<<<Block as BlockT>::Header as HeaderT>::Number>,
source§fn import_block<'life0, 'async_trait>(
diff --git a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
index 4a189d1df9..59d156b8c7 100644
--- a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
@@ -1,9 +1,9 @@
NewSlotNotification in sc_consensus_subspace::slot_worker - Rust pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for NewSlotNotification
§impl Send for NewSlotNotification
§impl Sync for NewSlotNotification
§impl Unpin for NewSlotNotification
§impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
A handle to a BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
A handle to a SyncOracle
.§type JustificationSyncLink = L
A handle to a JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
Data associated with a slot claim.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
§env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@
§telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
§offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
§impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::
fn import_block<'life0, 'async_trait>(
diff --git a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
index 4a189d1df9..59d156b8c7 100644
--- a/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.NewSlotNotification.html
@@ -1,9 +1,9 @@
NewSlotNotification in sc_consensus_subspace::slot_worker - Rust pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+§solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for NewSlotNotification
§impl Send for NewSlotNotification
§impl Sync for NewSlotNotification
§impl Unpin for NewSlotNotification
§impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
Called when new proof of time is available for slot. Read moresource§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
A handle to a BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
A handle to a SyncOracle
.§type JustificationSyncLink = L
A handle to a JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
Data associated with a slot claim.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
The type of future resolving to the proposer.source§fn logging_target(&self) -> &'static str
The logging target to use when logging messages.source§fn block_import(&mut self) -> &mut Self::BlockImport
A handle to a BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
§env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@
§telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
§offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
§impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::
pub struct NewSlotNotification {
pub new_slot_info: NewSlotInfo,
- pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
+ pub solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>,
}
Expand description
New slot notification with slot information and sender for solution for the slot.
Fields§
§new_slot_info: NewSlotInfo
New slot information.
-solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
+solution_sender: Sender<Solution<FarmerPublicKey, FarmerPublicKey>>
Sender that can be used to send solutions for the slot.
Trait Implementations§
source§impl Clone for NewSlotNotification
impl Clone for NewSlotNotification
source§fn clone(&self) -> NewSlotNotification
fn clone(&self) -> NewSlotNotification
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for NewSlotNotification
impl Send for NewSlotNotification
impl Sync for NewSlotNotification
impl Unpin for NewSlotNotification
impl !UnwindSafe for NewSlotNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
index 6b5380c4ff..4391b363ca 100644
--- a/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
+++ b/sc_consensus_subspace/slot_worker/struct.RewardSigningNotification.html
@@ -1,11 +1,11 @@
RewardSigningNotification in sc_consensus_subspace::slot_worker - Rust pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+§public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+§signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for RewardSigningNotification
§impl Send for RewardSigningNotification
§impl Sync for RewardSigningNotification
§impl Unpin for RewardSigningNotification
§impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
pub struct RewardSigningNotification {
pub hash: H256,
- pub public_key: FarmerPublicKey,
- pub signature_sender: TracingUnboundedSender<FarmerSignature>,
+ pub public_key: FarmerPublicKey,
+ pub signature_sender: TracingUnboundedSender<FarmerSignature>,
}
Expand description
Notification with a hash that needs to be signed to receive reward and sender for signature.
Fields§
§hash: H256
Hash to be signed.
-public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
-signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
+public_key: FarmerPublicKey
Public key of the plot identity that should create signature.
+signature_sender: TracingUnboundedSender<FarmerSignature>
Sender that can be used to send signature for the header.
Trait Implementations§
source§impl Clone for RewardSigningNotification
impl Clone for RewardSigningNotification
source§fn clone(&self) -> RewardSigningNotification
fn clone(&self) -> RewardSigningNotification
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for RewardSigningNotification
impl Send for RewardSigningNotification
impl Sync for RewardSigningNotification
impl Unpin for RewardSigningNotification
impl UnwindSafe for RewardSigningNotification
Blanket Implementations§
§impl<T> AnySync for Twhere
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
index 9015d9427f..4444f3e7a9 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html
@@ -5,7 +5,7 @@
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -16,15 +16,15 @@
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
impl<T> AnySync for Twhere diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html index 9015d9427f..4444f3e7a9 100644 --- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html +++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorker.html @@ -5,7 +5,7 @@ PosTable: Table, Block: BlockT, Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static, - Client::Api: SubspaceApi<Block, FarmerPublicKey>, + Client::Api: SubspaceApi<Block, FarmerPublicKey>, E: Environment<Block, Error = Error> + Send + Sync, E::Proposer: Proposer<Block, Error = Error>, SO: SyncOracle + Send + Sync, @@ -16,15 +16,15 @@ BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
sourcepub fn new(
_: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
) -> Self
pub fn new( _: SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS> ) -> Self
Create new Subspace slot worker
-Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+
impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where +
Trait Implementations§
source§impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
Block: BlockT,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
- SO: SyncOracle + Send + Sync,
impl<PosTable, Block, Client, E, SO, L, BS, AS> PotSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where Block: BlockT, Client: HeaderBackend<Block> + ProvideRuntimeApi<Block>, - Client::Api: SubspaceApi<Block, FarmerPublicKey>, - SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
source§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ SO: SyncOracle + Send + Sync,
impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where + Client::Api: SubspaceApi<Block, FarmerPublicKey>, + SO: SyncOracle + Send + Sync,
source§fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
fn on_proof(&mut self, slot: Slot, checkpoints: PotCheckpoints)
source§impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where
PosTable: Table,
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
E: Environment<Block, Error = Error> + Send + Sync,
E::Proposer: Proposer<Block, Error = Error>,
SO: SyncOracle + Send + Sync,
@@ -33,7 +33,7 @@
Error: Error + Send + From<Error> + 'static,
AS: AuxStore + Send + Sync + 'static,
BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
impl<PosTable, Block, Client, E, Error, SO, L, BS, AS> SimpleSlotWorker<Block> for SubspaceSlotWorker<PosTable, Block, Client, E, SO, L, BS, AS>where PosTable: Table, Block: BlockT, Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + HeaderMetadata<Block, Error = Error> + AuxStore + 'static, - Client::Api: SubspaceApi<Block, FarmerPublicKey>, + Client::Api: SubspaceApi<Block, FarmerPublicKey>, E: Environment<Block, Error = Error> + Send + Sync, E::Proposer: Proposer<Block, Error = Error>, SO: SyncOracle + Send + Sync, @@ -33,7 +33,7 @@ Error: Error + Send + From<Error> + 'static, AS: AuxStore + Send + Sync + 'static, BlockNumber: From<<<Block as BlockT>::Header as Header>::Number>,
§type BlockImport = SharedBlockImport<Block>
type BlockImport = SharedBlockImport<Block>
BlockImport
.§type SyncOracle = SubspaceSyncOracle<SO>
type SyncOracle = SubspaceSyncOracle<SO>
SyncOracle
.§type JustificationSyncLink = L
type JustificationSyncLink = L
JustificationSyncLink
, allows hooking into the sync module to control the
-justification sync process.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
§type Claim = (PreDigest<Public, Public>, SubspaceJustification)
type Claim = (PreDigest<Public, Public>, SubspaceJustification)
source§fn logging_target(&self) -> &'static str
fn logging_target(&self) -> &'static str
source§fn block_import(&mut self) -> &mut Self::BlockImport
fn block_import(&mut self) -> &mut Self::BlockImport
BlockImport
.§type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
type CreateProposer = Pin<Box<dyn Future<Output = Result<<E as Environment<Block>>::Proposer, Error>> + Send, Global>>
source§fn logging_target(&self) -> &'static str
fn logging_target(&self) -> &'static str
source§fn block_import(&mut self) -> &mut Self::BlockImport
fn block_import(&mut self) -> &mut Self::BlockImport
BlockImport
.source§fn aux_data(
&self,
_parent: &Block::Header,
_slot: Slot
diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
index 242d1b4dbf..5c57ab2270 100644
--- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
+++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html
@@ -14,7 +14,7 @@
pub max_block_proposal_slot_portion: Option<SlotProportion>,
pub telemetry: Option<TelemetryHandle>,
pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
fn aux_data( &self, _parent: &Block::Header, _slot: Slot diff --git a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html index 242d1b4dbf..5c57ab2270 100644 --- a/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html +++ b/sc_consensus_subspace/slot_worker/struct.SubspaceSlotWorkerOptions.html @@ -14,7 +14,7 @@ pub max_block_proposal_slot_portion: Option<SlotProportion>, pub telemetry: Option<TelemetryHandle>, pub offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>, - pub pot_verifier: PotVerifier, + pub pot_verifier: PotVerifier,
Expand description
Parameters for SubspaceSlotWorker
Fields§
§client: Arc<Client>
The client to use
env: E
The environment we are producing blocks for.
@@ -36,7 +36,7 @@telemetry: Option<TelemetryHandle>
Handle use to report telemetries.
offchain_tx_pool_factory: OffchainTransactionPoolFactory<Block>
The offchain transaction pool factory.
Will be used when sending equivocation reports and votes.
-pot_verifier: PotVerifier
Proof of time verifier
+pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
impl<Block, Client, E, SO, L, BS, AS> !RefUnwindSafe for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>
impl<Block, Client, E, SO, L, BS, AS> Send for SubspaceSlotWorkerOptions<Block, Client, E, SO, L, BS, AS>where
AS: Send + Sync,
BS: Send,
diff --git a/sc_consensus_subspace/struct.SubspaceLink.html b/sc_consensus_subspace/struct.SubspaceLink.html
index 5fd306cfd1..6688e72202 100644
--- a/sc_consensus_subspace/struct.SubspaceLink.html
+++ b/sc_consensus_subspace/struct.SubspaceLink.html
@@ -1,5 +1,5 @@
SubspaceLink in sc_consensus_subspace - Rust Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@
&self,
block_number: NumberFor<Block>
) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<Block> !RefUnwindSafe for SubspaceLink<Block>
§impl<Block> Send for SubspaceLink<Block>
§impl<Block> Sync for SubspaceLink<Block>
§impl<Block> Unpin for SubspaceLink<Block>
§impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
How many blocks can be verified concurrently. Read moresource§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
\ No newline at end of file
diff --git a/sc_subspace_block_relay/fn.build_consensus_relay.html b/sc_subspace_block_relay/fn.build_consensus_relay.html
index f8d9a7d690..5a65b98ee2 100644
--- a/sc_subspace_block_relay/fn.build_consensus_relay.html
+++ b/sc_subspace_block_relay/fn.build_consensus_relay.html
@@ -6,6 +6,6 @@
) -> Result<BlockRelayParams<Block>, BlockRelayConfigurationError>where
Block: BlockT,
Client: HeaderBackend<Block> + BlockBackend<Block> + ProvideRuntimeApi<Block> + 'static,
- Client::Api: SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceApi<Block, FarmerPublicKey>,
Pool: TransactionPool<Block = Block> + 'static,Expand description
Sets up the relay components.
\ No newline at end of file
diff --git a/src/subspace_farmer/lib.rs.html b/src/subspace_farmer/lib.rs.html
index 0ae31e2955..8ba884c293 100644
--- a/src/subspace_farmer/lib.rs.html
+++ b/src/subspace_farmer/lib.rs.html
@@ -49,8 +49,10 @@
49
50
51
+52
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
Struct sc_consensus_subspace::SubspaceLink
source · pub struct SubspaceLink<Block: BlockT> { /* private fields */ }
Expand description
State that must be shared between the import queue and the authoring logic.
-Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
pub fn new(chain_constants: ChainConstants, kzg: Kzg) -> Self
Create new instance.
+Implementations§
source§impl<Block: BlockT> SubspaceLink<Block>
impl<Block: BlockT> SubspaceLink<Block>
sourcepub fn new_slot_notification_stream(
&self
) -> SubspaceNotificationStream<NewSlotNotification>
pub fn new_slot_notification_stream( &self ) -> SubspaceNotificationStream<NewSlotNotification>
Get stream with notifications about new slot arrival with ability to send solution back.
@@ -20,7 +20,7 @@ &self, block_number: NumberFor<Block> ) -> Vec<SegmentHeader>Get blocks that are expected to be included at specified block number.
-sourcepub fn chain_constants(&self) -> &ChainConstants
pub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
+sourcepub fn chain_constants(&self) -> &ChainConstants
pub fn chain_constants(&self) -> &ChainConstants
Subspace chain constants.
Trait Implementations§
source§impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
impl<Block: Clone + BlockT> Clone for SubspaceLink<Block>
source§fn clone(&self) -> SubspaceLink<Block>
fn clone(&self) -> SubspaceLink<Block>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<Block> !RefUnwindSafe for SubspaceLink<Block>
impl<Block> Send for SubspaceLink<Block>
impl<Block> Sync for SubspaceLink<Block>
impl<Block> Unpin for SubspaceLink<Block>
impl<Block> !UnwindSafe for SubspaceLink<Block>
Blanket Implementations§
§impl<T> Any for Twhere
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
index 629da39ddb..ec06e5d448 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html
@@ -5,14 +5,14 @@
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
impl<T> Any for Twhere diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html index 629da39ddb..ec06e5d448 100644 --- a/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html +++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifier.html @@ -5,14 +5,14 @@ Block: BlockT, BlockNumber: From<NumberFor<Block>>, Client: AuxStore + HeaderBackend<Block> + ProvideRuntimeApi<Block>, - Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>, + Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>, SelectChain: SelectChain<Block>,
sourcepub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
pub fn new(options: SubspaceVerifierOptions<Block, Client, SelectChain>) -> Self
Create new instance
Trait Implementations§
source§impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where
PosTable: Table,
Block: BlockT,
BlockNumber: From<NumberFor<Block>>,
Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore,
- Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
+ Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>,
SelectChain: SelectChain<Block>,
impl<PosTable, Block, Client, SelectChain> Verifier<Block> for SubspaceVerifier<PosTable, Block, Client, SelectChain>where PosTable: Table, Block: BlockT, BlockNumber: From<NumberFor<Block>>, Client: HeaderBackend<Block> + ProvideRuntimeApi<Block> + Send + Sync + AuxStore, - Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>, + Client::Api: BlockBuilderApi<Block> + SubspaceApi<Block, FarmerPublicKey>, SelectChain: SelectChain<Block>,
source§fn verification_concurrency(&self) -> NonZeroUsize
fn verification_concurrency(&self) -> NonZeroUsize
source§fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
fn verify<'life0, 'async_trait>(
&'life0 self,
block: BlockImportParams<Block>
diff --git a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
index ba754f50e3..de9690daf1 100644
--- a/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
+++ b/sc_consensus_subspace/verifier/struct.SubspaceVerifierOptions.html
@@ -1,7 +1,7 @@
SubspaceVerifierOptions in sc_consensus_subspace::verifier - Rust pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-§chain_constants: ChainConstants
Subspace chain constants
+§chain_constants: ChainConstants
Subspace chain constants
§kzg: Kzg
Kzg instance
§select_chain: SelectChain
Chain selection rule
§telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@
§reward_signing_context: SigningContext
Context for reward signing
§sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-§pot_verifier: PotVerifier
Proof of time verifier
+§pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
§impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
§impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where
Client: Send + Sync,
SelectChain: Send,
§impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where
diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
index 677e5bc34b..b9011e3a9a 100644
--- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
+++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html
@@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
@@ -16,7 +16,7 @@
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
Ger metadata necessary for farmer operationsource§fn submit_solution_response(
&self,
diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
index 321a18dba7..1f56e3df6c 100644
--- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
+++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html
@@ -90,6 +90,6 @@
Implementors§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
pub struct SubspaceVerifierOptions<Block, Client, SelectChain>where
Block: BlockT,{
pub client: Arc<Client>,
- pub chain_constants: ChainConstants,
+ pub chain_constants: ChainConstants,
pub kzg: Kzg,
pub select_chain: SelectChain,
pub telemetry: Option<TelemetryHandle>,
@@ -9,10 +9,10 @@
pub reward_signing_context: SigningContext,
pub sync_target_block_number: Arc<AtomicU32>,
pub is_authoring_blocks: bool,
- pub pot_verifier: PotVerifier,
+ pub pot_verifier: PotVerifier,
}
Expand description
Options for Subspace block verifier
Fields§
§client: Arc<Client>
Substrate client
-chain_constants: ChainConstants
Subspace chain constants
+chain_constants: ChainConstants
Subspace chain constants
kzg: Kzg
Kzg instance
select_chain: SelectChain
Chain selection rule
telemetry: Option<TelemetryHandle>
Telemetry
@@ -21,7 +21,7 @@reward_signing_context: SigningContext
Context for reward signing
sync_target_block_number: Arc<AtomicU32>
Approximate target block number for syncing purposes
Whether this node is authoring blocks
-pot_verifier: PotVerifier
Proof of time verifier
+pot_verifier: PotVerifier
Proof of time verifier
Auto Trait Implementations§
impl<Block, Client, SelectChain> !RefUnwindSafe for SubspaceVerifierOptions<Block, Client, SelectChain>
impl<Block, Client, SelectChain> Send for SubspaceVerifierOptions<Block, Client, SelectChain>where Client: Send + Sync, SelectChain: Send,
impl<Block, Client, SelectChain> Sync for SubspaceVerifierOptions<Block, Client, SelectChain>where diff --git a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html index 677e5bc34b..b9011e3a9a 100644 --- a/sc_consensus_subspace_rpc/struct.SubspaceRpc.html +++ b/sc_consensus_subspace_rpc/struct.SubspaceRpc.html @@ -4,7 +4,7 @@
Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
impl<Block, Client, SO, AS> SubspaceRpc<Block, Client, SO, AS>where Block: BlockT, Client: ProvideRuntimeApi<Block> + HeaderBackend<Block>, - Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>, + Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey>, SO: SyncOracle + Send + Sync + Clone + 'static, AS: AuxStore + Send + Sync + 'static,
SubspaceRpc
is used for notifying subscribers about arrival of new slots and for
submission of solutions (or lack thereof).
Trait Implementations§
source§impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where
Block: BlockT,
Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static,
- Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
+ Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>,
SO: SyncOracle + Send + Sync + Clone + 'static,
AS: AuxStore + Send + Sync + 'static,
impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where Block: BlockT, Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static, - Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>, + Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>, SO: SyncOracle + Send + Sync + Clone + 'static, AS: AuxStore + Send + Sync + 'static,
source§fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
fn get_farmer_app_info(&self) -> RpcResult<FarmerAppInfo>
fn submit_solution_response( &self, diff --git a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html index 321a18dba7..1f56e3df6c 100644 --- a/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html +++ b/sc_consensus_subspace_rpc/trait.SubspaceRpcApiServer.html @@ -90,6 +90,6 @@
Implementors§
impl<Block, Client, SO, AS> SubspaceRpcApiServer for SubspaceRpc<Block, Client, SO, AS>where Block: BlockT, Client: ProvideRuntimeApi<Block> + HeaderBackend<Block> + BlockBackend<Block> + Send + Sync + 'static, - Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>, + Client::Api: SubspaceRuntimeApi<Block, FarmerPublicKey> + ObjectsApi<Block>, SO: SyncOracle + Send + Sync + Clone + 'static, AS: AuxStore + Send + Sync + 'static,
Expand description
Sets up the relay components.
#![feature(
array_chunks,
+ assert_matches,
const_option,
hash_extract_if,
impl_trait_in_assoc_type,
diff --git a/src/subspace_farmer/piece_cache.rs.html b/src/subspace_farmer/piece_cache.rs.html
index 52880ebca0..330101b8fb 100644
--- a/src/subspace_farmer/piece_cache.rs.html
+++ b/src/subspace_farmer/piece_cache.rs.html
@@ -778,7 +778,23 @@
778
779
780
-
use crate::node_client::NodeClient;
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+
#[cfg(test)]
+mod tests;
+
+use crate::node_client::NodeClient;
use crate::single_disk_farm::piece_cache::{DiskPieceCache, Offset};
use crate::utils::AsyncJoinOnDrop;
use event_listener_primitives::{Bag, HandlerId};
@@ -791,7 +807,7 @@
use std::num::NonZeroU16;
use std::sync::Arc;
use std::{fmt, mem};
-use subspace_core_primitives::{Piece, PieceIndex, SegmentIndex};
+use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_farmer_components::plotting::{PieceGetter, PieceGetterRetryPolicy};
use subspace_networking::libp2p::kad::{ProviderRecord, RecordKey};
use subspace_networking::libp2p::PeerId;
@@ -888,6 +904,21 @@
return;
}
+ let mut segment_headers_notifications =
+ match self.node_client.subscribe_archived_segment_headers().await {
+ Ok(segment_headers_notifications) => segment_headers_notifications,
+ Err(error) => {
+ error!(%error, "Failed to subscribe to archived segments notifications");
+ return;
+ }
+ };
+
+ // Keep up with segment indices that were potentially created since reinitialization,
+ // depending on the size of the diff this may pause block production for a while (due to
+ // subscription we have created above)
+ self.keep_up_after_initial_sync(&piece_getter, &mut worker_state)
+ .await;
+
loop {
select! {
maybe_command = worker_receiver.recv().fuse() => {
@@ -898,10 +929,14 @@
self.handle_command(command, &piece_getter, &mut worker_state).await;
}
- _ = self.keep_up_sync(&piece_getter, &mut worker_state).fuse() => {
- // Keep-up sync only ends with subscription, which lasts for duration of an
- // instance
- return;
+ maybe_segment_header = segment_headers_notifications.next().fuse() => {
+ if let Some(segment_header) = maybe_segment_header {
+ self.process_segment_header(segment_header, &mut worker_state).await;
+ } else {
+ // Keep-up sync only ends with subscription, which lasts for duration of an
+ // instance
+ return;
+ }
}
}
}
@@ -938,10 +973,10 @@
// Making offset as unoccupied and remove corresponding key from heap
cache.free_offsets.push(offset);
match cache.backend.read_piece_index(offset) {
- Some(piece_index) => {
+ Ok(Some(piece_index)) => {
worker_state.heap.remove(KeyWrapper(piece_index));
}
- None => {
+ Ok(None) => {
warn!(
%disk_farm_index,
%offset,
@@ -949,6 +984,15 @@
not freeing heap element"
);
}
+ Err(error) => {
+ error!(
+ %error,
+ %disk_farm_index,
+ ?key,
+ %offset,
+ "Error while reading piece from cache, might be a disk corruption"
+ );
+ }
}
return;
}
@@ -1172,33 +1216,15 @@
info!("Finished piece cache synchronization");
}
- async fn keep_up_sync<PG>(&self, piece_getter: &PG, worker_state: &mut CacheWorkerState)
- where
- PG: PieceGetter,
- {
- let mut segment_headers_notifications =
- match self.node_client.subscribe_archived_segment_headers().await {
- Ok(segment_headers_notifications) => segment_headers_notifications,
- Err(error) => {
- error!(%error, "Failed to subscribe to archived segments notifications");
- return;
- }
- };
-
- // Keep up with segment indices that were potentially created since reinitialization,
- // depending on the size of the diff this may pause block production for a while (due to
- // subscription we have created above)
- self.keep_up_after_initial_sync(piece_getter, worker_state)
- .await;
-
- while let Some(segment_header) = segment_headers_notifications.next().await {
- let segment_index = segment_header.segment_index();
- debug!(%segment_index, "Starting to process newly archived segment");
-
- if worker_state.last_segment_index >= segment_index {
- continue;
- }
+ async fn process_segment_header(
+ &self,
+ segment_header: SegmentHeader,
+ worker_state: &mut CacheWorkerState,
+ ) {
+ let segment_index = segment_header.segment_index();
+ debug!(%segment_index, "Starting to process newly archived segment");
+ if worker_state.last_segment_index < segment_index {
// TODO: Can probably do concurrency here
for piece_index in segment_index.segment_piece_indexes() {
if !worker_state
@@ -1240,22 +1266,22 @@
}
worker_state.last_segment_index = segment_index;
+ }
- match self
- .node_client
- .acknowledge_archived_segment_header(segment_index)
- .await
- {
- Ok(()) => {
- debug!(%segment_index, "Acknowledged archived segment");
- }
- Err(error) => {
- error!(%segment_index, ?error, "Failed to acknowledge archived segment");
- }
- };
+ match self
+ .node_client
+ .acknowledge_archived_segment_header(segment_index)
+ .await
+ {
+ Ok(()) => {
+ debug!(%segment_index, "Acknowledged archived segment");
+ }
+ Err(error) => {
+ error!(%segment_index, ?error, "Failed to acknowledge archived segment");
+ }
+ };
- debug!(%segment_index, "Finished processing newly archived segment");
- }
+ debug!(%segment_index, "Finished processing newly archived segment");
}
async fn keep_up_after_initial_sync<PG>(
@@ -1294,12 +1320,12 @@
for piece_index in piece_indices {
let key = KeyWrapper(piece_index);
if !worker_state.heap.should_include_key(key) {
- trace!(%piece_index, "Piece doesn't need to be cached #1");
+ trace!(%piece_index, "Piece doesn't need to be cached #2");
continue;
}
- trace!(%piece_index, "Piece needs to be cached #1");
+ trace!(%piece_index, "Piece needs to be cached #2");
let result = piece_getter
.get_piece(
diff --git a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
index ea39efd506..7fb1be1a0e 100644
--- a/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
+++ b/src/subspace_farmer/single_disk_farm/piece_cache.rs.html
@@ -232,7 +232,29 @@
232
233
234
-
use derive_more::Display;
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+
#[cfg(test)]
+mod tests;
+
+use derive_more::Display;
use std::fs::{File, OpenOptions};
use std::path::Path;
use std::sync::Arc;
@@ -288,7 +310,20 @@
impl DiskPieceCache {
pub(super) const FILE_NAME: &'static str = "piece_cache.bin";
- pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ #[cfg(not(test))]
+ pub(super) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ #[cfg(test)]
+ pub(crate) fn open(directory: &Path, capacity: usize) -> Result<Self, DiskPieceCacheError> {
+ Self::open_internal(directory, capacity)
+ }
+
+ pub(super) fn open_internal(
+ directory: &Path,
+ capacity: usize,
+ ) -> Result<Self, DiskPieceCacheError> {
if capacity == 0 {
return Err(DiskPieceCacheError::ZeroCapacity);
}
@@ -333,28 +368,13 @@
let mut element = vec![0; Self::element_size()];
(0..self.inner.num_elements).map(move |offset| {
- if let Err(error) =
- file.read_exact_at(&mut element, (offset * Self::element_size()) as u64)
- {
- warn!(%error, %offset, "Failed to read cache element #1");
- return (Offset(offset), None);
+ match Self::read_piece_internal(file, offset, &mut element) {
+ Ok(maybe_piece_index) => (Offset(offset), maybe_piece_index),
+ Err(error) => {
+ warn!(%error, %offset, "Failed to read cache element");
+ (Offset(offset), None)
+ }
}
-
- let (piece_index_bytes, piece_bytes) = element.split_at(PieceIndex::SIZE);
- let piece_index = PieceIndex::from_bytes(
- piece_index_bytes
- .try_into()
- .expect("Statically known to have correct size; qed"),
- );
- // Piece index zero might mean we have piece index zero or just an empty space
- let piece_index =
- if piece_index != PieceIndex::ZERO || piece_bytes.iter().any(|&byte| byte != 0) {
- Some(piece_index)
- } else {
- None
- };
-
- (Offset(offset), piece_index)
})
}
@@ -399,24 +419,20 @@
///
/// NOTE: it is possible to do concurrent reads and writes, higher level logic must ensure this
/// doesn't happen for the same piece being accessed!
- pub(crate) fn read_piece_index(&self, offset: Offset) -> Option<PieceIndex> {
+ pub(crate) fn read_piece_index(
+ &self,
+ offset: Offset,
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return None;
- }
-
- let mut piece_index_bytes = [0; PieceIndex::SIZE];
-
- if let Err(error) = self.inner.file.read_exact_at(
- &mut piece_index_bytes,
- (offset * Self::element_size()) as u64,
- ) {
- warn!(%error, %offset, "Failed to read cache piece index");
- return None;
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
- Some(PieceIndex::from_bytes(piece_index_bytes))
+ Self::read_piece_internal(&self.inner.file, offset, &mut vec![0; Self::element_size()])
}
/// Read piece from cache at specified offset.
@@ -429,22 +445,39 @@
let Offset(offset) = offset;
if offset >= self.inner.num_elements {
warn!(%offset, "Trying to read piece out of range, this must be an implementation bug");
- return Ok(None);
+ return Err(DiskPieceCacheError::OffsetOutsideOfRange {
+ provided: offset,
+ max: self.inner.num_elements - 1,
+ });
}
let mut element = vec![0; Self::element_size()];
- self.inner
- .file
- .read_exact_at(&mut element, (offset * Self::element_size()) as u64)?;
+ if Self::read_piece_internal(&self.inner.file, offset, &mut element)?.is_some() {
+ let mut piece = Piece::default();
+ piece.copy_from_slice(&element[PieceIndex::SIZE..][..Piece::SIZE]);
+ Ok(Some(piece))
+ } else {
+ Ok(None)
+ }
+ }
+
+ fn read_piece_internal(
+ file: &File,
+ offset: usize,
+ element: &mut [u8],
+ ) -> Result<Option<PieceIndex>, DiskPieceCacheError> {
+ file.read_exact_at(element, (offset * Self::element_size()) as u64)?;
let (piece_index_bytes, remaining_bytes) = element.split_at(PieceIndex::SIZE);
let (piece_bytes, expected_checksum) = remaining_bytes.split_at(Piece::SIZE);
- let mut piece = Piece::default();
- piece.copy_from_slice(piece_bytes);
// Verify checksum
- let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece.as_ref()]);
+ let actual_checksum = blake3_hash_list(&[piece_index_bytes, piece_bytes]);
if actual_checksum != expected_checksum {
+ if element.iter().all(|&byte| byte == 0) {
+ return Ok(None);
+ }
+
debug!(
actual_checksum = %hex::encode(actual_checksum),
expected_checksum = %hex::encode(expected_checksum),
@@ -454,7 +487,12 @@
return Err(DiskPieceCacheError::ChecksumMismatch);
}
- Ok(Some(piece))
+ let piece_index = PieceIndex::from_bytes(
+ piece_index_bytes
+ .try_into()
+ .expect("Statically known to have correct size; qed"),
+ );
+ Ok(Some(piece_index))
}
pub(crate) fn wipe(directory: &Path) -> io::Result<()> {
diff --git a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
index d71b657d0d..d60ca16052 100644
--- a/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
+++ b/subspace_archiving/archiver/enum.ArchiverInstantiationError.html
@@ -1,13 +1,13 @@
ArchiverInstantiationError in subspace_archiving::archiver - Rust pub enum ArchiverInstantiationError {
FailedToInitializeErasureCoding(String),
- InvalidLastArchivedBlock(BlockNumber),
+ InvalidLastArchivedBlock(BlockNumber),
InvalidBlockSmallSize {
block_bytes: u32,
archived_block_bytes: u32,
},
}
Expand description
Archiver instantiation error
Variants§
§FailedToInitializeErasureCoding(String)
Failed to initialize erasure coding
-§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
+§InvalidLastArchivedBlock(BlockNumber)
Invalid last archived block, its size is the same as encoded block
§InvalidBlockSmallSize
Fields
Invalid block, its size is smaller than already archived number of bytes
diff --git a/subspace_archiving/archiver/enum.SegmentItem.html b/subspace_archiving/archiver/enum.SegmentItem.html
index da76de1c26..852ad914c1 100644
--- a/subspace_archiving/archiver/enum.SegmentItem.html
+++ b/subspace_archiving/archiver/enum.SegmentItem.html
@@ -12,7 +12,7 @@
bytes: Vec<u8>,
/* private fields */
},
- ParentSegmentHeader(SegmentHeader),
+ ParentSegmentHeader(SegmentHeader),
}Expand description
Kinds of items that are contained within a segment
Variants§
§Padding
Special dummy enum variant only used as an implementation detail for padding purposes
§Block
Contains the beginning of the block inside, remainder will be found in subsequent segments
§BlockContinuation
Continuation of the partial block spilled over into the next segment
-§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
+§ParentSegmentHeader(SegmentHeader)
Segment header of the parent
Trait Implementations§
source§impl Clone for SegmentItem
source§fn clone(&self) -> SegmentItem
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for SegmentItem
source§impl Decode for SegmentItem
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
Attempt to deserialise the value from input.§fn decode_into<I>(
diff --git a/subspace_archiving/archiver/fn.is_piece_valid.html b/subspace_archiving/archiver/fn.is_piece_valid.html
index bf9949321f..bccd60ad8a 100644
--- a/subspace_archiving/archiver/fn.is_piece_valid.html
+++ b/subspace_archiving/archiver/fn.is_piece_valid.html
@@ -1,7 +1,7 @@
is_piece_valid in subspace_archiving::archiver - Rust Function subspace_archiving::archiver::is_piece_valid
source · pub fn is_piece_valid(
- kzg: &Kzg,
- piece: &PieceArray,
- segment_commitment: &SegmentCommitment,
+ kzg: &Kzg,
+ piece: &PieceArray,
+ segment_commitment: &SegmentCommitment,
position: u32
) -> bool
Expand description
Validate witness embedded within a piece produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
index 4dd33bf6f8..707711c861 100644
--- a/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
+++ b/subspace_archiving/archiver/fn.is_record_commitment_hash_valid.html
@@ -1,8 +1,8 @@
is_record_commitment_hash_valid in subspace_archiving::archiver - Rust pub fn is_record_commitment_hash_valid(
- kzg: &Kzg,
- record_commitment_hash: &Scalar,
- commitment: &SegmentCommitment,
- witness: &RecordWitness,
+ kzg: &Kzg,
+ record_commitment_hash: &Scalar,
+ commitment: &SegmentCommitment,
+ witness: &RecordWitness,
position: u32
) -> bool
Expand description
Validate witness for record commitment hash produced by archiver
\ No newline at end of file
diff --git a/subspace_archiving/archiver/struct.Archiver.html b/subspace_archiving/archiver/struct.Archiver.html
index 51f9c2a594..2f6e1855a9 100644
--- a/subspace_archiving/archiver/struct.Archiver.html
+++ b/subspace_archiving/archiver/struct.Archiver.html
@@ -1,27 +1,27 @@
Archiver in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::Archiver
source · pub struct Archiver { /* private fields */ }
Expand description
Block archiver for Subspace blockchain.
It takes new confirmed (at K
depth) blocks and concatenates them into a buffer, buffer is
-sliced into segments of [RecordedHistorySegment::SIZE
] size, segments are sliced into source
-records of [RawRecord::SIZE
], records are erasure coded, committed to with [Kzg
], then
+sliced into segments of RecordedHistorySegment::SIZE
size, segments are sliced into source
+records of RawRecord::SIZE
, records are erasure coded, committed to with Kzg
, then
commitments with witnesses are appended and records become pieces that are returned alongside
corresponding segment header header.
Panics
Panics when operating on blocks, whose length doesn’t fit into u32 (should never be the case in
blockchain context anyway).
-Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
+Implementations§
source§impl Archiver
sourcepub fn new(kzg: Kzg) -> Result<Self, ArchiverInstantiationError>
Create a new instance with specified record size and recorded history segment size.
Note: this is the only way to instantiate object archiver, while block archiver can be
instantiated with BlockArchiver::with_initial_state()
in case of restarts.
sourcepub fn with_initial_state(
- kzg: Kzg,
- segment_header: SegmentHeader,
+ kzg: Kzg,
+ segment_header: SegmentHeader,
encoded_block: &[u8],
- object_mapping: BlockObjectMapping
+ object_mapping: BlockObjectMapping
) -> Result<Self, ArchiverInstantiationError>
Create a new instance of the archiver with initial state in case of restart.
block
corresponds to last_archived_block
and will be processed accordingly to its state.
-sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
+sourcepub fn last_archived_block_number(&self) -> Option<BlockNumber>
Get last archived block if there was any
sourcepub fn add_block(
&mut self,
bytes: Vec<u8>,
- object_mapping: BlockObjectMapping,
+ object_mapping: BlockObjectMapping,
incremental: bool
) -> Vec<NewArchivedSegment>
Adds new block to internal buffer, potentially producing pieces and segment header headers.
Incremental archiving can be enabled if amortized block addition cost is preferred over
diff --git a/subspace_archiving/archiver/struct.NewArchivedSegment.html b/subspace_archiving/archiver/struct.NewArchivedSegment.html
index 26e7d30216..3c92a39f06 100644
--- a/subspace_archiving/archiver/struct.NewArchivedSegment.html
+++ b/subspace_archiving/archiver/struct.NewArchivedSegment.html
@@ -1,12 +1,12 @@
NewArchivedSegment in subspace_archiving::archiver - Rust Struct subspace_archiving::archiver::NewArchivedSegment
source · pub struct NewArchivedSegment {
- pub segment_header: SegmentHeader,
- pub pieces: ArchivedHistorySegment,
- pub object_mapping: Vec<PieceObjectMapping>,
+ pub segment_header: SegmentHeader,
+ pub pieces: ArchivedHistorySegment,
+ pub object_mapping: Vec<PieceObjectMapping>,
}
Expand description
Newly archived segment as a combination of segment header hash, segment index and corresponding
archived history segment containing pieces
-Fields§
§segment_header: SegmentHeader
Segment header
-§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
-§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
+Fields§
§segment_header: SegmentHeader
Segment header
+§pieces: ArchivedHistorySegment
Segment of archived history containing pieces
+§object_mapping: Vec<PieceObjectMapping>
Mappings for objects stored in corresponding pieces.
NOTE: Only half (source pieces) will have corresponding mapping item in this Vec
.
Trait Implementations§
source§impl Clone for NewArchivedSegment
source§fn clone(&self) -> NewArchivedSegment
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for NewArchivedSegment
source§impl Decode for NewArchivedSegment
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
diff --git a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
index 5d466ed107..1f2cabbbe9 100644
--- a/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
+++ b/subspace_archiving/piece_reconstructor/struct.PiecesReconstructor.html
@@ -1,15 +1,15 @@
PiecesReconstructor in subspace_archiving::piece_reconstructor - Rust pub struct PiecesReconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
-Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
+
Implementations§
source§impl PiecesReconstructor
sourcepub fn new(kzg: Kzg) -> Result<Self, ReconstructorInstantiationError>
sourcepub fn reconstruct_segment(
&self,
- segment_pieces: &[Option<Piece>]
-) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
+ segment_pieces: &[Option<Piece>]
+) -> Result<ArchivedHistorySegment, ReconstructorError>
Returns all the pieces for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present, the rest will be recovered
automatically due to use of erasure coding if needed).
sourcepub fn reconstruct_piece(
&self,
- segment_pieces: &[Option<Piece>],
+ segment_pieces: &[Option<Piece>],
piece_position: usize
-) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
+) -> Result<Piece, ReconstructorError>
Returns the missing piece for a segment using given set of pieces of a segment of the archived
history (any half of all pieces are required to be present).
Trait Implementations§
source§impl Clone for PiecesReconstructor
source§fn clone(&self) -> PiecesReconstructor
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl !RefUnwindSafe for PiecesReconstructor
§impl Send for PiecesReconstructor
§impl Sync for PiecesReconstructor
§impl Unpin for PiecesReconstructor
§impl !UnwindSafe for PiecesReconstructor
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_archiving/reconstructor/enum.ReconstructorError.html b/subspace_archiving/reconstructor/enum.ReconstructorError.html
index 682675c45a..370d1cdd7c 100644
--- a/subspace_archiving/reconstructor/enum.ReconstructorError.html
+++ b/subspace_archiving/reconstructor/enum.ReconstructorError.html
@@ -2,13 +2,13 @@
DataShardsReconstruction(String),
SegmentDecoding(Error),
IncorrectSegmentOrder {
- expected_segment_index: SegmentIndex,
- actual_segment_index: SegmentIndex,
+ expected_segment_index: SegmentIndex,
+ actual_segment_index: SegmentIndex,
},
}Expand description
Reconstructor-related instantiation error
Variants§
§DataShardsReconstruction(String)
Error during data shards reconstruction
§SegmentDecoding(Error)
Segment size is not bigger than record size
-§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
+§IncorrectSegmentOrder
Incorrect segment order, each next segment must have monotonically increasing segment index
Trait Implementations§
source§impl Clone for ReconstructorError
source§fn clone(&self) -> ReconstructorError
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructorError
source§impl Display for ReconstructorError
source§impl Error for ReconstructorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl PartialEq<ReconstructorError> for ReconstructorError
source§fn eq(&self, other: &ReconstructorError) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl StructuralPartialEq for ReconstructorError
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructorError
§impl Send for ReconstructorError
§impl Sync for ReconstructorError
§impl Unpin for ReconstructorError
§impl UnwindSafe for ReconstructorError
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.ReconstructedContents.html b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
index eeebaf7d1b..6c2eacc964 100644
--- a/subspace_archiving/reconstructor/struct.ReconstructedContents.html
+++ b/subspace_archiving/reconstructor/struct.ReconstructedContents.html
@@ -1,10 +1,10 @@
ReconstructedContents in subspace_archiving::reconstructor - Rust pub struct ReconstructedContents {
- pub segment_header: Option<SegmentHeader>,
- pub blocks: Vec<(BlockNumber, Vec<u8>)>,
+ pub segment_header: Option<SegmentHeader>,
+ pub blocks: Vec<(BlockNumber, Vec<u8>)>,
}
Expand description
Data structure that contains information reconstructed from given segment (potentially using
information from segments that were added previously)
-Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
-§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
+Fields§
§segment_header: Option<SegmentHeader>
Segment header stored in a segment
+§blocks: Vec<(BlockNumber, Vec<u8>)>
Reconstructed encoded blocks with their block numbers
Trait Implementations§
source§impl Clone for ReconstructedContents
source§fn clone(&self) -> ReconstructedContents
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for ReconstructedContents
source§impl Default for ReconstructedContents
source§fn default() -> ReconstructedContents
Returns the “default value” for a type. Read moresource§impl PartialEq<ReconstructedContents> for ReconstructedContents
source§fn eq(&self, other: &ReconstructedContents) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
.source§impl Eq for ReconstructedContents
source§impl StructuralEq for ReconstructedContents
source§impl StructuralPartialEq for ReconstructedContents
Auto Trait Implementations§
§impl RefUnwindSafe for ReconstructedContents
§impl Send for ReconstructedContents
§impl Sync for ReconstructedContents
§impl Unpin for ReconstructedContents
§impl UnwindSafe for ReconstructedContents
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_archiving/reconstructor/struct.Reconstructor.html b/subspace_archiving/reconstructor/struct.Reconstructor.html
index 2a3b106ce2..fa8678c50e 100644
--- a/subspace_archiving/reconstructor/struct.Reconstructor.html
+++ b/subspace_archiving/reconstructor/struct.Reconstructor.html
@@ -1,7 +1,7 @@
Reconstructor in subspace_archiving::reconstructor - Rust Struct subspace_archiving::reconstructor::Reconstructor
source · pub struct Reconstructor { /* private fields */ }
Expand description
Reconstructor helps to retrieve blocks from archived pieces.
Implementations§
source§impl Reconstructor
sourcepub fn new() -> Result<Self, ReconstructorInstantiationError>
sourcepub fn add_segment(
&mut self,
- segment_pieces: &[Option<Piece>]
+ segment_pieces: &[Option<Piece>]
) -> Result<ReconstructedContents, ReconstructorError>
Given a set of pieces of a segment of the archived history (any half of all pieces are
required to be present, the rest will be recovered automatically due to use of erasure
coding if needed), reconstructs and returns segment header and a list of encoded blocks with
diff --git a/subspace_erasure_coding/struct.ErasureCoding.html b/subspace_erasure_coding/struct.ErasureCoding.html
index 1809985666..ece10b5510 100644
--- a/subspace_erasure_coding/struct.ErasureCoding.html
+++ b/subspace_erasure_coding/struct.ErasureCoding.html
@@ -4,28 +4,28 @@
Number of shards supported is 2^scale
, half of shards are source data and the other half
are parity.
sourcepub fn max_shards(&self) -> usize
Max number of shards supported (both source and parity together)
-sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
+sourcepub fn extend(&self, source: &[Scalar]) -> Result<Vec<Scalar>, String>
Extend sources using erasure coding.
Returns parity data.
-sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
+sourcepub fn recover(&self, shards: &[Option<Scalar>]) -> Result<Vec<Scalar>, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_poly(
&self,
- shards: &[Option<Scalar>]
-) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
+ shards: &[Option<Scalar>]
+) -> Result<Polynomial, String>
Recovery of missing shards from given shards (at least 1/2 should be Some
) in form of
normalized polynomial (allows to not do inverse FFT afterwards if polynomial is desired).
Both in input and output source shards are interleaved with parity shards:
source, parity, source, parity, …
sourcepub fn recover_source(
&self,
- shards: &[Option<Scalar>]
-) -> Result<impl ExactSizeIterator<Item = Scalar>, String>
Recovery of source shards from given shards (at least 1/2 should be Some
).
+ shards: &[Option<Scalar>]
+) -> Result<impl ExactSizeIterator<Item = Scalar>, String>Recovery of source shards from given shards (at least 1/2 should be Some
).
The same as ErasureCoding::recover()
, but returns only source shards in form of an
iterator.
sourcepub fn extend_commitments(
&self,
- commitments: &[Commitment]
-) -> Result<Vec<Commitment>, String>
Extend commitments using erasure coding.
+ commitments: &[Commitment]
+) -> Result<Vec<Commitment>, String>Extend commitments using erasure coding.
Returns both source and parity commitments interleaved.
Trait Implementations§
source§impl Clone for ErasureCoding
source§fn clone(&self) -> ErasureCoding
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for ErasureCoding
§impl Send for ErasureCoding
§impl Sync for ErasureCoding
§impl Unpin for ErasureCoding
§impl UnwindSafe for ErasureCoding
Blanket Implementations§
source§impl<T> Borrow<T> for Twhere
diff --git a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
index 9859dcbe16..8d047caa32 100644
--- a/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
+++ b/subspace_farmer/constant.KNOWN_PEERS_CACHE_SIZE.html
@@ -1,2 +1,2 @@
-KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
+KNOWN_PEERS_CACHE_SIZE in subspace_farmer - Rust Constant subspace_farmer::KNOWN_PEERS_CACHE_SIZE
source · pub const KNOWN_PEERS_CACHE_SIZE: NonZeroUsize;
Expand description
Size of the LRU cache for peers.
\ No newline at end of file
diff --git a/subspace_farmer/index.html b/subspace_farmer/index.html
index f7121b3d4e..1dcb1bd83a 100644
--- a/subspace_farmer/index.html
+++ b/subspace_farmer/index.html
@@ -1,5 +1,5 @@
subspace_farmer - Rust Crate subspace_farmer
source · Expand description
Crate subspace_farmer
source · Expand description
subspace-farmer
library implementation overview
This library provides droppable/interruptable instances of two processes that can be run in
parallel: plotting
and farming
.
During plotting we create:
diff --git a/subspace_farmer/piece_cache/index.html b/subspace_farmer/piece_cache/index.html
index 1d22fb3fd4..c462bcfd6b 100644
--- a/subspace_farmer/piece_cache/index.html
+++ b/subspace_farmer/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
+subspace_farmer::piece_cache - Rust Module subspace_farmer::piece_cache
source · Structs
- Cache worker used to drive the cache
- Piece cache that aggregates caches of multiple disks
\ No newline at end of file
diff --git a/subspace_farmer/piece_cache/struct.CacheWorker.html b/subspace_farmer/piece_cache/struct.CacheWorker.html
index 24bb9357bd..1e6efc5bff 100644
--- a/subspace_farmer/piece_cache/struct.CacheWorker.html
+++ b/subspace_farmer/piece_cache/struct.CacheWorker.html
@@ -1,10 +1,10 @@
-CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
+CacheWorker in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::CacheWorker
source · pub struct CacheWorker<NC>where
NC: Debug,{ /* private fields */ }
Expand description
Cache worker used to drive the cache
-Implementations§
source§impl<NC> CacheWorker<NC>where
- NC: NodeClient,
Implementations§
source§impl<NC> CacheWorker<NC>where
+ NC: NodeClient,
sourcepub async fn run<PG>(self, piece_getter: PG)where
PG: PieceGetter,
Run the cache worker with provided piece getter
-Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
+
Trait Implementations§
Auto Trait Implementations§
§impl<NC> !RefUnwindSafe for CacheWorker<NC>
§impl<NC> Send for CacheWorker<NC>where
NC: Send,
§impl<NC> Sync for CacheWorker<NC>where
NC: Sync,
§impl<NC> Unpin for CacheWorker<NC>where
NC: Unpin,
§impl<NC> !UnwindSafe for CacheWorker<NC>
Blanket Implementations§
source§impl<T> Any for Twhere
diff --git a/subspace_farmer/piece_cache/struct.PieceCache.html b/subspace_farmer/piece_cache/struct.PieceCache.html
index a537f01dc4..c4fd11881d 100644
--- a/subspace_farmer/piece_cache/struct.PieceCache.html
+++ b/subspace_farmer/piece_cache/struct.PieceCache.html
@@ -1,19 +1,19 @@
-PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
-Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
+PieceCache in subspace_farmer::piece_cache - Rust Struct subspace_farmer::piece_cache::PieceCache
source · pub struct PieceCache { /* private fields */ }
Expand description
Piece cache that aggregates caches of multiple disks
+Implementations§
source§impl PieceCache
sourcepub fn new<NC>(node_client: NC, peer_id: PeerId) -> (Self, CacheWorker<NC>)where
NC: NodeClient,
Create new piece cache instance and corresponding worker.
NOTE: Returned future is async, but does blocking operations and should be running in
dedicated thread.
-sourcepub async fn replace_backing_caches(
+
sourcepub async fn replace_backing_caches(
&self,
new_caches: Vec<DiskPieceCache>
) -> Receiver<()>
Initialize replacement of backing caches, returns acknowledgement receiver that can be used
to identify when cache initialization has finished
-sourcepub fn on_sync_progress(
+
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
Trait Implementations§
source§impl Clone for PieceCache
source§fn clone(&self) -> PieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moresource§impl Debug for PieceCache
source§impl LocalRecordProvider for PieceCache
Auto Trait Implementations§
§impl !RefUnwindSafe for PieceCache
§impl Send for PieceCache
§impl Sync for PieceCache
§impl Unpin for PieceCache
§impl !UnwindSafe for PieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
index 961feca7fd..47894c3a85 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/enum.DiskPieceCacheError.html
@@ -1,4 +1,4 @@
-DiskPieceCacheError in subspace_farmer::single_disk_farm::piece_cache - Rust
Offset outsize of range
§ZeroCapacity
Cache size has zero capacity, this is not supported
§ChecksumMismatch
Checksum mismatch
-Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
Trait Implementations§
source§impl Debug for DiskPieceCacheError
source§impl Display for DiskPieceCacheError
source§impl Error for DiskPieceCacheError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more1.0.0 · source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()source§impl From<DiskPieceCacheError> for SingleDiskFarmError
source§fn from(source: DiskPieceCacheError) -> Self
Converts to this type from the input type.Auto Trait Implementations§
§impl !RefUnwindSafe for DiskPieceCacheError
§impl Send for DiskPieceCacheError
§impl Sync for DiskPieceCacheError
§impl Unpin for DiskPieceCacheError
§impl !UnwindSafe for DiskPieceCacheError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/index.html b/subspace_farmer/single_disk_farm/piece_cache/index.html
index 2412937c70..51d38a760e 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/index.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/index.html
@@ -1 +1 @@
-subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
+subspace_farmer::single_disk_farm::piece_cache - Rust Module subspace_farmer::single_disk_farm::piece_cache
source · Structs
- Piece cache stored on one disk
- Offset wrapper for pieces in
DiskPieceCache
Enums
- Disk piece cache open error
\ No newline at end of file
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
index 14f916dd39..26066fd977 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.DiskPieceCache.html
@@ -1,5 +1,5 @@
-DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
-Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
source§impl<T> Any for Twhere
+DiskPieceCache in subspace_farmer::single_disk_farm::piece_cache - Rust pub struct DiskPieceCache { /* private fields */ }
Expand description
Piece cache stored on one disk
+Trait Implementations§
source§impl Clone for DiskPieceCache
source§fn clone(&self) -> DiskPieceCache
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl RefUnwindSafe for DiskPieceCache
§impl Send for DiskPieceCache
§impl Sync for DiskPieceCache
§impl Unpin for DiskPieceCache
§impl UnwindSafe for DiskPieceCache
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
index 51eb22bd37..88f9b05fda 100644
--- a/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
+++ b/subspace_farmer/single_disk_farm/piece_cache/struct.Offset.html
@@ -1,5 +1,5 @@
-Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
-Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
source§impl<T> Any for Twhere
+Offset in subspace_farmer::single_disk_farm::piece_cache - Rust Struct subspace_farmer::single_disk_farm::piece_cache::Offset
source · pub struct Offset(/* private fields */);
Expand description
Offset wrapper for pieces in DiskPieceCache
+Trait Implementations§
source§impl Copy for Offset
Auto Trait Implementations§
§impl RefUnwindSafe for Offset
§impl Send for Offset
§impl Sync for Offset
§impl Unpin for Offset
§impl UnwindSafe for Offset
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§fn implicit(
diff --git a/subspace_farmer_components/auditing/fn.audit_plot_sync.html b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
index 4b12ab2acc..38b352af68 100644
--- a/subspace_farmer_components/auditing/fn.audit_plot_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_plot_sync.html
@@ -1,10 +1,10 @@
audit_plot_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_plot_sync
source · pub fn audit_plot_sync<'a, Plot>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
plot: &'a Plot,
sectors_metadata: &'a [SectorMetadataChecksummed],
- maybe_sector_being_modified: Option<SectorIndex>
+ maybe_sector_being_modified: Option<SectorIndex>
) -> Vec<AuditResult<'a, ReadAtOffset<'a, Plot>>>where
Plot: ReadAtSync + 'a,
Expand description
Audit the whole plot and generate streams of solutions
\ No newline at end of file
diff --git a/subspace_farmer_components/auditing/fn.audit_sector_sync.html b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
index fdf787690e..069d003913 100644
--- a/subspace_farmer_components/auditing/fn.audit_sector_sync.html
+++ b/subspace_farmer_components/auditing/fn.audit_sector_sync.html
@@ -1,7 +1,7 @@
audit_sector_sync in subspace_farmer_components::auditing - Rust Function subspace_farmer_components::auditing::audit_sector_sync
source · pub fn audit_sector_sync<'a, Sector>(
- public_key: &'a PublicKey,
- global_challenge: &Blake3Hash,
- solution_range: SolutionRange,
+ public_key: &'a PublicKey,
+ global_challenge: &Blake3Hash,
+ solution_range: SolutionRange,
sector: Sector,
sector_metadata: &'a SectorMetadataChecksummed
) -> Option<AuditResult<'a, Sector>>where
diff --git a/subspace_farmer_components/auditing/struct.AuditResult.html b/subspace_farmer_components/auditing/struct.AuditResult.html
index 3d7c620654..6ca4df3980 100644
--- a/subspace_farmer_components/auditing/struct.AuditResult.html
+++ b/subspace_farmer_components/auditing/struct.AuditResult.html
@@ -1,12 +1,12 @@
AuditResult in subspace_farmer_components::auditing - Rust Struct subspace_farmer_components::auditing::AuditResult
source · pub struct AuditResult<'a, Sector>where
Sector: 'a,{
- pub sector_index: SectorIndex,
+ pub sector_index: SectorIndex,
pub solution_candidates: SolutionCandidates<'a, Sector>,
- pub best_solution_distance: SolutionRange,
+ pub best_solution_distance: SolutionRange,
}
Expand description
Result of sector audit
-Fields§
§sector_index: SectorIndex
Sector index
+Fields§
§sector_index: SectorIndex
Sector index
§solution_candidates: SolutionCandidates<'a, Sector>
Solution candidates
-§best_solution_distance: SolutionRange
Best solution distance found
+§best_solution_distance: SolutionRange
Best solution distance found
Trait Implementations§
source§impl<'a, Sector> Clone for AuditResult<'a, Sector>where
Sector: 'a + Clone,
source§fn clone(&self) -> AuditResult<'a, Sector>
Returns a copy of the value. Read more1.0.0 · source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read moreAuto Trait Implementations§
§impl<'a, Sector> RefUnwindSafe for AuditResult<'a, Sector>where
diff --git a/subspace_farmer_components/plotting/enum.PlottingError.html b/subspace_farmer_components/plotting/enum.PlottingError.html
index 3e0f533db3..0c2df46ebf 100644
--- a/subspace_farmer_components/plotting/enum.PlottingError.html
+++ b/subspace_farmer_components/plotting/enum.PlottingError.html
@@ -9,13 +9,13 @@
expected: usize,
},
PieceNotFound {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
PieceRecoveryFailed {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
},
FailedToRetrievePiece {
- piece_index: PieceIndex,
+ piece_index: PieceIndex,
error: Box<dyn Error + Send + Sync + 'static>,
},
FailedToAcquirePermit {
@@ -29,11 +29,11 @@
§BadSectorMetadataOutputSize
Bad sector metadata output size
-§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
+§PieceNotFound
Fields
§piece_index: PieceIndex
Piece index
Piece not found, can’t create sector, this should never happen
-§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
+§PieceRecoveryFailed
Fields
§piece_index: PieceIndex
Piece index
Can’t recover missing piece
-§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
+§FailedToRetrievePiece
Fields
§piece_index: PieceIndex
Piece index
Failed to retrieve piece
§FailedToAcquirePermit
Fields
§error: AcquireError
Lower-level error
diff --git a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
index 08324ed870..f18b116d0f 100644
--- a/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
+++ b/subspace_farmer_components/plotting/struct.DownloadSectorOptions.html
@@ -1,19 +1,19 @@
DownloadSectorOptions in subspace_farmer_components::plotting - Rust Struct subspace_farmer_components::plotting::