pub struct EthFrame<IW: InterpreterTypes = EthInterpreter> {
    pub data: FrameData,
    pub input: FrameInput,
    pub depth: usize,
    pub checkpoint: JournalCheckpoint,
    pub interpreter: Interpreter<IW>,
    pub is_finished: bool,
}Expand description
Frame implementation for Ethereum.
Fields§
§data: FrameDataFrame-specific data (Call, Create, or EOFCreate).
input: FrameInputInput data for the frame.
depth: usizeCurrent call depth in the execution stack.
checkpoint: JournalCheckpointJournal checkpoint for state reversion.
interpreter: Interpreter<IW>Interpreter instance for executing bytecode.
is_finished: boolWhether the frame has been finished its execution. Frame is considered finished if it has been called and returned a result.
Implementations§
Source§impl EthFrame<EthInterpreter>
 
impl EthFrame<EthInterpreter>
Sourcepub fn is_finished(&self) -> bool
 
pub fn is_finished(&self) -> bool
Returns true if the frame has finished execution.
Sourcepub fn set_finished(&mut self, finished: bool)
 
pub fn set_finished(&mut self, finished: bool)
Sets the finished state of the frame.
Source§impl EthFrame<EthInterpreter>
 
impl EthFrame<EthInterpreter>
Sourcepub fn clear(
    &mut self,
    data: FrameData,
    input: FrameInput,
    depth: usize,
    memory: SharedMemory,
    bytecode: ExtBytecode,
    inputs: InputsImpl,
    is_static: bool,
    spec_id: SpecId,
    gas_limit: u64,
    checkpoint: JournalCheckpoint,
)
 
pub fn clear( &mut self, data: FrameData, input: FrameInput, depth: usize, memory: SharedMemory, bytecode: ExtBytecode, inputs: InputsImpl, is_static: bool, spec_id: SpecId, gas_limit: u64, checkpoint: JournalCheckpoint, )
Clear and initialize a frame.
Sourcepub fn make_call_frame<CTX: ContextTr, PRECOMPILES: PrecompileProvider<CTX, Output = InterpreterResult>, ERROR: From<ContextTrDbError<CTX>> + FromStringError>(
    this: OutFrame<'_, Self>,
    ctx: &mut CTX,
    precompiles: &mut PRECOMPILES,
    depth: usize,
    memory: SharedMemory,
    inputs: Box<CallInputs>,
) -> Result<ItemOrResult<FrameToken, FrameResult>, ERROR>
 
