Commit Graph

9277 Commits

Author SHA1 Message Date
11404adf6c chore(txpool): remove hash generics (#211) 2022-11-16 12:19:30 +01:00
bdf41d39a8 chore(txpool): use stabilized pop_last (#213) 2022-11-16 12:19:15 +01:00
6b336c62fb feat: add blog propagation handlers (#205) 2022-11-15 23:33:03 +01:00
f8fddcdfa4 feat(p2p): integrate txpool in p2p (#208) 2022-11-15 22:27:41 +01:00
f0388e4032 refactor: move BlockHashOrNumber to primitives (#203) 2022-11-15 09:44:07 -08:00
391a509443 feat: add FromRecoveredTransaction conversion trait (#207) 2022-11-15 16:24:13 +01:00
b60ced1de1 feat: add missing message handling (#200)
* feat: add missing message handling

* refactor: new block message handling

* feat: add events and commands for transaction handling

* more work in transactions

* chore: silence warnings
2022-11-15 10:34:28 +01:00
92a7818512 feat: bodies stage (#190)
* chore: clean up `.gitignore`

* fix: make RO cursors `Send + Sync`

* feat(wip): bodies stage

* driveby: improve docs

* chore: don't panic if we're the first stage

* chore: use `Vec` for ommers

* feat: error handling in bodies downloader

* chore: remove stale comment

* chore: pascal-case stage id

* refactor: remove unused new fns

* refactor: distinguish downloaders with prefix

* refactor: move downloader errs to own module

* refactor: `stream_bodies` -> `bodies_stream`

* test: fix borked imports in header stage

* test: clean up header tests

* test: add basic body stage tests

* test: add 2 more body stage test skeletons

* test: move generator test utils to own module

* refactor: move proof functions to primitives crate

* feat: add block generator test utils

* test: more body stage tests

* chore: fix typo (`Cannonical*` -> `Canonical`)

* docs: document `bodies_to_download`

* test: more body stage tests

* test: more body stage tests

* refactor: clean up body stage tests a bit

* test: fix broken tests

* refactor: clean up body stage tests

* test: more body stage tests
2022-11-15 08:49:11 +01:00
651eed1086 chore(txpool): add PoolError::hash function (#202) 2022-11-14 20:35:08 +01:00
14e97b2c43 chore(txpool): add external transaction helper function (#201) 2022-11-14 20:34:15 +01:00
f1e6639374 feat(net): authenticate sessions (#178)
* Switch stream type of ActiveSession to EthStream

 * Start `StatusBuilder` for initializing the `Status` message required
   for the handshake
 * Add `Hardfork` for `Status` default forkid
 * Add `MAINNET_GENESIS` constant

* finish `StatusBuilder`

* initialize eth streams in session

 * add status, hello, and fork filter to session manager
 * fix status builder example
 * add status and hello to network config
   * will probably remove

* removing status and hello from networkconfig

* move forkid to primitives

* change imports for forkid

* add hardfork to primitives

* remove hardfork and forkid from eth-wire

* fix remaining eth-wire forkid references

* put mainnet genesis in constants, remove NodeId

* replace NodeId with PeerId

 * the only NodeId remaining is inherited from enr
 * PeerId still needs to be documented
 * also run cargo fmt

* replace loop with iter().any()

* ignore missing docs for hardforks

* use correct PeerId for Discv4::bind example test

* document PeerId as secp256k1 public key

* cargo fmt

* temporarily allow too_many_arguments

 * the authenticate and start_pending_incoming_session methods have many
   arguments, we can reconsider the lint or fix the methods at a later
   point
2022-11-14 12:03:05 -05:00
5ca2cab97f refactor: move RequestError from network to interfaces p2p (#197) 2022-11-13 09:46:38 +01:00
139efee599 feat(net): impl peer management (#194) 2022-11-12 08:41:15 +01:00
9575eb89fb ci: fix workflow concurrency control (#191) 2022-11-11 07:46:32 +01:00
2754315e68 chore: omner -> ommer (#192)
* chore: omner -> ommer

* chore: missmatch -> mismatch

* chore: other typos
2022-11-11 07:46:09 +01:00
c13898e199 ci: make codecov less noisy (#193) 2022-11-11 07:45:43 +01:00
1db9a5aed4 ci: NEXTEST_EXPERIMENTAL_FILTER_EXPR env var no longer required (#188) 2022-11-10 22:30:19 +01:00
c43d752929 feat(net): more request handling (#186)
* feat(net): more request handling

* rm uneccessary checks

* rm box
2022-11-10 21:24:47 +01:00
dd4878c0e3 fix: remove broken client feature for pubsub (#189) 2022-11-10 20:12:32 +01:00
a77018fe03 chore: bump git deps in Cargo.lock (#187) 2022-11-10 19:57:11 +01:00
fd6a7cb628 WIP: feat: ipc support (#144)
* feat: ipc support

* copy futures

* feat: port ipc implementation

* cleanup

* add test

* fix clippy

* add request test
2022-11-10 19:47:00 +01:00
fc9b6f35e7 feat(test): add TestApi type (#183) 2022-11-10 13:17:36 -05:00
d4aabe4751 fix(eth-wire): fix usage of sink API in P2PStream (#184)
* fix(eth-wire): fix usage of sink API in P2PStream

* add error checks for sink buffer inserts
2022-11-09 19:06:27 -05:00
9e35d58b05 feat(primitive): Signer recovery (#179)
* feat(consensus): Signer recovery and tx validation

* Signature hash and use seckp256k1 over k256

* use deref_more for transactions

* cleanup and fix for eip1559 hash

* fix hash calculation on decoding
2022-11-09 18:11:32 +01:00
836ad6aaee feat(net): add request/response message types (#176)
* feat(net): add request/response message types

* chore: rustfmt
2022-11-08 17:52:17 +01:00
b9700791c8 feat(db): transaction value type (#175) 2022-11-08 16:56:13 +01:00
7ecbe01741 feat(provider): Add StorageProvider impl, table changes (#172)
* feat(provider): Add StorageProvider impl, table changes

* unwind header numbers by walker (#174)

* readme, fmt

* fix tests

* Update crates/interfaces/src/provider/db_provider/storage.rs

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>

* Update crates/interfaces/src/provider/db_provider/storage.rs

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
2022-11-08 15:55:45 +01:00
1408309b74 feat(net): add active session type (#169)
* refactor(net): unify capability types

* refactor(net): unify capability types

* feat(net): add active session type
2022-11-07 23:15:38 +01:00
86ffb4756d feat(bin): simple reth node command (#158)
* feat(bin): simple reth node command

* use silent flag

* small chore
2022-11-07 12:10:09 -08:00
caad026c70 refactor: rename HeaderLocked to SealedHeader (#173) 2022-11-07 21:06:53 +01:00
099d3cee9a meta(dep): ignore c files (#171) 2022-11-07 19:59:46 +01:00
5721262740 refactor(net): unify capability types (#168)
* refactor(net): unify capability types

* refactor(net): unify capability types
2022-11-07 18:04:17 +01:00
e870a4ce13 refactor(txpool): use tx hash for on new block update (#170)
* refactor(txpool): use tx hash for updates

* chore: rustfmt
2022-11-07 14:50:36 +01:00
b7cdfbf4f9 feat(net): network scaffolding (#110)
* feat(net): network scaffolding
2022-11-07 09:27:08 +01:00
9c40f8265b test(sync): headers stage test runner (#163)
* refactor headers stage tests

* inline unwind util functions
2022-11-04 08:15:34 -07:00
ca2b5ef7c7 style(p2p): simplify pinger (#165)
* style(p2p): simplify pinger

* update docs
2022-11-04 15:01:50 +01:00
5cb2c6e615 style(p2p): get rid of expects (#164)
* style(p2p): get rid of expects

* test: add test
2022-11-04 14:51:13 +01:00
f6d3a49d28 feat(sync): stage tx index (#149)
* init

* feat(sync): tx index stage

* create test runner

* finish tests

* clippy

* cleanup & docs

* add more comments

* revert headers test refactor

* rm unused function
2022-11-04 03:28:18 -07:00
9b74d7d39d feat(eth-wire): use UnauthedEthStream to create EthStream (#162)
* Create UnauthedEthStream

* remove authed flag from EthStream

* encode and decode in status handshake

 * update test to assert the proper status is communicated

* cargo fmt

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-04 08:36:40 +01:00
43a0a2b160 feat(eth-wire): return Hello on handshake (#161)
* feat(eth-wire): return Hello on handshake

* update P2PStream docs based on new auth design

* cargo fmt

* make clippy happy
2022-11-04 08:14:41 +01:00
ccdf2ffa92 hotfix(eth-wire): loosen lints temporarily 2022-11-03 12:43:19 -07:00
699db03187 feat(db): db error handling and Provider scaffolding (#154)
* feat(db): db error handling and Provider scaffolding
* remove one map_err
* fix after merge
2022-11-03 17:00:58 +01:00
bff27a4154 fix(rpc): type encoding (#155)
* fix(rpc): type encoding

* copy bytes from ethers
2022-11-03 03:04:09 -07:00
becceb2802 fix(db): add traits Encode/Decode for keys and Compress/Uncompress for values (#151)
* add UncompressedUint

* add more UncompressedUint keys

* add docs

* split key/value to encode/decode and compress/uncompress traits

* reveert into

* clippy

* rm whitespaces

* remove TODO

* Remove scale encode/decode traits

* decompress

* clippy

Co-authored-by: rakita <dragan0rakita@gmail.com>
2022-11-03 00:02:19 -07:00
3c72a12aff feat(eth-wire): Implement p2p stream (#114)
* wip: p2pstream

* add comment for handshake timeout

* temp allow some lint violations

* ignore unused_variables

* start of ping task

 * TODO: make it compile
 * TODO: test ping/pong/disconnect state machine
 * TODO: send subprotocol messages to stream
 * TODO: encode non-hello p2p messages as snappy encoding without using
   an encoder
 * TODO: create test comparing encoder to hand-written snappy encoding
   for ping, pong, disconnect messages

* implement message handling in stream poll method

 * restricts S to be Stream+Sink for P2PStream to implement Stream
 * start of a poll-based refactor

* impl Stream and Sink for P2PStream

 * add tests
 * TODO: make stream/sink types compatible
 * TODO: handshake message ids
 * TODO: inner poll fn
 * TODO: pinger interval
 * TODO: ethstream test
 * TODO: passthrough test

* create pingers and test

* impl working timeout interval pinger

 * it should be much easier to poll for pings and detect timeouts now

* use pinger in p2p stream

 * change item produced by stream so it's compatible with EthStream
   * add note on pros/cons
 * shorten message sends in stream

* improve errors and remove redundant methods

* fix handshake

* debugging printlns

* fix encoding and decoding

 * switch to snappy formatting for non-hello p2p messages

* cargo fmt

* perform handshake in ethstream over p2pstream test

 * remove check for `Hello` messages outside of the handshake because
   `P2PStream`s should assume messages sent in the sink are subprotocol
   messages, not `p2p` messages.

* impl From<EthVersion> for CapabilityMessage

* remove printlns

* add total_message method to EthVersion

* decode Hello in handshake

 * disallow protocol versions other than v5

* Integrate snappy and implement message size limits

* document constants, move stream definition

* fix missing hello message id

* implement shared capabilities

 * todo: test shared capabilities
 * todo: determine how / when / why to support multiple capabilities
 * removes obsolete authed and offset fields

* add sink api TODOs

* remove les

 * should add protocols when necessary rather than name unsupported
   protocols

* fix snappy compression length

 * add test for p2pstream over a passthrough codec which tests that
   peers agree on a single shared capability

* fix some clippy lints
2022-11-03 00:01:54 -07:00
c232a72338 test(stage): headers linear downloader (#143)
* headers stage linear test

* cleanup unwind
2022-11-02 17:28:44 -07:00
ac2f3fcd8a feat: Consensus crate and verification functions. (#152)
* wip executor

* wip

* Cleanup added some checks and structure to executor

* adding additional block/header checks

* add basefee calculation and check

* some cleanup

* Sanity check test

* Test for sanity check

* move verification to consensus crate

* cleanup

* Better Error handling
2022-11-02 12:59:51 +01:00
1ea98d40cf chore: remove mdbx c files from github lang stat (#153) 2022-11-01 14:24:03 +01:00
ee61be9d07 chore(db): add docs and doctest to tables (#150)
* add table docs

* add doctest to AccountHistory table

* add docs to placeholder types

* change from outer to docs

* no camelcase type
2022-10-28 08:53:57 -07:00
4a22936898 feat(rlp): add encode for &str (#147)
* feat(rlp): add encode for &str

* add test
2022-10-28 11:54:19 +02:00