-
Notifications
You must be signed in to change notification settings - Fork 97
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
Regenerated genesis bug #650
Conversation
I'm a bit confused by this change. AFAICT this is not a bug in the validation code, but possibly a bug in the genesis creation code itself. Seems weird to "fix" it here -- wouldn't this risk a valid genesis allocs (valid by our working definition, that it was generated using standard tooling invocations at a specified commit in the monorepo) failing validation (because it would have the the zeros which are now removed from the expectation). |
The key point is that for slots that are not set in genesis, the default storage value is zero. So two genesis files, where one omits zero valued slots and one explicitly sets them, are equivalent. Therefore I think the ideal fix is for the superchain registry to normalize both the provided genesis and the generated genesis before diffing them, by removing all slots where the value being set in storage is zero. This way it doesn't matter whether or not the provided and generated genesis files have these no-op keys being set, since both versions are equivalent In op-deployer, we do this same normalization when generating genesis. But you are right that this diff might cause genesis files generated by other scripts that don't normalize to fail. So we could extend this PR to normalize both genesis files to be more robust |
@mds1 agreed, Blaine and I just reached the same conclusion :-) |
Should we remove empty storage slots in the version of the genesis file that gets stored in the repo? Might save us some bytes |
Discoverd in this pr, we found that the regenerated genesis contains storage allocations that have zero as the value field. This causes the genesis allocs test to fail because op-deployer doesn't do this, nor should it.