* feat(eth-wire): add timeouts to tests using Geth
* feat(net): use NodeRecord instead of enode format
* make NodeRecord::new pub instead of pub(crate)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
`require_tip` could only be determined by the headers stage,
and it signalled that we have all of the headers to sync all
the way to the chain tip. Some stages may wait to execute
until the tip is reached, e.g. the stage that checks the
stage root, but there are a few problems:
- On initial sync, `reached_tip` would be `true`, but by
the time we reach the hashing stage, this would actually
no longer be the case: the other stages have spent
enough time for us to be "out of sync". This means
that the optimization here is lost, and the additional
logic is added for nothing.
- When we are not doing our initial sync, `reached_tip` would
always be `true` for each subsequent block we sync.
The same logic applies as above, i.e. the extra logic
is there for nothing.
In other words, `reached_tip` would *always* be `true` once
we leave the header stage, making the extra logic entirely
redundant.
* add trace in DisconnectReason Decodable impl
* add trace for decoding p2p hello
* add traces to p2p and eth stream
* refactor P2PMessage decoding
* improve disconnect tracing
* s/Hello/first
* add geth disconnect test
* add disconnectreason test cases
* add known failing disconnect messages
* add trace when disconnect reason decoding fails
* cargo fmt
* add more examples
* adding more as they appear in traces
* will add the rest since they can be exhaustively enumerated
* add every other possible encoding
* fix disconnect decoding
* the four possible formats for a disconnect message (rlp list (y/n) x
snappy (y/n)):
* encoded as a single rlp byte
* with snappy
* without snappy
* encoded as a rlp list
* with snappy
* without snappy
* fix the type for decoding in the test_decode_known_reasons test
* sort reasons by length in test
* remove printlns
* use one call to advance
* simplify decode impl to strip last byte
* todo: comment explaining the different formats being parsed?
* explicitly remove geth as a peer
* style: traces
* add another disconnect code from geth
* fix: add check for DisconnectRequested
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
* Add tracing to ProtocolMessage::decode errors
* Change trace message formatting
Now it prints the bytes as a hex string.
Also changed trace level to WARN and added 'handshake' to one of the traces to differentiate between them
* Add prefix to raw message bytes
* Specify 'eth' in trace message
to differentiate it from other handshakes
Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
* fix(sync): headers stage progress
* add tests to head/tip and split suite
* fix(sync): headers stage progress
* add tests to head/tip and split suite
* fix local tip and address comments
* rename error