pub struct ProgramCacheEntry {
pub program: ProgramCacheEntryType,
pub account_owner: ProgramCacheEntryOwner,
pub account_size: usize,
pub deployment_slot: Slot,
pub effective_slot: Slot,
pub tx_usage_counter: Arc<AtomicU64>,
pub latest_access_slot: AtomicU64,
}agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Expand description
Holds a program version at a specific address and on a specific slot / fork.
It contains the actual program in ProgramCacheEntryType and a bunch of meta-data.
Fields§
§program: ProgramCacheEntryTypeagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.The program of this entry
account_owner: ProgramCacheEntryOwneragave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.The loader of this entry
account_size: usizeagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Size of account that stores the program and program data
deployment_slot: Slotagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Slot in which the program was (re)deployed
effective_slot: Slotagave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Slot in which this entry will become active (can be in the future)
tx_usage_counter: Arc<AtomicU64>agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.How often this entry was used by a transaction
latest_access_slot: AtomicU64agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Latest slot in which the entry was used
Implementations§
Source§impl ProgramCacheEntry
impl ProgramCacheEntry
Sourcepub fn new(
loader_key: &Pubkey,
program_runtime_environment: ProgramRuntimeEnvironment,
deployment_slot: Slot,
effective_slot: Slot,
elf_bytes: &[u8],
account_size: usize,
) -> Result<Self, Box<dyn Error>>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn new( loader_key: &Pubkey, program_runtime_environment: ProgramRuntimeEnvironment, deployment_slot: Slot, effective_slot: Slot, elf_bytes: &[u8], account_size: usize, ) -> Result<Self, Box<dyn Error>>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Creates a new user program
Sourcepub unsafe fn reload(
loader_key: &Pubkey,
program_runtime_environment: Arc<BuiltinProgram<InvokeContext<'static, 'static>>>,
deployment_slot: Slot,
effective_slot: Slot,
elf_bytes: &[u8],
account_size: usize,
) -> Result<Self, Box<dyn Error>>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub unsafe fn reload( loader_key: &Pubkey, program_runtime_environment: Arc<BuiltinProgram<InvokeContext<'static, 'static>>>, deployment_slot: Slot, effective_slot: Slot, elf_bytes: &[u8], account_size: usize, ) -> Result<Self, Box<dyn Error>>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Reloads a user program, without running the verifier.
§Safety
This method is unsafe since it assumes that the program has already been verified. Should
only be called when the program was previously verified and loaded in the cache, but was
unloaded due to inactivity. It should also be checked that the program_runtime_environment
hasn’t changed since it was unloaded.
pub fn to_unloaded(&self) -> Option<Self>
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Sourcepub fn new_builtin(
deployment_slot: Slot,
account_size: usize,
builtin_function: BuiltinFunctionWithContext,
) -> Self
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn new_builtin( deployment_slot: Slot, account_size: usize, builtin_function: BuiltinFunctionWithContext, ) -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Creates a new built-in program
pub fn new_tombstone( slot: Slot, account_owner: ProgramCacheEntryOwner, reason: ProgramCacheEntryType, ) -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn new_tombstone_with_usage_counter( slot: Slot, account_owner: ProgramCacheEntryOwner, reason: ProgramCacheEntryType, tx_usage_counter: Arc<AtomicU64>, ) -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn is_tombstone(&self) -> bool
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn update_access_slot(&self, slot: Slot)
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn decayed_usage_counter(&self, now: Slot) -> u64
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.pub fn account_owner(&self) -> Pubkey
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Trait Implementations§
Source§impl Debug for ProgramCacheEntry
impl Debug for ProgramCacheEntry
Source§impl Default for ProgramCacheEntry
impl Default for ProgramCacheEntry
Source§fn default() -> ProgramCacheEntry
fn default() -> ProgramCacheEntry
Source§impl PartialEq for ProgramCacheEntry
impl PartialEq for ProgramCacheEntry
Auto Trait Implementations§
impl !Freeze for ProgramCacheEntry
impl RefUnwindSafe for ProgramCacheEntry
impl Send for ProgramCacheEntry
impl Sync for ProgramCacheEntry
impl Unpin for ProgramCacheEntry
impl !UnwindSafe for ProgramCacheEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more