aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
6.18k stars 3.65k forks source link

[Feature Request] Remove patch for Merlin (Patched Merlin dependency needed for Rust SDK users) #9340

Open gregnazario opened 1 year ago

gregnazario commented 1 year ago

🚀 Feature Request

Push upstream patch for Merlin, so users of the Rust SDK don't have to patch it locally.

DO NOT CLOSE

Details

Anyone who has this error, will need to apply the patches for Merlin:

error[E0597]: `dst` does not live long enough
   --> /aptos/aptos-core/aptos-move/framework/src/natives/cryptography/bulletproofs.rs:195:41
    |
174 |     dst: Vec<u8>,
    |     --- binding `dst` declared here
...
195 |     let mut ver_trans = Transcript::new(dst.as_slice());
    |                         ----------------^^^^-
    |                         |               |
    |                         |               borrowed value does not live long enough
    |                         argument requires that `dst` is borrowed for `'static`
...
208 | }
    | - `dst` dropped here while still borrowed

They can add the patch for the aptos-sdk by adding to their Cargo.toml, which removes the error:

[patch.crates-io]
merlin = { git = "https://github.com/aptos-labs/merlin" }

Rust doesn't let you apply a patch globally, so every user has to apply the patch. The maintainers of Merlin have been unresponsive on Github, Twitter. The patch is already ready here: https://github.com/zkcrypto/merlin/pull/6, but we have to maintain our own patch. @alinush had a previous conversation about it, and we should be able to get it in, but we're blocked on that.

Documentation added here: https://github.com/aptos-labs/aptos-core/pull/9324

Blocked on: https://github.com/zkcrypto/merlin/pull/6

Additional user details here: https://github.com/aptos-labs/aptos-core/issues/9377

gregnazario commented 1 year ago

Fix is here, but author is unresponsive https://github.com/zkcrypto/merlin/pull/6

gregnazario commented 11 months ago

I've got access to Bluesky now, which both contributors to the Merlin repository seem to use. So, I'm reaching out to them again about it.

gregnazario commented 11 months ago

Pinged both contributors on Bluesky again. Waiting on a response still.

Tranduy1dol commented 5 months ago

can anyone write a more detail to fix this, i applied [patch.crates-io] merlin = { git = "https://github.com/aptos-labs/merlin" } but it still error.