koute / polkavm

A fast and secure RISC-V based virtual machine
Apache License 2.0
244 stars 52 forks source link

Improve gas consumption ergonomics from within the host calls #96

Closed koute closed 3 months ago

koute commented 8 months ago

consume_gas should return whether there's still gas left (probably by returning a Return, e.g. Result<T, OutOfGas> and then make OutOfGas convertible into a Trap with ?; also perhaps have a special error type here instead of always returning Trap