Skip to content

Commit

Permalink
eth/protocols: change comments
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Feb 5, 2021
1 parent 31c75fa commit e12632d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion eth/protocols/eth/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func handleGetBlockHeaders(backend Backend, msg Decoder, peer *Peer) error {
return peer.SendBlockHeaders(response)
}

// handleGetBlockHeaders66 is the ETH-66 version of handleGetBlockHeaders
// handleGetBlockHeaders66 is the eth/66 version of handleGetBlockHeaders
func handleGetBlockHeaders66(backend Backend, msg Decoder, peer *Peer) error {
// Decode the complex header query
var query GetBlockHeadersPacket66
Expand Down
6 changes: 3 additions & 3 deletions eth/protocols/eth/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (p *Peer) SendPooledTransactionsRLP(hashes []common.Hash, txs PooledTransac
return p2p.Send(p.rw, PooledTransactionsMsg, txs) // Not packed into PooledTransactionsPacket to avoid RLP decoding
}

// ReplyPooledTransactionsRLP is the ETH-66 version of SendPooledTransactionsRLP
// ReplyPooledTransactionsRLP is the eth/66 version of SendPooledTransactionsRLP
func (p *Peer) ReplyPooledTransactionsRLP(id uint64, hashes []common.Hash, txs PooledTransactionsRLPPacket) error {
// Mark all the transactions as known, but ensure we don't overflow our limits
for p.knownTxs.Cardinality() > max(0, maxKnownTxs-len(hashes)) {
Expand Down Expand Up @@ -363,7 +363,7 @@ func (p *Peer) SendNodeData(data NodeDataPacket) error {
return p2p.Send(p.rw, NodeDataMsg, data)
}

// ReplyNodeData is the ETH-66 response to GetNodeData
// ReplyNodeData is the eth/66 response to GetNodeData
func (p *Peer) ReplyNodeData(id uint64, data NodeDataPacket) error {
return p2p.Send(p.rw, NodeDataMsg, NodeDataPacket66{id, data})
}
Expand All @@ -374,7 +374,7 @@ func (p *Peer) SendReceiptsRLP(receipts ReceiptsRLPPacket) error {
return p2p.Send(p.rw, ReceiptsMsg, receipts) // Not packed into ReceiptsPacket to avoid RLP decoding
}

// ReplyReceiptsRLP is the ETH-66 response to GetReceipts
// ReplyReceiptsRLP is the eth/66 response to GetReceipts
func (p *Peer) ReplyReceiptsRLP(id uint64, receipts ReceiptsRLPPacket) error {
return p2p.Send(p.rw, ReceiptsMsg, ReceiptsRLPPacket66{id, receipts})
}
Expand Down
22 changes: 11 additions & 11 deletions eth/protocols/eth/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ type GetBlockHeadersPacket struct {
Reverse bool // Query direction (false = rising towards latest, true = falling towards genesis)
}

// GetBlockHeadersPacket represents a block header query over ETH-66
// GetBlockHeadersPacket represents a block header query over eth/66
type GetBlockHeadersPacket66 struct {
RequestId uint64
*GetBlockHeadersPacket
Expand Down Expand Up @@ -174,7 +174,7 @@ func (hn *HashOrNumber) DecodeRLP(s *rlp.Stream) error {
// BlockHeadersPacket represents a block header response.
type BlockHeadersPacket []*types.Header

// BlockHeadersPacket represents a block header response over ETH-66.
// BlockHeadersPacket represents a block header response over eth/66.
type BlockHeadersPacket66 struct {
RequestId uint64
BlockHeadersPacket
Expand Down Expand Up @@ -202,7 +202,7 @@ func (request *NewBlockPacket) sanityCheck() error {
// GetBlockBodiesPacket represents a block body query.
type GetBlockBodiesPacket []common.Hash

// GetBlockBodiesPacket represents a block body query over ETH-66.
// GetBlockBodiesPacket represents a block body query over eth/66.
type GetBlockBodiesPacket66 struct {
RequestId uint64
GetBlockBodiesPacket
Expand All @@ -216,13 +216,13 @@ type BlockBodiesPacket []*BlockBody
// roundtrip.
type BlockBodiesRLPPacket []rlp.RawValue

// BlockBodiesRLPPacket66 is the BlockBodiesRLPPacket over ETH-66
// BlockBodiesRLPPacket66 is the BlockBodiesRLPPacket over eth/66
type BlockBodiesRLPPacket66 struct {
RequestId uint64
BlockBodiesRLPPacket
}

// BlockBodiesPacket is the network packet for block content distribution over ETH-66.
// BlockBodiesPacket is the network packet for block content distribution over eth/66.
type BlockBodiesPacket66 struct {
RequestId uint64
BlockBodiesPacket
Expand Down Expand Up @@ -250,7 +250,7 @@ func (p *BlockBodiesPacket) Unpack() ([][]*types.Transaction, [][]*types.Header)
// GetNodeDataPacket represents a trie node data query.
type GetNodeDataPacket []common.Hash

// GetNodeDataPacket represents a trie node data query over ETH-66.
// GetNodeDataPacket represents a trie node data query over eth/66.
type GetNodeDataPacket66 struct {
RequestId uint64
GetNodeDataPacket
Expand All @@ -259,7 +259,7 @@ type GetNodeDataPacket66 struct {
// NodeDataPacket is the network packet for trie node data distribution.
type NodeDataPacket [][]byte

// NodeDataPacket is the network packet for trie node data distribution over ETH-66.
// NodeDataPacket is the network packet for trie node data distribution over eth/66.
type NodeDataPacket66 struct {
RequestId uint64
NodeDataPacket
Expand All @@ -268,7 +268,7 @@ type NodeDataPacket66 struct {
// GetReceiptsPacket represents a block receipts query.
type GetReceiptsPacket []common.Hash

// GetReceiptsPacket represents a block receipts query over ETH-66.
// GetReceiptsPacket represents a block receipts query over eth/66.
type GetReceiptsPacket66 struct {
RequestId uint64
GetReceiptsPacket
Expand All @@ -277,7 +277,7 @@ type GetReceiptsPacket66 struct {
// ReceiptsPacket is the network packet for block receipts distribution.
type ReceiptsPacket [][]*types.Receipt

// ReceiptsPacket is the network packet for block receipts distribution over ETH-66.
// ReceiptsPacket is the network packet for block receipts distribution over eth/66.
type ReceiptsPacket66 struct {
RequestId uint64
ReceiptsPacket
Expand Down Expand Up @@ -306,7 +306,7 @@ type GetPooledTransactionsPacket66 struct {
// PooledTransactionsPacket is the network packet for transaction distribution.
type PooledTransactionsPacket []*types.Transaction

// PooledTransactionsPacket is the network packet for transaction distribution over ETH-66.
// PooledTransactionsPacket is the network packet for transaction distribution over eth/66.
type PooledTransactionsPacket66 struct {
RequestId uint64
PooledTransactionsPacket
Expand All @@ -316,7 +316,7 @@ type PooledTransactionsPacket66 struct {
// in the cases we already have them in rlp-encoded form
type PooledTransactionsRLPPacket []rlp.RawValue

// PooledTransactionsRLPPacket66 is the ETH-66 form of PooledTransactionsRLPPacket
// PooledTransactionsRLPPacket66 is the eth/66 form of PooledTransactionsRLPPacket
type PooledTransactionsRLPPacket66 struct {
RequestId uint64
PooledTransactionsRLPPacket
Expand Down
3 changes: 1 addition & 2 deletions eth/protocols/eth/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ package eth

import (
"bytes"
"fmt"
"github.com/ethereum/go-ethereum/core/types"
"math/big"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/rlp"
)

Expand Down

0 comments on commit e12632d

Please sign in to comment.