pub trait ExecutionController: Send + Sync {
    // Required methods
    fn update_blockclique_status(
        &self,
        finalized_blocks: HashMap<Slot, BlockId>,
        new_blockclique: Option<HashMap<Slot, BlockId>>,
        block_metadata: PreHashMap<BlockId, ExecutionBlockMetadata>,
    );
    fn query_state(&self, req: ExecutionQueryRequest) -> ExecutionQueryResponse;
    fn get_filtered_sc_output_event(
        &self,
        filter: EventFilter,
    ) -> Vec<SCOutputEvent>;
    fn get_final_and_candidate_balance(
        &self,
        addresses: &[Address],
    ) -> Vec<(Option<Amount>, Option<Amount>)>;
    fn get_ops_exec_status(
        &self,
        batch: &[OperationId],
    ) -> Vec<(Option<bool>, Option<bool>)>;
    fn get_final_and_active_data_entry(
        &self,
        input: Vec<(Address, Vec<u8>)>,
    ) -> Vec<(Option<Vec<u8>>, Option<Vec<u8>>)>;
    fn get_cycle_active_rolls(&self, cycle: u64) -> BTreeMap<Address, u64>;
    fn execute_readonly_request(
        &self,
        req: ReadOnlyExecutionRequest,
    ) -> Result<ReadOnlyExecutionOutput, ExecutionError>;
    fn get_denunciation_execution_status(
        &self,
        denunciation_index: &DenunciationIndex,
    ) -> (bool, bool);
    fn get_addresses_infos(
        &self,
        addresses: &[Address],
        deferred_credits_max_slot: Bound<Slot>,
    ) -> Vec<ExecutionAddressInfo>;
    fn get_stats(&self) -> ExecutionStats;
    fn clone_box(&self) -> Box<dyn ExecutionController>;
}
Expand description

interface that communicates with the execution worker thread

Required Methods§

source

fn update_blockclique_status( &self, finalized_blocks: HashMap<Slot, BlockId>, new_blockclique: Option<HashMap<Slot, BlockId>>, block_metadata: PreHashMap<BlockId, ExecutionBlockMetadata>, )

Updates blockclique status by signaling newly finalized blocks and the latest blockclique.

§Arguments
  • finalized_blocks: newly finalized blocks indexed by slot.
  • blockclique: new blockclique (if changed). Indexed by slot.
  • block_metadata: storage instances and metadata for new blocks. Each storage owns refs to the block and its ops/endorsements.
source

fn query_state(&self, req: ExecutionQueryRequest) -> ExecutionQueryResponse

Atomically query the execution state with multiple requests

source

fn get_filtered_sc_output_event( &self, filter: EventFilter, ) -> Vec<SCOutputEvent>

Get execution events optionally filtered by:

  • start slot
  • end slot
  • emitter address
  • original caller address
  • operation id
source

fn get_final_and_candidate_balance( &self, addresses: &[Address], ) -> Vec<(Option<Amount>, Option<Amount>)>

Get the final and active values of balance.

§Return value
  • (final_balance, active_balance)
source

fn get_ops_exec_status( &self, batch: &[OperationId], ) -> Vec<(Option<bool>, Option<bool>)>

Get the execution status of a batch of operations.

Return value: vector of (Option<speculative_status>, Option<final_status>) If an Option is None it means that the op execution was not found. Note that old op executions are forgotten. Otherwise, the status is a boolean indicating whether the execution was successful (true) or if there was an error (false.)

source

fn get_final_and_active_data_entry( &self, input: Vec<(Address, Vec<u8>)>, ) -> Vec<(Option<Vec<u8>>, Option<Vec<u8>>)>

Get a copy of a single datastore entry with its final and active values

§Return value
  • (final_data_entry, active_data_entry)
source

fn get_cycle_active_rolls(&self, cycle: u64) -> BTreeMap<Address, u64>

Returns for a given cycle the stakers taken into account by the selector. That correspond to the roll_counts in cycle - 3.

By default it returns an empty map.

source

fn execute_readonly_request( &self, req: ReadOnlyExecutionRequest, ) -> Result<ReadOnlyExecutionOutput, ExecutionError>

Execute read-only SC function call without causing modifications to the consensus state

§arguments
  • req: an instance of ReadOnlyCallRequest describing the parameters of the execution
§returns

An instance of ExecutionOutput containing a summary of the effects of the execution, or an error if the execution failed.

source

fn get_denunciation_execution_status( &self, denunciation_index: &DenunciationIndex, ) -> (bool, bool)

Check if a denunciation has been executed given a DenunciationIndex (speculative, final)

source

fn get_addresses_infos( &self, addresses: &[Address], deferred_credits_max_slot: Bound<Slot>, ) -> Vec<ExecutionAddressInfo>

Gets information about a batch of addresses

source

fn get_stats(&self) -> ExecutionStats

Get execution statistics

source

fn clone_box(&self) -> Box<dyn ExecutionController>

Returns a boxed clone of self. Useful to allow cloning Box<dyn ExecutionController>.

Trait Implementations§

source§

impl Clone for Box<dyn ExecutionController>

Allow cloning Box<dyn ExecutionController> Uses ExecutionController::clone_box internally

source§

fn clone(&self) -> Box<dyn ExecutionController>

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

Implementors§