Struct solana_program::message::MessageHeader
source · 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 AbiExample for MessageHeader
impl AbiExample for MessageHeader
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 moresource§impl Debug for MessageHeader
impl Debug for MessageHeader
source§impl Default for MessageHeader
impl Default for MessageHeader
source§fn default() -> MessageHeader
fn default() -> MessageHeader
source§impl<'de> Deserialize<'de> for MessageHeader
impl<'de> Deserialize<'de> for MessageHeader
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<MessageHeader> for MessageHeader
impl PartialEq<MessageHeader> for MessageHeader
source§fn eq(&self, other: &MessageHeader) -> bool
fn eq(&self, other: &MessageHeader) -> bool
self
and other
values to be equal, and is used
by ==
.