I have reviewed some techniques around Upgradeable smart contracts from starting point(Elena Dimitrova's Eternal Storage) to zeppelinOS's Unstructured Storage pattern. As I understood from posts that I have read, there is no secure&best pattern. Instead, the technique can vary dependent to your dApp design and business model. As far, most of the community thinks that zeppelinOS's approach is state of art.
I have a pain point on determining the strategy and ask for help to clarify my mind. In assumed scenario, I am required to hold identities of citizens for government on public ethereum chain. I have deployed a contract with following structure:
Contract CitizenController{
...
struct Person{
bytes name;
uint birthDate;
bool gender;
}
mapping (address => Person) people;
...
}
And the government suddenly made a new regulation that forbids holding gender publicly available data. And also they made storing irisInfo mandatory on publicly available data. Therefore, I am required to modify my struct to :
struct Person{
bytes name;
uint birthDate;
bytes irisInfo;
}
I would not require gender any more and must store irisInfo in smart contract. In my comprehension, it can be achieved using Eternal Storage as the data is stored as KeyValue Pairs. Still, I can not say that it is not possible using Proxy Contracts.
In summary, is it possible to modify struct(add/delete field) in upgradeable proxy contracts ? If that is the case, could you provide a sample code like above ? If not, do you think that it would be possible soon ?
PS: I am open to reading suggestions about upgradeable smart contracts or rabbit holes of solidity