-
Notifications
You must be signed in to change notification settings - Fork 6
fix: building in zkvm guest #457
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
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #457 will not alter performanceComparing Summary
|
|
|
||
| use zstd::Decoder; | ||
| #[cfg(feature = "zstd")] | ||
| use ruzstd as _; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ruzstd is only used for decoding? I guess it should be fully compatible with the C impl, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also curious about this?
dogeos using codec crate in guest, zstd won't compile on such target.
don't get this, why don't put decompress_blob_data at dogeos side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they also uses other things provided by scroll-codec, so two options:
- provide option to use rust zstd
- gate v2::zstd, and make zstd as optional dep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- gate v2::zstd, and make zstd as optional dep.
Does that mean that they don't actually need decompress_blob_data? Otherwise, without zstd, how would it work?
| let mut decoder = StreamingDecoder::new(header_data.as_slice()).unwrap(); | ||
| // heuristic: use data length as the allocated output capacity. | ||
| let mut output = Vec::with_capacity(header_data.len()); | ||
| decoder.read_to_end(&mut output).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why it's safe to use unwrap here. Are you sure this cannot fail? If not, we should return Result instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, but previous zstd call also unwrap and ignore errors, is there a such assumption that data is always valid?
| let mut decoder = Decoder::new(header_data.as_slice()).unwrap(); |
| while let Ok(size) = decoder.read(&mut dst) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returning Result will change the API, it's a breaking change, ok for me, but ok for others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this function is only used inside rollup-node, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to update the API.
dogeos using codec crate in guest, zstd won't compile on such target.