OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
cbdc::parsec::agent::runner::evm_runner Class Reference

Executes EVM transactions, implementing the runner interface. More...

#include <impl.hpp>

Inheritance diagram for cbdc::parsec::agent::runner::evm_runner:
Collaboration diagram for cbdc::parsec::agent::runner::evm_runner:

Public Member Functions

 evm_runner (std::shared_ptr< logging::log > logger, const cbdc::parsec::config &cfg, runtime_locking_shard::value_type function, parameter_type param, bool is_readonly_run, run_callback_type result_callback, try_lock_callback_type try_lock_callback, std::shared_ptr< secp256k1_context > secp, std::shared_ptr< thread_pool > t_pool, ticket_number_type ticket_number)
 Constructor.
 
 ~evm_runner () override
 Blocks until the transaction has completed and all processing threads have ended.
 
 evm_runner (const evm_runner &)=delete
 
auto operator= (const evm_runner &) -> evm_runner &=delete
 
 evm_runner (evm_runner &&)=delete
 
auto operator= (evm_runner &&) -> evm_runner &=delete
 
auto run () -> bool override
 Begin executing the transaction asynchronously.
 
- Public Member Functions inherited from cbdc::parsec::agent::runner::interface
 interface (std::shared_ptr< logging::log > logger, const cbdc::parsec::config &cfg, runtime_locking_shard::value_type function, parameter_type param, bool is_readonly_run, run_callback_type result_callback, try_lock_callback_type try_lock_callback, std::shared_ptr< secp256k1_context > secp, std::shared_ptr< thread_pool > t_pool, ticket_number_type ticket_number)
 Constructor.
 
virtual ~interface ()=default
 
 interface (const interface &)=delete
 
auto operator= (const interface &) -> interface &=delete
 
 interface (interface &&)=delete
 
auto operator= (interface &&) -> interface &=delete
 

Static Public Attributes

static constexpr auto initial_lock_type = broker::lock_type::write
 Initial lock type for the agent to request when retrieving the function key.
 

Additional Inherited Members

- Public Types inherited from cbdc::parsec::agent::runner::interface
enum class  error_code {
  result_value_type , result_key_type , result_type , result_count ,
  exec_error , function_load , internal_error , yield_count ,
  yield_type , lock_error , wounded
}
 Error codes return during function execution. More...
 
using ticket_number_type = parsec::ticket_machine::ticket_number_type
 Type alias for a ticket number.
 
using run_return_type
 Return type from executing a function.
 
using run_callback_type = std::function<void(run_return_type)>
 Callback type for function execution.
 
using try_lock_callback_type
 Callback function type for acquiring locks during function execution.
 
using factory_type
 Factory function type for instantiating new runners.
 

Detailed Description

Executes EVM transactions, implementing the runner interface.

Definition at line 47 of file agent/runners/evm/impl.hpp.

Constructor & Destructor Documentation

◆ evm_runner() [1/3]

cbdc::parsec::agent::runner::evm_runner::evm_runner ( std::shared_ptr< logging::log > logger,
const cbdc::parsec::config & cfg,
runtime_locking_shard::value_type function,
parameter_type param,
bool is_readonly_run,
run_callback_type result_callback,
try_lock_callback_type try_lock_callback,
std::shared_ptr< secp256k1_context > secp,
std::shared_ptr< thread_pool > t_pool,
ticket_number_type ticket_number )

Constructor.

Parameters
loggerlog instance.
cfgconfig reference.
functionkey of function bytecode to execute.
paramparameter to pass to function.
is_readonly_runtrue if runner execution should not result in state changes.
result_callbackfunction to call with function execution result.
try_lock_callbackfunction to call for the function to request key locks.
secpshared context for libsecp256k1.
t_poolshared thread pool between agents.
ticket_numberticket number for the ticket managed by this runner instance.

Definition at line 20 of file agent/runners/evm/impl.cpp.

◆ ~evm_runner()

cbdc::parsec::agent::runner::evm_runner::~evm_runner ( )
override

Blocks until the transaction has completed and all processing threads have ended.

Definition at line 41 of file agent/runners/evm/impl.cpp.

◆ evm_runner() [2/3]

cbdc::parsec::agent::runner::evm_runner::evm_runner ( const evm_runner & )
delete

◆ evm_runner() [3/3]

cbdc::parsec::agent::runner::evm_runner::evm_runner ( evm_runner && )
delete

Member Function Documentation

◆ operator=() [1/2]

auto cbdc::parsec::agent::runner::evm_runner::operator= ( const evm_runner & ) -> evm_runner &=delete
delete

◆ operator=() [2/2]

auto cbdc::parsec::agent::runner::evm_runner::operator= ( evm_runner && ) -> evm_runner &=delete
delete

◆ run()

auto cbdc::parsec::agent::runner::evm_runner::run ( ) -> bool
nodiscardoverridevirtual

Begin executing the transaction asynchronously.

Returns
true if execution was initiated successfully returns false if an internal system error has occurred

Implements cbdc::parsec::agent::runner::interface.

Definition at line 738 of file agent/runners/evm/impl.cpp.

Field Documentation

◆ initial_lock_type

auto cbdc::parsec::agent::runner::evm_runner::initial_lock_type = broker::lock_type::write
staticconstexpr

Initial lock type for the agent to request when retrieving the function key.

Definition at line 77 of file agent/runners/evm/impl.hpp.


The documentation for this class was generated from the following files: