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

Create bug: invalid length control in storage #121

Open
XianPaz opened this issue Nov 16, 2023 · 1 comment
Open

Create bug: invalid length control in storage #121

XianPaz opened this issue Nov 16, 2023 · 1 comment

Comments

@XianPaz
Copy link
Collaborator

XianPaz commented Nov 16, 2023

In https://github.com/paritytech/ink/blob/762730c63daa11f1f3349f5f6d43c77ca7468ddb/crates/storage/src/lazy/mapping.rs#L174

try_insert() check key.length() + value.length() <= 2^14

Then calls insert() , but in insert() inserts the tuple (&KeyType::KEY, key) where KeyType::KEY is a u32, so needing to serialize set_contract_storage which is something of length key.length() + 4.

@XianPaz
Copy link
Collaborator Author

XianPaz commented Nov 23, 2023

solved in PR #1961 (see here)

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