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 deserializing FlatPublicParams from the disk cache via abomonation, the decoding behavior as of #1085 panics if an matching cache file can't be deserialized to an instance of FlatPublicParams. This can lead to unnecessary panics, such as in CI benchmarks as described below.
Context
Due to the use of nullfs in our CI runners, we create the disk cache file(s) and then write 0 bytes to disk to preserve space and abstract the memory caching performance from our benchmarks (note: the mem cache has since been removed in #1085). However, this means the disk cache believes there is a valid public params file, and attempts to infallibly deserialize it into a FlatPublicParams instance so that we fail if the cache file gets mangled somehow.
Throw an error or regenerate the params if the abomonation::decode function errors, potentially checking that the file is >0 bytes if it's a common enough pattern.
Problem
When deserializing
FlatPublicParams
from the disk cache viaabomonation
, the decoding behavior as of #1085 panics if an matching cache file can't be deserialized to an instance ofFlatPublicParams
. This can lead to unnecessary panics, such as in CI benchmarks as described below.Context
Due to the use of nullfs in our CI runners, we create the disk cache file(s) and then write 0 bytes to disk to preserve space and abstract the memory caching performance from our benchmarks (note: the mem cache has since been removed in #1085). However, this means the disk cache believes there is a valid public params file, and attempts to infallibly deserialize it into a
FlatPublicParams
instance so that we fail if the cache file gets mangled somehow.This issue was discovered in https://github.com/lurk-lab/lurk-rs/actions/runs/7801249065/job/21275891776 and https://github.com/lurk-lab/lurk-rs/actions/runs/7788046751/job/21236613434.
Proposed solution
Throw an error or regenerate the params if the
abomonation::decode
function errors, potentially checking that the file is >0 bytes if it's a common enough pattern.cc @huitseeker @winston-h-zhang for comment
The text was updated successfully, but these errors were encountered: