So far we only limit the size of the contract blob. However, the contract can declare static memory that is not included in the blob (zero initialized sections). The contract can also use sbrk to allocate more memory dynamically.
We need to limit both of those angles to make sure a contract can't drive the runtime oom.
Because the way how memory allocation will change in the future within PolkaVM we will go for this approach
So far we only limit the size of the contract blob. However, the contract can declare static memory that is not included in the blob (zero initialized sections). The contract can also use sbrk to allocate more memory dynamically.
We need to limit both of those angles to make sure a contract can't drive the runtime oom.
Because the way how memory allocation will change in the future within PolkaVM we will go for this approach
cc @koute We need a config knob in PolkaVM to disable sbrk. Trapping on this instruction should be fine.