-
Notifications
You must be signed in to change notification settings - Fork 146
Conversation
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 you can show that ETH/64 is supported our-of-the-box by the majority of network nodes (I don't know whether it actually is...) then we can drop ETH/63
Yeah, I thought about that too but ended up abandoning the thought because:
|
65bccfc
to
dcf264b
Compare
Alright, this should be ready for review. |
I have reassigned this to you @gsalgado because I think @pipermerriam is very busy right now. |
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.
LGTM, just a few comments/suggestions
return chain | ||
|
||
|
||
@pytest.fixture(params=(ETHV63PeerPairFactory, ETHPeerPairFactory)) |
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.
So, this causes all fixtures that use this one to be parameterized as well, I guess?
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.
Correct! I tried to keep the tests structure similar to the LESV1
vs LESV2
tests that use the same pattern?
tests/core/p2p-proto/test_eth_api.py
Outdated
) | ||
from trinity.tools.factories import ( | ||
BlockHashFactory, | ||
ChainContextFactory, | ||
ETHPeerPairFactory, | ||
) | ||
from trinity.tools.factories.eth.proto import ETHV63PeerPairFactory |
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 is this factory not imported from the same place as ETHPeerPairFactory?
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.
This is me testing out PyCharm Professional and relying on its auto import feature 😅 I'll fix that.
self.protocol.send(StatusV63(payload)) | ||
|
||
|
||
class ETHAPI(BaseETHAPI): |
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 did you chose not to include the version in the class name here?
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 have only put in the version numbers in classes that aren't on the latest version.
E.g.
ETHV63API
ETHProtocolV63
ETHV63PeerFactory
vs
ETHAPI
ETHProtocol
ETHPeerFactory
raise WrongForkIDFailure( | ||
f"{multiplexer.remote} network " | ||
f"({receipt.handshake_params.fork_id}) is incompatible to ours " | ||
f"({self.handshake_params.fork_id}), disconnecting" |
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.
Maybe include the actual exception msg here as well, as it would give extra details about where exactly the incompatibility lies.
trinity/protocol/eth/handshaker.py
Outdated
) | ||
except BaseForkIDValidationError: | ||
raise WrongForkIDFailure( | ||
f"{multiplexer.remote} network " |
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.
s/network/forkid?
dcf264b
to
0a5a9f3
Compare
Just ran a last live test and had this error blasting out.
I had live tested this before with a mix of So I need to hold of merging this until I figured out what's wrong here. |
@gsalgado Mind taking a look at the most recent commit that I added? This deals with the |
p2p/multiplexer.py
Outdated
try: | ||
cmd = command_type.decode(msg, msg_proto.snappy_support) | ||
except rlp.exceptions.DeserializationError: | ||
raise MalformedMessage(f"Failed to decode {msg} for {command_type}") |
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.
Maybe use raise MalformedMessage(...) from err
, to include the original error?
732c53f
to
0f1ecd0
Compare
What was wrong?
Trinity is currently on
eth/63
whereas Geth has implementedeth/64
andeth/65
already. We are pushing for the inclusion of request ids aseth/66
.Before we add an implementation for the proposed
eth/66
protocol, we should first implementeth/64
andeth/65
.How was it fixed?
This implements the
eth/64
protocol according to EIP 2124. The implementation follows the general principle of how LESV1, LESV2 are implemented side by side.This also adds a tiny cleanup to combine three different places with the same
if/else
construct to choose the concrete API version into a single helper function.Real life testing also demonstrates we are having
eth/64
peers alongsideeth/63
peers in the pool.To-Do
Cute Animal Picture