pub type Beefy = Pallet<Runtime>;
Aliased Type§
struct Beefy(/* private fields */);
Implementations
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Methods for the ValidateUnsigned
implementation:
It restricts calls to report_equivocation_unsigned
to local calls (i.e. extrinsics generated
on this node) or that already in a block. This guarantees that only block authors can include
unsigned equivocation reports.
pub fn validate_unsigned( source: TransactionSource, call: &Call<T>, ) -> Result<ValidTransaction, TransactionValidityError>
pub fn pre_dispatch(call: &Call<T>) -> Result<(), TransactionValidityError>
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn report_double_voting(
origin: <T as Config>::RuntimeOrigin,
equivocation_proof: Box<DoubleVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId, <<T as Config>::BeefyId as RuntimeAppPublic>::Signature>>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn report_double_voting( origin: <T as Config>::RuntimeOrigin, equivocation_proof: Box<DoubleVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId, <<T as Config>::BeefyId as RuntimeAppPublic>::Signature>>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Report voter equivocation/misbehavior. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are valid, the offence will be reported.
Sourcepub fn report_double_voting_unsigned(
origin: <T as Config>::RuntimeOrigin,
equivocation_proof: Box<DoubleVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId, <<T as Config>::BeefyId as RuntimeAppPublic>::Signature>>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn report_double_voting_unsigned( origin: <T as Config>::RuntimeOrigin, equivocation_proof: Box<DoubleVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId, <<T as Config>::BeefyId as RuntimeAppPublic>::Signature>>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Report voter equivocation/misbehavior. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are 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 set_new_genesis(
origin: <T as Config>::RuntimeOrigin,
delay_in_blocks: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Result<(), DispatchError>
pub fn set_new_genesis( origin: <T as Config>::RuntimeOrigin, delay_in_blocks: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>
Reset BEEFY consensus by setting a new BEEFY genesis at delay_in_blocks
blocks in the
future.
Note: delay_in_blocks
has to be at least 1.
Sourcepub fn report_fork_voting(
origin: <T as Config>::RuntimeOrigin,
equivocation_proof: Box<ForkVotingProof<<<T as Config>::Block as HeaderProvider>::HeaderT, <T as Config>::BeefyId, <<T as Config>::AncestryHelper as AncestryHelper<<<T as Config>::Block as HeaderProvider>::HeaderT>>::Proof>>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn report_fork_voting( origin: <T as Config>::RuntimeOrigin, equivocation_proof: Box<ForkVotingProof<<<T as Config>::Block as HeaderProvider>::HeaderT, <T as Config>::BeefyId, <<T as Config>::AncestryHelper as AncestryHelper<<<T as Config>::Block as HeaderProvider>::HeaderT>>::Proof>>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Report fork voting equivocation. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are valid, the offence will be reported.
Sourcepub fn report_fork_voting_unsigned(
origin: <T as Config>::RuntimeOrigin,
equivocation_proof: Box<ForkVotingProof<<<T as Config>::Block as HeaderProvider>::HeaderT, <T as Config>::BeefyId, <<T as Config>::AncestryHelper as AncestryHelper<<<T as Config>::Block as HeaderProvider>::HeaderT>>::Proof>>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn report_fork_voting_unsigned( origin: <T as Config>::RuntimeOrigin, equivocation_proof: Box<ForkVotingProof<<<T as Config>::Block as HeaderProvider>::HeaderT, <T as Config>::BeefyId, <<T as Config>::AncestryHelper as AncestryHelper<<<T as Config>::Block as HeaderProvider>::HeaderT>>::Proof>>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Report fork voting equivocation. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are 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 report_future_block_voting(
origin: <T as Config>::RuntimeOrigin,
equivocation_proof: Box<FutureBlockVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId>>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn report_future_block_voting( origin: <T as Config>::RuntimeOrigin, equivocation_proof: Box<FutureBlockVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId>>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Report future block voting equivocation. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are valid, the offence will be reported.
Sourcepub fn report_future_block_voting_unsigned(
origin: <T as Config>::RuntimeOrigin,
equivocation_proof: Box<FutureBlockVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId>>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn report_future_block_voting_unsigned( origin: <T as Config>::RuntimeOrigin, equivocation_proof: Box<FutureBlockVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId>>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Report future block voting equivocation. This method will verify the equivocation proof and validate the given key ownership proof against the extracted offender. If both are 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.
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn do_try_state() -> Result<(), DispatchError>
pub fn do_try_state() -> Result<(), DispatchError>
Ensure the correctness of the state of this pallet.
This should be valid before or after each state transition of this pallet.
Source§impl<T> Pallet<T>where
T: Config,
impl<T> Pallet<T>where
T: Config,
Sourcepub fn validator_set() -> Option<ValidatorSet<<T as Config>::BeefyId>>
pub fn validator_set() -> Option<ValidatorSet<<T as Config>::BeefyId>>
Return the current active BEEFY validator set.
Sourcepub fn submit_unsigned_double_voting_report(
equivocation_proof: DoubleVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId, <<T as Config>::BeefyId as RuntimeAppPublic>::Signature>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Option<()>
pub fn submit_unsigned_double_voting_report( equivocation_proof: DoubleVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId, <<T as Config>::BeefyId as RuntimeAppPublic>::Signature>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Option<()>
Submits an extrinsic to report a double voting equivocation. This method will create
an unsigned extrinsic with a call to report_double_voting_unsigned
and
will push the transaction to the pool. Only useful in an offchain context.
Sourcepub fn submit_unsigned_fork_voting_report(
equivocation_proof: ForkVotingProof<<<T as Config>::Block as HeaderProvider>::HeaderT, <T as Config>::BeefyId, <<T as Config>::AncestryHelper as AncestryHelper<<<T as Config>::Block as HeaderProvider>::HeaderT>>::Proof>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Option<()>
pub fn submit_unsigned_fork_voting_report( equivocation_proof: ForkVotingProof<<<T as Config>::Block as HeaderProvider>::HeaderT, <T as Config>::BeefyId, <<T as Config>::AncestryHelper as AncestryHelper<<<T as Config>::Block as HeaderProvider>::HeaderT>>::Proof>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Option<()>
Submits an extrinsic to report a fork voting equivocation. This method will create
an unsigned extrinsic with a call to report_fork_voting_unsigned
and
will push the transaction to the pool. Only useful in an offchain context.
Sourcepub fn submit_unsigned_future_block_voting_report(
equivocation_proof: FutureBlockVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId>,
key_owner_proof: <T as Config>::KeyOwnerProof,
) -> Option<()>
pub fn submit_unsigned_future_block_voting_report( equivocation_proof: FutureBlockVotingProof<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, <T as Config>::BeefyId>, key_owner_proof: <T as Config>::KeyOwnerProof, ) -> Option<()>
Submits an extrinsic to report a future block voting equivocation. This method will create
an unsigned extrinsic with a call to report_future_block_voting_unsigned
and
will push the transaction to the pool. Only useful in an offchain context.
Trait Implementations
Source§impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
impl<T> BeforeAllRuntimeMigrations for Pallet<T>where
T: Config,
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T> BoundToRuntimeAppPublic for Pallet<T>where
T: Config,
impl<T> BoundToRuntimeAppPublic for Pallet<T>where
T: Config,
Source§impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
impl<T> DispatchViewFunction for Pallet<T>where
T: Config,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T> GetStorageVersion for Pallet<T>where
T: Config,
impl<T> GetStorageVersion for Pallet<T>where
T: Config,
Source§fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§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> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn try_state(
_n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Result<(), DispatchError>
fn try_state( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T> IntegrityTest for Pallet<T>where
T: Config,
impl<T> IntegrityTest for Pallet<T>where
T: Config,
Source§impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T> OnGenesis for Pallet<T>where
T: Config,
impl<T> OnGenesis for Pallet<T>where
T: Config,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
impl<T> OnRuntimeUpgrade for Pallet<T>where
T: Config,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T> OneSessionHandler<<T as Config>::AccountId> for Pallet<T>
impl<T> OneSessionHandler<<T as Config>::AccountId> for Pallet<T>
Source§fn on_genesis_session<'a, I>(validators: I)
fn on_genesis_session<'a, I>(validators: I)
on_new_session
should provide the same validator set.Source§fn on_new_session<'a, I>(_changed: bool, validators: I, queued_validators: I)
fn on_new_session<'a, I>(_changed: bool, validators: I, queued_validators: I)
Source§fn on_disabled(i: u32)
fn on_disabled(i: u32)
Source§fn on_before_session_ending()
fn on_before_session_ending()
Source§impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletInfoAccess for Pallet<T>where
T: Config,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
impl<T> PalletsInfoAccess for Pallet<T>where
T: Config,
Source§impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
impl<T> StorageInfoTrait for Pallet<T>where
T: Config,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
impl<T> TryDecodeEntireStorage for Pallet<T>where
T: Config,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>where
T: Config,
Source§impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
impl<T> ValidateUnsigned for Pallet<T>where
T: Config,
Source§fn pre_dispatch(
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<(), TransactionValidityError>
fn pre_dispatch( call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<(), TransactionValidityError>
Source§fn validate_unsigned(
source: TransactionSource,
call: &<Pallet<T> as ValidateUnsigned>::Call,
) -> Result<ValidTransaction, TransactionValidityError>
fn validate_unsigned( source: TransactionSource, call: &<Pallet<T> as ValidateUnsigned>::Call, ) -> Result<ValidTransaction, TransactionValidityError>
Source§impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
impl<T> WhitelistedStorageKeys for Pallet<T>where
T: Config,
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.