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

Non-deterministic wasm binary of the contracts #165

Open
xgreenx opened this issue Aug 11, 2022 · 0 comments
Open

Non-deterministic wasm binary of the contracts #165

xgreenx opened this issue Aug 11, 2022 · 0 comments
Assignees

Comments

@xgreenx
Copy link
Contributor

xgreenx commented Aug 11, 2022

After the bunch of size optimization, we decided to add a GitHub action that will compare the sizes of contracts. During the implementation of the size, we found that the size of the contracts is not deterministic.

After investigation, we found the reason:
OpenBrush stores some metadata in the target folder. It requires access to the storage and adds some delays during the parallel compilation of the contract. The code is optimized in the different sequences, which may cause differences in the contract sizes in 10-150 bytes.

The solution is entirely to replace the code generated by ink::trait_definition and ink::contract macros and store all required information in the code on Rust level to avoid access to the storage.

@xgreenx xgreenx self-assigned this Aug 11, 2022
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

No branches or pull requests

1 participant