Skip to content
Snippets Groups Projects
  • Alexander Theißen's avatar
    revive: Bump PolkaVM and add static code validation (#5939) · 5f55185e
    Alexander Theißen authored
    
    This PR adds **static** validation that prevents upload of code that:
    
    1) Contains basic blocks larger than the specified limit (currently
    `200`)
    2) Contains invalid instructions
    3) Uses the `sbrk` instruction
    
    Doing that statically at upload time (instead of at runtime) allows us
    to change the basic block limit or add instructions later without
    worrying about breaking old code. This is well worth the linear scan of
    the whole blob on deployment in my opinion. Please note that those
    checks are not applied when existing code is just run (hot path).
    
    Also some drive by fixes:
    - Remove superflous `publish = true`
    - Abort fixture build on warning and fix existing warnings
    - Re-enable optimizations in fixture builds (should be fixed now in
    PolkaVM)
    - Disable stripping for fixture builds (maybe we can get some line
    information on trap via `RUST_LOG`)
    
    ---------
    
    Co-authored-by: command-bot <>
    Co-authored-by: default avatarPG Herveou <pgherveou@gmail.com>
    Unverified
    5f55185e
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
pr_5939.prdoc 324 B
title: "[pallet-revive] Bump PolkaVM and add static code validation"

doc:
  - audience: Runtime Dev
    description: |
     Statically validate basic block sizes and instructions.

crates:
  - name: pallet-revive
    bump: major
  - name: pallet-revive-fixtures
    bump: minor
  - name: pallet-revive-uapi
    bump: patch