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

eth: implement eth66 #22241

Merged
merged 20 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7999e70
eth/protocols/eth: split up the eth protocol handlers
holiman Nov 24, 2020
5f0af8b
eth/protocols/eth: define eth-66 protocol messages
holiman Jan 26, 2021
d139b26
eth/protocols/eth: poc implement getblockheaders on eth/66
holiman Jan 26, 2021
114e366
eth/protocols/eth: implement remaining eth-66 handlers
holiman Jan 26, 2021
80f0f95
eth/protocols: define handler map for eth 66
holiman Jan 26, 2021
2b1477b
eth/downloader: use protocol constants from eth package
holiman Jan 26, 2021
9e8116f
eth/protocols/eth: add ETH66 capability
holiman Jan 26, 2021
ad57ef8
eth/downloader: tests for eth66
holiman Jan 26, 2021
e7858d7
eth/downloader: fix error in tests
holiman Jan 26, 2021
6e1bfe4
eth/protocols/eth: use eth66 for outgoing requests
holiman Jan 26, 2021
30f9649
eth/protocols/eth: remove unused error type
holiman Jan 26, 2021
bc10f94
eth/protocols/eth: define protocol length
holiman Jan 26, 2021
b7e8558
eth/protocols/eth: fix pooled tx over eth66
holiman Jan 27, 2021
0c03abc
protocols/eth/handlers: revert behavioural change which caused tests …
holiman Jan 27, 2021
0a83e81
eth/downloader: fix failing test
holiman Jan 27, 2021
5f62d2e
eth/protocols/eth: add testcases + fix flaw with header requests
holiman Jan 28, 2021
fb7c0d8
eth/protocols: change comments
holiman Jan 28, 2021
4ac8b82
eth/protocols/eth: review fixes + fixed flaw in RequestOneHeader
holiman Feb 8, 2021
7a1b727
eth/protocols: documentation
holiman Feb 18, 2021
c41ffe6
eth/protocols/eth: review concerns about types
holiman Feb 18, 2021
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
185 changes: 138 additions & 47 deletions eth/downloader/downloader_test.go

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions eth/downloader/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/eth/protocols/eth"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/log"
)
Expand Down Expand Up @@ -457,7 +458,7 @@ func (ps *peerSet) HeaderIdlePeers() ([]*peerConnection, int) {
defer p.lock.RUnlock()
return p.headerThroughput
}
return ps.idlePeers(64, 65, idle, throughput)
return ps.idlePeers(eth.ETH64, eth.ETH66, idle, throughput)
}

// BodyIdlePeers retrieves a flat list of all the currently body-idle peers within
Expand All @@ -471,7 +472,7 @@ func (ps *peerSet) BodyIdlePeers() ([]*peerConnection, int) {
defer p.lock.RUnlock()
return p.blockThroughput
}
return ps.idlePeers(64, 65, idle, throughput)
return ps.idlePeers(eth.ETH64, eth.ETH66, idle, throughput)
}

// ReceiptIdlePeers retrieves a flat list of all the currently receipt-idle peers
Expand All @@ -485,7 +486,7 @@ func (ps *peerSet) ReceiptIdlePeers() ([]*peerConnection, int) {
defer p.lock.RUnlock()
return p.receiptThroughput
}
return ps.idlePeers(64, 65, idle, throughput)
return ps.idlePeers(eth.ETH64, eth.ETH66, idle, throughput)
}

// NodeDataIdlePeers retrieves a flat list of all the currently node-data-idle
Expand All @@ -499,7 +500,7 @@ func (ps *peerSet) NodeDataIdlePeers() ([]*peerConnection, int) {
defer p.lock.RUnlock()
return p.stateThroughput
}
return ps.idlePeers(64, 65, idle, throughput)
return ps.idlePeers(eth.ETH64, eth.ETH66, idle, throughput)
}

// idlePeers retrieves a flat list of all currently idle peers satisfying the
Expand Down
Loading