Skip to content

SIMD-0123: Refine inclusion based on Alpenglow, remove DepositDelegatorRewards - #641

Closed
joncinque wants to merge 3 commits into
solana-foundation:mainfrom
joncinque:s123-ag
Closed

joncinque wants to merge 3 commits into
solana-foundation:mainfrom
joncinque:s123-ag

Conversation

@joncinque

@joncinque joncinque commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

It isn't possible to implement SIMD-0123 as written without introducing a new cache for delegated stakes at the end of the rewarded epoch. Also, Alpenglow updates the inflation reward mechanism substantially through its VAT inclusion of validators, which isn't reflected in SIMD-0123.

Finally, the design for DepositDelegatorRewards needs to be reworked.

Summary of changes

Refine the SIMD to specify a dependency on Alpenglow, how to calculate the block reward amounts using RewardEpochDelegatedStakes, and how to handle different vote accounts based on stake amount and VAT paying.

Also, remove DepositDelegatorRewards, which will be included in a separate SIMD.

#### Problem

It isn't possible to implement SIMD-0123 as written without introducing
a new cache for delegated stakes at the end of the rewarded epoch. Also,
Alpenglow updates the inflation reward mechanism substantially through
its VAT inclusion of validators, which isn't reflected in SIMD-0123.

#### Summary of changes

Refine the SIMD to specify a dependency on Alpenglow, how to calculate
the block reward amounts using `RewardEpochDelegatedStakes`, and how
to handle different vote accounts based on stake amount and VAT paying.
@simd-bot

simd-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

Hello joncinque! Welcome to the SIMD process. By opening this PR you are affirming that your SIMD has been thoroughly discussed and vetted in the SIMD discussion section. The SIMD PR section should only be used to submit a final technical specification for review. If your design / idea still needs discussion, please close this PR and create a new discussion here.

This PR requires the following approvals before it can be merged:

Once all requirements are met, you can merge this PR by commenting /merge.

@joncinque joncinque changed the title SIMD-0123: Refine calculation and inclusion based on Alpenglow SIMD-0123: Refine inclusion based on Alpenglow, remove DepositPendingDelegatorRewards Oct 5, 2026
@joncinque joncinque changed the title SIMD-0123: Refine inclusion based on Alpenglow, remove DepositPendingDelegatorRewards SIMD-0123: Refine inclusion based on Alpenglow, remove DepositDelegatorRewards Oct 5, 2026
@simd-bot

simd-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

Thanks, 0x0ece!

⚠️ Status: Cannot merge yet

buffalojoec
buffalojoec previously approved these changes Oct 6, 2026
Comment on lines +186 to +194
Also note that `A` (active stake) MUST be derived from the stake from the end of
the epoch, and not the cached epoch stakes. The cached epoch stakes amount does
not include inflation rewards earned during the rewarded epoch, so it is
incorrect for the calculation.

If block rewards need to be recalculated, due to restarting a node during the
distribution phase, the `RewardEpochDelegatedStakes` account created by
Alpenglow's inflation reward system may be used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like an agave implementation detail, not protocol? the key seems to be something like "the calculation MUST be performed with inflation rewards applied for the operative epoch"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that's correct. There's enough footguns in the code, so I wanted to try and clarify a bit. As it was written, the SIMD assumed that the end-of-epoch values were easily available, which was not the case until Alpenglow added them.

I can definitely also remove everything after the first sentence if you think that's better, or soften everything after the first sentence -- it's why the second paragraph uses "may" language.

Comment on lines +241 to +242
Similar to inflation rewards, vote accounts that are excluded from the active
validator set do not participate in block revenue distribution; all pending

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the vat quorum in sync with or ahead of the leader schedule? seems like leader schedule is what should be gating block rev distribution

@joncinque joncinque Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VAT is one epoch ahead. A validator pays VAT at the start of epoch E, to be included in the epoch stakes / leader schedule for E + 1.

If a validator has low stake, and doesn't get any leader slots, but pays the VAT, they still get inflation rewards, so to be consistent, they should also participate in block revenue distribution.

