Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
producer_plugin.cpp File Reference
#include <sysio/producer_plugin/producer_plugin.hpp>
#include <sysio/producer_plugin/subjective_billing.hpp>
#include <sysio/chain/plugin_interface.hpp>
#include <sysio/chain/global_property_object.hpp>
#include <sysio/chain/generated_transaction_object.hpp>
#include <sysio/chain/snapshot.hpp>
#include <sysio/chain/transaction_object.hpp>
#include <sysio/chain/thread_utils.hpp>
#include <sysio/chain/unapplied_transaction_queue.hpp>
#include <sysio/resource_monitor_plugin/resource_monitor_plugin.hpp>
#include <sysio/sub_chain_plugin/sub_chain_plugin.hpp>
#include <sysio/chain/s_root_extension.hpp>
#include <fc/io/json.hpp>
#include <fc/log/logger_config.hpp>
#include <fc/scoped_exit.hpp>
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <iostream>
#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/range/adaptor/map.hpp>
#include <boost/function_output_iterator.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/member.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/signals2/connection.hpp>
Include dependency graph for producer_plugin.cpp:

Go to the source code of this file.

Classes

struct  sysio::transaction_id_with_expiry
 
class  sysio::pending_snapshot
 
class  sysio::producer_plugin_impl
 

Namespaces

namespace  sysio
 

Macros

#define LOG_AND_DROP()
 
#define LOAD_VALUE_SET(options, op_name, container)
 

Typedefs

using sysio::transaction_id_with_expiry_index
 
using sysio::pending_snapshot_index
 

Enumerations

enum class  sysio::pending_block_mode { sysio::producing , sysio::speculating }
 

Functions

const std::string logger_name ("producer_plugin")
 
const std::string trx_successful_trace_logger_name ("transaction_success_tracing")
 
const std::string trx_failed_trace_logger_name ("transaction_failure_tracing")
 
const std::string trx_trace_success_logger_name ("transaction_trace_success")
 
const std::string trx_trace_failure_logger_name ("transaction_trace_failure")
 
const std::string trx_logger_name ("transaction")
 
void sysio::new_chain_banner (const sysio::chain::controller &db)
 
template<typename T >
T sysio::dejsonify (const string &s)
 

Variables

fc::logger _log
 
fc::logger _trx_successful_trace_log
 
fc::logger _trx_failed_trace_log
 
fc::logger _trx_trace_success_log
 
fc::logger _trx_trace_failure_log
 
fc::logger _trx_log
 

Macro Definition Documentation

◆ LOAD_VALUE_SET

#define LOAD_VALUE_SET ( options,
op_name,
container )
Value:
if( options.count(op_name) ) { \
const std::vector<std::string>& ops = options[op_name].as<std::vector<std::string>>(); \
for( const auto& v : ops ) { \
container.emplace( sysio::chain::name( v ) ); \
} \
}
Immutable except for fc::from_variant.
Definition name.hpp:43

Definition at line 940 of file producer_plugin.cpp.

940#define LOAD_VALUE_SET(options, op_name, container) \
941if( options.count(op_name) ) { \
942 const std::vector<std::string>& ops = options[op_name].as<std::vector<std::string>>(); \
943 for( const auto& v : ops ) { \
944 container.emplace( sysio::chain::name( v ) ); \
945 } \
946}

◆ LOG_AND_DROP

