-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[R4R] add extension in eth protocol handshake to disable tx broadcast #412
Conversation
4a9ede4
to
8705dbc
Compare
d5c4e29
to
22c6b28
Compare
22c6b28
to
b05ac6e
Compare
b05ac6e
to
19ae27f
Compare
@@ -44,7 +46,6 @@ import ( | |||
"github.com/ethereum/go-ethereum/params" | |||
"github.com/ethereum/go-ethereum/rlp" | |||
"github.com/ethereum/go-ethereum/trie" | |||
lru "github.com/hashicorp/golang-lru" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just fix the imports
defer timeout.Stop() | ||
for i := 0; i < 2; i++ { | ||
select { | ||
case err := <-errc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need make sure errc is clear before read from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the errc is not empty, the upper code should complain
Description
Add a new protocol version
67
in eth protocol, and add another round of handshake if peer's protocol version is larger than67
. In the new handshake message, we added an extennsion to control some new features. Currently, we only add a switch to turn off tx broadcast to the connected peer. but we can add more options in the future without adding new params.Rationale
Some nodes may do not need to receive txs broadcasted from other peers. When the network is congested, these nodes will take a lot of time to handle these txs and be unstable for queries. So we add a switch to turn off the tx broadcast for some specific nodes to make the network more stable.
Example
Changes
Notable changes:
67
Preflight checks
make build
)make test
)Already reviewed by
...
Related issues
... reference related issue #'s here ...