Leader Info Syscall
- Idea
- Draft
- Review
- Accept
- Implement
- Active
Decision brief
Why this proposal matters
Create a new syscall that returns the leader for the current & the next slot. fn sol_get_leader(result: *mut u8) -> u64
Proposal at a glance
What changes
- The leader_identity and leader_vote fields must be the block producer's identity pubkey and vote account pubkey for the current slot. The next_leader_identity and next_leader_vote fields must be the block producer's identity pubkey and vote account pubkey for slot current_slot + 1.
- For the duration of an epoch, the leader_identity, leader_vote, next_leader_identity, and next_leader_vote fields must correspond to the canonical leader schedule generated for that epoch. This is to address mid-epoch UpdateValidatorIdentity changes and the fact that multiple vote accounts may correspond to the same identity.
- Create a new syscall that returns the leader for the current & the next slot. fn sol_get_leader(result: *mut u8) -> u64
Stakeholder map
Who is affected
Builders & client teams Medium impact
Programs such as market makers may now use this syscall to better update quotes based on specific and undesirable leader characteristics. This will further improve the robustness of Solana's market-making environment.
Action requirement unknownValidators & operators Medium impact
The leader_identity and leader_vote fields must be the block producer's identity pubkey and vote account pubkey for the current slot. The next_leader_identity and next_leader_vote fields must be the block producer's identity pubkey and vote account pubkey for slot current_slot + 1.
Action may be requiredUsers & stakers Impact unknown
No proposal-specific evidence was found for this group.
Action requirement unknownGovernance & ecosystem Impact unknown
No proposal-specific evidence was found for this group.
Action requirement unknownExact source revision
Full proposal document
0616093b2952Summary
Create a new syscall that returns the leader for the current & the next slot.
fn sol_get_leader(result: *mut u8) -> u64
Motivation
Currently it is not possible to identify the leader for a given slot fully onchain. This information is needed for market makers to update quotes based on swaps coming in on specific leaders (e.g. a leader is malicious, very remote, or has historically unreliable scheduling characteristics).
New Terminology
No new terminology is introduced by this proposal.
Detailed Design
This syscall is intended to be an account-less sysvar accessor. It validates the complete 128 byte result pointer and returns a result in accordance with the details below.
Returned Result
#[repr(C)]
pub struct LeaderInfo {
pub leader_identity: Pubkey,
pub leader_vote: Pubkey,
pub next_leader_identity: Pubkey,
pub next_leader_vote: Pubkey
}
The LeaderInfo struct is written to the result formal by the syscall.
The leader_identity and leader_vote fields
must be the block producer's identity pubkey and vote account pubkey for the
current slot. The next_leader_identity and next_leader_vote fields must be
the block producer's identity pubkey and vote account pubkey for slot
current_slot + 1.
Returned Value
The syscall itself returns 0 on success. If any validation condition fails,
the syscall aborts VM execution without returning to the calling program.
Program Access
Programs may access the LeaderInfo information via the sol_get_leader syscall.
No sysvar is introduced.
CU Cost
This syscall copies data into a caller-provided memory address similar to the
sysvar-specific getter syscalls (SolGetClockSysvar,
SolGetLastRestartSlotSysvar, etc.).
We price this syscall in line with the cost model used by those
syscalls (100 + size_of::<T>() as u64).
Under this model, sol_get_leader costs 100 + 32 * 4 = 228 CU.
Leader & Vote Pubkeys
For the duration of an epoch, the leader_identity, leader_vote,
next_leader_identity, and next_leader_vote fields must correspond to the
canonical leader schedule generated for that epoch. This is to address
mid-epoch UpdateValidatorIdentity changes and the fact that multiple vote
accounts may correspond to the same identity.
Epoch Boundaries
On the last slot of an epoch, when the next leader is in epoch
current_epoch + 1, the next_leader value represents the first leader of
the next epoch. This value comes from the next epoch's leader schedule.
Alternatives Considered
- Add fields to the current
Clock. This was rejected as many programs assert invariants likeclock.data().len() == 40, so adding fields would break these programs. - Only include the current leader. We opted to include both current and next because knowledge of the next leader enables programs to compensate for, for example, the next leader having a history of outright censorship. A program can then take actions to ensure that its state remains valid even if it is censored for the entire next leader window. Even though the current / next leader will usually be the same it is only 64 bytes / CU and other schemes for counting the next leader (i.e, the actual next non-current leader) seemed to have awkward semantics or would exhibit odd behavior on single-node clusters. The % of time that these fields are the same will also decrease as we shorten leader windows.
- A full
LeaderSchedulesysvar containing the entire schedule for the current epoch. This was rejected to avoid variable-length sysvars and because the account would be well over 200,000 bytes. Additionally, getting the current slot fromClockand indexing by window offset makes the current-leader lookup costO(500)CU instead ofO(228)CU here.
Impact
Programs such as market makers may now use this syscall to better update quotes based on specific and undesirable leader characteristics. This will further improve the robustness of Solana's market-making environment.
Programs will need to be recompiled and redeployed to adopt this feature.
Similar to the Clock, programs relying on this syscall may exhibit different
behavior if simulated and executed at different slots.
Security Considerations
None
Backwards Compatibility
Programs accessing this syscall could not be used on Solana versions which do not implement it. Existing programs that do not use this syscall are not impacted. Therefore, a feature gate should be used to enable this feature when the majority of the cluster is using the required version.
Evidence graph
Related proposals and rollout
One or more sources are unavailable.
Upstream review record
Upstream discussion & review
GitHub review is editorial context, not evidence of on-chain support, voting, or outcome.
PR #621 · merged SIMD-0558 - Leader Info Syscall 28 comments and reviews · Sep 10, 2026What does this mean "validates" the pointer? Does it assert it's non-null? Does it assert it's a stack or heap pointer like SIMD-0459(https://github.com/solana-foundation/solana-improvement-documents/blob/main/proposals/0459-syscall-parameter-address-restrictions.md)? Is this SIMD dependent on SIMD-0459, or can validation of said pointer happen before SIMD-0459 is activated? I'm also assuming this means the syscall will assert result, result + 128) is not read-only? It might seem gratuitous, but these docs are supposed to be specs.
GitHub ↗nit: I'm assuming this 100 is sysvarbasecost? This isn't a sysvar, so I wouldn't price it like one. I'd use the variable name syscallbasecost (which is also 100) here instead, in case we ever change syscallbasecost.
GitHub ↗I think this SIMD is now in a much better shape than the original version, but I don't think it makes any sense to have merged it while it is proposing a new syscall instead of using the existing solgetsysvar. Is there some reason why we thought that was a good idea?
GitHub ↗I guess linking back to the discussion I can see why this was framed this way. If we want to make this call available via Static Sysvars, then maybe the framing is okay. I would have liked to hash this out a bit, though.
GitHub ↗@buffalojoec that's my fault. I thought we already had SME review on this one for some reason ☠️ let's not let my process fuckup leave us with a suboptimal design. if we just need to tweak things, let's open a PR to amend. if there are big disagreements on the design, let's hash those out in the discussion, abandon this, and re-create
GitHub ↗@buffalojoec that's my fault. I thought we already had SME review on this one for some reason ☠️ let's not let my process fuckup leave us with a suboptimal design. if we just need to tweak things, let's open a PR to amend. if there are big disagreements on the design, let's hash those out in the discussion, abandon this, and re-create No need to abandon. Let's nail it down here and PR later. It's almost there imo. It is my strong preference that we put this in the sysvar cache and use solgetsysvar, and as Trent suggested, not assign it an address or an account. It does not make sense to have a special behavior just for handling this one thing. If we migrate to static sysvars later, not havin
GitHub ↗@buffalojoec that's my fault. I thought we already had SME review on this one for some reason ☠️ let's not let my process fuckup leave us with a suboptimal design. if we just need to tweak things, let's open a PR to amend. if there are big disagreements on the design, let's hash those out in the discussion, abandon this, and re-create No need to abandon. Let's nail it down here and PR later. It's almost there imo. It is my strong preference that we put this in the sysvar cache and use solgetsysvar, and as Trent suggested, not assign it an address or an account. It does not make sense to have a special behavior just for handling this one thing. If we migrate to static sysvars later, not havin
GitHub ↗I'm on board for solgetsysvar as well. @soundsonacid if you don't mind PR'ing an amendment that would be great.
GitHub ↗Provenance
Evidence & technical details
Rollout or chain data, source revisions, freshness and integrity. 2
Provenance
Evidence & technical details
Rollout or chain data, source revisions, freshness and integrity.SIMD
Deployment Status
Feature Gate not yet created
Exact source revision
Sources & integrity
- Proposal document pinned_commit_blob
0616093b2952ed6de52c4a27d66aadd11d48d4f9 - simd-document document · stale · Sep 10, 2026
0616093b2952ed6de52c4a27d66aadd11d48d4f9
One or more sources are unavailable.
simd.watch community discussion · SIMD-0558
Powered by Giscus · Sign in with GitHub to comment
Community comments load when this section approaches the viewport.