sigp/discv5

errors after update, related to alloy_rlp

pedrohba1 opened this issue · 2 comments

Not sure if this is known already, but here is the output (v0.4.1)

error[E0432]: unresolved import `enr::EnrError`
  --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/discv5.rs:26:24
   |
26 | use enr::{CombinedKey, EnrError, EnrKey, NodeId};
   |                        ^^^^^^^^ no `EnrError` in the root
error[E0277]: the trait bound `T: alloy_rlp::encode::Encodable` is not satisfied
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/discv5.rs:443:26
    |
443 |             .insert(key, value, &self.enr_key.read())
    |              ------      ^^^^^ the trait `alloy_rlp::encode::Encodable` is not implemented for `T`
    |              |
    |              required by a bound introduced by this call
    |
note: required by a bound in `enr::Enr::<K>::insert`
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/enr-0.10.1/src/lib.rs:486:22
    |
486 |     pub fn insert<T: Encodable>(
    |                      ^^^^^^^^^ required by this bound in `Enr::<K>::insert`
help: consider further restricting this bound
    |
436 |     pub fn enr_insert<T: rlp::Encodable + alloy_rlp::encode::Encodable>(
    |                                         ++++++++++++++++++++++++++++++

   Compiling jsonrpsee v0.20.3
error[E0277]: the trait bound `enr::Enr<CombinedKey>: Encodable` is not satisfied
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/packet/mod.rs:176:35
    |
176 |                 let node_record = enr_record.as_ref().map(rlp::encode);
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Encodable` is not implemented for `enr::Enr<CombinedKey>`
    |
    = help: the following other types implement trait `Encodable`:
              bool
              usize
              u8
              u16
              u32
              u64
              u128
              Box<T>
            and 7 others
note: required by a bound in `rlp::encode`
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rlp-0.5.2/src/lib.rs:98:5
    |
96  | pub fn encode<E>(object: &E) -> BytesMut
    |        ------ required by a bound in this function
97  | where
98  |     E: Encodable,
    |        ^^^^^^^^^ required by this bound in `encode`

error[E0277]: the trait bound `enr::Enr<CombinedKey>: Encodable` is not satisfied
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/packet/mod.rs:176:59
    |
176 |                 let node_record = enr_record.as_ref().map(rlp::encode);
    |                                                           ^^^^^^^^^^^ the trait `Encodable` is not implemented for `enr::Enr<CombinedKey>`
    |
    = help: the following other types implement trait `Encodable`:
              bool
              usize
              u8
              u16
              u32
              u64
              u128
              Box<T>
            and 7 others
note: required by a bound in `rlp::encode`
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rlp-0.5.2/src/lib.rs:98:5
    |
96  | pub fn encode<E>(object: &E) -> BytesMut
    |        ------ required by a bound in this function
97  | where
98  |     E: Encodable,
    |        ^^^^^^^^^ required by this bound in `encode`

error[E0277]: the trait bound `enr::Enr<CombinedKey>: Decodable` is not satisfied
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/packet/mod.rs:262:39
    |
262 |                         rlp::decode::<Enr>(&remaining_data[total_size..])
    |                                       ^^^ the trait `Decodable` is not implemented for `enr::Enr<CombinedKey>`
    |
    = help: the following other types implement trait `Decodable`:
              bool
              usize
              u8
              u16
              u32
              u64
              u128
              Box<T>
            and 5 others
note: required by a bound in `rlp::decode`
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rlp-0.5.2/src/lib.rs:75:5
    |
73  | pub fn decode<T>(bytes: &[u8]) -> Result<T, DecoderError>
    |        ------ required by a bound in this function
74  | where
75  |     T: Decodable,
    |        ^^^^^^^^^ required by this bound in `decode`

error[E0277]: the trait bound `enr::Enr<CombinedKey>: Encodable` is not satisfied
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/rpc.rs:208:34
    |
208 |                         s.append(&node);
    |                           ------ ^^^^^ the trait `Encodable` is not implemented for `enr::Enr<CombinedKey>`
    |                           |
    |                           required by a bound introduced by this call
    |
    = help: the following other types implement trait `Encodable`:
              bool
              usize
              u8
              u16
              u32
              u64
              u128
              Box<T>
            and 7 others
note: required by a bound in `RlpStream::append`
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rlp-0.5.2/src/stream.rs:113:6
    |
111 |     pub fn append<E>(&mut self, value: &E) -> &mut Self
    |            ------ required by a bound in this associated function
112 |     where
113 |         E: Encodable,
    |            ^^^^^^^^^ required by this bound in `RlpStream::append`

error[E0277]: the trait bound `enr::Enr<CombinedKey>: Decodable` is not satisfied
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/rpc.rs:442:48
    |
442 |                         enr_list_rlp.as_list::<Enr<CombinedKey>>()?
    |                                      -------   ^^^^^^^^^^^^^^^^ the trait `Decodable` is not implemented for `enr::Enr<CombinedKey>`
    |                                      |
    |                                      required by a bound introduced by this call
    |
    = help: the following other types implement trait `Decodable`:
              bool
              usize
              u8
              u16
              u32
              u64
              u128
              Box<T>
            and 5 others
note: required by a bound in `Rlp::<'a>::as_list`
   --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rlp-0.5.2/src/rlpin.rs:281:6
    |
279 |     pub fn as_list<T>(&self) -> Result<Vec<T>, DecoderError>
    |            ------- required by a bound in this associated function
280 |     where
281 |         T: Decodable,
    |            ^^^^^^^^^ required by this bound in `Rlp::<'a>::as_list`

error[E0277]: the trait bound `enr::Enr<CombinedKey>: Encodable` is not satisfied
    --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/discv5-0.4.1/src/service.rs:1058:46
     |
1058 |                 let entry_size = rlp::encode(&enr).len();
     |                                  ----------- ^^^^ the trait `Encodable` is not implemented for `enr::Enr<CombinedKey>`
     |                                  |
     |                                  required by a bound introduced by this call
     |
     = help: the following other types implement trait `Encodable`:
               bool
               usize
               u8
               u16
               u32
               u64
               u128
               Box<T>
             and 7 others
note: required by a bound in `rlp::encode`
    --> /home/bufulin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rlp-0.5.2/src/lib.rs:98:5
     |
96   | pub fn encode<E>(object: &E) -> BytesMut
     |        ------ required by a bound in this function
97   | where
98   |     E: Encodable,
     |        ^^^^^^^^^ required by this bound in `encode`

   Compiling ssz_types v0.5.4
Some errors have detailed explanations: E0277, E0432.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `discv5` (lib) due to 8 previous errors
warning: build failed, waiting for other jobs to finish...

same issue trying to build the latest stable version of lighthouse

Yep. Sorry guys. This was my bad. I pushed a version change that I thought didn't have breaking API changes. It has been corrected.
I've yanked the 10.1 version of ENR.