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

contract init: generate a contract that's compatible with fuzzing #1814

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leighmcculloch
Copy link
Member

What

Generate contracts with their crate-type set to both lib and cdylib.

Why

cdylib is required for building to a wasm file, and lib is required to be able to import the crate into another crate.

To do fuzzing the contract has to be imported into another binary.

Contract init should generate a contract that's compatible with fuzzing.

Historically the lib has been left off because specifying multiple crate-types results in link time optimisation (LTO) not running and the final wasm builds being larger. However since then the stellar-cli now provides a build command that runs the cargo tooling with configurations to ensure only cdylib is enabled when the wasm build occurs. So there's no longer a need to avoid the multiple crate-type.

All contracts should be fuzzing and have both crate types.

Close #1800

@leighmcculloch leighmcculloch changed the title contract init should generate a contract that's compatible with fuzzing contract init: generate a contract that's compatible with fuzzing Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog (Not Ready)
Development

Successfully merging this pull request may close these issues.

contract init should generate a contract that's compatible with fuzzing
2 participants