piecrust: remove zero-cost host query blanket impl - #491
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the “zero-cost” blanket HostQuery implementation for Fn(&mut [u8], u32) -> u32, making host-query pricing explicit and preventing accidental zero-gas host queries in the Piecrust VM API.
Changes:
- Removed the blanket
HostQueryimpl for host query closures frompiecrust/src/vm.rs. - Updated host-query tests to wrap function-based queries in an explicit
ZeroCostHostQueryadapter. - Added a
CHANGELOG.mdentry documenting the removal.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
piecrust/tests/host.rs |
Adds an explicit ZeroCostHostQuery wrapper and updates test registrations accordingly. |
piecrust/src/vm.rs |
Removes the blanket HostQuery implementation for Fn(&mut [u8], u32) -> u32. |
piecrust/CHANGELOG.md |
Documents the removal under Unreleased → Removed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bb44311 to
a7c8337
Compare
a7c8337 to
33cfb03
Compare
moCello
left a comment
There was a problem hiding this comment.
APPROVE — Clean, well-scoped removal of a zero-gas footgun. The test wrapper preserves behavior, all in-tree registrations are updated, and downstream (rusk/vm) already uses explicit HostQuery impls, so nothing breaks. One optional nit: capitalize "Remove" in the commit subject to match the repo convention.
There is no repo convention that says that. Over 90% of commits with a "piecrust: " prefix does not have capitalization. |
No description provided.