ElectionProviderMultiPhase pallet
Derived from live runtime metadata on TRN root (pallet index 22, captured 2026-05-02). For prose-style documentation see ElectionProviderMultiPhase on the curated reference side.
- Pallet index
22- Calls
- 5
- Events
- 6
- Errors
- 14
- Storage items
- 10
- Constants
- 20
Calls (extrinsics)
ElectionProviderMultiPhase.submit_unsigned
See [
Pallet::submit_unsigned].
api.tx.electionProviderMultiPhase.submit_unsigned(raw_solution: {"solution":"SeedRuntimeNposCompactSolution16","score":"SpNposElectionsElectionScore","round":"u32"}, witness: {"voters":"Compact<u32>","targets":"Compact<u32>"})| Argument | Type | Doc |
|---|---|---|
raw_solution | {"solution":"SeedRuntimeNposCompactSolution16","score":"SpNposElectionsElectionScore","round":"u32"} | Box<RawSolution<SolutionOf<T::MinerConfig>>> |
witness | {"voters":"Compact<u32>","targets":"Compact<u32>"} | SolutionOrSnapshotSize |
Call index: 0
ElectionProviderMultiPhase.set_minimum_untrusted_score
See [
Pallet::set_minimum_untrusted_score].
api.tx.electionProviderMultiPhase.set_minimum_untrusted_score(maybe_next_score: Option<SpNposElectionsElectionScore>)| Argument | Type | Doc |
|---|---|---|
maybe_next_score | Option<SpNposElectionsElectionScore> | Option<ElectionScore> |
Call index: 1
ElectionProviderMultiPhase.set_emergency_election_result
See [
Pallet::set_emergency_election_result].
api.tx.electionProviderMultiPhase.set_emergency_election_result(supports: Vec<(SeedPrimitivesSignatureAccountId20,SpNposElectionsSupport)>)| Argument | Type | Doc |
|---|---|---|
supports | Vec<(SeedPrimitivesSignatureAccountId20,SpNposElectionsSupport)> | Supports<T::AccountId> |
Call index: 2
ElectionProviderMultiPhase.submit
See [
Pallet::submit].
api.tx.electionProviderMultiPhase.submit(raw_solution: {"solution":"SeedRuntimeNposCompactSolution16","score":"SpNposElectionsElectionScore","round":"u32"})| Argument | Type | Doc |
|---|---|---|
raw_solution | {"solution":"SeedRuntimeNposCompactSolution16","score":"SpNposElectionsElectionScore","round":"u32"} | Box<RawSolution<SolutionOf<T::MinerConfig>>> |
Call index: 3
ElectionProviderMultiPhase.governance_fallback
See [
Pallet::governance_fallback].
api.tx.electionProviderMultiPhase.governance_fallback(maybe_max_voters: Option<u32>, maybe_max_targets: Option<u32>)| Argument | Type | Doc |
|---|---|---|
maybe_max_voters | Option<u32> | Option<u32> |
maybe_max_targets | Option<u32> | Option<u32> |
Call index: 4
Events
ElectionProviderMultiPhase.SolutionStored
A solution was stored with the given compute. The
originindicates the origin of the solution. IforiginisSome(AccountId), the stored solution was submited in the signed phase by a miner with theAccountId. Otherwise, the solution was stored either during the unsigned phase or byT::ForceOrigin. Theboolistruewhen a previous solution was ejected to make room for this one.
| Field | Type | Doc |
|---|---|---|
compute | {"_enum":["OnChain","Signed","Unsigned","Fallback","Emergency"]} | |
origin | Option<SeedPrimitivesSignatureAccountId20> | |
prev_ejected | bool |
ElectionProviderMultiPhase.ElectionFinalized
The election has been finalized, with the given computation and score.
| Field | Type | Doc |
|---|---|---|
compute | {"_enum":["OnChain","Signed","Unsigned","Fallback","Emergency"]} | |
score | {"minimalStake":"u128","sumStake":"u128","sumStakeSquared":"u128"} |
ElectionProviderMultiPhase.ElectionFailed
An election failed. Not much can be said about which computes failed in the process.
No payload.
ElectionProviderMultiPhase.Rewarded
An account has been rewarded for their signed submission being finalized.
| Field | Type | Doc |
|---|---|---|
account | [u8;20] | |
value | u128 |
ElectionProviderMultiPhase.Slashed
An account has been slashed for submitting an invalid signed submission.
| Field | Type | Doc |
|---|---|---|
account | [u8;20] | |
value | u128 |
ElectionProviderMultiPhase.PhaseTransitioned
There was a phase transition in a given round.
| Field | Type | Doc |
|---|---|---|
from | {"_enum":{"Off":"Null","Signed":"Null","Unsigned":"(bool,u32)","Emergency":"Null"}} | |
to | {"_enum":{"Off":"Null","Signed":"Null","Unsigned":"(bool,u32)","Emergency":"Null"}} | |
round | u32 |
Errors
ElectionProviderMultiPhase.PreDispatchEarlySubmission
Submission was too early.
ElectionProviderMultiPhase.PreDispatchWrongWinnerCount
Wrong number of winners presented.
ElectionProviderMultiPhase.PreDispatchWeakSubmission
Submission was too weak, score-wise.
ElectionProviderMultiPhase.SignedQueueFull
The queue was full, and the solution was not better than any of the existing ones.
ElectionProviderMultiPhase.SignedCannotPayDeposit
The origin failed to pay the deposit.
ElectionProviderMultiPhase.SignedInvalidWitness
Witness data to dispatchable is invalid.
ElectionProviderMultiPhase.SignedTooMuchWeight
The signed submission consumes too much weight
ElectionProviderMultiPhase.OcwCallWrongEra
OCW submitted solution for wrong round
ElectionProviderMultiPhase.MissingSnapshotMetadata
Snapshot metadata should exist but didn't.
ElectionProviderMultiPhase.InvalidSubmissionIndex
Self::insert_submissionreturned an invalid index.
ElectionProviderMultiPhase.CallNotAllowed
The call is not allowed at this point.
ElectionProviderMultiPhase.FallbackFailed
The fallback failed
ElectionProviderMultiPhase.BoundNotMet
Some bound not met
ElectionProviderMultiPhase.TooManyWinners
Submitted solution has too many winners
Storage
ElectionProviderMultiPhase.Round
Internal counter for the number of rounds. This is useful for de-duplication of transactions submitted to the pool, and general diagnostics of the pallet. This is merely incremented once per every time that an upstream
electis called.
await api.query.electionProviderMultiPhase.round()Returns: u32
Modifier: Default
ElectionProviderMultiPhase.CurrentPhase
Current phase.
await api.query.electionProviderMultiPhase.currentPhase()Returns: {"_enum":{"Off":"Null","Signed":"Null","Unsigned":"(bool,u32)","Emergency":"Null"}}
Modifier: Default
ElectionProviderMultiPhase.QueuedSolution
Current best solution, signed or unsigned, queued to be returned upon
elect. Always sorted by score.
await api.query.electionProviderMultiPhase.queuedSolution()Returns: {"supports":"Vec<(SeedPrimitivesSignatureAccountId20,SpNposElectionsSupport)>","score":"SpNposElectionsElectionScore","compute":"PalletElectionProviderMultiPhaseElectionCompute"}
Modifier: Optional
ElectionProviderMultiPhase.Snapshot
Snapshot data of the round. This is created at the beginning of the signed phase and cleared upon calling
elect.
await api.query.electionProviderMultiPhase.snapshot()Returns: {"voters":"Vec<(SeedPrimitivesSignatureAccountId20,u64,Vec<SeedPrimitivesSignatureAccountId20>)>","targets":"Vec<SeedPrimitivesSignatureAccountId20>"}
Modifier: Optional
ElectionProviderMultiPhase.DesiredTargets
Desired number of targets to elect for this round. Only exists when [
Snapshot] is present.
await api.query.electionProviderMultiPhase.desiredTargets()Returns: u32
Modifier: Optional
ElectionProviderMultiPhase.SnapshotMetadata
The metadata of the [
RoundSnapshot] Only exists when [Snapshot] is present.
await api.query.electionProviderMultiPhase.snapshotMetadata()Returns: {"voters":"Compact<u32>","targets":"Compact<u32>"}
Modifier: Optional
ElectionProviderMultiPhase.SignedSubmissionNextIndex
The next index to be assigned to an incoming signed submission. Every accepted submission is assigned a unique index; that index is bound to that particular submission for the duration of the election. On election finalization, the next index is reset to 0. We can't just use
SignedSubmissionIndices.len(), because that's a bounded set; past its capacity, it will simply saturate. We can't just iterate overSignedSubmissionsMap, because iteration is slow. Instead, we store the value here.
await api.query.electionProviderMultiPhase.signedSubmissionNextIndex()Returns: u32
Modifier: Default
ElectionProviderMultiPhase.SignedSubmissionIndices
A sorted, bounded vector of
(score, block_number, index), where eachindexpoints to a value inSignedSubmissions. We never need to process more than a single signed submission at a time. Signed submissions can be quite large, so we're willing to pay the cost of multiple database accesses to access them one at a time instead of reading and decoding all of them at once.
await api.query.electionProviderMultiPhase.signedSubmissionIndices()Returns: Vec<(SpNposElectionsElectionScore,u32,u32)>
Modifier: Default
ElectionProviderMultiPhase.SignedSubmissionsMap
Unchecked, signed solutions. Together with
SubmissionIndices, this stores a bounded set ofSignedSubmissionswhile allowing us to keep only a single one in memory at a time. Twox note: the key of the map is an auto-incrementing index which users cannot inspect or affect; we shouldn't need a cryptographically secure hasher.
await api.query.electionProviderMultiPhase.signedSubmissionsMap(key1)- Key:
u32(hasher: Twox64Concat) - Returns:
{"who":"SeedPrimitivesSignatureAccountId20","deposit":"u128","rawSolution":"PalletElectionProviderMultiPhaseRawSolution","callFee":"u128"}
Modifier: Optional
ElectionProviderMultiPhase.MinimumUntrustedScore
The minimum score that each 'untrusted' solution must attain in order to be considered feasible. Can be set via
set_minimum_untrusted_score.
await api.query.electionProviderMultiPhase.minimumUntrustedScore()Returns: {"minimalStake":"u128","sumStake":"u128","sumStakeSquared":"u128"}
Modifier: Optional
Constants
ElectionProviderMultiPhase.UnsignedPhase
Duration of the unsigned phase.
Type: u32
SCALE-encoded value: 0x84030000
ElectionProviderMultiPhase.SignedPhase
Duration of the signed phase.
Type: u32
SCALE-encoded value: 0x84030000
ElectionProviderMultiPhase.BetterSignedThreshold
The minimum amount of improvement to the solution score that defines a solution as "better" in the Signed phase.
Type: Perbill
SCALE-encoded value: 0x00000000
ElectionProviderMultiPhase.BetterUnsignedThreshold
The minimum amount of improvement to the solution score that defines a solution as "better" in the Unsigned phase.
Type: Perbill
SCALE-encoded value: 0x20a10700
ElectionProviderMultiPhase.OffchainRepeat
The repeat threshold of the offchain worker. For example, if it is 5, that means that at least 5 blocks will elapse between attempts to submit the worker's solution.
Type: u32
SCALE-encoded value: 0x1c000000
ElectionProviderMultiPhase.MinerTxPriority
The priority of the unsigned transaction submitted in the unsigned-phase
Type: u64
SCALE-encoded value: 0x65666666666666e6
ElectionProviderMultiPhase.SignedMaxSubmissions
Maximum number of signed submissions that can be queued. It is best to avoid adjusting this during an election, as it impacts downstream data structures. In particular,
SignedSubmissionIndices<T>is bounded on this value. If you update this value during an election, you must ensure thatSignedSubmissionIndices.len()is less than or equal to the new value. Otherwise, attempts to submit new solutions may cause a runtime panic.
Type: u32
SCALE-encoded value: 0x10000000
ElectionProviderMultiPhase.SignedMaxWeight
Maximum weight of a signed solution. If [
Config::MinerConfig] is being implemented to submit signed solutions (outside of this pallet), then [MinerConfig::solution_weight] is used to compare against this value.
Type: {"refTime":"Compact<u64>","proofSize":"Compact<u64>"}
SCALE-encoded value: 0x075888a795961366666666666666a6
ElectionProviderMultiPhase.SignedMaxRefunds
The maximum amount of unchecked solutions to refund the call fee for.
Type: u32
SCALE-encoded value: 0x04000000
ElectionProviderMultiPhase.SignedRewardBase
Base reward for a signed solution
Type: u128
SCALE-encoded value: 0x00000000000000000000000000000000
ElectionProviderMultiPhase.SignedDepositBase
Base deposit for a signed solution.
Type: u128
SCALE-encoded value: 0x005a6202000000000000000000000000
ElectionProviderMultiPhase.SignedDepositByte
Per-byte deposit for a signed solution.
Type: u128
SCALE-encoded value: 0xd0030000000000000000000000000000
ElectionProviderMultiPhase.SignedDepositWeight
Per-weight deposit for a signed solution.
Type: u128
SCALE-encoded value: 0x00000000000000000000000000000000
ElectionProviderMultiPhase.MaxElectingVoters
The maximum number of electing voters to put in the snapshot. At the moment, snapshots are only over a single block, but once multi-block elections are introduced they will take place over multiple blocks.
Type: u32
SCALE-encoded value: 0xe4570000
ElectionProviderMultiPhase.MaxElectableTargets
The maximum number of electable targets to put in the snapshot.
Type: u16
SCALE-encoded value: 0xffff
ElectionProviderMultiPhase.MaxWinners
The maximum number of winners that can be elected by this
ElectionProviderimplementation. Note: This must always be greater or equal toT::DataProvider::desired_targets().
Type: u32
SCALE-encoded value: 0xb0040000
ElectionProviderMultiPhase.MinerMaxLength
Type: u32
SCALE-encoded value: 0x00003600
ElectionProviderMultiPhase.MinerMaxWeight
Type: {"refTime":"Compact<u64>","proofSize":"Compact<u64>"}
SCALE-encoded value: 0x075888a795961366666666666666a6
ElectionProviderMultiPhase.MinerMaxVotesPerVoter
Type: u32
SCALE-encoded value: 0x10000000
ElectionProviderMultiPhase.MinerMaxWinners
Type: u32
SCALE-encoded value: 0xb0040000
wss://root.rootnet.live/archive/ws · captured 2026-05-02