Edit: that was my thinking, at least

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for block revenue earned in E and distributed in E+1, the VAT collected at the start of E+1 determines admission for E+2.

is the intention that failing admission for E+2 burns delegators' block revenue already accumulated in E? even though the validator's own block commission has already been paid?

if so, can we state that explicitly here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's exactly correct. I'll add a sentence about it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's exactly correct

To be honest, I didn’t quite understand.

Does “correct” mean that if a validator was validating in epoch E, but is not validating in epoch E+2 (regardless of the reason, whether it’s insufficient stake or insufficient balance), then its delegators won’t receive rewards for epoch E in epoch E+1?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alpenglow persists some of that data on-chain for inflation reward calculations

Can you explain what exactly, from a technical standpoint, prevents inflation rewards from being calculated and paid out here? Because I don’t see how this differs from Tower. All I can see is that credits have been renamed to lamports in the vote account state (with a somewhat different algorithm for accruing them), but I still don’t see how VAT for E+1 prevents inflation rewards from being calculated for E-1.

I’ll clarify my other unanswered questions after you answer this one, because the answer to this question determines how the rest of my questions branch, and I’d rather not have to spell out every possible branch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, inflation rewards are calculated using a cache of stake and vote account states from the previous epoch. What I don’t understand is how that cache could possibly change after the epoch has started if VAT for E+1 hasn’t been paid.

Unless the algorithm explicitly includes a check like this:

for each vote_account from vote_accounts_from_epoch(E-1)
  if not vote_accounts_from_epoch(E+1).contains(vote_account) then
    continue
...

But I find it hard to call that a technical limitation. If that’s the case, it looks like a deliberate decision by the developers to unfairly deprive delegators of their rewards. Again, only if that’s actually what’s happening.

I genuinely can’t think of any other explanation, which is why I’m asking the question in my previous post.

And if that really is the case, I want to understand the actual reasoning behind that decision. That’s what I asked earlier but never got an answer to.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on everything I know so far, it seems to me that solving this issue (in my message above) would also resolve all the other problems.

@dimandotsol dimandotsol Oct 19, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I found #13230 and #13061, so I understand that you’re aware of the issue. However, I strongly disagree with the conclusion that this is somehow the same as before. No, it’s not.

The worst-case scenario before was a validator closing their own vote account, thereby depriving their delegators of inflation rewards.

What has been implemented now does not depend on the validator’s actions — they can fall out of the set through no fault of their own.

In other words, it wouldn’t be their action or decision. It could even be the result of an attack.

The same applies to burning. I can easily imagine a scenario where a validator receives a large MEV reward (non-Jito) into their vote account near the end, and someone deliberately pushes them out of the set to avoid negatively affecting their own APY statistics.

What I’m trying to say is that, in my opinion, this PR shouldn’t exist at all. You’re trying to change the 123 specification to accommodate existing implementation bugs. What happens once those bugs are fixed? Are we going to change the 123 specification again?

To me, these bugs are blockers for the development of 123. And this isn’t the first time. For the past 2.5 years, 123 has been constantly blocked by various issues.

So the bugs should be fixed, rather than changing the specification.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like it'll be possible to use the previous epoch set, we had a discussion about it: https://discord.com/channels/428295358100013066/489504501749907468/1561755992348426302

Either way, the current design for this SIMD must be changed in some way, since it can't be implemented without introducing more tech debt, as I explained earlier.

The final question will be whether we block 123 until we've specced and implemented the changes. I understand that you're against that, and many others may agree with you, so we'll take all that into consideration.

| --- | --- | --- | --- | --- | --- |
| > 0 | > 0 | Yes | Yes | Yes | No |
| 0 | > 0 | Yes | No | No | No |
| 0 | 0 | N/A cannot | Yes | No | Yes |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trying to reconcile this with Delegator Rewards Calculation section above.

My parsing of that section is we return pending rewards to the voter whenever active stake is zero, whereas this row requires sweeping and burning them.

