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

Ensure backwards compatiblity of structs used in storage arrays #247

Open
cygnusv opened this issue Mar 8, 2024 · 1 comment
Open

Ensure backwards compatiblity of structs used in storage arrays #247

cygnusv opened this issue Mar 8, 2024 · 1 comment
Assignees

Comments

@cygnusv
Copy link
Member

cygnusv commented Mar 8, 2024

When upgrading our contracts, we need to take special care with structs that are used in arrays in storage. Special care should be taken with:

  • Changing the struct size or layout, since it can lead to memory misalignment issues.
  • Introducing new fields can only be done in unassigned space within the struct

At the very least, this will affect the Participant and Ritual structs in the Coordinator, but we need to audit all contracts for instances of this problem

See https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html for reference on storage layout.

@cygnusv
Copy link
Member Author

cygnusv commented Mar 8, 2024

Forgot to mention that since we already have contracts deployed, we need acceptance tests to validate that any contract change is backwards compatible on this regard.

@cygnusv cygnusv self-assigned this Mar 8, 2024
cygnusv added a commit to cygnusv/nucypher-contracts that referenced this issue May 3, 2024
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