-
Notifications
You must be signed in to change notification settings - Fork 296
doc: add account spec pages #5489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds information to guide account database and cache design. This information is not reviewed, YMMV. May be useful in a real spec later.
### Program executions | ||
|
||
A *program execution* is a type of account access that results from | ||
transaction execution. The *program account* to execute is specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transaction execution. The *program account* to execute is specified | |
transaction execution. The *program accounts* to execute are specified |
### Sysvar reads | ||
|
||
Certain accounts can be read at any time during runtime execution. This | ||
includes the slot transition, native programs, and syscall handlers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should define what a "slot transition" is or rephrase
When executing a slot, the runtime alternates between transaction | ||
execution and miscellaneous system processing. The latter includes any | ||
slot execution phase during which transactions are not executed. These | ||
steps perform various writes to [*stored accounts*](#stored-accounts). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify that system accesses only happen in this aforementioned "miscellaneous system processing". (Or use a proper term to define that sort of system processing, like "slot freeze")
8. [Incinerator](#incinerator) | ||
2. [System managed accounts](#system-managed-accounts) | ||
1. [Slot sysvars](#slot-sysvars) | ||
2. [Builtin accounts](#builtin-accounts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about where we draw the distinction between "user writable accounts" and "system managed accounts". Perhaps, there is none ...
1. [Slot sysvars](#slot-sysvars) | ||
2. [Builtin accounts](#builtin-accounts) | ||
|
||
### Transparent Accounts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Virtual account" sounds better
non-existent account when trying to read *transparent accounts*. | ||
|
||
[*System writes*](#system-writes) to transparent accounts are inherently | ||
undefined, since the written data would not persist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reflink is broken (system-accesses instead), also clarify that these accesses don't exist because they are undefined
Ephemeral sysvars are transparent accounts that are accessible through | ||
*sysvar reads*. | ||
|
||
For more information, see [sysvars.md](./sysvars.md#slot-sysvars) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reflink should say txn-sysvars
Most modifications are subject to permission checks. Increasing the | ||
lamport value of an account always passes the permission checks of a | ||
*user writable account*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These permission checks are specific to the access type (transaction account access), not the account type.
|
||
### BPF program accounts | ||
|
||
There are two type of *BPF program accounts*: *User BPF programs* and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two type of *BPF program accounts*: *User BPF programs* and | |
There are two types of *BPF program accounts*: *User BPF programs* and |
- Transitioning a program between immutable/executable, and | ||
mutable/non-executable incurs a one slot delay. | ||
|
||
### Core BPF programs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be a separate section
|
||
Firedancer uses a **write-through** cache policy for these sysvars. | ||
|
||
All writes to the above sysvars use the `fd_slot_sysvar_write` API, which: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably going to be called fd_sysvar_XXX_write
(FIXME clarify what happens when this is attempted) | ||
- Never written to the account database | ||
- Account reads via user transactions are redirected to a custom | ||
callback (does not access the account database) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add reference to account.md "virtual accounts", and add a rough summary what virtual accounts do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Document cache behavior of "rent" bank field vs rent sysvar
Adds information to guide account database and cache design.
This information is not reviewed, YMMV. May be useful in a real
spec later.