Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P2P: Additional info in handshake message #1083

Open
heifner opened this issue Dec 19, 2024 · 0 comments
Open

P2P: Additional info in handshake message #1083

heifner opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request 👍 lgtm

Comments

@heifner
Copy link
Member

heifner commented Dec 19, 2024

Current net_plugin protocol version: proto_savanna = 9.
Add new protocol version: proto_handshake_v2 = 10

handshake_message_v2 sent instead of handshake_message when handshake_message::network_version is >= proto_handshake_v2.

struct handshake_message_v2 : handshake_message {
   fc::time_point last_vote_received;  // report in connection status, allows node operators to see which connections have vote messages
   fc::time_point last_trx_received;  // report in connection status, allows node operators to see which connections have trxs
   block_num_type start_block = 0; // if block_log then what is the starting block, 0 if no block log
};

Current handshake_message

   struct handshake_message {
      uint16_t                   network_version = 0; ///< incremental value above a computed base
      chain_id_type              chain_id; ///< used to identify chain
      fc::sha256                 node_id; ///< used to identify peers and prevent self-connect
      chain::public_key_type     key; ///< authentication key; may be a producer or peer key, or empty
      int64_t                    time{0}; ///< time message created in nanoseconds from epoch
      fc::sha256                 token; ///< digest of time to prove we own the private key of the key above
      chain::signature_type      sig; ///< signature for the digest
      string                     p2p_address;
      uint32_t                   fork_db_root_num = 0;
      block_id_type              fork_db_root_id;
      uint32_t                   fork_db_head_num = 0;
      block_id_type              fork_db_head_id;
      string                     os;
      string                     agent;
      int16_t                    generation = 0;
   };
  • On first handshake_message received when network_verison > proto_handshake_v2 send back a handshake_message_v2.
  • Do not attempt sync from peer when start_block == 0 or needed block is < start_block.
  • Add handshake_message_v2 info to connection status response.
  • If configured as a block producer or finalizer, generate error log message if all peers do not have a last_vote_received and Savanna is active.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 👍 lgtm
Projects
Status: Todo
Development

No branches or pull requests

3 participants