ZenGo-X / gotham-city

Gotham city is a fully functional project to demonstrate real-life example of minimalist Bitcoin decentralized HD wallet using 2 party ECDSA
Other
191 stars 51 forks source link

Build Error due to conflicting versions of two_party_ecdsa crate #93

Open Sajjad-Khoshdooni opened 5 months ago

Sajjad-Khoshdooni commented 5 months ago

Description: I encountered the above build error while working on the project. It seems to be caused by conflicting versions of the two_party_ecdsa crate. Specifically, the error suggests that there are two different versions of the crate being used, resulting in incompatible trait signatures for methods insert and get.

Error:

error[E0053]: method `insert` has an incompatible type for trait
  --> gotham-server/src/public_gotham.rs:56:1
   |
56 | #[async_trait]
   | ^^^^^^^^^^^^^^ expected trait `two_party_ecdsa::party_one::Value`, found a different trait `two_party_ecdsa::party_one::Value`
   |
   = note: expected signature `fn(&'life0 PublicGotham, &'life1 gotham_engine::types::DbIndex, &'life2 (dyn gotham_engine::traits::MPCStruct + 'life2), &'life3 (dyn two_party_ecdsa::party_one::Value + 'static)) -> Pin<_>`
              found signature `fn(&'life0 PublicGotham, &'life1 gotham_engine::types::DbIndex, &'life2 (dyn gotham_engine::traits::MPCStruct + 'life2), &'life3 (dyn two_party_ecdsa::party_one::Value + 'static)) -> Pin<_>`
   = note: perhaps two different versions of crate `two_party_ecdsa` are being used?

error[E0053]: method `get` has an incompatible type for trait
  --> gotham-server/src/public_gotham.rs:56:1
   |
56 | #[async_trait]
   | ^^^^^^^^^^^^^^ expected trait `two_party_ecdsa::party_one::Value`, found a different trait `two_party_ecdsa::party_one::Value`
   |
   = note: expected signature `fn(&'life0 PublicGotham, &'life1 gotham_engine::types::DbIndex, &'life2 (dyn gotham_engine::traits::MPCStruct + 'life2)) -> Pin<Box<(dyn std::future::Future<Output = Result<std::option::Option<Box<(dyn two_party_ecdsa::party_one::Value + 'static)>>, gotham_engine::types::DatabaseError>> + std::marker::Send + 'async_trait)>>`
              found signature `fn(&'life0 PublicGotham, &'life1 gotham_engine::types::DbIndex, &'life2 (dyn gotham_engine::traits::MPCStruct + 'life2)) -> Pin<Box<(dyn std::future::Future<Output = Result<std::option::Option<Box<(dyn two_party_ecdsa::party_one::Value + 'static)>>, gotham_engine::types::DatabaseError>> + std::marker::Send + 'async_trait)>>`
   = note: perhaps two different versions of crate `two_party_ecdsa` are being used?

Environment: rustc 1.75.0

auronvila commented 2 months ago

Hey I am having the same build error in my server.

Anuj-Dhiman commented 2 weeks ago

I had faced the same issue. this is because gotham-city has two-party-ecdsa and gotham-engine also uses the same repo but picking up latest one - main branch. I have fixed it by replacing bellow packages in main Cargo.toml

two-party-ecdsa = { git = "https://github.com/ZenGo-X/two-party-ecdsa.git", branch="compatibility_gotham_engine" } gotham-engine = { git = "https://github.com/ZenGo-X/gotham-engine.git", rev="6bdfa4fb302d4e089ac24e488c3ca41c6e35c23c" }

Let me know if still you have issue