Skip to content

Commit e1b0a64

Browse files
topointon-jumpjumpsiegel
authored andcommitted
SIMD-0197: fix markdown lint errors
1 parent 396b8b4 commit e1b0a64

File tree

1 file changed

+128
-49
lines changed

1 file changed

+128
-49
lines changed

proposals/0197-chilli-peppers.md

+128-49
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
simd: '0197'
3-
title: Chilli Peppers
3+
title: Chili Peppers
44
authors:
55
- Firedancer Team
66
category: Standard
@@ -13,71 +13,117 @@ feature: (fill in with feature tracking issues once accepted)
1313

1414
## Summary
1515

16-
This proposal adds a new consumable resource governing tiered memory bandwidth usage similar to the way that Compute Units seek to govern CPU usage.
17-
Tiered memory bandwidth will become a performance bottleneck as transaction throughput and total state size increase. This proposal serves to outline changes to the Solana protocol that would enable:
18-
Deterministic, easily computable and cluster-wide separation of state into hot and cold tiers
19-
A new transaction level resource requesting the transfer of state from cold to hot
20-
Block level constraints on the total cold to hot state transition
21-
These added features will allow for a pricing market for the bandwidth from cold state to hot state (via priority fees), and allow block producers to more optimally pack blocks to get the highest possible throughput on already hot state and constrain access to cold state to be within bounds that the validator network will be able to keep up with.
16+
This proposal adds a new consumable resource governing tiered memory bandwidth
17+
usage similar to the way that Compute Units seek to govern CPU usage.
18+
Tiered memory bandwidth will become a performance bottleneck as transaction
19+
throughput and total state size increase. This proposal serves to outline
20+
changes to the Solana protocol that would enable:
21+
- Deterministic, easily computable and cluster-wide separation of state into
22+
hot and cold tiers.
23+
- A new transaction level resource requesting the transfer of state from cold
24+
to hot.
25+
- Block level constraints on the total cold to hot state transition.
26+
27+
These added features will allow for a pricing market for the bandwidth from
28+
cold state to hot state (via priority fees), and allow block producers to more
29+
optimally pack blocks to get the highest possible throughput on already hot
30+
state and constrain access to cold state to be within bounds that the validator
31+
network will be able to keep up with.
2232

2333

2434

2535
## Motivation
2636

27-
In commodity hardware (for fixed cost), there is a fundamental tradeoff between the the size of accessible state and the bandwidth of random access to that state. On-chip caches >> RAM >> SSD >> HDD >> NAS increase by orders of magnitude in size, while falling by orders of magnitude in bandwidth.
28-
For Solana (or any blockchain), treating all state as equivalent (regardless of its usage patterns) means that either total state size will
29-
be limited by the size of RAM, or the throughput of the network will be limited to the bandwidth of disks. Actual usage patterns
30-
(and expectations for future usage patterns as the network grows) show that a relatively small amount of the total state is accessed
37+
In commodity hardware (for fixed cost), there is a fundamental tradeoff between
38+
the the size of accessible state and the bandwidth of random access to that
39+
state. On-chip caches >> RAM >> SSD >> HDD >> NAS increase by orders of
40+
magnitude in size, while falling by orders of magnitude in bandwidth.
41+
For Solana (or any blockchain), treating all state as equivalent (regardless of
42+
its usage patterns) means that either total state size will
43+
be limited by the size of RAM, or the throughput of the network will be limited
44+
to the bandwidth of disks. Actual usage patterns
45+
(and expectations for future usage patterns as the network grows) show that a
46+
relatively small amount of the total state is accessed
3147
frequently, and most of the state is accessed infrequently.
32-
This usage pattern allows a hot/cold tiered state design to allow the total state size available from disk, while achieving the
33-
throughput available from RAM.
48+
This usage pattern allows a hot/cold tiered state design to allow the total
49+
state size available from disk, while achieving the throughput available from
50+
RAM.
3451

3552
## New Terminology
3653

