#[repr(C)]pub struct PublicValues<W1, W2, W3, T> {Show 39 fields
pub prev_committed_value_digest: [W1; 8],
pub committed_value_digest: [W1; 8],
pub prev_deferred_proofs_digest: [T; 8],
pub deferred_proofs_digest: [T; 8],
pub pc_start: W2,
pub next_pc: W2,
pub prev_exit_code: T,
pub exit_code: T,
pub is_execution_shard: T,
pub previous_init_addr: W2,
pub last_init_addr: W2,
pub previous_finalize_addr: W2,
pub last_finalize_addr: W2,
pub previous_init_page_idx: W2,
pub last_init_page_idx: W2,
pub previous_finalize_page_idx: W2,
pub last_finalize_page_idx: W2,
pub initial_timestamp: W3,
pub last_timestamp: W3,
pub is_timestamp_high_eq: T,
pub inv_timestamp_high: T,
pub is_timestamp_low_eq: T,
pub inv_timestamp_low: T,
pub global_init_count: T,
pub global_finalize_count: T,
pub global_page_prot_init_count: T,
pub global_page_prot_finalize_count: T,
pub global_count: T,
pub global_cumulative_sum: SepticDigest<T>,
pub prev_commit_syscall: T,
pub commit_syscall: T,
pub prev_commit_deferred_syscall: T,
pub commit_deferred_syscall: T,
pub initial_timestamp_inv: T,
pub last_timestamp_inv: T,
pub is_first_execution_shard: T,
pub is_untrusted_programs_enabled: T,
pub proof_nonce: [T; 4],
pub empty: [T; 4],
}Expand description
Stores all of a shard proof’s public values.
Fields§
§prev_committed_value_digest: [W1; 8]The committed_value_digest value before this shard.
committed_value_digest: [W1; 8]The hash of all the bytes that the guest program has written to public values.
prev_deferred_proofs_digest: [T; 8]The deferred_proof_digest value before this shard.
deferred_proofs_digest: [T; 8]The hash of all deferred proofs that have been witnessed in the VM. It will be rebuilt in recursive verification as the proofs get verified. The hash itself is a rolling poseidon2 hash of each proof+vkey hash and the previous hash which is initially zero.
pc_start: W2The shard’s start program counter.
next_pc: W2The expected start program counter for the next shard.
prev_exit_code: TThe expected exit code of the program before this shard.
exit_code: TThe expected exit code code of the program up to this shard. This value is only valid if halt has been executed.
is_execution_shard: TWhether or not the current shard is an execution shard.
previous_init_addr: W2The largest address that is witnessed for initialization in the previous shard.
last_init_addr: W2The largest address that is witnessed for initialization in the current shard.
previous_finalize_addr: W2The largest address that is witnessed for finalization in the previous shard.
last_finalize_addr: W2The largest address that is witnessed for finalization in the current shard.
previous_init_page_idx: W2The largest page idx that is witnessed for initialization in the previous shard.
last_init_page_idx: W2The largest page idx that is witnessed for initialization in the current shard.
previous_finalize_page_idx: W2The largest page idx that is witnessed for finalization in the previous shard.
last_finalize_page_idx: W2The largest page idx that is witnessed for finalization in the current shard.
initial_timestamp: W3The initial timestamp of the shard.
last_timestamp: W3The last timestamp of the shard.
is_timestamp_high_eq: TIf the high bits of timestamp is equal in this shard.
inv_timestamp_high: TThe inverse of the difference of the high bits of timestamp.
is_timestamp_low_eq: TIf the low bits of timestamp is equal in this shard.
inv_timestamp_low: TThe inverse of the difference of the low bits of timestamp.
global_init_count: TThe number of global memory initializations in the shard.
global_finalize_count: TThe number of global memory finalizations in the shard.
global_page_prot_init_count: TThe number of global page prot initializations in the shard.
global_page_prot_finalize_count: TThe number of global page prot finalizations in the shard.
global_count: TThe number of global interactions in the shard.
global_cumulative_sum: SepticDigest<T>The global cumulative sum of the shard.
prev_commit_syscall: TThe commit_syscall value of the previous shard.
commit_syscall: TWhether COMMIT syscall has been called up to this shard.
prev_commit_deferred_syscall: TThe commit_deferred_syscall value of the previous shard.
commit_deferred_syscall: TWhether COMMIT_DEFERRED syscall has been called up to this shard.
initial_timestamp_inv: TThe inverse to show that initial_timestamp != 1 in the shards that aren’t the first one.
last_timestamp_inv: TThe inverse to show that last_timestamp != 1 in all shards.
is_first_execution_shard: TWhether or not this shard is the first shard of the proof.
is_untrusted_programs_enabled: TWhether untrusted program support is enabled. This specifically will enable fetching instructions from memory during runtime and checking/setting page permissions.
proof_nonce: [T; 4]The nonce used for this proof.
empty: [T; 4]This field is here to ensure that the size of the public values struct is a multiple of 8.
Implementations§
Source§impl PublicValues<u32, u64, u64, u32>
impl PublicValues<u32, u64, u64, u32>
Sourcepub fn to_vec<F: AbstractField>(&self) -> Vec<F>
pub fn to_vec<F: AbstractField>(&self) -> Vec<F>
Convert the public values into a vector of field elements. This function will pad the vector to the maximum number of public values.
Sourcepub fn range(&self) -> ShardRange
pub fn range(&self) -> ShardRange
Get the range of the shard.
TODO: deprecate this once recursion is fully streaming.
Sourcepub fn initialize(
&self,
pc_start_abs: u64,
enable_untrusted_programs: bool,
) -> Self
pub fn initialize( &self, pc_start_abs: u64, enable_untrusted_programs: bool, ) -> Self
Get the public values corresponding to initial state of the program for a non-execution shard.
Sourcepub fn update_state(&mut self, state: &PublicValues<u32, u64, u64, u32>)
pub fn update_state(&mut self, state: &PublicValues<u32, u64, u64, u32>)
Update the public values to the state.
Sourcepub fn update_initialized_state(
&mut self,
pc_start_abs: u64,
enable_untrusted_programs: bool,
)
pub fn update_initialized_state( &mut self, pc_start_abs: u64, enable_untrusted_programs: bool, )
Update the public values to the state, as a non-execution shard in the initial state of the program’s execution.
Sourcepub fn update_finalized_state(
&mut self,
timestamp: u64,
pc: u64,
exit_code: u32,
is_untrusted_programs_enabled: u32,
committed_value_digest: [u32; 8],
deferred_proofs_digest: [u32; 8],
nonce: [u32; 4],
)
pub fn update_finalized_state( &mut self, timestamp: u64, pc: u64, exit_code: u32, is_untrusted_programs_enabled: u32, committed_value_digest: [u32; 8], deferred_proofs_digest: [u32; 8], nonce: [u32; 4], )
Update the public values to the state, as a non-execution shard in the final state of the program’s execution.
Sourcepub fn update_finalized_state_from_public_values(
&mut self,
public_values: &PublicValues<u32, u64, u64, u32>,
)
pub fn update_finalized_state_from_public_values( &mut self, public_values: &PublicValues<u32, u64, u64, u32>, )
Similar to [update_finalized_state], but takes all the values from an existing public
values struct for convenience.
Source§impl<F: PrimeField32> PublicValues<[F; 4], [F; 3], [F; 4], F>
impl<F: PrimeField32> PublicValues<[F; 4], [F; 3], [F; 4], F>
Sourcepub fn commit_digest_bytes(&self) -> Vec<u8> ⓘ
pub fn commit_digest_bytes(&self) -> Vec<u8> ⓘ
Returns the commit digest as a vector of little-endian bytes.
Sourcepub fn initial_timestamp(&self) -> u64
pub fn initial_timestamp(&self) -> u64
Returns the initial timestamp.
Sourcepub fn last_timestamp(&self) -> u64
pub fn last_timestamp(&self) -> u64
Returns the last timestamp.
Sourcepub fn previous_init_addr(&self) -> u64
pub fn previous_init_addr(&self) -> u64
Returns the previous initialization address.
Sourcepub fn last_init_addr(&self) -> u64
pub fn last_init_addr(&self) -> u64
Returns the last initialization address.
Sourcepub fn previous_finalize_addr(&self) -> u64
pub fn previous_finalize_addr(&self) -> u64
Returns the previous finalize address.
Sourcepub fn last_finalize_addr(&self) -> u64
pub fn last_finalize_addr(&self) -> u64
Returns the last finalize address.
Sourcepub fn previous_init_page_idx(&self) -> u64
pub fn previous_init_page_idx(&self) -> u64
Returns the previous initialization page index.
Sourcepub fn last_init_page_idx(&self) -> u64
pub fn last_init_page_idx(&self) -> u64
Returns the last initialization page index.
Sourcepub fn previous_finalize_page_idx(&self) -> u64
pub fn previous_finalize_page_idx(&self) -> u64
Returns the previous finalize page index.
Sourcepub fn last_finalize_page_idx(&self) -> u64
pub fn last_finalize_page_idx(&self) -> u64
Returns the last finalize page index.
Sourcepub fn range(&self) -> ShardRange
pub fn range(&self) -> ShardRange
Returns the range of the shard.
Trait Implementations§
Source§impl<T: Clone> BorrowMut<PublicValues<[T; 4], [T; 3], [T; 4], T>> for [T]
impl<T: Clone> BorrowMut<PublicValues<[T; 4], [T; 3], [T; 4], T>> for [T]
Source§fn borrow_mut(&mut self) -> &mut PublicValues<[T; 4], [T; 3], [T; 4], T>
fn borrow_mut(&mut self) -> &mut PublicValues<[T; 4], [T; 3], [T; 4], T>
Source§impl<W1: Clone, W2: Clone, W3: Clone, T: Clone> Clone for PublicValues<W1, W2, W3, T>
impl<W1: Clone, W2: Clone, W3: Clone, T: Clone> Clone for PublicValues<W1, W2, W3, T>
Source§fn clone(&self) -> PublicValues<W1, W2, W3, T>
fn clone(&self) -> PublicValues<W1, W2, W3, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<W1: DeepSizeOf, W2: DeepSizeOf, W3: DeepSizeOf, T: DeepSizeOf> DeepSizeOf for PublicValues<W1, W2, W3, T>
impl<W1: DeepSizeOf, W2: DeepSizeOf, W3: DeepSizeOf, T: DeepSizeOf> DeepSizeOf for PublicValues<W1, W2, W3, T>
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Source§impl<W1: Default, W2: Default, W3: Default, T: Default> Default for PublicValues<W1, W2, W3, T>
impl<W1: Default, W2: Default, W3: Default, T: Default> Default for PublicValues<W1, W2, W3, T>
Source§fn default() -> PublicValues<W1, W2, W3, T>
fn default() -> PublicValues<W1, W2, W3, T>
Source§impl<'de, W1, W2, W3, T> Deserialize<'de> for PublicValues<W1, W2, W3, T>
impl<'de, W1, W2, W3, T> Deserialize<'de> for PublicValues<W1, W2, W3, T>
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<F: AbstractField> From<PublicValues<u32, u64, u64, u32>> for PublicValues<[F; 4], [F; 3], [F; 4], F>
impl<F: AbstractField> From<PublicValues<u32, u64, u64, u32>> for PublicValues<[F; 4], [F; 3], [F; 4], F>
Source§impl<W1: PartialEq, W2: PartialEq, W3: PartialEq, T: PartialEq> PartialEq for PublicValues<W1, W2, W3, T>
impl<W1: PartialEq, W2: PartialEq, W3: PartialEq, T: PartialEq> PartialEq for PublicValues<W1, W2, W3, T>
Source§impl<W1, W2, W3, T> Serialize for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> Serialize for PublicValues<W1, W2, W3, T>
impl<W1: Copy, W2: Copy, W3: Copy, T: Copy> Copy for PublicValues<W1, W2, W3, T>
impl<W1: Eq, W2: Eq, W3: Eq, T: Eq> Eq for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> StructuralPartialEq for PublicValues<W1, W2, W3, T>
Auto Trait Implementations§
impl<W1, W2, W3, T> Freeze for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> RefUnwindSafe for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> Send for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> Sync for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> Unpin for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> UnsafeUnpin for PublicValues<W1, W2, W3, T>
impl<W1, W2, W3, T> UnwindSafe for PublicValues<W1, W2, W3, T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<Challenger, A> FromChallenger<Challenger, A> for Challengerwhere
Challenger: Clone,
impl<Challenger, A> FromChallenger<Challenger, A> for Challengerwhere
Challenger: Clone,
fn from_challenger(challenger: &Challenger, _backend: &A) -> Challenger
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.