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(AztecMacro): Correct serialized size computation for shared state #5078

Open
Tracked by #5077
LHerskind opened this issue Mar 8, 2024 · 1 comment
Open
Tracked by #5077

Comments

@LHerskind
Copy link
Contributor

LHerskind commented Mar 8, 2024

The macros are currently not handling the shared state sizing correctly when assigning storage slots.

For the SharedImmutable it should be fairly straightforward. When #4738 is implemented, it should be handles similar to public state.

However, when implementing the shared mutable storage (#4761) the type of storage will be storing N*2 + 1 value to state, and not just the N that the type T would normally have.

This is to account for the before and after.

This means that the computation needs to be altered slightly, to ensure that we don't end up overwriting the storage by mistake.

@LHerskind LHerskind changed the title feat(AztecMacro): Correct serialized size computation for shared and immutable state feat(AztecMacro): Correct serialized size computation for shared mutable state Mar 8, 2024
@LHerskind LHerskind changed the title feat(AztecMacro): Correct serialized size computation for shared mutable state feat(AztecMacro): Correct serialized size computation for shared state Mar 11, 2024
@Thunkar
Copy link
Contributor

Thunkar commented Apr 19, 2024

For SharedImmutable wouldn't it be possible to just hash the current storage slot, just like we do with maps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants