Contributors, builders and testers include Eric Lombrozo (cross-compilation), Tim Hughes (MSVC compilation & Dagger testing), Alex Leverington (Clang & Mac building), Marko Simovic (CI) and several others.
Ethereum is based on a design in an original whitepaper by Vitalik Buterin. This implementation is based on the formal specification of a refinement of that idea detailed in the 'yellow paper' by Gavin Wood. Contributors, builders and testers include Alex Leverington (Clang & Mac building, client multiplexing), Tim Hughes (MSVC compilation & Dagger testing), Caktux (ongoing CI), Christoph Jentzsch (tests), Christian Reissweiner (Solidity), Marek Kotewicz (external JS & JSON-RPC), Eric Lombrozo (MinGW32 cross-compilation), Marko Simovic (original CI), and several others.
autop=make_shared<Session>(_h,std::move(*s),_h->node(id),true);// true because we don't care about ids matched for now. Once we have permenant IDs this will matter a lot more and we can institute a safer mechanism.
autop=make_shared<Session>(_h,std::move(*s),_h->node(id),true);// true because we don't care about ids matched for now. Once we have permenant IDs this will matter a lot more and we can institute a safer mechanism.
bi::tcp::endpointm_public;///< Our public listening endpoint.
bi::tcp::endpointm_public;///< Our public listening endpoint.
KeyPairm_key;///< Our unique ID.
KeyPairm_key;///< Our unique ID.
boolm_hadNewNodes=false;
mutableRecursiveMutexx_peers;
mutableRecursiveMutexx_peers;
/// The nodes to which we are currently connected.
/// The nodes to which we are currently connected.
@ -227,8 +236,6 @@ private:
RangeMask<unsigned>m_ready;///< Indices into m_nodesList over to which nodes we are not currently connected, connecting or otherwise ignoring.
RangeMask<unsigned>m_ready;///< Indices into m_nodesList over to which nodes we are not currently connected, connecting or otherwise ignoring.
RangeMask<unsigned>m_private;///< Indices into m_nodesList over to which nodes are private.
RangeMask<unsigned>m_private;///< Indices into m_nodesList over to which nodes are private.
std::chrono::steady_clock::time_pointm_lastPeersRequest;///< Last time we asked for some peers - don't want to do this too often. TODO: peers should be pushed, not polled.
unsignedm_idealPeerCount=5;///< Ideal number of peers to be connected to.
unsignedm_idealPeerCount=5;///< Ideal number of peers to be connected to.
// Our addresses.
// Our addresses.
@ -238,6 +245,8 @@ private:
// Our capabilities.
// Our capabilities.
std::map<CapDesc,std::shared_ptr<HostCapabilityFace>>m_capabilities;///< Each of the capabilities we support.
std::map<CapDesc,std::shared_ptr<HostCapabilityFace>>m_capabilities;///< Each of the capabilities we support.
std::chrono::steady_clock::time_pointm_lastPing;///< Time we sent the last ping to all peers.
/// Perform a single round of the write operation. This could end up calling itself asynchronously.
voidwrite();
voidwrite();
voidgetPeers();
/// Interpret an incoming message.
boolinterpret(RLPconst&_r);
boolinterpret(RLPconst&_r);
/// @returns true iff the _msg forms a valid message for sending or receiving on the network.
/// @returns true iff the _msg forms a valid message for sending or receiving on the network.
staticboolcheckPacket(bytesConstRef_msg);
staticboolcheckPacket(bytesConstRef_msg);
Host*m_server;
Host*m_server;///< The host that owns us. Never null.
std::mutexm_writeLock;
mutablebi::tcp::socketm_socket;///< Socket for the peer's connection. Mutable to ask for native_handle().
std::deque<bytes>m_writeQueue;
Mutexx_writeQueue;///< Mutex for the write queue.
std::deque<bytes>m_writeQueue;///< The write queue.
std::array<byte,65536>m_data;///< Data buffer for the write queue.
bytesm_incoming;///< The incoming read queue of bytes.
mutablebi::tcp::socketm_socket;///< Mutable to ask for native_handle().
PeerInfom_info;///< Dyanamic information about this peer.
std::array<byte,65536>m_data;
PeerInfom_info;
bytesm_incoming;
unsignedm_protocolVersion=0;///< The protocol version of the peer.
unsignedm_protocolVersion;
std::shared_ptr<Node>m_node;///< The Node object. Might be null if we constructed using a bare address/port.
std::shared_ptr<Node>m_node;
bi::tcp::endpointm_manualEndpoint;///< The endpoint as specified by the constructor.
bi::tcp::endpointm_manualEndpoint;
boolm_force=false;///< If true, ignore IDs being different. This could open you up to MitM attacks.
boolm_force=false;/// If true, ignore IDs being different. This could open you up to MitM attacks.
boolm_dropped=false;///< If true, we've already divested ourselves of this peer. We're just waiting for the reads & writes to fail before the shared_ptr goes OOS and the destructor kicks in.
std::chrono::steady_clock::time_pointm_ping;
boolm_theyRequestedNodes=false;///< Has the peer requested nodes from us without receiveing an answer from us?
std::chrono::steady_clock::time_pointm_connect;
boolm_weRequestedNodes=false;///< Have we requested nodes from the peer and not received an answer yet?