You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we determine the version of serialized circuits that we should use for a given version of zero_bin, we use the version of evm_arithmetization that is set in Cargo.lock. This is perfect as a way to version serialized circuits, but the way we do this at runtime is not the best for distributing a binary for others to use.
Currently this is the process:
At compile time, we get the path to the root of the repo by reading the env variable CARGO_MANIFEST_DIR and bake this path into the binary.
At runtime, we look for Cargo.lock in this directory and attempt to read the version of evm_arithmetization.
If we can't find Cargo.lock or a version of evm_arithmetization inside the file, we default to the NA version.
While the above should work fine in development settings, this is probably going to be an issue once we start building and redistributing the zero_bin binary since it's going to attempt to look for Cargo.lock in the location that it was built in.
Ideally instead, if we can read the version set in Cargo.lock at compile time and bake the version string into the binary, this is probably the most optimal solution. However, doing this requires using a proc macro which (at the moment) requires a sub-crate that only contains proc macros and nothing else.
While we could create a sub-crate just for this, I also noticed that no crate exists for reading a project's Cargo.lock at compile time, which I find a bit surprising. When I have a bit of free time, I'm going to attempt to create a public crate to do this, since I think there are probably a lot of other projects that could also use this.
The text was updated successfully, but these errors were encountered:
Update: I'm going to take the time to write a generic library to query Cargo.lock at compile time. Might not be ready for a while, so the proper fix might take a bit.
When we determine the version of serialized circuits that we should use for a given version of
zero_bin
, we use the version ofevm_arithmetization
that is set inCargo.lock
. This is perfect as a way to version serialized circuits, but the way we do this at runtime is not the best for distributing a binary for others to use.Currently this is the process:
CARGO_MANIFEST_DIR
and bake this path into the binary.Cargo.lock
in this directory and attempt to read the version ofevm_arithmetization
.Cargo.lock
or a version ofevm_arithmetization
inside the file, we default to theNA
version.While the above should work fine in development settings, this is probably going to be an issue once we start building and redistributing the
zero_bin
binary since it's going to attempt to look forCargo.lock
in the location that it was built in.Ideally instead, if we can read the version set in
Cargo.lock
at compile time and bake the version string into the binary, this is probably the most optimal solution. However, doing this requires using aproc macro
which (at the moment) requires a sub-crate that only containsproc macro
s and nothing else.While we could create a sub-crate just for this, I also noticed that no crate exists for reading a project's
Cargo.lock
at compile time, which I find a bit surprising. When I have a bit of free time, I'm going to attempt to create a public crate to do this, since I think there are probably a lot of other projects that could also use this.The text was updated successfully, but these errors were encountered: