#[repr(C)]
pub struct StateMerkleTreeAccount {
Show 15 fields pub index: u64, pub rollover_fee: u64, pub rollover_threshold: u64, pub tip: u64, pub rolledover_slot: u64, pub close_threshold: u64, pub next_merkle_tree: Pubkey, pub owner: Pubkey, pub delegate: Pubkey, pub associated_queue: Pubkey, pub state_merkle_tree_struct: [u8; 272], pub state_merkle_tree_filled_subtrees: [u8; 832], pub state_merkle_tree_changelog: [u8; 1220800], pub state_merkle_tree_roots: [u8; 76800], pub state_merkle_tree_canopy: [u8; 65472],
}
Expand description

Concurrent state Merkle tree used for public compressed transactions.

Fields§

§index: u64

Unique index.

§rollover_fee: u64

This fee is used for rent for the next account. It accumulates in the account so that once the corresponding Merkle tree account is full it can be rolled over

§rollover_threshold: u64

The threshold in percentage points when the account should be rolled over (95 corresponds to 95% filled).

§tip: u64

Tip for maintaining the account.

§rolledover_slot: u64

The slot when the account was rolled over, a rolled over account should not be written to.

§close_threshold: u64

If current slot is greater than rolledover_slot + close_threshold and the account is empty it can be closed.

§next_merkle_tree: Pubkey

Public key of the next Merkle tree.

§owner: Pubkey

Owner of the Merkle tree.

§delegate: Pubkey

Delegate of the Merkle tree. This will be used for program owned Merkle trees.

§associated_queue: Pubkey§state_merkle_tree_struct: [u8; 272]

Merkle tree for the transaction state.

§state_merkle_tree_filled_subtrees: [u8; 832]§state_merkle_tree_changelog: [u8; 1220800]§state_merkle_tree_roots: [u8; 76800]§state_merkle_tree_canopy: [u8; 65472]

Implementations§

source§

impl StateMerkleTreeAccount

source

pub const LEN: usize = 1_364_360usize

source§

impl StateMerkleTreeAccount

source

pub fn copy_merkle_tree(&self) -> Result<ConcurrentMerkleTree26<'_, Poseidon>>

source

pub fn load_merkle_tree(&self) -> Result<&ConcurrentMerkleTree26<'_, Poseidon>>

source

pub fn load_merkle_tree_init( &mut self, height: usize, changelog_size: usize, roots_size: usize, canopy_depth: usize ) -> Result<&mut ConcurrentMerkleTree26<'_, Poseidon>>

source

pub fn load_merkle_tree_mut( &mut self ) -> Result<&mut ConcurrentMerkleTree26<'_, Poseidon>>

source

pub fn load_next_index(&self) -> Result<usize>

source

pub fn load_roots(&self) -> Result<CyclicBoundedVec<'_, [u8; 32]>>

Trait Implementations§

source§

impl AccountDeserialize for StateMerkleTreeAccount

source§

fn try_deserialize(buf: &mut &[u8]) -> Result<Self>

Deserializes previously initialized account data. Should fail for all uninitialized accounts, where the bytes are zeroed. Implementations should be unique to a particular account type so that one can never successfully deserialize the data of one account type into another. For example, if the SPL token program were to implement this trait, it should be impossible to deserialize a Mint account into a token Account.
source§

fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self>

Deserializes account data without checking the account discriminator. This should only be used on account initialization, when the bytes of the account are zeroed.
source§

impl BorshDeserialize for StateMerkleTreeAccount

source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>

source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

source§

impl BorshSerialize for StateMerkleTreeAccount

source§

fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>

source§

fn try_to_vec(&self) -> Result<Vec<u8>, Error>

Serialize this instance into a vector of bytes.
source§

impl Clone for StateMerkleTreeAccount

source§

fn clone(&self) -> StateMerkleTreeAccount

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for StateMerkleTreeAccount

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Discriminator for StateMerkleTreeAccount

source§

impl GroupAccess for StateMerkleTreeAccount

source§

impl Owner for StateMerkleTreeAccount

source§

impl Zeroable for StateMerkleTreeAccount

source§

fn zeroed() -> Self

source§

impl Copy for StateMerkleTreeAccount

source§

impl Pod for StateMerkleTreeAccount

source§

impl ZeroCopy for StateMerkleTreeAccount

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> AbiExample for T

source§

default fn example() -> T

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> AnyBitPattern for T
where T: Pod,

source§

impl<T> NoUninit for T
where T: Pod,