Struct pallet_subspace::pallet::Pallet
source · pub struct Pallet<T>(/* private fields */);
Expand description
The Subspace Pallet
Implementations§
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
Methods for the ValidateUnsigned
implementation:
It restricts calls to report_equivocation
to local calls (i.e. extrinsics generated on this
node) or that already in a block. This guarantees that only block authors can include
equivocation reports.
pub fn validate_equivocation_report( source: TransactionSource, equivocation_proof: &EquivocationProof<HeaderFor<T>>, ) -> TransactionValidity
pub fn pre_dispatch_equivocation_report( 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>>>,
) -> DispatchResultWithPostInfo
pub fn report_equivocation( origin: OriginFor<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
call it (validated in ValidateUnsigned
), as such if the block author is defined it
will be defined as the equivocation reporter.
sourcepub fn store_segment_headers(
origin: OriginFor<T>,
segment_headers: Vec<SegmentHeader>,
) -> DispatchResult
pub fn store_segment_headers( origin: OriginFor<T>, segment_headers: Vec<SegmentHeader>, ) -> DispatchResult
Submit new segment header to the blockchain. This is an inherent extrinsic and part of the Subspace consensus logic.
sourcepub fn enable_solution_range_adjustment(
origin: OriginFor<T>,
solution_range_override: Option<u64>,
voting_solution_range_override: Option<u64>,
) -> DispatchResult
pub fn enable_solution_range_adjustment( origin: OriginFor<T>, solution_range_override: Option<u64>, voting_solution_range_override: Option<u64>, ) -> DispatchResult
Enable solution range adjustment after every era. 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>>,
) -> DispatchResult
pub fn vote( origin: OriginFor<T>, 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_at(
origin: OriginFor<T>,
enable_rewards_at: EnableRewardsAt<BlockNumberFor<T>>,
) -> DispatchResult
pub fn enable_rewards_at( origin: OriginFor<T>, enable_rewards_at: EnableRewardsAt<BlockNumberFor<T>>, ) -> DispatchResult
Enable rewards for blocks and votes at specified block height.
Enable storage access for all users.
sourcepub fn set_pot_slot_iterations(
origin: OriginFor<T>,
slot_iterations: NonZeroU32,
) -> DispatchResult
pub fn set_pot_slot_iterations( origin: OriginFor<T>, slot_iterations: NonZeroU32, ) -> DispatchResult
Update proof of time slot iterations
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 block_slots() -> BoundedBTreeMap<BlockNumberFor<T>, Slot, T::BlockSlotCount>
pub fn block_slots() -> BoundedBTreeMap<BlockNumberFor<T>, Slot, T::BlockSlotCount>
An auto-generated getter for BlockSlots
.
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 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>>,
) -> Option<()>
pub fn submit_equivocation_report( 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>>,
) -> Option<()>
pub fn submit_test_equivocation_report( 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 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>
impl<T> Pallet<T>
sourcepub fn submit_vote(
signed_vote: SignedVote<BlockNumberFor<T>, T::Hash, T::AccountId>,
)
pub fn submit_vote( 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> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
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 InCodeStorageVersion = NoStorageVersionSet
type InCodeStorageVersion = NoStorageVersionSet
source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
storage_version
attribute, or
[NoStorageVersionSet
] if the attribute is missing.source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
] instead. Read moresource§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_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read more§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> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
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> 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(
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,
data: &InherentData,
) -> Result<(), Self::Error>
fn check_inherent( call: &Self::Call, data: &InherentData, ) -> Result<(), Self::Error>
source§fn is_inherent(call: &Self::Call) -> bool
fn is_inherent(call: &Self::Call) -> bool
source§impl<T: Config> Randomness<<T as Config>::Hash, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Randomness<<T as Config>::Hash, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> RewardsEnabled for Pallet<T>
impl<T: Config> RewardsEnabled for Pallet<T>
source§fn rewards_enabled() -> bool
fn rewards_enabled() -> bool
source§impl<T: Config> ValidateUnsigned for Pallet<T>
impl<T: Config> ValidateUnsigned for Pallet<T>
source§fn validate_unsigned(
source: TransactionSource,
call: &Self::Call,
) -> TransactionValidity
fn validate_unsigned( source: TransactionSource, call: &Self::Call, ) -> TransactionValidity
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
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.impl<T> Eq for Pallet<T>
Auto Trait Implementations§
impl<T> Freeze for Pallet<T>
impl<T> RefUnwindSafe for Pallet<T>where
T: RefUnwindSafe,
impl<T> Send for Pallet<T>where
T: Send,
impl<T> Sync for Pallet<T>where
T: Sync,
impl<T> Unpin for Pallet<T>where
T: Unpin,
impl<T> UnwindSafe for Pallet<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.