paritytech / revive

Solidity compiler for PolkaVM
Apache License 2.0
38 stars 5 forks source link

Remove `sbkr` in favor of a static buffer #53

Closed xermicus closed 1 month ago

xermicus commented 1 month ago

Dynamic allocations need to be metered in polkavm but this will be implemented later on. As an interim solution, we just use a static buffer instead.

The exact size of this has still to be determined. The amount of memory a contract can consume on EVM is capped by the blocks gas limit, currently around a couple megabytes (see also this discussion). Using a static buffer implies a fixed a fixed cost, it is also connected to the maximum call stack depth we will allow. However, assuming we can do away with just a fraction of EVMs call stack depth limit of 1024, this penalty should be very small regardless.

If needed, the static buffer size it could also be set as a compiler option.

xermicus commented 1 month ago

76