similar issue for the last row: zero stake in E, positive stake in E+1, and no VAT payment.

I think we need to make the precedence explicit in the calculation algorithm:

  1. excluded accounts are swept for burning
  2. admitted accounts with zero rewarded-epoch stake retain lamports

pending counter should still be reset in both cases

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "return pending rewards when stake is 0" only applies to one situation, which is non-zero activating stake in E, since voters with 0 stake are excluded from VAT admission.

I can add that language in the earlier section to make it clear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And actually, given the amendment we're considering for DepositDelegatorRewards in #686, it would become impossible for a validator to be in this state, since it wouldn't be possible for a vote account to receive delegator rewards while at 0 stake.

I'll spell it out anyway, since the protocol should have a way of handling that situation, should it come up due to future changes.

Comment on lines +241 to +242
Similar to inflation rewards, vote accounts that are excluded from the active
validator set do not participate in block revenue distribution; all pending

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for block revenue earned in E and distributed in E+1, the VAT collected at the start of E+1 determines admission for E+2.

is the intention that failing admission for E+2 burns delegators' block revenue already accumulated in E? even though the validator's own block commission has already been paid?

if so, can we state that explicitly here?

Comment on lines +249 to +250
Concretely, this means that for block revenue earned in epoch E, the validator
MUST pay VAT at the start of E + 1, or those lamports are burned.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reasoning behind this decision?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my other comment covers the explanation for the decision: #641 (comment)

But let me know if there are still other questions

@bw-solana

Copy link
Copy Markdown
Contributor

It sounds like we all recognize admission into E+2 should not determine reward payouts for E.

The question is if we block SIMD-0123 on this change, which effectively means slipping the feature to v4.5, or not.

I lean towards blocking on making this change and living with pushing this out a release to avoid spec and feature thrash. I was originally thinking this is limited to validators that are shutting down, but Diman brings up a good point that with the new VAT rules, there are a variety of reasons one might be excluded.

@joncinque

Copy link
Copy Markdown
Contributor Author

Fair enough! I'll close this and work on fixing rewards 🫡

@dimandotsol

Copy link
Copy Markdown

I know it’s closed, but I hope GitHub will notify everyone who participated in this issue. I’m not sure this is substantial enough to warrant a full discussion, and I feel like it would just get lost in Discord.

I had an idea that it might be worth taking an actual snapshot of vote accounts at the beginning of each epoch and storing all consensus- and validation-relevant variables in a dedicated account.

Such an account would have two sources of truth: the previous account of the same type (to retrieve values configured by validators for E+2) and the current state of vote accounts.

This would create a single source of truth for all consensus-related variables, including for online readers.

It would also simplify the logic for storing and updating data in vote accounts, since only one value per variable would need to be stored.

The consensus state would no longer depend on the possibility of a vote account being deleted. Technically, a vote account could be deleted and recreated (I’m not sure how credit comparison works now compared to how it worked before AG). But I think removing this dependency would be a good step forward.

To be honest, I would also move the current lamports (credits before AG) out of the vote account, probably into a single account per epoch. That way, the vote account would simply become a declaration of the validator’s intended parameters.

I’m not sure how it’s currently implemented, but in general, the total amount of active stake for each validator could also be stored there. This would similarly eliminate any dependency on stake accounts being deleted. I’m not saying such a dependency currently exists, but I suspect that, for certain purposes, it’s necessary to maintain a cache of what the state looked like one epoch ago.

This is probably nothing more than a cache that already exists, just made available on-chain.

@dimandotsol

Copy link
Copy Markdown

What I mean is that when the vote account was originally designed, everything was simple: all changes took effect within a single block at the epoch boundary (with one small exception). Over time, more exceptions have emerged, and we’ve gained some experience along the way. So maybe it’s simply time to rethink how all this data is stored, with an eye toward the future.

@joncinque

Copy link
Copy Markdown
Contributor Author

@dimandotsol you'll be happy to see that we're actively considering all of these points!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants