Repository navigation
chore(arion): drop legacy zero FamilyActiveChildren rows in a v4 migr… - #77
faizsarwar wants to merge 2 commits into
Conversation
…ation (#75 nit) migrate_v2_to_v3 recomputed FamilyCount but left behind the legacy FamilyActiveChildren rows holding 0 (families that dropped out before the drop-to-zero decrement existed; 142 of 619 on mainnet). They were already treated as uncounted everywhere, so this is a pure cleanup that shrinks the map and the per-upgrade recount scan. - bump STORAGE_VERSION to 4 and add migrate_v3_to_v4 (collect-then-remove, idempotent, FamilyCount unaffected) - post_upgrade now also asserts no zero row survived (check_no_zero_family_rows) - test migration_v4_drops_legacy_zero_family_rows; v3 test updated for the bumped version and the now-cleared zero row
The v4 migration (drop legacy zero FamilyActiveChildren rows) advances the arion pallet's on-chain StorageVersion to 4, but two tests still asserted 3 after on_runtime_upgrade and failed in CI: - miner_payments.rs: migration_builds_uid_reverse_index_and_drops_duplicates - uid_bootstrap_poc.rs: bulk_bind_runs_on_a_chain_already_at_storage_version_one Both now assert 4. The v3 fixtures in arion_family_count_and_unbond.rs are left as-is: they set the pre-migration version on purpose to exercise v3->v4. Full runtime integration suite passes; the only failure is the pre-existing runtime_integrity_tests staking slash/bond assertion, unchanged from main.
|
bumped the storage-version assertions to v4 and ran the full runtime suite. The v4 migration (drop legacy zero FamilyActiveChildren rows) advances arion's on-chain StorageVersion to 4, but two tests still asserted 3 after on_runtime_upgrade:
Both now assert StorageVersion::new(4). Left the v3 .put::() fixtures in arion_family_count_and_unbond.rs as-is — those set the pre-migration version on purpose to exercise v3→v4 (that test already asserts it reaches 4). Full runtime integration suite is green: miner_payments 39, uid_bootstrap_poc 10, arion_family_count_and_unbond 11, date_to_date_billing 37, hourly_storage_billing 31, referral_mechanics 42, usage_v2 33, and the rest. The only failure is the pre-existing runtime_integrity_tests staking slash-defer / bonding-duration assertion (pallets/staking/src/pallet/mod.rs:966), which fails identically on main and is unrelated to this PR. |
chore(arion): drop legacy zero
FamilyActiveChildrenrows in a v4 migrationCloses the remaining open item of #75 (nit 2). Parts 1 (atomic
deregister_family,ec44fab) and 3 (redundant try-runtime check, 7f20e13) already landed; this finishes it.
What & why
migrate_v2_to_v3recomputedFamilyCountbut left behind the legacyFa Idempotent;FamilyCountis unaffected since only> 0` families are counted.post_upgradenow also asserts no zero row survived(
check_no_zero_family_rows), alongside the existingcheck_family_count.migration_v4_drops_legacy_zero_family_rows(seeds 3 zero rows +2 active families, asserts the zero rows are dropped, active families and
FamilyCountare untouched, and a re-run is a no-op); the existing v3 test isupdated for the bumped version and the now-cleared zero row.
Testing
cargo check -p pallet-arionand--features try-runtime: clean.cargo test -p hippius-mainnet-runtime --test arion_family_count_and_unbond:11/11 pass.
Release note
This bumps the arion storage version, so it runs a migration on the next runtime
upgrade. It must not ride along with the frozen 92021 srtool wasm from #74 —
it belongs in a later spec bump, which should also carry the corresponding
spec_versionincrement.