Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public params disk cache panics on failed deserialization #1096

Open
samuelburnham opened this issue Feb 6, 2024 · 0 comments
Open

Public params disk cache panics on failed deserialization #1096

samuelburnham opened this issue Feb 6, 2024 · 0 comments

Comments

@samuelburnham
Copy link
Member

Problem

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant