Skip to content

Commit 78377b1

Browse files
authored
Update SVM docs (solana-labs#2628)
1 parent 92d932e commit 78377b1

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

svm/doc/spec.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -139,28 +139,25 @@ pub trait TransactionProcessingCallback {
139139
Consumers can customize this plug-in to use their own Solana account source,
140140
caching, and more.
141141

142-
### `SanitizedTransaction`
142+
### `SVMTransaction`
143143

144-
A "sanitized" Solana transaction is a transaction that has undergone the
144+
An SVM transaction is a transaction that has undergone the
145145
various checks required to evaluate a transaction against the Solana protocol
146146
ruleset. Some of these rules include signature verification and validation
147147
of account indices (`num_readonly_signers`, etc.).
148148

149-
A `SanitizedTransaction` contains:
150-
151-
- `SanitizedMessage`: Enum with two kinds of messages - `LegacyMessage` and
152-
`LoadedMessage` - both of which contain:
153-
- `MessageHeader`: Vector of `Pubkey` of accounts used in the transaction.
154-
- `Hash` of recent block.
155-
- Vector of `CompiledInstruction`.
156-
- In addition, `LoadedMessage` contains a vector of
157-
`MessageAddressTableLookup` - list of address table lookups to
158-
load additional accounts for this transaction.
159-
- A Hash of the message
160-
- A boolean flag `is_simple_vote_tx` - shortcut for determining if the
161-
transaction is merely a simple vote transaction produced by a validator.
162-
- A vector of `Signature` - the hash of the transaction message encrypted using
149+
A `SVMTransaction` is a trait that can access:
150+
151+
- `signatures`: the hash of the transaction message encrypted using
163152
the signing key (for each signer in the transaction).
153+
- `static_account_keys`: Slice of `Pubkey` of accounts used in the transaction.
154+
- `account_keys`: Pubkeys of all accounts used in the transaction, including
155+
those from address table lookups.
156+
- `recent_blockhash`: Hash of a recent block.
157+
- `instructions_iter`: An iterator over the transaction's instructions.
158+
- `message_address_table_lookups`: An iterator over the transaction's
159+
address table lookups. These are only used in V0 transactions, for legacy
160+
transactions the iterator is empty.
164161

165162
### `TransactionCheckResult`
166163

@@ -245,10 +242,10 @@ Steps of `load_and_execute_sanitized_transactions`
245242
- Return the replenished local program cache.
246243

247244
2. Load accounts (call to `load_accounts` function)
248-
- For each `SanitizedTransaction` and `TransactionCheckResult`, we:
245+
- For each `SVMTransaction` and `TransactionCheckResult`, we:
249246
- Calculate the number of signatures in transaction and its cost.
250247
- Call `load_transaction_accounts`
251-
- The function is interwined with the struct `CompiledInstruction`
248+
- The function is interwined with the struct `SVMInstruction`
252249
- Load accounts from accounts DB
253250
- Extract data from accounts
254251
- Verify if we've reached the maximum account data size

0 commit comments

Comments
 (0)