Ok, but apart from the intended use of cargo tests, it could be more convenient to use a proper test suite instead of custom one.
New test gives:
Run sanity tests against ĞDev at last best block
accounts.len(): 25948.
identities.len(): 7098.
identity_index_of.len(): 7096.
address 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 is the owner_key of 2 identities
address 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz is the owner_key of 2 identities
duplicate key 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 at position 3595
duplicate key 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz at position 2457
duplicate key 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 at position 3594
duplicate key 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz at position 7238
identities.len(7098) != identity_index_of.len(7096).
identity number 2457 with owner key 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz is mapped to identity index 7238
identity number 3594 with owner key 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 is mapped to identity index 3595
Error: Storage corrupted: 9 errors.
Two addresses have multiple identities. This should never happen. @ManUtopiK is the other one.
This problem was already present at the genesis:
$ WS_RPC_ENDPOINT=wss://gdev.coinduf.eu:443/ws AT_BLOCK_NUMBER=0 cargo sanity-gdev
Run sanity tests against ĞDev at block #0.
accounts.len(): 25843.
identities.len(): 7220.
identity_index_of.len(): 7218.
Account 5HJJL5kZWVPwz1Wzgrwosee24tWw87aBB7AgGhJbZXhyZKBr not respect existential deposit rule.
[...]
Account 5DTAhrSz26tRe79WnciL1grHWXF9AHEcABMPBbXew23UX1Mc not respect existential deposit rule.
address 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 is the owner_key of 2 identities
address 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz is the owner_key of 2 identities
duplicate key 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 at position 3595
duplicate key 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 at position 3594
duplicate key 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz at position 2453
duplicate key 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz at position 2457
identities.len(7220) != identity_index_of.len(7218).
identity number 3594 with owner key 5DUjwHRqPayt3tAZk1fqEgU99xZB9jzBHKy2sMSTNcc7m9D1 is mapped to identity index 3595
identity number 2453 with owner key 5Dq8xjvkmbz7q4g2LbZgyExD26VSCutfEc6n4W4AfQeVHZqz is mapped to identity index 2457
Error: Storage corrupted: 891 errors.
so we have to find out whether it’s a problem of genesis parsing or genesis produced by @poka’s june-migrator.
[edit] I do not see any problem in https://g1-migrator.axiom-team.fr/genesis/gdev.json data. It could have been introduced later (for example a copy-paste error when adding session keys), or less likely a parsing issue. We should look in raw chainspecs for that, but that’s not convenient