Skip to content

Conversation

@gakonst
Copy link
Member

@gakonst gakonst commented Oct 23, 2022

Builds on #117 and part of splitting #58 in parts which can be individually reviewed.

  • Adds the Downloader trait to interfaces
  • Create interfaces::test_utils which implements TestConsensus, TestHeadersClient and `Test

Follow up: add a net/downloaders crate which contains the linear downloader from #58.

--

@rakita I think we'll soon want the rest of the impls here: https://github.com/foundry-rs/reth/blob/2e6b18a1547ef01bf30a5141a29ec8ffe081f331/crates/interfaces/src/db/mock.rs#L42-L180, so we can run the Stages w/o using MDBX at all

@codecov
Copy link

codecov bot commented Oct 24, 2022

Codecov Report

Merging #118 (0d1d07c) into main (a4e5051) will increase coverage by 1.16%.
The diff coverage is 85.74%.

@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
+ Coverage   69.49%   70.66%   +1.16%     
==========================================
  Files         130      135       +5     
  Lines        8776     9186     +410     
==========================================
+ Hits         6099     6491     +392     
- Misses       2677     2695      +18     
Impacted Files Coverage Δ
crates/interfaces/src/consensus.rs 50.00% <0.00%> (+50.00%) ⬆️
crates/interfaces/src/lib.rs 100.00% <ø> (ø)
crates/primitives/src/header.rs 92.94% <0.00%> (+6.71%) ⬆️
crates/interfaces/src/test_utils.rs 58.02% <58.02%> (ø)
crates/interfaces/src/p2p/headers/client.rs 66.66% <66.66%> (ø)
crates/interfaces/src/p2p/headers/downloader.rs 81.08% <81.08%> (ø)
crates/net/headers-downloaders/src/linear.rs 95.77% <95.77%> (ø)
crates/net/headers-downloaders/src/lib.rs 100.00% <100.00%> (ø)
crates/net/rpc-types/src/eth/engine.rs 14.28% <100.00%> (+14.28%) ⬆️
crates/transaction-pool/src/pool/txpool.rs 61.48% <0.00%> (+0.55%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gakonst gakonst requested review from mattsse, rakita and rkrasiuk and removed request for mattsse, rakita and rkrasiuk October 24, 2022 00:09
@gakonst gakonst changed the title feat: add Downloader trait and test utils headers(part2) - feat: add Downloader trait and test utils Oct 24, 2022
Base automatically changed from gakonst/gats-bounded-lifetimes to main October 24, 2022 06:11
@gakonst gakonst force-pushed the gakonst/downloader-test-utils branch from bd27baf to c19a425 Compare October 24, 2022 06:13
Comment on lines 29 to 31
#[cfg(any(test, feature = "test-helpers"))]
/// Common test helpers for mocking out Consensus, Downloaders and Header Clients.
pub mod test_helpers {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move this to a separate file?

gakonst and others added 3 commits October 24, 2022 04:38
* feat: add headers downloaders crate

* feat: more scaffolding

* interfaces: generalize retryable erros

* feat: implement linear downloader

* fix linear downloader tests & add builder

* extend & reverse

* feat: linear downloader generics behind arc and reversed return order (#120)

* put client & consensus behind arc and return headers in rev

* cleanup

Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
@rkrasiuk rkrasiuk merged commit 15bd88e into main Oct 24, 2022
@rkrasiuk rkrasiuk deleted the gakonst/downloader-test-utils branch October 24, 2022 11:56
@rkrasiuk rkrasiuk added C-enhancement New feature or request A-staged-sync Related to staged sync (pipelines and stages) labels Dec 6, 2022
yutianwu pushed a commit to yutianwu/reth that referenced this pull request Sep 6, 2024
release: prepare for release v1.0.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-staged-sync Related to staged sync (pipelines and stages) C-enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants