Expand description

AccountInfo represents a reference to AccountSharedData in either an AppendVec or the write cache. AccountInfo is not persisted anywhere between program runs. AccountInfo is purely runtime state. Note that AccountInfo is saved to disk buckets during runtime, but disk buckets are recreated at startup.

Structs

Enums

Constants

  • This is an illegal value for ‘offset’. Account size on disk would have to be pointing to the very last 8 byte value in the max sized append vec. That would mean there was a maximum size of 8 bytes for the last entry in the append vec. A pubkey alone is 32 bytes, so there is no way for a valid offset to be this high of a value. Realistically, a max offset is (1<<31 - 156) bytes or so for an account with zero data length. Of course, this depends on the layout on disk, compression, etc. But, 8 bytes per account will never be possible. So, we use this last value as a sentinel to say that the account info refers to an entry in the write cache.
  • We have to have SOME value for store_id when we are cached

Type Definitions

  • offset within an append vec to account data
  • how large the offset we store in AccountInfo is Note this is a smaller datatype than ‘Offset’ AppendVecs store accounts aligned to u64, so offset is always a multiple of 8 (sizeof(u64))
  • bytes used to store this account in append vec Note this max needs to be big enough to handle max data len of 10MB, which is a const