37-
Chili Peppers (State Units?) - a consumable resource representing the number of bytes loaded into the "hot store" (active, frequently
38-
accessed memory) for state operations on the Solana blockchain. Each Chili Pepper corresponds directly to one byte of data loaded, providing
39-
a precise mechanism to quantify and limit the resources consumed by transactions in terms of state memory usage.
40-
Note that Chili Peppers required for a transaction are not the size of hot state touched by the transaction, but rather the amount of cold
41-
state made hot or new state allocated. Transactions that are only accessing already hot state would require 0 Chili Peppers.
42-
43-
Block Chili Pepper Limit - The maximum number of Chili Peppers that can be requested in a single block.
44-
45-
Block Chili Pepper Clock - a cumulative measure of the total Chili Peppers requested since the genesis of the blockchain. At the beginning of each block, the Block State Unit Clock is updated to reflect the cumulative total of Chili Peppers consumed up to that point, ensuring a monotonically increasing record of state consumption.
46-
47-
Account Chili Pepper Clock Timestamp - each account in the "hot" state needs to keep track of the value of the Block Chili Pepper Clock the last time it was accessed (read or written to). This allows determination of which accounts are hot and which are cold.
48-
49-
Hot Cache Size - A new predefined constant, termed "Hot Cache Size" corresponds approximately to the size of the hot state supported
50-
by the validator network. An account is designated as hot if it was last
54+
Chili Peppers (State Units?) - a consumable resource representing the number of
55+
bytes loaded into the "hot store" (active, frequently
56+
accessed memory) for state operations on the Solana blockchain. Each Chili
57+
Pepper corresponds directly to one byte of data loaded, providing
58+
a precise mechanism to quantify and limit the resources consumed by
59+
transactions in terms of state memory usage.
60+
Note that Chili Peppers required for a transaction are not the size of hot
61+
state touched by the transaction, but rather the amount of cold
62+
state made hot or new state allocated. Transactions that are only accessing
63+
already hot state would require 0 Chili Peppers.
64+
65+
Block Chili Pepper Limit - The maximum number of Chili Peppers that can be
66+
requested in a single block.
67+
68+
Block Chili Pepper Clock - a cumulative measure of the total Chili Peppers
69+
requested since the genesis of the blockchain. At the beginning of each block,
70+
the Block State Unit Clock is updated to reflect the cumulative total of Chili
71+
Peppers consumed up to that point, ensuring a monotonically increasing record
72+
of state consumption.
73+
74+
Account Chili Pepper Clock Timestamp - each account in the "hot" state needs to
75+
keep track of the value of the Block Chili Pepper Clock the last time it was
76+
accessed (read or written to). This allows determination of which accounts are
77+
hot and which are cold.
78+
79+
Hot Cache Size - A new predefined constant, termed "Hot Cache Size" corresponds
80+
approximately to the size of the hot state supported by the validator network.
81+
An account is designated as hot if it was last
5182
accessed within this threshold of the current Block Chili Pepper Clock
52-
(Account Chili Pepper Clock Timestamp > Block Chili Pepper Clock - Hot Cache Size), otherwise it is designated
53-
as cold.
83+
(Account Chili Pepper Clock Timestamp > Block Chili Pepper Clock - Hot Cache
84+
Size), otherwise it is designated as cold.
5485

5586

5687
## Detailed Design
5788

5889
### Integration with ComputeBudget Program
5990

60-
To facilitate the utilization of Chili Peppers, every transaction on the Solana network will be required to use the ComputeBudget program to request the maximum number of Chili Peppers they require. Alongside existing functionalities, a new instruction will be introduced to specify the requested State Units for the transaction. This ensures that developers have the flexibility to request resources based on the anticipated needs of their transactions, within the constraints of the block's Chili Peppers capacity.
91+
To facilitate the utilization of Chili Peppers, every transaction on the Solana
92+
network will be required to use the ComputeBudget program to request the
93+
maximum number of Chili Peppers they require. Alongside existing
94+
functionalities, a new instruction will be introduced to specify the requested
95+
State Units for the transaction. This ensures that developers have the
96+
flexibility to request resources based on the anticipated needs of their
97+
transactions, within the constraints of the block's Chili Peppers capacity.
6198
The new ComputeBudgetInstruction will be as follows:
6299

63100
```rust
64101
discriminant: 5
65102
ComputeBudgetInstruction::SetChiliPepperLimit(u32)
66103
```
67104