pub fn make_call_frame<CTX: ContextTr, PRECOMPILES: PrecompileProvider<CTX, Output = InterpreterResult>, ERROR: From<ContextTrDbError<CTX>> + FromStringError>( this: OutFrame<'_, Self>, ctx: &mut CTX, precompiles: &mut PRECOMPILES, depth: usize, memory: SharedMemory, inputs: Box<CallInputs>, ) -> Result<ItemOrResult<FrameToken, FrameResult>, ERROR>
Make call frame
Sourcepub fn make_create_frame<CTX: ContextTr, ERROR: From<ContextTrDbError<CTX>> + FromStringError>(
    this: OutFrame<'_, Self>,
    context: &mut CTX,
    depth: usize,
    memory: SharedMemory,
    inputs: Box<CreateInputs>,
) -> Result<ItemOrResult<FrameToken, FrameResult>, ERROR>
 
pub fn make_create_frame<CTX: ContextTr, ERROR: From<ContextTrDbError<CTX>> + FromStringError>( this: OutFrame<'_, Self>, context: &mut CTX, depth: usize, memory: SharedMemory, inputs: Box<CreateInputs>, ) -> Result<ItemOrResult<FrameToken, FrameResult>, ERROR>
Make create frame.
Sourcepub fn init_with_context<CTX: ContextTr, PRECOMPILES: PrecompileProvider<CTX, Output = InterpreterResult>>(
    this: OutFrame<'_, Self>,
    ctx: &mut CTX,
    precompiles: &mut PRECOMPILES,
    frame_init: FrameInit,
) -> Result<ItemOrResult<FrameToken, FrameResult>, ContextError<<<CTX as ContextTr>::Db as Database>::Error>>
 
pub fn init_with_context<CTX: ContextTr, PRECOMPILES: PrecompileProvider<CTX, Output = InterpreterResult>>( this: OutFrame<'_, Self>, ctx: &mut CTX, precompiles: &mut PRECOMPILES, frame_init: FrameInit, ) -> Result<ItemOrResult<FrameToken, FrameResult>, ContextError<<<CTX as ContextTr>::Db as Database>::Error>>
Initializes a frame with the given context and precompiles.
Source§impl EthFrame<EthInterpreter>
 
impl EthFrame<EthInterpreter>
Sourcepub fn process_next_action<CTX: ContextTr, ERROR: From<ContextTrDbError<CTX>> + FromStringError>(
    &mut self,
    context: &mut CTX,
    next_action: InterpreterAction,
) -> Result<FrameInitOrResult<Self>, ERROR>
 
pub fn process_next_action<CTX: ContextTr, ERROR: From<ContextTrDbError<CTX>> + FromStringError>( &mut self, context: &mut CTX, next_action: InterpreterAction, ) -> Result<FrameInitOrResult<Self>, ERROR>
Processes the next interpreter action, either creating a new frame or returning a result.
Sourcepub fn return_result<CTX: ContextTr, ERROR: From<ContextTrDbError<CTX>> + FromStringError>(
    &mut self,
    ctx: &mut CTX,
    result: FrameResult,
) -> Result<(), ERROR>
 
pub fn return_result<CTX: ContextTr, ERROR: From<ContextTrDbError<CTX>> + FromStringError>( &mut self, ctx: &mut CTX, result: FrameResult, ) -> Result<(), ERROR>
Processes a frame result and updates the interpreter state accordingly.
Trait Implementations§
Source§impl<IW> Clone for EthFrame<IW>where
    IW: Clone + InterpreterTypes,
    <IW as InterpreterTypes>::Stack: Clone,
    <IW as InterpreterTypes>::Memory: Clone,
    <IW as InterpreterTypes>::Bytecode: Clone,
    <IW as InterpreterTypes>::ReturnData: Clone,
    <IW as InterpreterTypes>::Input: Clone,
    <IW as InterpreterTypes>::RuntimeFlag: Clone,
    <IW as InterpreterTypes>::Extend: Clone,
 
impl<IW> Clone for EthFrame<IW>where
    IW: Clone + InterpreterTypes,
    <IW as InterpreterTypes>::Stack: Clone,
    <IW as InterpreterTypes>::Memory: Clone,
    <IW as InterpreterTypes>::Bytecode: Clone,
    <IW as InterpreterTypes>::ReturnData: Clone,
    <IW as InterpreterTypes>::Input: Clone,
    <IW as InterpreterTypes>::RuntimeFlag: Clone,
    <IW as InterpreterTypes>::Extend: Clone,
Source§impl<IW> Debug for EthFrame<IW>where
    IW: Debug + InterpreterTypes,
    <IW as InterpreterTypes>::Stack: Debug,
    <IW as InterpreterTypes>::Memory: Debug,
    <IW as InterpreterTypes>::Bytecode: Debug,
    <IW as InterpreterTypes>::ReturnData: Debug,
    <IW as InterpreterTypes>::Input: Debug,
    <IW as InterpreterTypes>::RuntimeFlag: Debug,
    <IW as InterpreterTypes>::Extend: Debug,
 
impl<IW> Debug for EthFrame<IW>where
    IW: Debug + InterpreterTypes,
    <IW as InterpreterTypes>::Stack: Debug,
    <IW as InterpreterTypes>::Memory: Debug,
    <IW as InterpreterTypes>::Bytecode: Debug,
    <IW as InterpreterTypes>::ReturnData: Debug,
    <IW as InterpreterTypes>::Input: Debug,
    <IW as InterpreterTypes>::RuntimeFlag: Debug,
    <IW as InterpreterTypes>::Extend: Debug,
Source§impl Default for EthFrame<EthInterpreter>
 
impl Default for EthFrame<EthInterpreter>
Source§impl<IT: InterpreterTypes> FrameTr for EthFrame<IT>
 
impl<IT: InterpreterTypes> FrameTr for EthFrame<IT>
Source§type FrameResult = FrameResult
 
type FrameResult = FrameResult
The result type returned when a frame completes execution.
Auto Trait Implementations§
impl<IW> Freeze for EthFrame<IW>where
    <IW as InterpreterTypes>::Bytecode: Freeze,
    <IW as InterpreterTypes>::Stack: Freeze,
    <IW as InterpreterTypes>::ReturnData: Freeze,
    <IW as InterpreterTypes>::Memory: Freeze,
    <IW as InterpreterTypes>::Input: Freeze,
    <IW as InterpreterTypes>::RuntimeFlag: Freeze,
    <IW as InterpreterTypes>::Extend: Freeze,
impl<IW> RefUnwindSafe for EthFrame<IW>where
    <IW as InterpreterTypes>::Bytecode: RefUnwindSafe,
    <IW as InterpreterTypes>::Stack: RefUnwindSafe,
    <IW as InterpreterTypes>::ReturnData: RefUnwindSafe,
    <IW as InterpreterTypes>::Memory: RefUnwindSafe,
    <IW as InterpreterTypes>::Input: RefUnwindSafe,
    <IW as InterpreterTypes>::RuntimeFlag: RefUnwindSafe,
    <IW as InterpreterTypes>::Extend: RefUnwindSafe,
impl<IW> Send for EthFrame<IW>where
    <IW as InterpreterTypes>::Bytecode: Send,
    <IW as InterpreterTypes>::Stack: Send,
    <IW as InterpreterTypes>::ReturnData: Send,
    <IW as InterpreterTypes>::Memory: Send,
    <IW as InterpreterTypes>::Input: Send,
    <IW as InterpreterTypes>::RuntimeFlag: Send,
    <IW as InterpreterTypes>::Extend: Send,
impl<IW> Sync for EthFrame<IW>where
    <IW as InterpreterTypes>::Bytecode: Sync,
    <IW as InterpreterTypes>::Stack: Sync,
    <IW as InterpreterTypes>::ReturnData: Sync,
    <IW as InterpreterTypes>::Memory: Sync,
    <IW as InterpreterTypes>::Input: Sync,
    <IW as InterpreterTypes>::RuntimeFlag: Sync,
    <IW as InterpreterTypes>::Extend: Sync,
impl<IW> Unpin for EthFrame<IW>where
    <IW as InterpreterTypes>::Bytecode: Unpin,
    <IW as InterpreterTypes>::Stack: Unpin,
    <IW as InterpreterTypes>::ReturnData: Unpin,
    <IW as InterpreterTypes>::Memory: Unpin,
    <IW as InterpreterTypes>::Input: Unpin,
    <IW as InterpreterTypes>::RuntimeFlag: Unpin,
    <IW as InterpreterTypes>::Extend: Unpin,
impl<IW> UnwindSafe for EthFrame<IW>where
    <IW as InterpreterTypes>::Bytecode: UnwindSafe,
    <IW as InterpreterTypes>::Stack: UnwindSafe,
    <IW as InterpreterTypes>::ReturnData: UnwindSafe,
    <IW as InterpreterTypes>::Memory: UnwindSafe,
    <IW as InterpreterTypes>::Input: UnwindSafe,
    <IW as InterpreterTypes>::RuntimeFlag: UnwindSafe,
    <IW as InterpreterTypes>::Extend: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
§impl<T> Conv for T
 
impl<T> Conv for T
§impl<T> FmtForward for T
 
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
    Self: Binary,
 
fn fmt_binary(self) -> FmtBinary<Self>where
    Self: Binary,
Causes 
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
    Self: Display,
 
fn fmt_display(self) -> FmtDisplay<Self>where
    Self: Display,
Causes 
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
    Self: LowerExp,
 
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
    Self: LowerExp,
Causes 
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
    Self: LowerHex,
 
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
    Self: LowerHex,
Causes 
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
    Self: Octal,
 
fn fmt_octal(self) -> FmtOctal<Self>where
    Self: Octal,
Causes 
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
    Self: Pointer,
 
fn fmt_pointer(self) -> FmtPointer<Self>where
    Self: Pointer,
Causes 
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
    Self: UpperExp,
 
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
    Self: UpperExp,
Causes 
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
    Self: UpperHex,
 
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
    Self: UpperHex,
Causes 
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
    &'a Self: for<'a> IntoIterator,
 
fn fmt_list(self) -> FmtList<Self>where
    &'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
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>
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 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>
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§impl<T> Pipe for Twhere
    T: ?Sized,
 
impl<T> Pipe for Twhere
    T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
    Self: Sized,
 
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
    Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§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,
Borrows 
self and passes that borrow into the pipe function. Read more§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,
Mutably borrows 
self and passes that borrow into the pipe function. Read more§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
§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
§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
Borrows 
self, then passes self.as_ref() into the pipe function.§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
Mutably borrows 
self, then passes self.as_mut() into the pipe
function.§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
Borrows 
self, then passes self.deref() into the pipe function.§impl<T> Tap for T
 
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
 
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the 
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
 
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the 
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
 
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the 
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
 
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the 
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
 
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the 
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
 
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the 
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
 
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls 
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
 
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls 
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
 
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls 
.tap_borrow() only in debug builds, and is erased in release
builds.§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
Calls 
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
 
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls 
.tap_ref() only in debug builds, and is erased in release
builds.§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
Calls 
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
 
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls 
.tap_deref() only in debug builds, and is erased in release
builds.