-
Notifications
You must be signed in to change notification settings - Fork 828
Client: local client connections for debugging #1147
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
Conversation
(and I have no idea where this |
d3962ae
to
ff44614
Compare
Hi @holgerd77, just saw this and wanted to chime in that it could possibly be this? |
(For this random port? If you restart your client you probably get a different port?) |
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
@jochem-brouwer thanks, my assumption on the port question is that we might mix up the discovery (DPT) port and the RLPx port. The fixed and deterministic port is the discovery port (so mostly: 30303), since the discovery handshake is always used to start an initial peer connection, also for known peers, since one first has to find out if a peer is alive and open for a connection. Then a subsequently following RLPx connection is done via a randomly chosen RLPx port (I guess the protocol is just not meant for using the same socket here to decouple or avoid concurrency issues or something?). All this might need some additional confirmation, but that's my current understanding. Setting a reliable discovery port for the client is also fixed here in the PR (this is working), although fixing this wasn't my primary intention for the PR. 😄 This port can then also be used for a local connection with geth. |
… provide feedback on peer searching when discovery enabled
…fore -> always defaulted to 30303)
…ection debugging, added networking debugging section in developer README
ff44614
to
0959546
Compare
@ryanio very strange coincidence: apart from this I just have no idea what caused this. I first had private key generation not being done with Anyhow. 😛 Will apart from that do some more tests and eventual 1-2 follow-up commits here and than open up for review. |
809125b
to
63e7780
Compare
I've added some instructions on how to locally connect to a geth instance in both ways:
Both generally work, I am not totally satisfied with the Both described ways are nevertheless also sufficient for a start and we can also further evolve on this later on (if possible). |
On the client behavior itself on the two connection setups (not necessarily a part of this PR): Both connections are not working sufficiently yet. 😜
This should be relatively easily fixable though.
WARN [03-12|13:13:53.010] Dropping unsynced node during fast sync id=5b58fe45d523f96d conn=inbound addr=127.0.0.1:64023 type=ethereumjs-devp2p/v3... This seems to be expected behavior I guess (?). Assumption (not proven): geth doesn't want to accept unsynced connections while still being in a sync process itself. |
Case 1. might actually also be some default behavior: WARN [03-12|13:59:22.319] Synchronisation failed, dropping peer peer=c843cc42d11456df err="unsynced peer: remote head 16500 below checkpoint 11337727" |
Anyhow, apart from all potential debugging: this is open for review 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.
nice, lgtm!
This PR makes the necessary preparations to allow for a local client connection with discovery and bootnode connection deactivated which will help on debugging networking issues (@ryanio that was also the source of my interest in #1145 since before it was not possible to deactivate the bootnode connections 😛 ).
For convenience I added two new npm start scripts along with a dedicated
README
section on how to easily use (see respective commits).I managed to get a connection work (more hurdles than I expected though). Scarily enough this directly breaks though with:
(this might be a major left source for our networking issues)
Will have a look into this tomorrow.