feat(core-processor): make dlmalloc
a program library
#2941
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1059
gwasm
for program librariesWhat happens
this PR has introduced
gwasm
feature forgstd
, ifgwasm
enabled, the program will use dlmalloc as a shared library which requires the backend linking the dlmalloc wasm library when executing the programfor the result of the size of
demo_ping.opt.wasm
after compilationHow to test it?
TBA
Open questions
1. where to perform the link operation?
imo the final solution will be in pallet-gear that users can import their uploaded libraries, or some official library like ERC-20, but for the mvp version, introducing it in pallet-gear is risky, so considering core-processor atm
2. where to store the program libraries?
hardcode in our node ( dirty but practical ) or upload it as storage ( storage IO requires more weights )
@gear-tech/dev