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

wasm memory limit #2009

Merged
merged 11 commits into from
Apr 1, 2024
Merged

wasm memory limit #2009

merged 11 commits into from
Apr 1, 2024

Conversation

turuslan
Copy link
Contributor

@turuslan turuslan commented Mar 20, 2024

Referenced issues

Description of the Change

  • prepareBlobForCompilation combines instrumentWithStackLimiter and wasm memory limit
  • enum HeapAllocStrategy { Dynamic, Static }
  • Memory::pagesMax()
  • use :heappages
  • remove RuntimeInstancesPoolImpl::instantiateFromState
  • RuntimeInstancesPoolImpl uses tuple<hash, config> as key
  • RuntimeCodeProvider::getCodeAt returns shared_ptr<Bytes>

Benefits

Possible Drawbacks

  • editing wasm code with wabt can cause inconsistency in wabt object fields.
    • test checks consistency with additional check for reencoding

turuslan added 4 commits March 8, 2024 11:14
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from Harrm March 20, 2024 08:58
Signed-off-by: turuslan <turuslan.devbox@gmail.com>

# Conflicts:
#	core/parachain/pvf/pvf_impl.cpp
#	core/parachain/pvf/pvf_impl.hpp
#	core/parachain/pvf/session_params.hpp
#	core/runtime/common/runtime_instances_pool.cpp
#	core/runtime/common/runtime_instances_pool.hpp
#	core/runtime/common/stack_limiter.hpp
#	test/core/parachain/pvf_test.cpp
#	test/core/runtime/runtime_test_base.hpp
@igor-egorov igor-egorov self-requested a review March 25, 2024 08:37
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from Harrm March 28, 2024 12:04
core/runtime/common/stack_limiter.hpp Outdated Show resolved Hide resolved
core/runtime/common/stack_limiter.cpp Outdated Show resolved Hide resolved
core/runtime/common/stack_limiter.cpp Outdated Show resolved Hide resolved
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan requested a review from Harrm March 29, 2024 04:21
turuslan added 3 commits April 1, 2024 13:56
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@turuslan turuslan merged commit 3d5d4df into master Apr 1, 2024
12 of 13 checks passed
@turuslan turuslan deleted the wasm/memory-limit branch April 1, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

":heappages" must limit memory
3 participants