Trait sp_consensus_subspace::SubspaceApi
source · pub trait SubspaceApi<Block: BlockT, RewardAddress: Encode + Decode>: Core<Block> {
Show 13 methods
// Provided methods
fn pot_parameters(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<PotParameters, ApiError> { ... }
fn solution_ranges(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<SolutionRanges, ApiError> { ... }
fn submit_report_equivocation_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
equivocation_proof: EquivocationProof<Block::Header>,
) -> Result<Option<()>, ApiError> { ... }
fn submit_vote_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
signed_vote: SignedVote<<<Block as BlockT>::Header as HeaderT>::Number, Block::Hash, RewardAddress>,
) -> Result<(), ApiError> { ... }
fn is_in_block_list(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
farmer_public_key: &FarmerPublicKey,
) -> Result<bool, ApiError> { ... }
fn history_size(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<HistorySize, ApiError> { ... }
fn max_pieces_in_sector(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u16, ApiError> { ... }
fn segment_commitment(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
segment_index: SegmentIndex,
) -> Result<Option<SegmentCommitment>, ApiError> { ... }
fn extract_segment_headers(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<Option<Vec<SegmentHeader>>, ApiError> { ... }
fn is_inherent(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<bool, ApiError> { ... }
fn root_plot_public_key(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<FarmerPublicKey>, ApiError> { ... }
fn should_adjust_solution_range(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<bool, ApiError> { ... }
fn chain_constants(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<ChainConstants, ApiError> { ... }
}
Expand description
API necessary for block authorship with Subspace.
Provided Methods§
sourcefn pot_parameters(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<PotParameters, ApiError>
fn pot_parameters( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<PotParameters, ApiError>
Proof of time parameters
sourcefn solution_ranges(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<SolutionRanges, ApiError>
fn solution_ranges( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<SolutionRanges, ApiError>
Solution ranges.
sourcefn submit_report_equivocation_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
equivocation_proof: EquivocationProof<Block::Header>,
) -> Result<Option<()>, ApiError>
fn submit_report_equivocation_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, equivocation_proof: EquivocationProof<Block::Header>, ) -> Result<Option<()>, ApiError>
Submits an unsigned extrinsic to report an equivocation. The caller must provide the
equivocation proof. The extrinsic will be unsigned and should only be accepted for local
authorship (not to be broadcast to the network). This method returns None
when
creation of the extrinsic fails, e.g. if equivocation reporting is disabled for the
given runtime (i.e. this method is hardcoded to return None
). Only useful in an
offchain context.
sourcefn submit_vote_extrinsic(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
signed_vote: SignedVote<<<Block as BlockT>::Header as HeaderT>::Number, Block::Hash, RewardAddress>,
) -> Result<(), ApiError>
fn submit_vote_extrinsic( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, signed_vote: SignedVote<<<Block as BlockT>::Header as HeaderT>::Number, Block::Hash, RewardAddress>, ) -> Result<(), ApiError>
Submit farmer vote vote that is essentially a header with bigger solution range than acceptable for block authoring. Only useful in an offchain context.
sourcefn is_in_block_list(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
farmer_public_key: &FarmerPublicKey,
) -> Result<bool, ApiError>
fn is_in_block_list( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, farmer_public_key: &FarmerPublicKey, ) -> Result<bool, ApiError>
Check if farmer_public_key
is in block list (due to equivocation)
sourcefn history_size(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<HistorySize, ApiError>
fn history_size( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<HistorySize, ApiError>
Size of the blockchain history
sourcefn max_pieces_in_sector(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<u16, ApiError>
fn max_pieces_in_sector( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<u16, ApiError>
How many pieces one sector is supposed to contain (max)
sourcefn segment_commitment(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
segment_index: SegmentIndex,
) -> Result<Option<SegmentCommitment>, ApiError>
fn segment_commitment( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, segment_index: SegmentIndex, ) -> Result<Option<SegmentCommitment>, ApiError>
Get the segment commitment of records for specified segment index
sourcefn extract_segment_headers(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<Option<Vec<SegmentHeader>>, ApiError>
fn extract_segment_headers( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ext: &Block::Extrinsic, ) -> Result<Option<Vec<SegmentHeader>>, ApiError>
Returns Vec<SegmentHeader>
if a given extrinsic has them.
sourcefn is_inherent(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
ext: &Block::Extrinsic,
) -> Result<bool, ApiError>
fn is_inherent( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ext: &Block::Extrinsic, ) -> Result<bool, ApiError>
Checks if the extrinsic is an inherent.
sourcefn root_plot_public_key(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<Option<FarmerPublicKey>, ApiError>
fn root_plot_public_key( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<Option<FarmerPublicKey>, ApiError>
Returns root plot public key in case block authoring is restricted.
sourcefn should_adjust_solution_range(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<bool, ApiError>
fn should_adjust_solution_range( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<bool, ApiError>
Whether solution range adjustment is enabled.
sourcefn chain_constants(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
) -> Result<ChainConstants, ApiError>
fn chain_constants( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, ) -> Result<ChainConstants, ApiError>
Get Subspace blockchain constants