0xPolygonZero / zk_evm

Apache License 2.0
86 stars 38 forks source link

Decide on if `#[global_allocator]` should remain in `evm_arithmetization` #205

Closed BGluth closed 5 months ago

BGluth commented 6 months ago

Recently due to adding SMT support in #198, we need to link against two versions of evm_artithmetization in a single build. This works, except that evm_artithmetization defines a global allocator (jemalloc) with #[global_allocator]. #[global_allocator] can only appear once in any given build, so this ends up breaking compilation.

It seems that best practices are to avoid using #[global_allocator] in libraries and only use it in binaries (since it affects the entire binary, including deps). Currently if there is another binary (or library for that matter) that also defines it's own global allocator, it would not be able to use evm_artithmetization.

My thoughts are we should either do one of the following:

Also note that @nbgl mentioned that she is not sure how much performance jemalloc is actually giving us at this point and it might be worth revisiting.

muursh commented 6 months ago

Remove jemalloc from evm_artithmetization and make this the responsibility of the binary to do this.

I'm still a proponent of this

BGluth commented 6 months ago

Also going to add that this issue is much less urgent at this point since we're now back to feature gating SMT support.

0xaatif commented 5 months ago
0xaatif commented 5 months ago

Closing as completed, with follow up in #302