68-
The 32-bit unsigned integer in the instruction indicates the number of Chili Peppers requested for the transaction.
105+
The 32-bit unsigned integer in the instruction indicates the number of Chili
106+
Peppers requested for the transaction.
69107

70108
### Block Chili Pepper Clock
71109

72-
The Block Chili Pepper Clock serves as a cumulative measure of the total Chili Peppers requested since the genesis of the blockchain. At the beginning of each block, the Block State Unit Clock is updated to reflect the cumulative total of Chili Peppers requested up to that point, ensuring a monotonically increasing record of state consumption.
110+
The Block Chili Pepper Clock serves as a cumulative measure of the total Chili
111+
Peppers requested since the genesis of the blockchain. At the beginning of
112+
each block, the Block State Unit Clock is updated to reflect the cumulative
113+
total of Chili Peppers requested up to that point, ensuring a monotonically
114+
increasing record of state consumption.
73115

74116
Computing the block Chili Pepper clock:
75117

76118
```python
77119
block_chili_pepper_clock = prev_block_chili_pepper_clock + sum(txn.requested_chili_peppers for txn in block.txns)
78120
```
79121

80-
Implemented as a 64-bit unsigned integer (uint64), this clock is updated at the beginning of every block to reflect the total Chili Peppers requested since the chain's genesis. This monotonically increasing value is stored in a dedicated system variable (sysvar), ensuring that it remains accessible and immutable throughout the blockchain's operation.
122+
Implemented as a 64-bit unsigned integer (uint64), this clock is updated at the
123+
beginning of every block to reflect the total Chili Peppers requested since the
124+
chain's genesis. This monotonically increasing value is stored in a dedicated
125+
system variable (sysvar), ensuring that it remains accessible and immutable
126+
throughout the blockchain's operation.
81127
The new sysvar will have identifier: `SysvarB1ockChiliPepperC1ock111111111111111111`
82128

