pub enum Call<T: Config> {
validate {
payload: ValidatePayloadOf<T>,
signature: T::Signature,
},
declare {
payload: AffidavitPayloadOf<T>,
signature: T::Signature,
},
elect {
payload: ElectionPayloadOf<T>,
signature: T::Signature,
},
chill {
affidavit_pub: AffidavitId<T>,
},
force_genesis_config {
field: ForceGenesisConfig<T>,
},
// some variants omitted
}Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
Variants§
validate
Register an author’s new affidavit signing key for the upcoming session’s participation as a validator.
This extrinsic allows an author to declare their off-chain signing key that will be used to sign affidavits for the next session’s election.
It ensures that only valid and available authors can register keys.
§Notes
- Affidavit Keys are session-specific and are updated each session.
- This extrinsic allows submission of affidavit for next session only.
- Affidavit Declaration/Submission will rotate keys once every submission for further sessions then.
§Errors
Returns a DispatchError if author-role authorization fails.
declare
Submit an affidavit for the upcoming session election.
This extrinsic allows an author to declare their election weights (affidavit) for the next session. It also rotates the author’s signing key for the subsequent affidavit.
§Parameters
origin: Must be a signed account corresponding to the author submitting the affidavit.payload: The payload that was signed off-chain representing the affidavit data.signature: The author’s signature of the payload, used for verification.new_key: A new affidavit signing key to replace the current one for the next upcoming session.
§Notes
- Affidavit submissions are session-specific.
- Key rotation ensures authors maintain fresh signing keys for security.
- Only validated and available authors can submit affidavits.
§Errors
Returns a DispatchError if un-privileged to submit an affidavit.
elect
Execute the election for the upcoming session.
This extrinsic allows an author to act as the election runner for the election session (next-session). It verifies the author’s affidavit-based signature, prepares the election using all submitted affidavits, and records the runner for audit and reward attribution.
Since this is an unsigned extrinsic, it is constructed and submitted by validator offchain workers (OCWs).
Although unsigned, it is treated as a pseudo-inherent:
- It is authorized via affidavit signature verification
- It may carry rewards for successfully running the election
- It is expected to be submitted locally by validators rather than propagated by external transaction authors
§Errors
Returns a DispatchError if election execution or authorization fails.
chill
Request to step back or “chill” immediately from election participation by erasing affidavit keys.
This safely avoids penalties by pausing an author’s duties.
This extrinsic allows an author to withdraw from participating in upcoming elections or prevent submitting future affidavits. The actual effect depends on the current block relative to the affidavit submissions and election windows.
Note that its always advised to chill validation before resign author role
to skip unnecessary invalid affidavit declarations.
§Parameters
origin: Must be a signed account corresponding to the author i.e., controller/role account.affidavit_pub: Public affidavit key registered for a new session’s affidavit submission.
§Notes
- Removing affidavit keys ensures authors cannot unfairly influence future elections.
- By inspecting returned errors, callers can compute the optimal chill window.
§Errors
Returns a DispatchError with diagnostic in case of irrevocable
duties assigned.
Fields
affidavit_pub: AffidavitId<T>force_genesis_config
Force-update a selected genesis configuration parameter.
Origin: Root only.
This extrinsic allows privileged modification of runtime parameters that were originally defined at genesis.
AllowAffidavits- Enables or disables affidavit submission.AffidavitBeginsAt- Updates the start of the affidavit submission window.AffidavitEndsAt- Updates the end of the affidavit submission window.ElectionBeginsAt- Updates when election execution begins within the session.ElectionRunnerPointsUpgrade- Updates the reward points for election runners.ValidateTxPriority- Updates the priority for validation-related extrinsics.ElectionTxPriority- Updates the priority for election execution extrinsics.AffidavitTxPriority- Updates the priority for affidavit submission extrinsics.FinalityAfter- Updates the time-based delay before operations are considered final.FinalityTicks- Updates the block-based confirmation threshold for finality.
The call enforces consistency constraints where applicable:
- Affidavit window ordering:
AffidavitBeginsAt < AffidavitEndsAtAffidavitEndsAt > AffidavitBeginsAt
- The following values must be non-zero:
- transaction priorities
- finality thresholds (
FinalityAfter,FinalityTicks)
This call directly overwrites storage and emits an event containing the updated configuration variant.
Fields
field: ForceGenesisConfig<T>Implementations§
Source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
Sourcepub fn new_call_variant_validate(
payload: ValidatePayloadOf<T>,
signature: T::Signature,
) -> Self
pub fn new_call_variant_validate( payload: ValidatePayloadOf<T>, signature: T::Signature, ) -> Self
Create a call with the variant validate.
Sourcepub fn new_call_variant_declare(
payload: AffidavitPayloadOf<T>,
signature: T::Signature,
) -> Self
pub fn new_call_variant_declare( payload: AffidavitPayloadOf<T>, signature: T::Signature, ) -> Self
Create a call with the variant declare.
Sourcepub fn new_call_variant_elect(
payload: ElectionPayloadOf<T>,
signature: T::Signature,
) -> Self
pub fn new_call_variant_elect( payload: ElectionPayloadOf<T>, signature: T::Signature, ) -> Self
Create a call with the variant elect.
Sourcepub fn new_call_variant_chill(affidavit_pub: AffidavitId<T>) -> Self
pub fn new_call_variant_chill(affidavit_pub: AffidavitId<T>) -> Self
Create a call with the variant chill.
Sourcepub fn new_call_variant_force_genesis_config(
field: ForceGenesisConfig<T>,
) -> Self
pub fn new_call_variant_force_genesis_config( field: ForceGenesisConfig<T>, ) -> Self
Create a call with the variant force_genesis_config.
Trait Implementations§
Source§impl<T: Config> CheckIfFeeless for Call<T>
impl<T: Config> CheckIfFeeless for Call<T>
Source§fn is_feeless(&self, origin: &Self::Origin) -> bool
fn is_feeless(&self, origin: &Self::Origin) -> bool
#[pallet::feeless_if]Source§impl<T: Config> Decode for Call<T>
impl<T: Config> Decode for Call<T>
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>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Source§impl<T: Config> Encode for Call<T>
impl<T: Config> Encode for Call<T>
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Source§impl<T: Config> GetCallIndex for Call<T>
impl<T: Config> GetCallIndex for Call<T>
Source§fn get_call_index(&self) -> u8
fn get_call_index(&self) -> u8
Source§fn get_call_indices() -> &'static [u8] ⓘ
fn get_call_indices() -> &'static [u8] ⓘ
GetCallName].Source§impl<T: Config> GetCallName for Call<T>
impl<T: Config> GetCallName for Call<T>
Source§fn get_call_name(&self) -> &'static str
fn get_call_name(&self) -> &'static str
Source§fn get_call_names() -> &'static [&'static str]
fn get_call_names() -> &'static [&'static str]
GetCallIndex].Source§impl<T: Config> GetDispatchInfo for Call<T>
impl<T: Config> GetDispatchInfo for Call<T>
Source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
DispatchInfo, containing relevant information of this dispatch. Read moreSource§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
ValidatePayloadOf<T>: TypeInfo + 'static,
T::Signature: TypeInfo + 'static,
AffidavitPayloadOf<T>: TypeInfo + 'static,
ElectionPayloadOf<T>: TypeInfo + 'static,
AffidavitId<T>: TypeInfo + 'static,
ForceGenesisConfig<T>: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
ValidatePayloadOf<T>: TypeInfo + 'static,
T::Signature: TypeInfo + 'static,
AffidavitPayloadOf<T>: TypeInfo + 'static,
ElectionPayloadOf<T>: TypeInfo + 'static,
AffidavitId<T>: TypeInfo + 'static,
ForceGenesisConfig<T>: TypeInfo + 'static,
T: Config + 'static,
Source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
Source§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin).Source§fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin,
) -> DispatchResultWithPostInfo
fn dispatch_bypass_filter( self, origin: Self::RuntimeOrigin, ) -> DispatchResultWithPostInfo
impl<T: Config> DecodeWithMemTracking for Call<T>where
ValidatePayloadOf<T>: DecodeWithMemTracking,
T::Signature: DecodeWithMemTracking,
AffidavitPayloadOf<T>: DecodeWithMemTracking,
ElectionPayloadOf<T>: DecodeWithMemTracking,
AffidavitId<T>: DecodeWithMemTracking,
ForceGenesisConfig<T>: DecodeWithMemTracking,
impl<T: Config> EncodeLike for Call<T>
impl<T: Config> Eq for Call<T>
Auto Trait Implementations§
impl<T> Freeze for Call<T>
impl<T> RefUnwindSafe for Call<T>where
<T as SigningTypes>::Signature: RefUnwindSafe,
<T as Config>::AccountId: RefUnwindSafe,
<T as SigningTypes>::Public: RefUnwindSafe,
<T as Config>::Moment: RefUnwindSafe,
<<<T as Config>::Block as Block>::Header as Header>::Number: RefUnwindSafe,
T: RefUnwindSafe,
<T as Config>::Points: RefUnwindSafe,
impl<T> Send for Call<T>
impl<T> Sync for Call<T>
impl<T> Unpin for Call<T>
impl<T> UnwindSafe for Call<T>where
<T as SigningTypes>::Signature: UnwindSafe,
<T as Config>::AccountId: UnwindSafe,
<T as SigningTypes>::Public: UnwindSafe,
<T as Config>::Moment: UnwindSafe,
<<<T as Config>::Block as Block>::Header as Header>::Number: UnwindSafe,
T: UnwindSafe,
<T as Config>::Points: 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,
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere
T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
§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> Hashable for Twhere
T: Codec,
impl<T> Hashable for Twhere
T: Codec,
§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 moreSource§impl<T, U, Tag> IntoTag<U, Tag> for Twhere
U: FromTag<T, Tag>,
Tag: DiscriminantTag,
impl<T, U, Tag> IntoTag<U, Tag> for Twhere
U: FromTag<T, Tag>,
Tag: DiscriminantTag,
§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
§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> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere
T: Codec,
Source§impl<T, Time> Logging<Time> for Twhere
Time: Time,
impl<T, Time> Logging<Time> for Twhere
Time: Time,
Source§const FALLBACK_TARGET: &'static str = "routine"
const FALLBACK_TARGET: &'static str = "routine"
Default logging target if none is provided.
Most routines, especially offchain workers or background tasks, use this target for simplicity.
It allows a consistent place to look for routine logs without requiring every call to specify a target.
Note: This target is only a conveninence and may be somewhat vague. To ensure errors can still be traced accurately, the logged messages should include additional metadata (e.g., module name, error index, or contextual info) so that the source of the error can be identified even if the target is generic.
Source§type Logger = DispatchError
type Logger = DispatchError
The type taken and returned for logging.
We simply return the same [DispatchError] that was logged,
so logging does not change control flow or error propagation.
DispatchError is used because in Substrate it encompasses all
runtime errors - including module errors, token errors, arithmetic
issues, and transactional boundaries - making it the universal
substrate-side error representation.
Source§type Level = LogLevel
type Level = LogLevel
The log level type.
We use the LogLevel enum to standardize severity levels
(Info, Warn, Error, Debug) across all routine logs.
Source§fn log(
level: <T as Logging<Time>>::Level,
err: &<T as Logging<Time>>::Logger,
timestamp: Time,
target: Option<&str>,
fmt: Option<fn(Time, &<T as Logging<Time>>::Level, &str, &str) -> String>,
) -> <T as Logging<Time>>::Logger
fn log( level: <T as Logging<Time>>::Level, err: &<T as Logging<Time>>::Logger, timestamp: Time, target: Option<&str>, fmt: Option<fn(Time, &<T as Logging<Time>>::Level, &str, &str) -> String>, ) -> <T as Logging<Time>>::Logger
Source§fn info(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
fn info(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
Source§fn warn(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
fn warn(
err: &Self::Logger,
timestamp: Timestamp,
target: Option<&str>,
fmt: Option<fn(Timestamp, &Self::Level, &str, &str) -> String>,
) -> Self::Loggerwhere
Self: Sized,
§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.