From 07fd50f3e057a9153137c96047c7f50a22c0e25c Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Tue, 28 Jun 2022 13:26:28 +0200 Subject: [PATCH] Revert "Switch sentry to eth/67 (#113)" (#114) This reverts commit 319e7d08a0191ae36b4d5413e485c01cf6708dbf. --- _docs/README.md | 2 +- p2psentry/sentry.proto | 71 ++++++++++++++++++++++++++++------------- remote/ethbackend.proto | 2 +- 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/_docs/README.md b/_docs/README.md index 9718607..62eba7e 100644 --- a/_docs/README.md +++ b/_docs/README.md @@ -82,7 +82,7 @@ In Erigon, there are with two interfaces: ## 2. Sentry -Sentry is the component, connecting the node to the p2p network of the blockchain. In case of Erigon and Ethereum, it implements [`eth/67`](https://github.com/ethereum/devp2p/blob/master/caps/eth.md) protocol via [devp2p](https://github.com/ethereum/devp2p). +Sentry is the component, connecting the node to the p2p network of the blockchain. In case of Erigon and Ethereum, it implements [`eth/65`, `eth/66`, etc](https://github.com/ethereum/devp2p/blob/master/caps/eth.md#change-log) protocols via [devp2p](https://github.com/ethereum/devp2p). Sentry accepts connections from [Core] and [Transaction Pool] components. diff --git a/p2psentry/sentry.proto b/p2psentry/sentry.proto index 4362364..71940e3 100644 --- a/p2psentry/sentry.proto +++ b/p2psentry/sentry.proto @@ -8,27 +8,53 @@ package sentry; option go_package = "./sentry;sentry"; enum MessageId { - // ======= eth/67 protocol =========== - // Version 67 removed the GetNodeData and NodeData messages. - - // eth/64 (or earlier) announcement messages (no request-id) - STATUS = 0; - NEW_BLOCK_HASHES = 1; - TRANSACTIONS = 2; - NEW_BLOCK = 3; - - // eth/65 announcement messages (no request-id) - NEW_POOLED_TRANSACTION_HASHES = 4; - - // eth/66 messages with request-id - GET_BLOCK_HEADERS = 5; - BLOCK_HEADERS = 6; - GET_BLOCK_BODIES = 7; - BLOCK_BODIES = 8; - GET_POOLED_TRANSACTIONS = 9; - POOLED_TRANSACTIONS = 10; - GET_RECEIPTS = 11; - RECEIPTS = 12; + // ======= eth 65 protocol =========== + + STATUS_65 = 0; + GET_BLOCK_HEADERS_65 = 1; + BLOCK_HEADERS_65 = 2; + BLOCK_HASHES_65 = 3; + GET_BLOCK_BODIES_65 = 4; + BLOCK_BODIES_65 = 5; + GET_NODE_DATA_65 = 6; + NODE_DATA_65 = 7; + GET_RECEIPTS_65 = 8; + RECEIPTS_65 = 9; + NEW_BLOCK_HASHES_65 = 10; + NEW_BLOCK_65 = 11; + TRANSACTIONS_65 = 12; + NEW_POOLED_TRANSACTION_HASHES_65 = 13; + GET_POOLED_TRANSACTIONS_65 = 14; + POOLED_TRANSACTIONS_65 = 15; + + + // ======= eth 66 protocol =========== + + // eth64 announcement messages (no id) + STATUS_66 = 17; + NEW_BLOCK_HASHES_66 = 18; + NEW_BLOCK_66 = 19; + TRANSACTIONS_66 = 20; + + // eth65 announcement messages (no id) + NEW_POOLED_TRANSACTION_HASHES_66 = 21; + + // eth66 messages with request-id + GET_BLOCK_HEADERS_66 = 22; + GET_BLOCK_BODIES_66 = 23; + GET_NODE_DATA_66 = 24; + GET_RECEIPTS_66 = 25; + GET_POOLED_TRANSACTIONS_66 = 26; + BLOCK_HEADERS_66 = 27; + BLOCK_BODIES_66 = 28; + NODE_DATA_66 = 29; + RECEIPTS_66 = 30; + POOLED_TRANSACTIONS_66 = 31; + + + + // ======= eth 67 protocol =========== + // ... } message OutboundMessageData { @@ -85,7 +111,8 @@ message StatusData { } enum Protocol { - ETH67 = 0; + ETH65 = 0; + ETH66 = 1; } message SetStatusReply {} diff --git a/remote/ethbackend.proto b/remote/ethbackend.proto index 3a2f2a0..8782c26 100644 --- a/remote/ethbackend.proto +++ b/remote/ethbackend.proto @@ -32,7 +32,7 @@ service ETHBACKEND { // Version returns the service version number rpc Version(google.protobuf.Empty) returns (types.VersionReply); - // ProtocolVersion returns the Ethereum protocol version number (e.g. 67 for ETH67). + // ProtocolVersion returns the Ethereum protocol version number (e.g. 66 for ETH66). rpc ProtocolVersion(ProtocolVersionRequest) returns (ProtocolVersionReply); // ClientVersion returns the Ethereum client version string using node name convention (e.g. TurboGeth/v2021.03.2-alpha/Linux).