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

feat(core-processor): make dlmalloc a program library #2941

Closed
wants to merge 13 commits into from

Conversation

clearloop
Copy link
Contributor

@clearloop clearloop commented Jul 13, 2023

Resolves #1059

  • introduce gwasm for program libraries
  • introduce gwasm-dlmalloc which is the wasm library version of dlmalloc
  • provide tests somewhere

What happens

this PR has introduced gwasm feature for gstd, if gwasm enabled, the program will use dlmalloc as a shared library which requires the backend linking the dlmalloc wasm library when executing the program

for the result of the size of demo_ping.opt.wasm after compilation

allocator size
gwasm 4.0k
galloc 8.0k

How 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

@clearloop
Copy link
Contributor Author

waiting for #2934

@breathx
Copy link
Member

breathx commented Sep 24, 2023

Temporary closing as blocked

@breathx breathx closed this Sep 24, 2023
@clearloop clearloop deleted the cl/issue-1059 branch December 1, 2023 19:10
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.

Store smart contracts code as shared libraries
2 participants