For the complete documentation index, see llms.txt.
aztec-nr - noir_aztec::protocol::delayed_public_mutable::with_hash

Function read_current_value_of_delayed_public_mutable_with_hash

pub fn read_current_value_of_delayed_public_mutable_with_hash<T, let INITIAL_DELAY: u64>(
    historical_header: BlockHeader,
    storage_slot: Field,
    contract_address: AztecAddress,
    delayed_public_mutable: DelayedPublicMutableValues<T, INITIAL_DELAY>,
    witness: MembershipWitness<40>,
    leaf_preimage: PublicDataTreeLeafPreimage,
) -> T
where T: Packable, T: Eq

Read the current value of a delayed public mutable state variable, which was written to public storage with the hash of the packed values. See aztec-nr/aztec/src/state_vars/delayed_public_mutable.nr > write for more details on how the variable and hash are written.

Parameters:

  • historical_header: The header of the block whose state we are reading from.
  • storage_slot: The starting storage slot of the delayed public mutable state variable.
  • contract_address: The address of the contract where the delayed public mutable was written to.
  • delayed_public_mutable: The hinted delayed public mutable to read (its correctness is validated within this function).
  • witness: A hint to prove that the leaf_preimage exists in the tree.
  • leaf_preimage: The preimage of the leaf containing the hash of the packed values. Or a low leaf if the variable has not been initialized.

Returns:

  • T: The current value of the delayed public mutable at the time of the historical block. Returns T::unpack(std::mem::zeroed()) (the bitwise-zero packing of T, i.e. the storage-default) if the variable has not been initialized.