namada icon indicating copy to clipboard operation
namada copied to clipboard

Replace "ferveo-tpke" feature guards that are only being used to prevent wasm build breakages

Open james-chf opened this issue 3 years ago • 1 comments

The shared namada crate is used by code that is compiled to wasm and also by code that is compiled to native binaries (e.g. namadac, namadan). Sometimes, things get pulled in to wasm builds via this shared crate that cause breakages. The ferveo-tpke feature is sometimes (ab)used to guard code which should only be used in native builds because it would otherwise break wasm builds e.g. https://github.com/anoma/namada/blob/2604a91cd23c6d542abab9502ec446502adfbee2/shared/src/lib.rs#L9-L12

  • "ferveo-tpke" should only be used to guard code that is actually relevant to Ferveo functionality
  • we could introduce a new dedicated feature for guarding code that shouldn't ever be included in wasm builds and use that instead of "ferveo-tpke". Even if this is only an interim solution until wasm-breaking functionality could be split out from the namada crate altogether.

james-chf avatar Nov 17 '22 12:11 james-chf

"ferveo-tpke" pulls in rand and rand_core dependencies, which is probably what leads to the breakages.

ferveo-tpke = [
  "ferveo",
  "tpke",
  "ark-ec",
  "rand_core",
  "rand",
]

The "testing" feature does this also (which means things guarded by the "testing" flag cannot currently be used within e.g. test wasms).

james-chf avatar Jan 03 '23 14:01 james-chf

this has been removed with abcipp feature flag

tzemanovic avatar Feb 19 '24 15:02 tzemanovic