Struct casper_execution_engine::core::engine_state::EngineState
source · [−]pub struct EngineState<S> { /* private fields */ }
Expand description
Main implementation of an execution engine state.
Takes an engine’s configuration and a provider of a state (aka the global state) to operate on. Methods implemented on this structure are the external API intended to be used by the users such as the node, test framework, and others.
Implementations
sourceimpl EngineState<LmdbGlobalState>
impl EngineState<LmdbGlobalState>
sourcepub fn flush_environment(&self) -> Result<(), Error>
pub fn flush_environment(&self) -> Result<(), Error>
Flushes the LMDB environment to disk when manual sync is enabled in the config.toml.
sourceimpl<S> EngineState<S> where
S: StateProvider,
S::Error: Into<Error>,
impl<S> EngineState<S> where
S: StateProvider,
S::Error: Into<Error>,
sourcepub fn new(state: S, config: EngineConfig) -> EngineState<S>
pub fn new(state: S, config: EngineConfig) -> EngineState<S>
Creates new engine state.
sourcepub fn config(&self) -> &EngineConfig
pub fn config(&self) -> &EngineConfig
Returns engine config.
sourcepub fn update_config(&mut self, new_config: EngineConfig)
pub fn update_config(&mut self, new_config: EngineConfig)
Updates current engine config with a new instance.
sourcepub fn commit_genesis(
&self,
correlation_id: CorrelationId,
genesis_config_hash: Digest,
protocol_version: ProtocolVersion,
ee_config: &ExecConfig
) -> Result<GenesisSuccess, Error>
pub fn commit_genesis(
&self,
correlation_id: CorrelationId,
genesis_config_hash: Digest,
protocol_version: ProtocolVersion,
ee_config: &ExecConfig
) -> Result<GenesisSuccess, Error>
Commits genesis process.
This process is run only once per network to initiate the system. By definition users are unable to execute smart contracts on a network without a genesis.
Takes genesis configuration passed through ExecConfig
and creates the system contracts,
sets up the genesis accounts, and sets up the auction state based on that. At the end of
the process, SystemContractRegistry
is persisted under the special global state space
Key::SystemContractRegistry
.
Returns a GenesisSuccess
for a successful operation, or an error otherwise.
sourcepub fn commit_upgrade(
&self,
correlation_id: CorrelationId,
upgrade_config: UpgradeConfig
) -> Result<UpgradeSuccess, Error>
pub fn commit_upgrade(
&self,
correlation_id: CorrelationId,
upgrade_config: UpgradeConfig
) -> Result<UpgradeSuccess, Error>
sourcepub fn tracking_copy(
&self,
hash: Digest
) -> Result<Option<TrackingCopy<S::Reader>>, Error>
pub fn tracking_copy(
&self,
hash: Digest
) -> Result<Option<TrackingCopy<S::Reader>>, Error>
Creates a new tracking copy instance.
sourcepub fn run_query(
&self,
correlation_id: CorrelationId,
query_request: QueryRequest
) -> Result<QueryResult, Error>
pub fn run_query(
&self,
correlation_id: CorrelationId,
query_request: QueryRequest
) -> Result<QueryResult, Error>
Executes a query.
For a given root Key
it does a path lookup through the named keys.
Returns the value stored under a URef
wrapped in a QueryResult
.
sourcepub fn run_execute(
&self,
correlation_id: CorrelationId,
exec_request: ExecuteRequest
) -> Result<ExecutionResults, Error>
pub fn run_execute(
&self,
correlation_id: CorrelationId,
exec_request: ExecuteRequest
) -> Result<ExecutionResults, Error>
Runs a deploy execution request.
For each deploy stored in the request it will execute it.
Currently a special shortcut is taken to distinguish a native transfer, from a deploy.
Return execution results which contains results from each deploy ran.
sourcepub fn get_purse_balance(
&self,
correlation_id: CorrelationId,
state_hash: Digest,
purse_uref: URef
) -> Result<BalanceResult, Error>
pub fn get_purse_balance(
&self,
correlation_id: CorrelationId,
state_hash: Digest,
purse_uref: URef
) -> Result<BalanceResult, Error>
Get the balance of a passed purse referenced by its URef
.
sourcepub fn transfer(
&self,
correlation_id: CorrelationId,
executor: &Executor,
protocol_version: ProtocolVersion,
prestate_hash: Digest,
blocktime: BlockTime,
deploy_item: DeployItem,
proposer: PublicKey
) -> Result<ExecutionResult, Error>
pub fn transfer(
&self,
correlation_id: CorrelationId,
executor: &Executor,
protocol_version: ProtocolVersion,
prestate_hash: Digest,
blocktime: BlockTime,
deploy_item: DeployItem,
proposer: PublicKey
) -> Result<ExecutionResult, Error>
Executes a native transfer.
Native transfers do not involve WASM at all, and also skip executing payment code. Therefore this is the fastest and cheapest way to transfer tokens from account to account.
Returns an ExecutionResult
for a successful native transfer.
sourcepub fn deploy(
&self,
correlation_id: CorrelationId,
executor: &Executor,
protocol_version: ProtocolVersion,
prestate_hash: Digest,
blocktime: BlockTime,
deploy_item: DeployItem,
proposer: PublicKey
) -> Result<ExecutionResult, Error>
pub fn deploy(
&self,
correlation_id: CorrelationId,
executor: &Executor,
protocol_version: ProtocolVersion,
prestate_hash: Digest,
blocktime: BlockTime,
deploy_item: DeployItem,
proposer: PublicKey
) -> Result<ExecutionResult, Error>
Executes a deploy.
A deploy execution consists of running the payment code, which is expected to deposit funds
into the payment purse, and then running the session code with a specific gas limit. For
running payment code, we lock MAX_PAYMENT
amount of motes from the user as collateral.
If both the payment code and the session code execute successfully, a fraction of the
unspent collateral will be transferred back to the proposer of the deploy, as specified
in the request.
Returns ExecutionResult
, or an error condition.
sourcepub fn apply_effect(
&self,
correlation_id: CorrelationId,
pre_state_hash: Digest,
effects: AdditiveMap<Key, Transform>
) -> Result<Digest, Error> where
Error: From<S::Error>,
pub fn apply_effect(
&self,
correlation_id: CorrelationId,
pre_state_hash: Digest,
effects: AdditiveMap<Key, Transform>
) -> Result<Digest, Error> where
Error: From<S::Error>,
Apply effects of the execution.
This is also referred to as “committing” the effects into the global state. This method has to be run after an execution has been made to persists the effects of it.
Returns new state root hash.
sourcepub fn get_trie(
&self,
correlation_id: CorrelationId,
trie_key: Digest
) -> Result<Option<Trie<Key, StoredValue>>, Error> where
Error: From<S::Error>,
pub fn get_trie(
&self,
correlation_id: CorrelationId,
trie_key: Digest
) -> Result<Option<Trie<Key, StoredValue>>, Error> where
Error: From<S::Error>,
Gets a trie object for given state root hash.
sourcepub fn put_trie_and_find_missing_descendant_trie_keys(
&self,
correlation_id: CorrelationId,
trie: &Trie<Key, StoredValue>
) -> Result<Vec<Digest>, Error> where
Error: From<S::Error>,
pub fn put_trie_and_find_missing_descendant_trie_keys(
&self,
correlation_id: CorrelationId,
trie: &Trie<Key, StoredValue>
) -> Result<Vec<Digest>, Error> where
Error: From<S::Error>,
Puts a trie and finds missing descendant trie keys.
sourcepub fn missing_trie_keys(
&self,
correlation_id: CorrelationId,
trie_keys: Vec<Digest>
) -> Result<Vec<Digest>, Error> where
Error: From<S::Error>,
pub fn missing_trie_keys(
&self,
correlation_id: CorrelationId,
trie_keys: Vec<Digest>
) -> Result<Vec<Digest>, Error> where
Error: From<S::Error>,
Performs a lookup for a list of missing root hashes.
sourcepub fn get_era_validators(
&self,
correlation_id: CorrelationId,
system_contract_registry: Option<SystemContractRegistry>,
get_era_validators_request: GetEraValidatorsRequest
) -> Result<EraValidators, GetEraValidatorsError>
pub fn get_era_validators(
&self,
correlation_id: CorrelationId,
system_contract_registry: Option<SystemContractRegistry>,
get_era_validators_request: GetEraValidatorsRequest
) -> Result<EraValidators, GetEraValidatorsError>
Obtains validator weights for given era.
This skips execution of auction’s get_era_validator
entry point logic to avoid creating an
executor instance, and going through the execution flow. It follows the same process but
uses queries rather than execution to get the snapshot.
sourcepub fn get_bids(
&self,
correlation_id: CorrelationId,
get_bids_request: GetBidsRequest
) -> Result<GetBidsResult, Error>
pub fn get_bids(
&self,
correlation_id: CorrelationId,
get_bids_request: GetBidsRequest
) -> Result<GetBidsResult, Error>
Gets current bids from the auction system.
sourcepub fn commit_step(
&self,
correlation_id: CorrelationId,
step_request: StepRequest
) -> Result<StepSuccess, StepError>
pub fn commit_step(
&self,
correlation_id: CorrelationId,
step_request: StepRequest
) -> Result<StepSuccess, StepError>
Executes a step request.
sourcepub fn get_balance(
&self,
correlation_id: CorrelationId,
state_hash: Digest,
public_key: PublicKey
) -> Result<BalanceResult, Error>
pub fn get_balance(
&self,
correlation_id: CorrelationId,
state_hash: Digest,
public_key: PublicKey
) -> Result<BalanceResult, Error>
Gets the balance of a given public key.
sourcepub fn get_system_contract_registry(
&self,
correlation_id: CorrelationId,
state_root_hash: Digest
) -> Result<SystemContractRegistry, Error>
pub fn get_system_contract_registry(
&self,
correlation_id: CorrelationId,
state_root_hash: Digest
) -> Result<SystemContractRegistry, Error>
Obtains an instance of a system contract registry for a given state root hash.
sourcepub fn get_system_mint_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
pub fn get_system_mint_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
Returns mint system contract hash.
sourcepub fn get_system_auction_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
pub fn get_system_auction_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
Returns auction system contract hash.
sourcepub fn get_handle_payment_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
pub fn get_handle_payment_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
Returns handle payment system contract hash.
sourcepub fn get_standard_payment_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
pub fn get_standard_payment_hash(
&self,
correlation_id: CorrelationId,
state_hash: Digest
) -> Result<ContractHash, Error>
Returns standard payment system contract hash.
Trait Implementations
Auto Trait Implementations
impl<S> RefUnwindSafe for EngineState<S> where
S: RefUnwindSafe,
impl<S> Send for EngineState<S> where
S: Send,
impl<S> Sync for EngineState<S> where
S: Sync,
impl<S> Unpin for EngineState<S> where
S: Unpin,
impl<S> UnwindSafe for EngineState<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
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. Read more
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. Read more
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. Read more
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. Read more
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. Read more
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. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeDeref for T
impl<T> PipeDeref for T
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
impl<T> PipeRef for T
impl<T> PipeRef for T
impl<T> Tap for T
impl<T> Tap for T
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Provides immutable access for inspection. Read more
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Calls tap
in debug builds, and does nothing in release builds.
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Provides mutable access for modification. Read more
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Calls tap_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the reference for inspection.
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Calls tap_ref
in debug builds, and does nothing in release builds.
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the reference for modification.
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the borrow for inspection. Read more
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_borrow_mut
in debug builds, and does nothing in release
builds. Read more
impl<T> TapDeref for T
impl<T> TapDeref for T
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Calls tap_deref_mut
in debug builds, and does nothing in release
builds. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more