Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 0fa9a94

Browse files
mvinesmergify[bot]
authored andcommitted
Initial feature proposal documentation
1 parent 2ce4817 commit 0fa9a94

File tree

2 files changed

+148
-0
lines changed

2 files changed

+148
-0
lines changed

docs/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
"memo",
1111
"shared-memory",
1212
"stake-pool",
13+
"feature-proposal",
1314
],
1415
},
1516
};

docs/src/feature-proposal.md

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
---
2+
title: Feature Proposal Program
3+
---
4+
5+
The Feature Proposal Program provides a workflow for activation of Solana
6+
network features through community vote based on validator stake weight.
7+
8+
Community voting is accomplished using [SPL Tokens](token.md). Tokens are
9+
minted that represent the total active stake on the network, and distributed to
10+
all validators based on their stake. Validators vote for feature activation by
11+
transferring their vote tokens to a predetermined address. Once the vote
12+
threshold is met the feature is activated.
13+
14+
## Background
15+
16+
The Solana validator software supports runtime feature activation through the
17+
built-in `Feature` program. This program ensures that features are activated
18+
simultaneously across all validators to avoid divergent behavior that would
19+
cause hard forks or otherwise break consensus.
20+
21+
The
22+
[feature](https://docs.rs/solana-program/latest/solana_program/feature/index.html)
23+
and [feature_set](https://docs.rs/solana-sdk/latest/solana_sdk/feature_set/index.html)
24+
Rust modules are the primitives for this facility, and the `solana feature`
25+
command-line subcommands allow for easy feature status inspection and feature
26+
activation.
27+
28+
The `solana feature activate` workflow was designed for use by the core Solana
29+
developers to allow for low-overhead addition of non-controversial network
30+
features over time.
31+
32+
The Feature Proposal Program provides an additional mechanism over these runtime
33+
feature activation primitives to permit feature activation by community vote
34+
when appropriate.
35+
36+
## Source
37+
The Feature Proposal Program's source is available on
38+
[github](https://github.com/solana-labs/solana-program-library)
39+
40+
## Interface
41+
The Feature Proposal Program is written in Rust and available on [crates.io](https://crates.io/crates/spl-feature-proposal) and [docs.rs](https://docs.rs/spl-feature-proposal).
42+
43+
## Command-line Utility
44+
The `spl-feature-proposal` command-line utility can be used to manage feature
45+
proposal. Once you have [Rust installed](https://rustup.rs/), run:
46+
```sh
47+
$ cargo install spl-feature-proposal-cli
48+
```
49+
50+
Run `spl-feature-proposal --help` for a full description of available commands.
51+
52+
### Configuration
53+
The `spl-feature-proposal` configuration is shared with the `solana` command-line tool.
54+
55+
## Feature Proposal Life Cycle
56+
57+
This section describes the life cycle of a feature proposal.
58+
59+
### Implement The Feature
60+
The first step is to conceive of the new feature and realize it in the
61+
Solana code base, working with the core Solana developers at https://github.com/solana-labs/solana.
62+
63+
During the implementation, a *feature id* will be required to identity the new
64+
feature in the code base to avoid the new functionality until its activation.
65+
The *feature id* for a feature proposal is derived by running the following
66+
commands.
67+
68+
First create a keypair for the proposal:
69+
```
70+
$ solana-keygen new --outfile feature-proposal.json --silent --no-passphrase
71+
Wrote new keypair to feature-proposal.json
72+
```
73+
74+
Now run the `spl-feature-proposal` program to derive the *feature id*:
75+
```
76+
$ spl-feature-proposal address feature-proposal.json
77+
Feature Id: HQ3baDfNU7WKCyWvtMYZmi51YPs7vhSiLn1ESYp3jhiA
78+
Token Mint Address: ALvA7Lv9jbo8JFhxqnRpjWWuR3aD12uCb5KBJst4uc3d
79+
Acceptance Token Address: AdqKm3mSJf8AtTWjfpA5ZbJszWQPcwyLA2XkRyLbf3Di
80+
```
81+
which in this case is `HQ3baDfNU7WKCyWvtMYZmi51YPs7vhSiLn1ESYp3jhiA`.
82+
83+
`HQ3baDfNU7WKCyWvtMYZmi51YPs7vhSiLn1ESYp3jhiA` is the identifier that will be
84+
used in the code base and eventually will be visible in the `solana feature status` command.
85+
86+
Note however that it is not possible to use `solana feature activate` to
87+
activate this feature, as there is no private key for
88+
`HQ3baDfNU7WKCyWvtMYZmi51YPs7vhSiLn1ESYp3jhiA`. Activation of this feature is
89+
only possible by the Feature Proposal Program.
90+
91+
### Initiate the Feature Proposal
92+
93+
After the feature is implemented and deployed to the Solana cluster,
94+
the *feature id* will be visible in `solana feature status` and the *feature
95+
proposer* may initiate the community proposal process.
96+
97+
This is done by running:
98+
```
99+
$ spl-feature-proposal propose feature-proposal.json
100+
Feature Id: HQ3baDfNU7WKCyWvtMYZmi51YPs7vhSiLn1ESYp3jhiA
101+
Token Mint Address: ALvA7Lv9jbo8JFhxqnRpjWWuR3aD12uCb5KBJst4uc3d
102+
Delivery Token Address: GK55hNft4TGc3Hg4KzbjEmju8VfaNuXK8jQNDTZKcsNF
103+
Acceptance Token Address: AdqKm3mSJf8AtTWjfpA5ZbJszWQPcwyLA2XkRyLbf3Di
104+
Number of validators: 376
105+
Tokens to be minted: 134575791.53064314
106+
Tokens required for acceptance: 90165780.3255309 (67%)
107+
Token distribution file: feature-proposal.csv
108+
JSON RPC URL: http://api.mainnet-beta.solana.com
109+
110+
Distribute the proposal tokens to all validators by running:
111+
$ solana-tokens distribute-spl-tokens --from GK55hNft4TGc3Hg4KzbjEmju8VfaNuXK8jQNDTZKcsNF --input-csv feature-proposal.csv --db-path db.8CyUVvio --fee-payer ~/.config/solana/id.json --owner <FEATURE_PROPOSAL_KEYPAIR>
112+
$ solana-tokens spl-token-balances --mint ALvA7Lv9jbo8JFhxqnRpjWWuR3aD12uCb5KBJst4uc3d --input-csv feature-proposal.csv
113+
114+
Once the distribution is complete, request validators vote for the proposal by first looking up their token account address:
115+
$ spl-token --owner ~/validator-keypair.json accounts ALvA7Lv9jbo8JFhxqnRpjWWuR3aD12uCb5KBJst4uc3d
116+
and then submit their vote by running:
117+
$ spl-token --owner ~/validator-keypair.json transfer <TOKEN_ACCOUNT_ADDRESS> ALL AdqKm3mSJf8AtTWjfpA5ZbJszWQPcwyLA2XkRyLbf3Di
118+
119+
Periodically the votes must be tallied by running:
120+
$ spl-feature-proposal tally 8CyUVvio2oYAP28ZkMBPHq88ikhRgWet6i4NYsCW5Cxa
121+
Tallying is permissionless and may be run by anybody.
122+
Once this feature proposal is accepted, the HQ3baDfNU7WKCyWvtMYZmi51YPs7vhSiLn1ESYp3jhiA feature will be activated at the next epoch.
123+
124+
Add --confirm flag to initiate the feature proposal
125+
```
126+
127+
If the output looks good run the command again with the `--confirm` flag to
128+
continue, and then follow the remaining steps in the output to distribute the
129+
vote tokens to all the validators.
130+
131+
**COST:** As a part of token distribution, the *feature proposer* will be
132+
financing the creation of SPL Token accounts for each of the validators. A SPL
133+
Token account requires 0.00203928 SOL at creation, so the cost for initiating a
134+
feature proposal on a network with 500 validators is approximately 1 SOL.
135+
136+
### Tally the Votes
137+
138+
After advertising to the validators that a feature proposal is pending their
139+
acceptance, the votes are tallied by running:
140+
```
141+
$ spl-feature-proposal tally 8CyUVvio2oYAP28ZkMBPHq88ikhRgWet6i4NYsCW5Cxa
142+
```
143+
Anybody may tally the vote. Once the required number of votes are tallied, the
144+
feature will be automatically activated at the start of the next epoch.
145+
146+
Upon a successful activation the feature will now show as activated by
147+
`solana feature status` as well.

0 commit comments

Comments
 (0)