Commit Graph

83 Commits

Author SHA1 Message Date
Matthias Seitz
3d60a24f9b perf: reuse genesis hash (#1271) 2023-02-10 14:20:43 +01:00
Dan Cline
c7c76e9a5b feat(primitives): rm RawBlockBody, use Block (#1263) 2023-02-10 00:59:15 +01:00
Tomás
1d1d90bd19 feat: optional serde features (#1214)
Co-authored-by: lambdaclass-user <github@lambdaclass.com>
2023-02-07 15:52:32 -08:00
Bjerg
02a6aec3fb feat: support time-based forking (#1128) 2023-02-06 12:55:41 -08:00
Georgios Konstantopoulos
0c341ed9ce Revert "feat: support time-based forking" (#1090) 2023-01-30 10:58:55 -08:00
Bjerg
87306f2892 ci: ensure docs build (#1073)
Co-authored-by: xqft <estefano.bargas@fing.edu.uy>
Co-authored-by: lambdaclass-user <github@lambdaclass.com>
2023-01-27 18:49:22 +01:00
Aurélien
9cdead5646 feat: support time-based forking (#985) 2023-01-27 10:49:54 -05:00
Dan Cline
1d5cce1092 fix(eth-wire): send p2p handshake disconnects (#1047) 2023-01-26 15:01:53 +01:00
Tomás
2ae88b01df test: fix failing doctests (#1024)
Co-authored-by: lambdaclass-user <github@lambdaclass.com>
2023-01-25 04:04:48 +01:00
Dan Cline
eb11da8adf fix(net): set status, forkfilter from chainspec (#939) 2023-01-20 10:53:01 +01:00
Ikechukwu Ahiara Marvellous
54e9b12e65 Send pings in P2PStream.poll_ready (#931) 2023-01-19 12:47:23 +01:00
Georgios Konstantopoulos
d0e3741136 impl From for Status/SealedHeader (#927) 2023-01-18 19:23:02 -08:00
Dan Cline
b07e5be040 chore(eth-wire): trace handshake messages (#910) 2023-01-18 01:07:44 +01:00
Aurélien
f9de425ad8 refactor: unify all chains confs (#747)
Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
2023-01-17 07:47:34 -08:00
joshieDo
42f7936470 fix(rlp): receipts from non legacy transactions returning wrong length (#847) 2023-01-16 10:28:13 -08:00
joshieDo
d50d9bd0fe chore(net): Add proptest roundtrip to rlp types (#829) 2023-01-16 09:50:58 -08:00
Matthias Seitz
18dbcd4e6a fix: use correct boolean conversion for direction (#870) 2023-01-13 15:50:39 +01:00
Matthias Seitz
513df631e3 chore: convert warn,err to debug (#862) 2023-01-13 12:00:57 +01:00
Kim, JinSan
c4bafe809b fix: clippy warnings, or_fun_call and unnecessary_lazy_evaluations (#846) 2023-01-13 11:10:02 +01:00
Andrew Kirillov
5b63437039 chore(net): set_capability_offsets tests and refactors (#763)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2023-01-12 11:09:21 +01:00
Bjerg
20ee1bb1c9 refactor: move cli trace helpers to reth-tracing (#820) 2023-01-11 10:20:37 -08:00
joshieDo
6407b5087e chore: use B160, B256 and U256 coming from revm and ruint (#676)
* use B256, B160 and U256 from revm

* fix U256 from_str

* use U256::ZERO

* use temporary commit for revm and interpreter

* more U256::ZERO

* more changes for revm/ruint types

* clippy

* change revm and revm-interpreter repo

* remove H160 wrap

* minor cleanup

* remove unused

* fix MIN_PROTOCOL_BASE_FEE
2023-01-04 11:11:48 +02:00
Matthias Seitz
dafc01dde7 feat(net): add eth66 to default caps (#673) 2023-01-01 18:32:35 +02:00
Matthias Seitz
1ba81191f6 perf(net): backoff on IO error (#633) 2022-12-28 12:43:02 +01:00
Andrew Kirillov
d4d8a8c882 Moves code walkthrough book chapters to docs (#629)
* replaced template blocks with code blocks in stages chapter

* replaced template blocks with code blocks in network chapter

* moved book sections to docs

* fix indentation in recover_signer codeblock

* remove unnecessary TODO comment in network.md
2022-12-28 10:24:39 +01:00
Andrew Kirillov
a51fa4fd63 docs(book): start book chapter for network crate (#445)
* WIP FOR DRAFT PR

* WIP draft, walking through usage in pipeline

* diving deeper into instantiation of NetworkHandle & FetchClient

* WIP network management task & eth requests task done (ish)

* address pr comments: networkmanager as standalone task, networkconfig as main entrypoint for setup

* complete draft of the  crate docs

* restructured, starts w/ expl of

* added more snippets/anchors

* using ignore flag on code blocks, brief explanation of  struct

* typos addressed
2022-12-27 14:53:15 -08:00
Matthias Seitz
a2c1cdb399 refactor(net): deduplicate error variants (#619) 2022-12-26 23:29:26 +01:00
Matthias Seitz
ebd686a407 refactor(net): rename and restructure wire error types (#614) 2022-12-26 16:33:59 +02:00
Matthias Seitz
7c80dde0ec fix(net): check for handshake disconnect (#596) 2022-12-24 00:58:43 +01:00
Matthias Seitz
d84eb9d93c fix(net): add capacity check on ping (#558) 2022-12-21 15:41:14 +02:00
Matthias Seitz
151420df58 fix(net): encode ping pong as snappy (#555) 2022-12-21 15:24:41 +02:00
Dan Cline
aab385c84a feat(eth-wire): RLP encode then compress (#535) 2022-12-20 14:33:47 +02:00
Dan Cline
5758c297b3 fix(eth-wire): fix disconnect reason rlp decoding (#502)
* 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>
2022-12-19 11:19:08 -05:00
Matthias Seitz
dc85695d0d fix(net): set disconnect status (#520) 2022-12-19 16:22:55 +01:00
Tomás
253aae5ea9 RLP decoding error tracing (#499)
* 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>
2022-12-16 20:57:48 -05:00
Mariano A. Nicolini
4da574df84 feat: add prometheus support (#474) 2022-12-16 20:21:26 +01:00
Matthias Seitz
864e6481da fix: set forkfilter correctly (#486)
* fix: set forkfilter correctly

* fix types

* update tests
2022-12-16 14:14:07 +02:00
Matthias Seitz
6a70494612 fix(net): use frontier forkid as default (#478) 2022-12-16 10:08:16 +02:00
Matthias Seitz
12e7f0acbc feat(net): make Status and Hello configurable (#431)
* feat(net): make Status and Hello configurable

* set port
2022-12-14 11:39:09 +01:00
Dan Cline
1e38ffa5ad feat(eth-wire): fuzzing wire encoding roundtrip (#350)
* move hello to separate file

* cargo fmt

* wip: actual fuzz test

 * should probably also take advantage of test-fuzz to generate
   benchmarks like impl_fuzzer_with_input

* impl generic roundtrip method

* generate test with macro

* change testname to fuzzname

* add reth-eth-wire to fuzz in ci

* add other message types to fuzz

* remove unused_crate_dependencies

 * was causing test issues, may want to revisit whether or not we can
   include this warning and still use test_fuzz

* more afl debugging ci

* use more explicit imports in fuzz_rlp

* impl Default for types and fuzz ping/pong

 * Default is necessary for test-fuzz to auto generate a corpus for each
   type we are fuzz testing

* enable AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES

 * not sure if we should do this in the workflow instead:
   echo core >/proc/sys/kernel/core_pattern

   we may miss crashes if we keep this enabled?

* remove reth-interfaces from fuzzing

* add secp256k1 to reth-db dev deps
2022-12-13 19:10:52 +02:00
Dan Cline
aeca7ddaab fix(eth-wire): remove inaccurate status doc (#396) 2022-12-13 08:33:22 +01:00
Dan Cline
6c91322251 feat(eth-wire): derive serde traits for eth-wire types (#348)
* wip: start adding serde to stuff

* add serde traits to NewBlockHashes

* derive serde traits for the rest of the types

* derive serde traits for p2p subprotocol messages

* cargo fmt
2022-12-06 18:05:22 -08:00
Roman Krasiuk
925001e1ee move tokio utils to dev dep (#345) 2022-12-06 18:02:04 -08:00
Matthias Seitz
4643f840d7 chore(deps): get rid of unused deps (#339) 2022-12-06 18:02:04 -08:00
Matthias Seitz
b40546b999 refactor(net): misc P2Pstream refactor (#336)
* refactor(net): misc P2Pstream refactor

* update note
2022-12-06 18:02:04 -08:00
Matthias Seitz
074e69cafb chore(net): remove unused function (#335) 2022-12-06 18:02:04 -08:00
Matthias Seitz
a4472ca1c6 chore(clippy): make clippy happy (#334) 2022-12-06 18:02:04 -08:00
Dan Cline
2b6ef0afcf fix(eth-wire): encode p2p message id as valid rlp (#324) 2022-12-06 18:02:04 -08:00
Dan Cline
debc87177c fix(eth-wire): handle 0x80 for DisconnectReason and P2PMessageID (#313)
* fix disconnect reason encoding

* move disconnect to own file

* add encoding test for 0x80 in list

 * rlp([0u8]) is a good test case to have because it is the RLP encoding
   of a DisconnectRequested p2p message

* fix disconnect encoding and decoding

 * directly decode the disconnect id to handle the 0x80 case of
   DisconnectRequested
 * the previous manual snappy encoding / decoding was incorrect - a
   snappy encoded disconnect message is 4 bytes, not 3 bytes. The tests
   and implementation are changed to reflect this.

* fix p2p message decoding

 * had a similar issue to disconnect reason decoding where it would not
   handle a 0x80 message id

* make invalid rlp header case more explicit

* cargo fmt
2022-12-02 04:21:00 -08:00
Matthias Seitz
04105ec82b test: add mainnet connection test (#306) 2022-12-01 17:59:52 +01:00