pub struct MessageHeader {
pub num_required_signatures: u8,
pub num_readonly_signed_accounts: u8,
pub num_readonly_unsigned_accounts: u8,
}
Expand description
Describes the organization of a Message
’s account keys.
Every Instruction
specifies which accounts it may reference, or
otherwise requires specific permissions of. Those specifications are:
whether the account is read-only, or read-write; and whether the account
must have signed the transaction containing the instruction.
Whereas individual Instruction
s contain a list of all accounts they may
access, along with their required permissions, a Message
contains a
single shared flat list of all accounts required by all instructions in
a transaction. When building a Message
, this flat list is created and
Instruction
s are converted to CompiledInstruction
s. Those
CompiledInstruction
s then reference by index the accounts they require in
the single shared account list.
The shared account list is ordered by the permissions required of the accounts:
- accounts that are writable and signers
- accounts that are read-only and signers
- accounts that are writable and not signers
- accounts that are read-only and not signers
Given this ordering, the fields of MessageHeader
describe which accounts
in a transaction require which permissions.
When multiple transactions access the same read-only accounts, the runtime may process them in parallel, in a single PoH entry. Transactions that access the same read-write accounts are processed sequentially.
Fields§
§num_required_signatures: u8
The number of signatures required for this message to be considered
valid. The signers of those signatures must match the first
num_required_signatures
of Message::account_keys
.
num_readonly_signed_accounts: u8
The last num_readonly_signed_accounts
of the signed keys are read-only
accounts.
num_readonly_unsigned_accounts: u8
The last num_readonly_unsigned_accounts
of the unsigned keys are
read-only accounts.
Trait Implementations§
Source§impl Clone for MessageHeader
impl Clone for MessageHeader
Source§fn clone(&self) -> MessageHeader
fn clone(&self) -> MessageHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more