webb-tools / protocol-substrate

Webb protocol implementation in Substrate.
https://docs.webb.tools/v1/anchor-system/overview/
Apache License 2.0
37 stars 11 forks source link

Remove unused dependencies #285

Closed Nutomic closed 1 year ago

Nutomic commented 1 year ago

Summary of changes Changes introduced in this pull request:

I didnt measure how much this speeds up compile time as that would take too long, but the difference should be very significant.

Reference issue to close (if applicable)

Closes

shekohex commented 1 year ago

Remove rocksdb dependency feature which seems unused and is extremely slow to compile

RocksDB is needed, as it is our storage backend for the blockchain.

Switch to stable Rust

We will still need the nightly Rust too, as it is needed while compiling the WASM runtime, otherwise it will fail to compile and ask you to install the nightly Rust version with the right wasm target too.

1xstj commented 1 year ago

Agree with @shekohex comment, the nightly should not be avoided, even though it might compile here it will create problems downstream. Imo we should benchmark the build time against a standard substrate node (https://github.com/substrate-developer-hub/substrate-node-template) i dont think we can get any faster than the template node.

shekohex commented 1 year ago

Moving a lot of dependencies to dev-dependencies makes sense, and we should actually add this as a CI check too.

Nutomic commented 1 year ago

Okay im adding Rocksdb back in. Though this could be put behind a feature flag if there are use cases where it isnt needed.

About nightly, do you know why it should be used? Wasm build seems to work fine on stable. My guess is that a nightly feature was previously used, and then either stabilized or removed from the code.

shekohex commented 1 year ago

About nightly, do you know why it should be used? Wasm build seems to work fine on stable. My guess is that a nightly feature was previously used, and then either stabilized or removed from the code.

It uses your currently nightly Rust version, for building the WASM runtime, See: https://docs.rs/substrate-wasm-builder/6.0.0/substrate_wasm_builder/#prerequisites

Nutomic commented 1 year ago

You are right, the build fails if nightly isnt installed. Reverted those changes.