koute / polkavm

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

Allow passing larger types to exported functions #108

Open athei opened 2 months ago

athei commented 2 months ago

Right now we can only pass arguments that fit into registers to exported functions. I want to pass larger types either on the stack or some other memory region.

My use case is that I want to pass the amount of balance a contract running on pallet_contracts received as an argument (256bit). This will save us a host function call since almost every Solidity contract will query it. The first 256bit of the input data is another candidate since it contains the selector. hose two things are already more than we can pass in our 6 input registers.