Skip to content

SIMD-0186: Define LoaderV4 #282

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions proposals/0186-loaded-transaction-data-size-specification.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ the unique intersection of:
irrespective of how they are used.
* The set of programdata accounts referenced by the LoaderV3 program
accounts specified on the transaction.
2. Each account's size is defined as the byte length of its data prior to
2. Each loaded account's size is defined as the byte length of its data prior to
transaction execution plus 64 bytes to account for metadata.
3. There is an additional flat 8248 byte cost for transactions that use an
address lookup table, accounting for the 8192 bytes for the maximum size of such
a table plus 56 bytes for metadata.
3. There is an additional flat 8248 byte cost for each address lookup table used
by a transaction, accounting for the 8192 bytes for the maximum size of such a
table plus 56 bytes for metadata.
Copy link
Contributor

Choose a reason for hiding this comment

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

I wouldn't mind a clarifying comment stating that the 64 bytes for account metadata is not added here. I think as written the SIMD is probably clear enough though.

4. The total transaction loaded account data size is the sum of these sizes.

Transactions may include a
Expand All @@ -102,17 +102,17 @@ counted otherwise.
Read-only and writable accounts are treated the same. In the future, when direct
mapping is enabled, this SIMD may be amended to count them differently.

If an account does not exist, it has not been loaded, and thus its size is 0.

Comment on lines 104 to +106
Copy link
Member Author

Choose a reason for hiding this comment

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

added another clarification. imo this was already implicitly the rule because this whole simd refers to the size of loaded accounts

We include programdata size for LoaderV3 programs because using the program
account on a transaction forces an unconditional load of programdata to compile
the program for execution. We always count it, even when the program account is
not a transaction program ID, because the program must be available for CPI.
not a transaction program ID, because the program must be available for CPI. If
the programdata account does not exist, then its size is 0, and transaction
loading continues as normal.

There is no special handling for any account owned by the native loader,
LoaderV1, or LoaderV2.

Account size for programs owned by LoaderV4 is left undefined. This SIMD should
be amended to define the required semantics before LoaderV4 is enabled on any
network.
LoaderV1, LoaderV2, or LoaderV4.
Copy link
Member Author

Choose a reason for hiding this comment

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

@Lichtso if you could confirm my understanding is correct

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, only loader-v3 had an indirection. All other loaders (including v4) store the executable directly in the program account.


## Alternatives Considered

Expand Down
Loading