OpenZeppelin / OpenZeppelin/openzeppelin-upgrades

Check struct compatibility in diamond storage pattern

Open
#459 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

storage-checks
Dominant language
TypeScript
Stars
658
Forks
286
PR merge metrics
No merged PRs in 30d

Description

The diamond storage pattern described in EIP-2535 is gaining popularity. It consists of an internal getter that returns a storage pointer to a struct that is placed in some random location in storage. This is an alternative to storage gaps that is more powerful because it also tolerates different inheritance linearization.

A struct defined in a contract used only in a diamond storage getter should also be checked for layout incompatibilities, but currently isn't

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the EIP-2535 section linked in the issue, then inspect the repository's existing storage-layout compatibility checks for how structs in diamond storage getters are handled. Done means incompatible struct layouts are detected while compatible layouts continue to pass the relevant upgrade validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.