Skip to content

fix(revenue_pool): feed real layout hashes into pool upgrade validation (#1164) - #1388

Open
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1164-pool-upgrade-layout-hashes
Open

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1164-pool-upgrade-layout-hashes

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Summary

Replaces the hardcoded zero_layout_hash placeholder and static version 1 in RevenuePool::upgrade with real storage-layout descriptor hashes (callora_storage_migration::layout_hash) recorded at init and validated across sequential upgrades.

Closes #1164

Changes

  • Defined STORAGE_LAYOUT_DESCRIPTOR for revenue_pool and recorded the initial layout hash and STORAGE_MIGRATION_VERSION (1) in RevenuePool::init via StorageMigrationValidator::record_deployed_schema.
  • Added RevenuePool::upgrade_with_layout (and updated RevenuePool::upgrade to advance current_version + 1 using the deployed layout hash) so sequential upgrades (v1 -> v2 -> v3) succeed and schema drift is caught before the WASM swap.
  • Added introspection helpers (current_layout_hash, get_storage_migration_version, get_storage_layout_hash) with complete rustdoc comments.
  • Added integration tests in contracts/revenue_pool/src/test_storage_migration.rs verifying v1 -> v2 -> v3 sequential upgrades and asserting StorageMigrationError::SchemaMismatch when expected_source_layout does not match the recorded layout.

Payout / Settlement

  • USDC Wallet (Base Mainnet / EVM): 0x3806cd592a508d1992Ed007C2F53de251C2E7452

@lienhoatienphung-svg
lienhoatienphung-svg force-pushed the feature/1164-pool-upgrade-layout-hashes branch from 8356c6f to f9a508b Compare October 16, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feed real layout hashes into pool upgrade validation

1 participant