referrerpolicy=no-referrer-when-downgrade

check_pvm_code

Function check_pvm_code 

Source
pub fn check_pvm_code(pvm_blob: &[u8]) -> Result<(), CodeRejection>
Expand description

Make sure that the various program parts are within the defined limits.

This is the check the pallet runs on code upload. It is not generic over the runtime so that tooling can find out ahead of deployment whether a blob would be accepted.

The verdict only matches a production runtime when pallet-revive is built without the runtime-benchmarks feature. With it, a blob that uses the reserved SENTINEL ecalli passes here but is rejected with CodeRejection::InvalidInstruction on upload, and a blob that imports the benchmark-only noop syscall passes here but is rejected with CodeRejection::Malformed. Features unify across the build, so a dependency can enable it unasked.