reth icon indicating copy to clipboard operation
reth copied to clipboard

Move interfaces/p2p to a new crate net/p2p

Open supernovahs opened this issue 1 year ago • 9 comments

closes #7598

supernovahs avatar Apr 21 '24 04:04 supernovahs

Figuring this out then clean up

warning: `reth-rpc-builder` (lib) generated 2 warnings
error[E0599]: the method `value_parser` exists for reference `&&&&&&_AutoValueParser<LogLevel>`, but its trait bounds were not satisfied
    --> crates/node-core/src/args/database_args.rs:12:5
     |
12   |     /// Database logging level. Levels higher than "notice" require a debug build.
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&&&&&&_AutoValueParser<LogLevel>` due to unsatisfied trait bounds
     |
    ::: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/value_parser.rs:2462:1
     |
2462 | pub struct _AutoValueParser<T>(std::marker::PhantomData<T>);
     | ------------------------------ doesn't satisfy `_: _ValueParserViaParse`
     |
    ::: /home/runner/work/reth/reth/crates/net/p2p/src/db.rs:104:1
     |
104  | pub enum LogLevel {
     | ----------------- doesn't satisfy 7 bounds
     |
     = note: the following trait bounds were not satisfied:
             `LogLevel: ValueEnum`
             which is required by `&&&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaValueEnum`
             `LogLevel: ValueParserFactory`
             which is required by `&&&&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFactory`
             `LogLevel: From<OsString>`
             which is required by `&&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromOsString`
             `LogLevel: From<&'s std::ffi::OsStr>`
             which is required by `&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromOsStr`
             `LogLevel: From<std::string::String>`
             which is required by `&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromString`
             `LogLevel: From<&'s str>`
             which is required by `&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromStr`
             `LogLevel: FromStr`
             which is required by `_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaParse`
     = note: this error originates in the macro `clap::value_parser` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0599`.
error: could not compile `reth-node-core` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0599]: the method `value_parser` exists for reference `&&&&&&_AutoValueParser<LogLevel>`, but its trait bounds were not satisfied
    --> crates/node-core/src/args/database_args.rs:12:5
     |
12   |     /// Database logging level. Levels higher than "notice" require a debug build.
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&&&&&&_AutoValueParser<LogLevel>` due to unsatisfied trait bounds
     |
    ::: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clap_builder-4.5.2/src/builder/value_parser.rs:[246](https://github.com/paradigmxyz/reth/actions/runs/8770603685/job/24067351439?pr=7779#step:6:247)2:1
     |
2462 | pub struct _AutoValueParser<T>(std::marker::PhantomData<T>);
     | ------------------------------ doesn't satisfy `_: _ValueParserViaParse`
     |
    ::: /home/runner/work/reth/reth/crates/net/p2p/src/db.rs:104:1
     |
104  | pub enum LogLevel {
     | ----------------- doesn't satisfy 7 bounds
     |
     = note: the following trait bounds were not satisfied:
             `LogLevel: ValueEnum`
             which is required by `&&&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaValueEnum`
             `LogLevel: ValueParserFactory`
             which is required by `&&&&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFactory`
             `LogLevel: From<OsString>`
             which is required by `&&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromOsString`
             `LogLevel: From<&'s std::ffi::OsStr>`
             which is required by `&&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromOsStr`
             `LogLevel: From<std::string::String>`
             which is required by `&&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromString`
             `LogLevel: From<&'s str>`
             which is required by `&_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaFromStr`
             `LogLevel: std::str::FromStr`
             which is required by `_AutoValueParser<LogLevel>: clap::builder::via_prelude::_ValueParserViaParse`
     = note: this error originates in the macro `clap::value_parser` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `reth-node-core` (lib test) due to 2 previous errors
error: command `/home/runner/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo test --no-run --message-format json-render-diagnostics --workspace --exclude examples --exclude ef-tests --features 'asm-keccak optimism' --locked` exited with code 101
Error: Process completed with exit code 101.

supernovahs avatar Apr 21 '24 06:04 supernovahs

Let me know for refactors needed

  • crate name reth-net-p2p

  • I shifted the consensus ,sync, provider , db files and test-utils from the interfaces to p2p as those were needed.

  • Also, now directly importing ForkchoiceState from alloy rpc types engine directly instead of using reth rpc types

supernovahs avatar Apr 21 '24 10:04 supernovahs

just saw #7757 .will wait forit

supernovahs avatar Apr 21 '24 12:04 supernovahs

@supernovahs this is unblocked now

mattsse avatar Apr 23 '24 11:04 mattsse

really sorry about these conflicts -.-

might be easier to do it from main.

we can do this in two steps even

  1. move files
  2. reexport from interfaces

then gradually replace imports in followups

mattsse avatar Apr 23 '24 21:04 mattsse

et me know if I missed something

supernovahs avatar Apr 24 '24 06:04 supernovahs

It would probably difficult to review now for you. Should have started with fresh main

supernovahs avatar Apr 24 '24 11:04 supernovahs

will you start again here on same branch @supernovahs ?

emhane avatar May 18 '24 15:05 emhane

Would start on a new branch now probably

supernovahs avatar May 19 '24 19:05 supernovahs

yeah this drifted too much, so best to redo before wasting time resolving conflicts imo

mattsse avatar May 22 '24 09:05 mattsse