BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
26 #define P2P_IN_DEDICATED_THREAD
31 # undef DEFAULT_LOGGER
33 #define DEFAULT_LOGGER "p2p"
36 #ifdef GRAPHENE_TEST_NETWORK
37 #define testnetlog wlog
39 #define testnetlog(...) do {} while (0)
43 #include <boost/accumulators/accumulators.hpp>
44 #include <boost/accumulators/statistics.hpp>
45 #include <boost/accumulators/statistics/rolling_mean.hpp>
58 namespace graphene {
namespace net {
namespace detail {
60 namespace bmi = boost::multi_index;
65 template <
class Key,
class Hash = std::hash<Key>,
class Pred = std::equal_to<Key> >
77 std::pair< typename std::unordered_set<Key, Hash, Pred>::iterator,
bool>
emplace( Key key)
80 return std::unordered_set<Key, Hash, Pred>::emplace( key );
82 std::pair< typename std::unordered_set<Key, Hash, Pred>::iterator,
bool>
insert (
const Key& val)
85 return std::unordered_set<Key, Hash, Pred>::insert( val );
93 return std::unordered_set<Key, Hash, Pred>::size();
95 bool empty() const noexcept
98 return std::unordered_set<Key, Hash, Pred>::empty();
103 void clear() noexcept
106 std::unordered_set<Key, Hash, Pred>::clear();
108 typename std::unordered_set<Key, Hash, Pred>::iterator
erase(
109 typename std::unordered_set<Key, Hash, Pred>::const_iterator itr)
112 return std::unordered_set<Key, Hash, Pred>::erase( itr);
114 size_t erase(
const Key& key)
117 return std::unordered_set<Key, Hash, Pred>::erase( key );
122 void swap(
typename std::unordered_set<Key, Hash, Pred>& other ) noexcept
125 std::unordered_set<Key, Hash, Pred>::swap( other );
130 typename std::unordered_set<Key, Hash, Pred>::iterator
begin() noexcept
133 return std::unordered_set<Key, Hash, Pred>::begin();
135 typename std::unordered_set<Key, Hash, Pred>::const_iterator
begin() const noexcept
138 return std::unordered_set<Key, Hash, Pred>::begin();
140 typename std::unordered_set<Key, Hash, Pred>::local_iterator
begin(
size_t n)
143 return std::unordered_set<Key, Hash, Pred>::begin(n);
145 typename std::unordered_set<Key, Hash, Pred>::const_local_iterator
begin(
size_t n)
const
148 return std::unordered_set<Key, Hash, Pred>::begin(n);
150 typename std::unordered_set<Key, Hash, Pred>::iterator
end() noexcept
153 return std::unordered_set<Key, Hash, Pred>::end();
155 typename std::unordered_set<Key, Hash, Pred>::const_iterator
end() const noexcept
158 return std::unordered_set<Key, Hash, Pred>::end();
160 typename std::unordered_set<Key, Hash, Pred>::local_iterator
end(
size_t n)
163 return std::unordered_set<Key, Hash, Pred>::end(n);
165 typename std::unordered_set<Key, Hash, Pred>::const_local_iterator
end(
size_t n)
const
168 return std::unordered_set<Key, Hash, Pred>::end(n);
172 typename std::unordered_set<Key, Hash, Pred>::const_iterator
find(Key key)
175 return std::unordered_set<Key, Hash, Pred>::find(key);
184 struct message_hash_index{};
185 struct message_contents_hash_index{};
186 struct block_clock_index{};
191 uint32_t block_clock_when_received;
201 uint32_t block_clock_when_received,
204 message_hash( message_hash ),
205 message_body( message_body ),
206 block_clock_when_received( block_clock_when_received ),
207 propagation_data( propagation_data ),
208 message_contents_hash( message_contents_hash )
212 using message_cache_container = boost::multi_index_container < message_info,
214 bmi::ordered_unique< bmi::tag<message_hash_index>,
215 bmi::member<message_info, message_hash_type, &message_info::message_hash> >,
216 bmi::ordered_non_unique< bmi::tag<message_contents_hash_index>,
217 bmi::member<message_info, message_hash_type, &message_info::message_contents_hash> >,
218 bmi::ordered_non_unique< bmi::tag<block_clock_index>,
219 bmi::member<message_info, uint32_t, &message_info::block_clock_when_received> > > >;
221 message_cache_container _message_cache;
223 uint32_t block_clock = 0;
234 size_t size()
const {
return _message_cache.size(); }
253 "block_message_type must be greater than trx_message_type for prioritized_item_ids to sort correctly");
263 std::shared_ptr<node_delegate> _node_delegate;
266 using call_stats_accumulator = boost::accumulators::accumulator_set< int64_t,
267 boost::accumulators::stats< boost::accumulators::tag::min,
268 boost::accumulators::tag::rolling_mean,
269 boost::accumulators::tag::max,
270 boost::accumulators::tag::sum,
271 boost::accumulators::tag::count> >;
272 #define NODE_DELEGATE_METHOD_NAMES (has_item) \
275 (handle_transaction) \
279 (get_blockchain_synopsis) \
281 (connection_count_changed) \
284 (get_head_block_id) \
285 (estimate_last_known_fork_from_git_revision_timestamp) \
286 (error_encountered) \
287 (get_current_block_interval_in_seconds)
291 #define DECLARE_ACCUMULATOR(r, data, method_name) \
292 mutable call_stats_accumulator BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _execution_accumulator)); \
293 mutable call_stats_accumulator BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_before_accumulator)); \
294 mutable call_stats_accumulator BOOST_PP_CAT(_, BOOST_PP_CAT(method_name, _delay_after_accumulator));
296 #undef DECLARE_ACCUMULATOR
298 class call_statistics_collector
304 const char* _method_name;
305 call_stats_accumulator* _execution_accumulator;
306 call_stats_accumulator* _delay_before_accumulator;
307 call_stats_accumulator* _delay_after_accumulator;
311 std::shared_ptr<call_statistics_collector> _collector;
314 _collector(collector)
316 _collector->starting_execution();
320 _collector->execution_completed();
323 call_statistics_collector(
const char* method_name,
324 call_stats_accumulator* execution_accumulator,
325 call_stats_accumulator* delay_before_accumulator,
326 call_stats_accumulator* delay_after_accumulator) :
327 _call_requested_time(
fc::time_point::now()),
328 _method_name(method_name),
329 _execution_accumulator(execution_accumulator),
330 _delay_before_accumulator(delay_before_accumulator),
331 _delay_after_accumulator(delay_after_accumulator)
333 ~call_statistics_collector()
336 fc::microseconds actual_execution_time(_execution_completed_time - _begin_execution_time);
337 fc::microseconds delay_before(_begin_execution_time - _call_requested_time);
339 fc::microseconds total_duration(actual_execution_time + delay_before + delay_after);
340 (*_execution_accumulator)(actual_execution_time.count());
341 (*_delay_before_accumulator)(delay_before.count());
342 (*_delay_after_accumulator)(delay_after.count());
345 dlog(
"Call to method node_delegate::${method} took ${total_duration}us, longer than our target maximum of 500ms",
346 (
"method", _method_name)
347 (
"total_duration", total_duration.count()));
348 dlog(
"Actual execution took ${execution_duration}us, with a ${delegate_delay}us delay before the delegate thread started "
349 "executing the method, and a ${p2p_delay}us delay after it finished before the p2p thread started processing the response",
350 (
"execution_duration", actual_execution_time)
351 (
"delegate_delay", delay_before)
352 (
"p2p_delay", delay_after));
355 void starting_execution()
359 void execution_completed()
373 std::vector<message_hash_type>& contained_transaction_msg_ids )
override;
375 std::vector<item_hash_t>
get_block_ids(
const std::vector<item_hash_t>& blockchain_synopsis,
376 uint32_t& remaining_item_count,
377 uint32_t limit = 2000)
override;
378 message
get_item(
const item_id&
id )
override;
381 uint32_t number_of_blocks_after_reference_point)
override;
382 void sync_status( uint32_t item_type, uint32_t item_count )
override;
422 #ifdef P2P_IN_DEDICATED_THREAD
423 std::shared_ptr<fc::thread>
_thread = std::make_shared<fc::thread>(
"p2p");
425 #endif // P2P_IN_DEDICATED_THREAD
426 std::unique_ptr<statistics_gathering_node_delegate_wrapper>
_delegate;
429 #define NODE_CONFIGURATION_FILENAME "node_config.json"
430 #define POTENTIAL_PEER_DATABASE_FILENAME "peers.json"
480 boost::multi_index::indexed_by<
481 boost::multi_index::ordered_unique< boost::multi_index::identity<prioritized_item_id> >,
482 boost::multi_index::hashed_unique<
483 boost::multi_index::tag<item_id_index>,
484 boost::multi_index::member<prioritized_item_id, item_id, &prioritized_item_id::item>,
604 #ifdef USE_PEERS_TO_DELETE_MUTEX
611 #ifdef ENABLE_P2P_DEBUGGING_API
612 std::set<node_id_t> _allowed_peers;
613 #endif // ENABLE_P2P_DEBUGGING_API
638 explicit node_impl(
const std::string& user_agent);
681 const message& received_message )
override;
736 const message& message_to_process,
741 const message& message_to_process,
781 const std::string& reason_for_disconnect,
782 bool caused_by_error =
false,
792 const std::vector<std::string>& advertise_or_exclude_list );
808 void sync_from(
const item_id& current_head_block,
const std::vector<uint32_t>& hard_fork_block_numbers);
822 uint32_t download_bytes_per_second );
843 (accept_incoming_connections)
844 (connect_to_new_peers)
845 (wait_if_endpoint_is_busy)
void save_node_configuration()
void set_accept_incoming_connections(bool accept)
bool is_connected_to_endpoint(const fc::ip::endpoint &remote_endpoint) const
statistics_gathering_node_delegate_wrapper(std::shared_ptr< node_delegate > delegate, fc::thread *thread_for_delegate_calls)
void on_blockchain_item_ids_inventory_message(peer_connection *originating_peer, const blockchain_item_ids_inventory_message &blockchain_item_ids_inventory_message_received)
std::pair< typename std::unordered_set< Key, Hash, Pred >::iterator, bool > insert(const Key &val)
graphene::protocol::chain_id_type get_chain_id() const override
microseconds milliseconds(int64_t s)
void start_synchronizing()
An order-perserving dictionary of variant's.
size_t _avg_net_usage_minute_counter
Average network usage minute counter.
void set_inbound_endpoint(const fc::ip::endpoint &ep)
void operator()(node_impl *)
bool is_connected() const
void trigger_fetch_items_loop()
std::vector< item_hash_t > get_blockchain_synopsis(const item_hash_t &reference_point, uint32_t number_of_blocks_after_reference_point) override
uint32_t get_next_known_hard_fork_block_number(uint32_t block_number) const
void p2p_network_connect_loop()
bool is_accepting_new_connections()
void request_sync_items_from_peer(const peer_connection_ptr &peer, const std::vector< item_hash_t > &items_to_request)
void on_current_time_request_message(peer_connection *originating_peer, const current_time_request_message ¤t_time_request_message_received)
std::list< graphene::net::block_message > _received_sync_items
virtual bool should_advertise(const fc::ip::endpoint &in) const =0
void trigger_p2p_network_connect_loop()
std::list< graphene::net::block_message > _new_received_sync_items
List of sync blocks we've just received but haven't yet tried to process.
void on_message(peer_connection *originating_peer, const message &received_message) override
fc::future< void > _fetch_updated_peer_lists_loop_done
fc::future< void > _dump_node_status_task_done
void connect_to_p2p_network(node_impl_ptr self)
uint32_t get_connection_count() const
fc::future< void > _fetch_item_loop_done
void on_item_ids_inventory_message(peer_connection *originating_peer, const item_ids_inventory_message &item_ids_inventory_message_received)
fc::future< void > _accept_loop_complete
void update_bandwidth_data(uint32_t bytes_read_this_second, uint32_t bytes_written_this_second)
#define GRAPHENE_MAX_BLOCK_INTERVAL
boost::circular_buffer< item_hash_t > _most_recent_blocks_accepted
The /n/ most recent blocks we've accepted (currently tuned to the max number of connections)
#define GRAPHENE_NET_MAX_BLOCKS_PER_PEER_DURING_SYNCING
fc::future< void > _kill_inactive_conns_loop_done
fc::ripemd160 transaction_id_type
fc::future< void > _delayed_peer_deletion_task_done
std::unordered_set< Key, Hash, Pred >::iterator begin() noexcept
uint8_t get_current_block_interval_in_seconds() const override
message_propagation_data get_tx_propagation_data(const graphene::net::transaction_id_type &transaction_id) const
message get_message(const message_hash_type &hash_of_message_to_lookup) const
void fetch_sync_items_loop()
message_propagation_data get_block_propagation_data(const graphene::net::block_id_type &block_id) const
std::vector< item_hash_t > get_block_ids(const std::vector< item_hash_t > &blockchain_synopsis, uint32_t &remaining_item_count, uint32_t limit=2000) override
fc::variant_object get_call_statistics() const
fc::ip::endpoint get_actual_listening_endpoint() const
void on_hello_message(peer_connection *originating_peer, const hello_message &hello_message_received)
std::unordered_set< Key, Hash, Pred >::iterator end() noexcept
fc::variant_object generate_hello_user_data()
#define NODE_DELEGATE_METHOD_NAMES
peer_connection::timestamped_items_set_type _recently_failed_items
List of transactions we've recently pushed and had rejected by the delegate.
void disconnect_from_peer(peer_connection *originating_peer, const std::string &reason_for_disconnect, bool caused_by_error=false, const fc::oexception &additional_data=fc::oexception())
void parse_hello_user_data_for_peer(peer_connection *originating_peer, const fc::variant_object &user_data)
void set_total_bandwidth_limit(uint32_t upload_bytes_per_second, uint32_t download_bytes_per_second)
void fetch_next_batch_of_item_ids_from_peer(peer_connection *peer, bool reset_fork_tracking_data_for_peer=false)
std::unordered_map< graphene::net::block_id_type, fc::time_point > active_sync_requests_map
uint32_t calculate_unsynced_block_count_from_all_peers()
void cache_message(const message &message_to_cache, const message_hash_type &hash_of_message_to_cache, const message_propagation_data &propagation_data, const message_hash_type &message_content_hash)
bool operator<(const prioritized_item_id &rhs) const
#define GRAPHENE_NET_DEFAULT_MAX_CONNECTIONS
std::shared_ptr< detail::node_impl > node_impl_ptr
peer_connection_ptr get_connection_for_endpoint(const fc::ip::endpoint &remote_endpoint) const
fc::time_point_sec get_block_time(const item_hash_t &block_id) override
message_propagation_data get_message_propagation_data(const message_hash_type &hash_of_msg_contents_to_lookup) const
fc::variant_object get_call_statistics()
fc::ecc::private_key private_key
fc::future< void > _update_seed_nodes_loop_done
std::shared_ptr< address_builder > _address_builder
fc::optional< fc::ip::endpoint > inbound_endpoint
fc::tcp_server _tcp_server
void clear_peer_database()
void process_ordinary_message(peer_connection *originating_peer, const message &message_to_process, const message_hash_type &message_hash)
std::pair< typename std::unordered_set< Key, Hash, Pred >::iterator, bool > emplace(Key key)
fc::ripemd160 item_hash_t
constexpr size_t MAX_BLOCKS_TO_HANDLE_AT_ONCE
void on_address_message(peer_connection *originating_peer, const address_message &address_message_received)
void connection_count_changed(uint32_t c) override
void on_connection_accepted_message(peer_connection *originating_peer, const connection_accepted_message &) const
#define DECLARE_ACCUMULATOR(r, data, method_name)
void schedule_peer_for_deletion(const peer_connection_ptr &peer_to_delete)
concurrent_unordered_set< graphene::net::peer_connection_ptr > _handshaking_connections
size_t _max_addrs_to_handle_at_once
Maximum number of addresses to handle at one time.
void add_node(const fc::ip::endpoint &ep)
size_t _items_to_fetch_seq_counter
Items to fetch sequence counter.
void delayed_peer_deletion_task()
bool _node_is_shutting_down
void start_synchronizing_with_peer(const peer_connection_ptr &peer)
concurrent_unordered_set< graphene::net::peer_connection_ptr > _terminating_connections
void load_configuration(const fc::path &configuration_directory)
fc::promise< void >::ptr _retrigger_fetch_item_loop_promise
node_id_t get_node_id() const
fc::future< void > _bandwidth_monitor_loop_done
fc::variant_object get_advanced_node_parameters()
bool accept_incoming_connections
fc::time_point timestamp
the time we last heard about this item in an inventory message
an elliptic curve private key.
std::unique_ptr< statistics_gathering_node_delegate_wrapper > _delegate
void initiate_connect_to(const peer_connection_ptr &peer)
void send_hello_message(const peer_connection_ptr &peer)
bool is_wanting_new_connections()
prioritized_item_id(const item_id &item, size_t sequence_number)
bool handle_block(const graphene::net::block_message &block_message, bool sync_mode, std::vector< message_hash_type > &contained_transaction_msg_ids) override
Called when a new block comes in from the network.
void on_fetch_blockchain_item_ids_message(peer_connection *originating_peer, const fetch_blockchain_item_ids_message &fetch_blockchain_item_ids_message_received)
fc::rate_limiting_group _rate_limiter
uint32_t _peer_connection_retry_timeout
void process_block_message(peer_connection *originating_peer, const message &message_to_process, const message_hash_type &message_hash)
std::vector< item_hash_t > create_blockchain_synopsis_for_peer(const peer_connection *peer)
void trigger_process_backlog_of_sync_blocks()
void set_listen_endpoint(const fc::ip::endpoint &ep, bool wait_if_not_available)
size_t _max_sync_blocks_per_peer
Maximum number of blocks per peer during syncing.
void update_seed_nodes_task()
void set_connect_to_new_peers(bool connect)
fc::future< void > _process_backlog_of_sync_blocks_done
bool _potential_peer_db_updated
concurrent_unordered_set< item_id > _new_inventory
List of items we have received but not yet advertised to our peers.
wraps boost::filesystem::path to provide platform independent path manipulation.
concurrent_unordered_set< graphene::net::peer_connection_ptr > _closing_connections
active_sync_requests_map _active_sync_requests
List of sync blocks we've asked for from peers but have not yet received.
#define GRAPHENE_NET_PEER_HANDSHAKE_INACTIVITY_TIMEOUT
boost::container::flat_set< std::string > _seed_nodes
uint32_t _peer_inactivity_timeout
std::vector< peer_status > get_connected_peers() const
void connect(AsyncSocket &sock, const EndpointType &ep)
wraps boost::asio::socket::async_connect
void bandwidth_monitor_loop()
void connect_to_endpoint(const fc::ip::endpoint &ep)
peer_connection_ptr get_active_conn_for_endpoint(const fc::ip::endpoint &remote_endpoint) const
std::shared_ptr< peer_connection > peer_connection_ptr
void accept_connection_task(peer_connection_ptr new_peer)
fc::promise< void >::ptr _retrigger_advertise_inventory_loop_promise
std::shared_ptr< fc::thread > _thread
bool empty() const noexcept
void set_advanced_node_parameters(const fc::variant_object ¶ms)
fc::ip::endpoint listen_endpoint
void process_backlog_of_sync_blocks()
constexpr size_t MAX_ADDRESSES_TO_HANDLE_AT_ONCE
std::list< potential_peer_record > _add_once_node_list
void trigger_advertise_inventory_loop()
void listen_to_p2p_network()
fc::future< void > _fetch_sync_items_loop_done
std::list< peer_connection_ptr > _peers_to_delete
boost::circular_buffer< uint32_t > _avg_net_read_speed_seconds
Average network read speed in the past seconds.
fc::variant_object network_get_usage_stats() const
void fetch_updated_peer_lists_loop()
#define GRAPHENE_NET_DEFAULT_DESIRED_CONNECTIONS
virtual ~address_builder()=default
uint8_t _recent_block_interval_seconds
A cached copy of the block interval, to avoid a thread hop to the blockchain to get the current value...
fc::ripemd160 block_id_type
void display_current_connections()
void on_closing_connection_message(peer_connection *originating_peer, const closing_connection_message &closing_connection_message_received)
void set_advertise_algorithm(const std::string &algo, const std::vector< std::string > &advertise_or_exclude_list)
node_id_t _node_public_key
void process_block_during_syncing(peer_connection *originating_peer, const graphene::net::block_message &block_message, const message_hash_type &message_hash)
void handle_message(const message &) override
Called when a new message comes in from the network other than a block or a transaction....
fc::promise< void >::ptr _retrigger_fetch_sync_items_loop_promise
~actual_execution_measurement_helper()
std::string _user_agent_string
void advertise_inventory_loop()
void move_peer_to_closing_list(const peer_connection_ptr &peer)
void resolve_seed_node_and_add(const std::string &seed_string)
bool wait_if_endpoint_is_busy
fc::variant_object network_get_info() const
void on_connection_closed(peer_connection *originating_peer) override
fc::path _node_configuration_directory
bool _items_to_fetch_updated
node_impl(const std::string &user_agent)
void move_peer_to_active_list(const peer_connection_ptr &peer)
void on_current_time_reply_message(peer_connection *originating_peer, const current_time_reply_message ¤t_time_reply_message_received)
std::vector< uint32_t > _hard_fork_block_numbers
List of all block numbers where there are hard forks.
graphene::net::message get_message_for_item(const item_id &item) override
size_t _max_sync_blocks_to_prefetch
Maximum number of sync blocks to prefetch.
void swap(typename std::unordered_set< Key, Hash, Pred > &other) noexcept
void accept(AcceptorType &acc, SocketType &sock)
wraps boost::asio::async_accept
fc::future< void > _advertise_inventory_loop_done
fc::promise< void >::ptr _retrigger_connect_loop_promise
static std::shared_ptr< address_builder > create_default_address_builder()
item_hash_t get_head_block_id() const override
void set_node_delegate(std::shared_ptr< node_delegate > del, fc::thread *thread_for_delegate_calls)
uint32_t _maximum_number_of_connections
items_to_fetch_set_type _items_to_fetch
List of items we know another peer has and we want.
bool connect_to_new_peers
#define GRAPHENE_NET_DEFAULT_PEER_CONNECTION_RETRY_TIME
uint32_t estimate_last_known_fork_from_git_revision_timestamp(uint32_t unix_timestamp) const override
bool _suspend_fetching_sync_blocks
bool is_item_in_any_peers_inventory(const item_id &item) const
bool _sync_items_to_fetch_updated
bool is_hard_fork_block(uint32_t block_number) const
uint32_t _total_num_of_unfetched_items
The number of items we still need to fetch while syncing.
boost::multi_index_container< prioritized_item_id, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::identity< prioritized_item_id > >, boost::multi_index::hashed_unique< boost::multi_index::tag< item_id_index >, boost::multi_index::member< prioritized_item_id, item_id, &prioritized_item_id::item >, std::hash< item_id > > > > items_to_fetch_set_type
bool has_item(const graphene::net::item_id &id) override
std::vector< potential_peer_record > get_potential_peers() const
void kill_inactive_conns_loop(node_impl_ptr self)
message get_item(const item_id &id) override
void send_sync_block_to_node_delegate(const graphene::net::block_message &block_message_to_send)
uint32_t _last_reported_number_of_conns
Number of connections last reported to the client (to avoid sending duplicate messages)
fc::mutex & get_mutex() const
Iterations require a lock. This exposes the mutex. Use with care (i.e. lock_guard)
void new_peer_just_added(const peer_connection_ptr &peer)
Called after a peer finishes handshaking, kicks off syncing.
fc::ip::endpoint _actual_listening_endpoint
boost::circular_buffer< uint32_t > _avg_net_write_speed_minutes
Average network write speed in the past minutes.
void add_seed_node(const std::string &seed_string)
void on_fetch_items_message(peer_connection *originating_peer, const fetch_items_message &fetch_items_message_received)
blockchain_tied_message_cache _message_cache
Cache message we have received and might be required to provide to other peers via inventory requests...
void connect_to_task(peer_connection_ptr new_peer, const fc::ip::endpoint &remote_endpoint)
void build(node_impl *impl, address_message &) const
size_t _avg_net_usage_second_counter
Average network usage second counter.
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
void on_address_request_message(peer_connection *originating_peer, const address_request_message &)
boost::multi_index_container< timestamped_item_id, boost::multi_index::indexed_by< boost::multi_index::hashed_unique< boost::multi_index::member< timestamped_item_id, item_id, ×tamped_item_id::item >, std::hash< item_id > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< timestamp_index >, boost::multi_index::member< timestamped_item_id, fc::time_point_sec, ×tamped_item_id::timestamp > > > > timestamped_items_set_type
std::list< fc::future< void > > _handle_message_calls_in_progress
void set_allowed_peers(const std::vector< node_id_t > &allowed_peers)
peer_database _potential_peer_db
concurrent_unordered_set< graphene::net::peer_connection_ptr > _active_connections
provides stack-based nullable value similar to boost::optional
actual_execution_measurement_helper(std::shared_ptr< call_statistics_collector > collector)
void handle_transaction(const graphene::net::trx_message &transaction_message) override
Called when a new transaction comes in from the network.
std::unordered_set< Key, Hash, Pred >::const_iterator find(Key key)
void on_item_not_available_message(peer_connection *originating_peer, const item_not_available_message &item_not_available_message_received)
constexpr size_t MAX_SYNC_BLOCKS_TO_PREFETCH
boost::circular_buffer< uint32_t > _avg_net_read_speed_hours
Average network read speed in the past hours.
size_t _max_blocks_to_handle_at_once
Maximum number of blocks to handle at one time.
uint32_t get_number_of_connections()
fc::future< void > _p2p_network_connect_loop_done
std::unordered_set< Key, Hash, Pred >::iterator erase(typename std::unordered_set< Key, Hash, Pred >::const_iterator itr)
node_configuration _node_configuration
void dump_node_status_task()
void move_peer_to_terminating_list(const peer_connection_ptr &peer)
bool have_already_received_sync_item(const item_hash_t &item_hash)
void sync_from(const item_id ¤t_head_block, const std::vector< uint32_t > &hard_fork_block_numbers)
boost::circular_buffer< uint32_t > _avg_net_read_speed_minutes
Average network read speed in the past minutes.
std::shared_ptr< fc::thread > get_thread() const
void sync_status(uint32_t item_type, uint32_t item_count) override
void trigger_fetch_sync_items_loop()
boost::circular_buffer< uint32_t > _avg_net_write_speed_hours
Average network write speed in the past hours.
uint32_t _desired_number_of_connections
boost::circular_buffer< uint32_t > _avg_net_write_speed_seconds
Average network write speed in the past seconds.
void on_connection_rejected_message(peer_connection *originating_peer, const connection_rejected_message &connection_rejected_message_received)
void error_encountered(const std::string &message, const fc::oexception &error) override
peer_connection_ptr get_peer_by_node_id(const node_id_t &id) const
void schedule_next_update_seed_nodes_task()
bool merge_address_info_with_potential_peer_database(const std::vector< address_info > addresses)
fc::time_point_sec _bandwidth_monitor_last_update_time
void process_block_when_in_sync(peer_connection *originating_peer, const graphene::net::block_message &block_message, const message_hash_type &message_hash)
used by node reports status to client or fetch data from client
#define GRAPHENE_NET_MESSAGE_CACHE_DURATION_IN_BLOCKS
uint32_t get_block_number(const item_hash_t &block_id) override
void broadcast(const message &item_to_broadcast, const message_propagation_data &propagation_data)
void request_sync_item_from_peer(const peer_connection_ptr &peer, const item_hash_t &item_to_request)