Skip to content

Commit 0131156

Browse files
committed
SIMD-0123: Block Fee Distribution
1 parent 9347aec commit 0131156

File tree

1 file changed

+145
-0
lines changed

1 file changed

+145
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
---
2+
simd: '0123'
3+
title: Block Fee Distribution
4+
authors: Justin Starry (Anza)
5+
category: Standard
6+
type: Core
7+
status: Draft
8+
created: 2024-03-10
9+
feature: (fill in with feature tracking issues once accepted)
10+
---
11+
12+
## Summary
13+
14+
A new mechanism for distributing block fees to delegated stake accounts is
15+
proposed to allow validators to share block fee revenue with their delegators.
16+
Validators will be able to specify a commission rate for block fees and the
17+
protocol will automatically distribute the remaining fees to delegated stake
18+
accounts at the end of each epoch.
19+
20+
## Motivation
21+
22+
Delegated stake directly increases the number of blocks that a validator is allocated
23+
in an epoch leader schedule but the core protocol doesn't support diverting any of
24+
that extra revenue to stake delegators.
25+
26+
## Alternatives Considered
27+
28+
Due to the lack of core protocol support for this feature, validators have
29+
developed independent ways to distribute block revenue which is not enforced by
30+
the core protocol. For example, the Cogent validator diverts part of its fee
31+
revenue to NFT holders. But it's up the NFT holders to audit and hold Cogent
32+
accountable to promised commission.
33+
34+
Another alternative is Jito's mechanism for block "tips" (not fees, but the idea
35+
is similar). Jito's validator implementation includes a tip distribution program
36+
which it instructs validator operators to divert all of their tips to but cannot
37+
enforce perfect compliance. It's up to stakers and the Jito team to audit
38+
compliance by validator operators. This mechanism requires trusting a
39+
third-party (in this case Jito) to calculate reward distribution in an accurate
40+
and fair mannger. It also relies on using a merkle tree to distribute fees to
41+
all stake accounts and the distributed fees are not automatically staked in
42+
recipient stake accounts.
43+
44+
## New Terminology
45+
46+
- validator fee program: New core program which supports diverting a portion of
47+
block fees to stake delegators
48+
49+
- validator fee account: New account type which supports setting a commission
50+
for collected block fees
51+
52+
## Detailed Design
53+
54+
Currently, all block fees, including both transaction base fees and priority
55+
fees, are collected into a validator's node id account. As of SIMD 85, the
56+
validator id account must be both system-owned and rent-exempt to receive
57+
collected fees.
58+
59+
In order to allow validators to set a block fee commission rate, a new validator
60+
fee program and validator fee distribution account is proposed below. Note that
61+
vote accounts cannot be used because there isn't a guaranteed 1:1 mapping from
62+
validator node id addresses to vote accounts.
63+
64+
Since validator node id's are not easily changed and are predominantly used for
65+
paying vote transaction fees, this proposal introduces new fee distribution
66+
accounts whose addresses are derived from validator node ids at a derivation
67+
path proposed below.
68+
69+
### Block Fee Collection
70+
71+
After all transactions are processed in a block for a given leader, rather than
72+
collecting fees into the validator node id account, the protocol REQUIRES
73+
checking the existence of an initialized validator fee account derived from the
74+
leader's node id address. If no account is found at that path or the account has
75+
not been initialized, fees MUST continue being collected into the validator node
76+
id account balance in adherence to SIMD 85 fee collector constraints. If an
77+
initialized account is found, the account MUST be loaded and deserialized to
78+
determine the leader's fee commission. Then the protocol REQUIRES that collected
79+
fees are first split at the determined commission rate and then the commission
80+
fee MUST be transferred to the validator node id account and the leftover fees
81+
MUST be transferred to the validator fee account.
82+
83+
### Block Fee Reward Calculation
84+
85+
At the end of an epoch, validator fee accounts MUST be derived for all validator
86+
node id's in the epoch leader schedule. The protocol REQUIRES checking if an
87+
initialized validator fee account exists and has a lamport surplus above its
88+
rent-exempt balance. For every validator fee account with a lamport surplus,
89+
the lamport surplus is divided evenly by delegated stake weight across all vote
90+
accounts.
91+
92+
TODO: Prevent vote accounts from changing node id?
93+
TODO: Prevent multiple vote accounts for one node?
94+
95+
### Block Fee Reward Distribution
96+
97+
Each fee reward calculated for a delegated stake account will be included into a
98+
list of reward entries which MUST be partitioned and distributed according to
99+
SIMD 118.
100+
101+
102+
### Validator Fee Program
103+
104+
Created as an enshrined SVM program..
105+
106+
TODO
107+
108+
- `InitFeeAccount`
109+
- `UpdateFeeCommission`
110+
111+
### Validator Fee Account
112+
113+
TODO
114+
115+
- `account_type`
116+
- `version`
117+
- `commission`
118+
119+
### Validator Fee Derived Address
120+
121+
TODO
122+
123+
1. `"VALIDATOR_FEE"`
124+
2. Validator node id address
125+
126+
## Impact
127+
128+
Validators will need to initialize and set commissions for their new validator
129+
fee accounts.
130+
131+
Stake delegators will receive additional stake reward income when delegating to
132+
validators who adopt this new feature.
133+
134+
## Security Considerations
135+
136+
TODO
137+
138+
## Drawbacks *(Optional)*
139+
140+
Why should we not do this?
141+
142+
## Backwards Compatibility *(Optional)*
143+
144+
Does the feature introduce any breaking changes? All incompatibilities and
145+
consequences should be listed.

0 commit comments

Comments
 (0)