83129
```rust
@@ -90,41 +136,69 @@ struct SysvarBlockChiliPepperClock {
90136

91137
### Account Chili Pepper Clock Timestamp
92138

93-
The Account Chili Pepper Clock Timestamp is an integral component within each "hot" account, representing the account's interaction with the blockchain's
94-
state management resources. This clock is dynamically set to match the current Block Chili Pepper Clock at any instance an account is accessed (read or written to) within a given block.
95-
These clocks are also implemented as 64-bit unsigned integers. Whenever a hot account is read from or written to within a block, its Account State Unit Clock is updated to match the current Block State Unit Clock.
96-
All accounts will have a Chili Pepper Clock Timestamp, which will only exist for accounts which are hot, and is discarded for accounts which are cold. All implementations should keep track of the current hot accounts.
139+
The Account Chili Pepper Clock Timestamp is an integral component within each
140+
"hot" account, representing the account's interaction with the blockchain's
141+
state management resources. This clock is dynamically set to match the current
142+
Block Chili Pepper Clock at any instance an account is accessed (read or
143+
written to) within a given block.
144+
These clocks are also implemented as 64-bit unsigned integers. Whenever a hot
145+
account is read from or written to within a block, its Account State Unit Clock
146+
is updated to match the current Block State Unit Clock.
147+
All accounts will have a Chili Pepper Clock Timestamp, which will only exist
148+
for accounts which are hot, and is discarded for accounts which are cold.
149+
All implementations should keep track of the current hot accounts.
97150

98151
#### Hot and Cold Account Designation
99152

100-
An account is designated as cold when its Account Chili Pepper Clock Timestamp falls behind the current Block Chili Pepper Clock by more than the Hot Cache Size parameter.
101-
An account which has never existed is considered cold. An account that is deleted is still considered hot until its state unit clock lapses into cold. Creating an account against a
102-
deleted account which is still hot, will create the hot account again.
153+
An account is designated as cold when its Account Chili Pepper Clock Timestamp
154+
falls behind the current Block Chili Pepper Clock by more than the Hot Cache
155+
Size parameter.
156+
157+
An account which has never existed is considered cold. An account that is
158+
deleted is still considered hot until its state unit clock lapses into cold.
159+
Creating an account against a deleted account which is still hot, will create
160+
the hot account again.
103161

104162
#### Storage and Management
105163

106-
To manage the Account State Unit Clocks efficiently, Solana employs a table, associating each hot account with its respective Chili Pepper Clock Timestamp. This table enables the dynamic tracking and updating of account states, facilitating the transition of accounts between hot and cold statuses based on their activity.
164+
To manage the Account State Unit Clocks efficiently, Solana employs a table,
165+
associating each hot account with its respective Chili Pepper Clock Timestamp.
166+
This table enables the dynamic tracking and updating of account states,
167+
facilitating the transition of accounts between hot and cold statuses based on
168+
their activity.
107169

108170
### Error Cases for State Units Implementation
109171

110-
Here are common error scenarios related to State Units and their respective handling mechanisms:
172+
Here are common error scenarios related to State Units and their respective
173+
handling mechanisms:
111174

112175
#### Exceeding Block Chili Pepper Limit
113176

114-
- **Error Description**: This error occurs when a transaction's requested Chili Peppers exceed the remaining capacity of the Block Chili Pepper Clock for the current block.
177+
- **Error Description**: This error occurs when a transaction's requested Chili
178+
Peppers exceed the remaining capacity of the Block Chili Pepper Clock for the
179+
current block.
115180
- **Handling**: The block is marked as invalid and cannot be processed.
116181

117182
#### Invalid Chili Pepper Request
118183

119-
- **Error Description**: A transaction specifies an invalid number of Chili Peppers, either by requesting more than a predefined maximum limit per transaction or by formatting the request improperly.
120-
- **Handling**: The transaction is invalidated, and an "Invalid Chili Pepper Request" error message is issued. Developers must ensure that Chili Pepper requests conform to protocol specifications, including proper formatting and adherence to maximum limits.
184+
- **Error Description**: A transaction specifies an invalid number of Chili
185+
Peppers, either by requesting more than a predefined maximum limit per
186+
transaction or by formatting the request improperly.
187+
- **Handling**: The transaction is invalidated, and an "Invalid Chili Pepper
188+
Request" error message is issued. Developers must ensure that Chili Pepper
189+
requests conform to protocol specifications, including proper formatting and
190+
adherence to maximum limits.
121191

122192
#### Account State Unit Clock Synchronization Failure
123193

124194
#### Accessing Cold Account
125195

126-
- **Error Description**: A transaction attempts to interact with an account that has been designated as "cold" due to its Chili Pepper Clock Timestamp falling below the "Hot Cache Size" threshold relative to the current Block Chili Pepper Clock, without requesting sufficient Chili Peppers.
127-
- **Handling**: The transaction is rejected with a "Cold Account Access Attempted" error.
196+
- **Error Description**: A transaction attempts to interact with an account
197+
that has been designated as "cold" due to its Chili Pepper Clock Timestamp
198+
falling below the "Hot Cache Size" threshold relative to the current Block
199+
Chili Pepper Clock, without requesting sufficient Chili Peppers.
200+
- **Handling**: The transaction is rejected with a "Cold Account Access
201+
Attempted" error.
128202

129203

130204
## Alternatives Considered
@@ -134,7 +208,8 @@ have relative to them?
134208

135209
## Impact
136210

137-
How will the implemented proposal impacts dapp developers, validators, and core contributors?
211+
How will the implemented proposal impacts dapp developers, validators, and
212+
core contributors?
138213

139214
## Security Considerations
140215

@@ -144,4 +219,8 @@ Are there any implementation-specific guidance or pitfalls?
144219

145220
## Backwards Compatibility
146221

147-
This proposal requires changes to the Solana Runtime Protocol and the ComputeBudget program. It is not backwards compatible and will require updates to existing programs and transactions to specify State Unit requirements. A transition period and comprehensive developer support will be essential to implement these changes smoothly across the ecosystem.
222+
This proposal requires changes to the Solana Runtime Protocol and the
223+
ComputeBudget program. It is not backwards compatible and will require updates
224+
to existing programs and transactions to specify State Unit requirements. A
225+
transition period and comprehensive developer support will be essential to
226+
implement these changes smoothly across the ecosystem.

0 commit comments

Comments
 (0)