Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

P2p launch 132 #178

Merged
merged 11 commits into from
Aug 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ programs/witness_node/witness_node
programs/data-dir
programs/eosd/eosd
programs/eosc/eosc
programs/launcher/launcher

tests/app_test
tests/chain_bench
Expand All @@ -66,3 +67,5 @@ object_database/*

build/*
build-debug/*

tn_data_*
17 changes: 4 additions & 13 deletions plugins/net_plugin/include/eos/net_plugin/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ namespace eos {
using namespace chain;
using namespace fc;

using node_id_type = fc::sha256;

struct handshake_message {
int16_t network_version = 0;
chain_id_type chain_id; ///< used to identify chain
node_id_type node_id; ///< used to identify peers and prevent self-connect
fc::sha256 node_id; ///< used to identify peers and prevent self-connect
string p2p_address;
uint32_t last_irreversible_block_num = 0;
block_id_type last_irreversible_block_id;
Expand All @@ -24,7 +22,6 @@ namespace eos {
struct notice_message {
vector<transaction_id_type> known_trx;
vector<block_id_type> known_blocks;
vector<node_id_type> known_to;
};


Expand All @@ -36,8 +33,6 @@ namespace eos {
struct block_summary_message {
signed_block block;
vector<transaction_id_type> trx_ids;
vector<node_id_type> known_to;

};

struct sync_request_message {
Expand All @@ -46,7 +41,7 @@ namespace eos {
};

struct peer_message {
vector<node_id_type> peers;
vector<fc::ip::endpoint> peers;
};

using net_message = static_variant<handshake_message,
Expand All @@ -58,10 +53,6 @@ namespace eos {
SignedTransaction,
signed_block>;

using forward_message = static_variant<peer_message,
notice_message,
block_summary_message>;

} // namespace eos


Expand All @@ -73,7 +64,7 @@ FC_REFLECT( eos::handshake_message,
(os)(agent) )

FC_REFLECT( eos::block_summary_message, (block)(trx_ids) )
FC_REFLECT( eos::notice_message, (known_trx)(known_blocks)(known_to) )
FC_REFLECT( eos::notice_message, (known_trx)(known_blocks) )
FC_REFLECT( eos::request_message, (req_trx)(req_blocks) )
FC_REFLECT( eos::sync_request_message, (start_block)(end_block) )
FC_REFLECT( eos::peer_message, (peers) )
Expand Down Expand Up @@ -144,7 +135,7 @@ parallel fetches, request in groups

only relay transactions to peers if we don't already know about it.

send a notification rather than a transaction if the txn is > 3mtu size.
send a notification rather than a transaaction if the txn is > 3mtu size.



Expand Down
Loading