Skip to content

SIMD-0232: Custom Commission Collector Account#232

Merged
Benhawkins18 merged 6 commits into
solana-foundation:mainfrom
jstarry:block-fee-collection
Aug 11, 2025
Merged

SIMD-0232: Custom Commission Collector Account#232
Benhawkins18 merged 6 commits into
solana-foundation:mainfrom
jstarry:block-fee-collection

Conversation

@jstarry
Copy link
Copy Markdown
Contributor

@jstarry jstarry commented Jan 24, 2025

No description provided.

@jstarry jstarry changed the title SIMD-XXXX: Custom Fee Collector Account SIMD-0232: Custom Fee Collector Account Jan 24, 2025
@jstarry jstarry force-pushed the block-fee-collection branch 5 times, most recently from de734ee to 436083d Compare January 24, 2025 04:53
@buffalu
Copy link
Copy Markdown
Contributor

buffalu commented Feb 12, 2025

how does this work with SIMD-0123?

would a % of the PDA funds get sent to stakers? what if the PDA subtracts the lamports half way through the epoch?

@jstarry
Copy link
Copy Markdown
Contributor Author

jstarry commented Feb 17, 2025

@topointon-jump and I were thinking of this as an alternative approach to solving SIMD-0123 by first allowing collection into a custom address and then later providing a cranking mechanism in another SIMD to distribute the funds. But I think we've agreed to go with SIMD-0123 for now since the cranking mechanism design needs to be thought out and would probably be a sizable change on its own.

@t-nelson
Copy link
Copy Markdown
Contributor

how does 123 preclude this simd?

@jstarry
Copy link
Copy Markdown
Contributor Author

jstarry commented Feb 28, 2025

@t-nelson
Copy link
Copy Markdown
Contributor

oh i think i'd prefer that the changes not be combined. this is desirable even without 123

@jstarry jstarry reopened this Apr 16, 2025
Comment thread proposals/0232-custom-fee-collector.md Outdated
@jstarry jstarry force-pushed the block-fee-collection branch from 436083d to 32607e1 Compare May 14, 2025 07:26
@buffalojoec buffalojoec self-requested a review May 14, 2025 07:34
@jstarry jstarry changed the title SIMD-0232: Custom Fee Collector Account SIMD-0232: Custom Commission Collector Account May 14, 2025
Copy link
Copy Markdown
Contributor

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

Note that this proposal is listed as an alternative in SIMD-123, with drawbacks highlighted, but the roadmap shared in Discord reflects SIMD-232 as incrementally leading up to SIMD-123.

https://github.com/solana-foundation/solana-improvement-documents/pull/123/files#diff-83b8762bc609b496e2e81c57ee42d62e3d6d3447498ccf4d140d2feee9f21dfeR29-R34

Comment thread proposals/0232-custom-commission-collector.md Outdated
The designated commission collector must either be equal to the vote account's
address OR satisfy the following constraints:

1. Must be a system program owned account
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.

The motivation explicitly states that validators cannot use program-derived addresses, thus on-chain programs, for revenue distribution. This constraint preserves that limitation.

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.

No it definitely removes the limitation despite not allowing non system owned accounts. Onchain programs will be able to create system owned pda's for the collector accounts.

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.

What's the rationale for the System program ownership?

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.

Trying to minimize the surface area of possible account state changes the runtime can do outside of the SVM. By limiting to system program ownership, we implicitly make it impossible to do things like collect your commission into the system program account or some other unexpected place.

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.

im a little confused here. by allowing system program, won't you give up programmatic control of the fees?

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.

Onchain programs will be able to create system owned pda's for the collector accounts.

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.

Ok, this works for me. The only thing that's left off the table is some PDA that must carry data, which would be owned by the user program still. I think that's ok, since programs can work around that limitation programmatically before providing a PDA signature.

It's also more performant to ensure the owner is System, rather than go through some handful of constraints like reserved account keys or multiple disallowed owners.

Comment thread proposals/0232-custom-commission-collector.md
@jstarry
Copy link
Copy Markdown
Contributor Author

jstarry commented May 16, 2025

Note that this proposal is listed as an alternative in SIMD-123, with drawbacks highlighted, but the roadmap shared in Discord reflects SIMD-232 as incrementally leading up to SIMD-123.

Yeah thanks for calling it out, I need to clean up SIMD-123 with the latest updates to the rollout plan.

The designated commission collector must either be equal to the vote account's
address OR satisfy the following constraints:

1. Must be a system program owned account
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.

Ok, this works for me. The only thing that's left off the table is some PDA that must carry data, which would be owned by the user program still. I think that's ok, since programs can work around that limitation programmatically before providing a PDA signature.

It's also more performant to ensure the owner is System, rather than go through some handful of constraints like reserved account keys or multiple disallowed owners.

Comment on lines +95 to +103
For a given epoch `E`, the earned inflation rewards for each vote account are
calculated at the beginning of the next epoch `E + 1`. This proposal doesn't
change the commission calculation but it does define new rules for how the
calculated commission rewards are collected into an account. Rather than
collecting the inflation rewards commission into the vote accounts by default,
the protocol must fetch the inflation rewards commission collector address from
the vote account state at the beginning of epoch `E + 1`. This is the same
vote account state used to get the commission rate and latest vote credits
for inflation rewards calculation.
Copy link
Copy Markdown
Contributor

@topointon-jump topointon-jump Aug 1, 2025

Choose a reason for hiding this comment

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

Sorry to raise this now, but could we avoid having to cache the commission collector account across epochs? Cross-pasting from a discussion in #consensus:

Data that needs to be persisted for business logic operations such as paying rewards out, should be persisted on-chain and not solely in a cache that each client has to re-create on re-start. If a particular client wants to add a cache then they obviously are able to, but falling back to on-chain data should always be an option.

Two questions:

  • Do we need to use older versions of this field? Can't we just use the current commission collector account in the vote state at the point of the rewards payout slot? Is there a good reason not to do this?
  • If we do need to use the collector account from previous epochs, could we store this data on-chain, possibly in a PDA keyed by epoch? This would make implementing this much easier.

Thank-you so much, and again sorry for not raising this before.

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.

Do we need to use older versions of this field? Can't we just use the current commission collector account in the vote state at the point of the rewards payout slot? Is there a good reason not to do this?

Part of the design of this SIMD was done with the idea that some validators will implement their own reward distribution mechanisms using these collector accounts. I feel it's best to not allow rugging those custom reward mechanisms by enforcing a few epoch's delay before applying new collector accounts. This is similar to the idea of avoiding commission rugs by delaying commission rate updates.

If we do need to use the collector account from previous epochs, could we store this data on-chain, possibly in a PDA keyed by epoch? This would make implementing this much easier.

As discussed in #consensus in Discord, we should definitely move to storing this data onchain but it's a reasonably large effort so I think it's best to tackle that later and not delay shipping SIMD-0123.

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.

Agreed in the discord chat, shipping SIMD-0123 is the priority - approved this SIMD. Having a long-term plan to move this data on-chain is awesome though.

@Benhawkins18 Benhawkins18 merged commit 2cf861d into solana-foundation:main Aug 11, 2025
2 checks passed
@jstarry jstarry deleted the block-fee-collection branch August 11, 2025 14:51
This was referenced Sep 24, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants