Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework memory allocator in order to increase contract size #6761

Open
5 tasks
athei opened this issue Dec 4, 2024 · 2 comments
Open
5 tasks

Rework memory allocator in order to increase contract size #6761

athei opened this issue Dec 4, 2024 · 2 comments

Comments

@athei
Copy link
Member

athei commented Dec 4, 2024

Currently, the memory allocator lives in the client. It is pretty simple. For this reason we need to be very conservative how much memory we can use. This means that contract sizes and call stack depths are limited.

We should move the allocator into the runtime. This allows us to use a more sophisticated allocator.

cc @koute AFAIK you have an allocator in mind we should use for the runtime?

Alternative: Wait for the JIT

Once we move PolkaVM into the client (for the JIT) we no longer need to hold all code and memory of the current call stack in runtime memory. It will all be inside client memory and the runtime just holds a handle to it. This will likely remove the need for more memory.

My stance on this is: It will take too long to block on the JIT. We need more memory sooner to allow deeper call stacks. The linked RFC is a bit outdated (there might be new host functions it does not cover) but in good shape. It is not blocked by anything. If we get somebody to work in it, it can happen in parallel with the JIT work.

@athei athei converted this from a draft issue Dec 4, 2024
@athei athei moved this from Minimal Feature Launch to Polkadot APIs in Smart Contracts Dec 4, 2024
@athei athei moved this from Polkadot APIs to Minimal Feature Launch in Smart Contracts Dec 4, 2024
@athei athei moved this from Minimal Feature Launch to Polkadot APIs in Smart Contracts Dec 4, 2024
@bkchr
Copy link
Member

bkchr commented Dec 22, 2024

This is basically: polkadot-fellows/RFCs#4

It requires to finalize the RFC, get it approved and then we can implement it.

@athei
Copy link
Member Author

athei commented Jan 2, 2025

Agreed. I still leave this open because I can't add the other issue to my board. I also added some more follow up points that will be unlocked by the RFC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Polkadot APIs
Development

No branches or pull requests

2 participants