#define LOG_AND_DROP ( )
Value:
catch ( const guard_exception& e ) { \
chain_plugin::handle_guard_exception(e); \
} catch ( const std::bad_alloc& ) { \
chain_plugin::handle_bad_alloc(); \
} catch ( boost::interprocess::bad_alloc& ) { \
chain_plugin::handle_db_exhaustion(); \
} catch( fc::exception& er ) { \
wlog( "${details}", ("details",er.to_detail_string()) ); \
} catch( const std::exception& e ) { \
FC_LOG_MESSAGE( warn, "std::exception: ${what}: ",("what",e.what()) ), \
BOOST_CORE_TYPEID(e).name(), \
e.what() ) ; \
wlog( "${details}", ("details",fce.to_detail_string()) ); \
} catch( ... ) { \
FC_LOG_MESSAGE( warn, "unknown: ", ), \
std::current_exception() ); \
wlog( "${details}", ("details",e.to_detail_string()) ); \
}
std::string name
Used to generate a useful error report when an exception is thrown.
Definition exception.hpp:58
std::string to_detail_string(log_level ll=log_level::all) const
re-thrown whenever an unhandled exception is caught.Any exceptions thrown by 3rd party libraries that...
#define FC_LOG_MESSAGE(LOG_LEVEL, FORMAT,...)
A helper method for generating log messages.
@ std_exception_code
Definition exception.hpp:32

Definition at line 47 of file producer_plugin.cpp.

47#define LOG_AND_DROP() \
48 catch ( const guard_exception& e ) { \
49 chain_plugin::handle_guard_exception(e); \
50 } catch ( const std::bad_alloc& ) { \
51 chain_plugin::handle_bad_alloc(); \
52 } catch ( boost::interprocess::bad_alloc& ) { \
53 chain_plugin::handle_db_exhaustion(); \
54 } catch( fc::exception& er ) { \
55 wlog( "${details}", ("details",er.to_detail_string()) ); \
56 } catch( const std::exception& e ) { \
57 fc::exception fce( \
58 FC_LOG_MESSAGE( warn, "std::exception: ${what}: ",("what",e.what()) ), \
59 fc::std_exception_code,\
60 BOOST_CORE_TYPEID(e).name(), \
61 e.what() ) ; \
62 wlog( "${details}", ("details",fce.to_detail_string()) ); \
63 } catch( ... ) { \
64 fc::unhandled_exception e( \
65 FC_LOG_MESSAGE( warn, "unknown: ", ), \
66 std::current_exception() ); \
67 wlog( "${details}", ("details",e.to_detail_string()) ); \
68 }

Function Documentation

◆ logger_name()

const std::string logger_name ( "producer_plugin" )

◆ trx_failed_trace_logger_name()

const std::string trx_failed_trace_logger_name ( "transaction_failure_tracing" )
Here is the caller graph for this function:

◆ trx_logger_name()

const std::string trx_logger_name ( "transaction" )
Here is the caller graph for this function:

◆ trx_successful_trace_logger_name()

const std::string trx_successful_trace_logger_name ( "transaction_success_tracing" )
Here is the caller graph for this function:

◆ trx_trace_failure_logger_name()

const std::string trx_trace_failure_logger_name ( "transaction_trace_failure" )
Here is the caller graph for this function:

◆ trx_trace_success_logger_name()

const std::string trx_trace_success_logger_name ( "transaction_trace_success" )
Here is the caller graph for this function:

Variable Documentation

◆ _log

fc::logger _log

Definition at line 71 of file producer_plugin.cpp.

◆ _trx_failed_trace_log

fc::logger _trx_failed_trace_log

Definition at line 77 of file producer_plugin.cpp.

◆ _trx_log

fc::logger _trx_log

Definition at line 86 of file producer_plugin.cpp.

◆ _trx_successful_trace_log

fc::logger _trx_successful_trace_log

Definition at line 74 of file producer_plugin.cpp.

◆ _trx_trace_failure_log

fc::logger _trx_trace_failure_log

Definition at line 83 of file producer_plugin.cpp.

◆ _trx_trace_success_log

fc::logger _trx_trace_success_log

Definition at line 80 of file producer_plugin.cpp.

◆ ex_flags

uint8_t ex_flags = 0

Definition at line 282 of file producer_plugin.cpp.

◆ num_failures

uint32_t num_failures = 0

Definition at line 281 of file producer_plugin.cpp.