Skip to content

Conversation

sigurpol
Copy link
Contributor

@sigurpol sigurpol commented Aug 27, 2025

Overview

This PR migrates the proxy pallet from the Currency trait to the fungible traits with holds, addressing the balance overlap issue where proxy reserves couldn't overlap with staking holds.

Changes

  • Added HoldReason enum with ProxyDeposit and AnnouncementDeposit variants
  • Updated Config trait to use fungible::hold::Mutate and related traits
  • Replaced all Currency::reserve calls with hold operations
  • Replaced all Currency::unreserve calls with release operations
  • Updated rejig_deposit function to handle hold/release with proper reason
  • Fixed tests to work with new hold-based balance model

This enables proper balance overlap: users now only need max(staking_hold, governance_lock,proxy_hold) total balance instead of staking_hold + governance_lock + proxy_reserve.

Migration: Conversion of proxy and announcement reserves into holds.

This migration uses multi-block execution with proxy preservation:

  • Multi-block: Handles accounts with weight-limited batching without timing out
  • Always preserve proxy relationships even when hold creation fails
  • Set deposit to zero as permanent marker for failed migration
  • Funds automatically moved to free balance for user control
  • Self-recovery via add_proxy when users have sufficient balance
  • Critical pure proxy access maintained without governance intervention

Testing migration

Beside new unit tests added in the proxy pallet, I have tested the migration via try-runtime-cli on Westend AH.
There, we have ~1000 accounts with an incorrect state (proxies configured with deposit and zero reserved funds before migrations), for them - as expected - the migration preserves the proxy relationship and set deposits to 0, as explained above.
Similar results when tested against Westend RC.

The expectation on Kusama and Polkadot is to have a decent clear state.
Further test via chopsticks / PET need to confirm that's the case.

Below some logs for WAH case

[2025-09-02T08:54:46Z INFO  runtime::proxy] ✅ Fund conservation verified: 111898073807640938000000
[2025-09-02T08:54:46Z INFO  runtime::proxy] 📊 Migration verification completed: 2451/2451 accounts verified successfully
[2025-09-02T08:54:46Z INFO  runtime::proxy]    - 1412 successful conversions to holds
[2025-09-02T08:54:46Z INFO  runtime::proxy]    - 1039 preserved with zero deposit
[2025-09-02T08:54:46Z INFO  runtime::proxy]    - 0 accounts cleaned up
[2025-09-02T08:54:46Z INFO  runtime::proxy] ✅ Migration verification passed - all checks successful

Benchmarking

Replace Currency trait usage in benchmarks with fungible equivalents:

  • Use mint_into() instead of make_free_balance_be() to add balance without destroying existing holds
  • Replace reserved_balance() with balance_on_hold() for specific hold reasons
  • Replace reserve() with hold() operations using proper HoldReason variants
  • Fix add_announcements helper to avoid overwriting caller balance when provided
  • Add proper real account parameter to announcement benchmarks for correct proxy relationships
  • Use appropriate balance amounts to prevent overflow in test runtime

The key difference is that holds come from total balance (reducing free balance), while the old reserves were separate from free balance.

Weights

Looking at benchmark results, there is a significant weight increase (~40-100%) when moving from reserves to holds, which is expected and can be explained by the fact that holds are more complex than reserves (e.g. for storage: Reserves -> single Balance field per account in ReservedBalance balance vs Holds -> BTreeMap<HoldReason, Balance> in Holds storage). The most affected operations are create_pure, add_proxy and remove_proxy because they rely on hold creation / destruction patterns now. I think the UX improvement is enough to justify the performance cost, especially because proxy addition / removal happens rarely in comparison with proxy execution.

Resources

This is part of the umbrella task #226.
More details here

TODO

  • More tests (including PET) should be added, in this or in a follow-up PR depending on how fast we want the migration to be on Westend.

This commit migrates the proxy pallet from the deprecated Currency trait
to modern fungible traits with holds, addressing the balance overlap issue
where proxy reserves couldn't overlap with staking holds.

Changes:
- Added HoldReason enum with ProxyDeposit and AnnouncementDeposit variants
- Updated Config trait to use fungible::hold::Mutate and related traits
- Replaced all Currency::reserve calls with hold operations
- Replaced all Currency::unreserve calls with release operations
- Updated rejig_deposit function to handle hold/release with proper reason
- Fixed tests to work with new hold-based balance model

This enables proper balance overlap: users now only need
max(staking_hold, governance_lock) + proxy_hold total balance
instead of staking_hold + governance_lock + proxy_reserve.
@sigurpol sigurpol requested a review from a team as a code owner August 27, 2025 08:53
@sigurpol sigurpol added the T2-pallets This PR/Issue is related to a particular pallet. label Aug 27, 2025
@sigurpol sigurpol marked this pull request as draft August 27, 2025 08:54
Implements multi-block migration with graceful degradation to convert
proxy and announcement reserves to holds during runtime upgrade.

- Add migration cursor for multi-block execution
- Convert reserves to holds with fallback to proxy removal + refund
- Add migration events for user communication
- Include comprehensive pure proxy recovery documentation
Replace Currency trait usage in benchmarks with fungible equivalents:
- Use mint_into() instead of make_free_balance_be() to add balance without
destroying existing holds
- Replace reserved_balance() with balance_on_hold() for specific hold reasons
- Replace reserve() with hold() operations using proper HoldReason variants
- Fix add_announcements helper to avoid overwriting caller balance when
provided
- Add proper real account parameter to announcement benchmarks for correct
proxy relationships
- Use appropriate balance amounts to prevent overflow in test runtime

The key difference is that holds come from total balance (reducing free
balance), while the old reserves were separate from free balance.
Pure proxy accounts can become permanently inaccessible when they lose
their proxy configuration but retain funds in a keyless account. This
creates an unrecoverable state where funds are locked forever.

Add four Root-origin force functions to enable governance recovery:
- force_add_proxy: restore proxy relationships for inaccessible accounts
- force_remove_proxy: remove specific proxy relationships
- force_remove_proxies: clear all proxies and release deposits
- force_remove_announcements: clear announcements and release deposits

These functions provide emergency intervention capabilities for edge cases
where normal proxy management fails, ensuring no funds become permanently
locked while maintaining security through Root-only access.
@sigurpol sigurpol marked this pull request as ready for review August 29, 2025 11:55
Copy link
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall logic change certainly sounds good, have some doubts about how to deal with migration edge cases.

Refactors proxy pallet v2 migration from OnRuntimeUpgrade to SteppedMigration
to integrate with pallet_migrations framework for proper multi-block execution.

- Implement SteppedMigration trait with cursor-based batching
- Add migration to Asset Hub Westend runtime configuration
@sigurpol
Copy link
Contributor Author

/cmd bench --pallet pallet_proxy --runtime dev

Copy link
Contributor

Command "bench --pallet pallet_proxy --runtime dev" has started 🚀 See logs here

Copy link
Contributor

Command "bench --pallet pallet_proxy --runtime dev" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs create_pure 152.39us 375.68us +146.52
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs add_proxy 151.82us 319.06us +110.16
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs kill_pure 149.76us 311.03us +107.69
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_proxies 148.48us 305.30us +105.61
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_proxy 151.51us 310.82us +105.16
polkadot/runtime/westend/src/weights/pallet_proxy.rs create_pure 155.43us 314.18us +102.14
substrate/frame/proxy/src/weights.rs add_proxy 154.85us 312.64us +101.89
polkadot/runtime/westend/src/weights/pallet_proxy.rs add_proxy 155.39us 312.21us +100.92
substrate/frame/proxy/src/weights.rs create_pure 155.59us 312.23us +100.68
polkadot/runtime/westend/src/weights/pallet_proxy.rs kill_pure 152.76us 301.51us +97.37
substrate/frame/proxy/src/weights.rs remove_proxies 151.88us 299.26us +97.04
substrate/frame/proxy/src/weights.rs kill_pure 152.77us 300.39us +96.62
substrate/frame/proxy/src/weights.rs remove_proxy 154.80us 303.31us +95.94
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_proxies 151.88us 297.26us +95.72
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_proxy 155.37us 302.84us +94.92
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs announce 319.66us 542.22us +69.62
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs proxy_announced 323.63us 538.65us +66.44
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs reject_announcement 282.24us 447.66us +58.61
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_announcement 282.21us 447.53us +58.58
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_announcement 285.20us 434.36us +52.30
polkadot/runtime/westend/src/weights/pallet_proxy.rs reject_announcement 285.16us 434.16us +52.25
substrate/frame/proxy/src/weights.rs remove_announcement 285.50us 434.24us +52.10
substrate/frame/proxy/src/weights.rs reject_announcement 285.53us 434.11us +52.03
substrate/frame/proxy/src/weights.rs announce 318.85us 475.60us +49.16
polkadot/runtime/westend/src/weights/pallet_proxy.rs announce 319.14us 475.36us +48.95
polkadot/runtime/westend/src/weights/pallet_proxy.rs proxy_announced 323.09us 472.69us +46.30
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs poke_deposit 420.42us 601.82us +43.15
substrate/frame/proxy/src/weights.rs proxy_announced 380.06us 530.50us +39.58
polkadot/runtime/westend/src/weights/pallet_proxy.rs poke_deposit 425.37us 591.62us +39.08
substrate/frame/proxy/src/weights.rs poke_deposit 422.97us 587.16us +38.82
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs proxy 41.07us 46.05us +12.13
substrate/frame/proxy/src/weights.rs migration_complete 5.81ms Added
substrate/frame/proxy/src/weights.rs migrate_proxy_account 185.06us Added
substrate/frame/proxy/src/weights.rs migrate_announcement_account 185.78us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- dev: ['pallet_proxy']

…t_staking_async --runtime asset-hub-westend'
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/17740772555
Failed job name: cargo-clippy

@paritytech paritytech deleted a comment from github-actions bot Sep 15, 2025
@paritytech paritytech deleted a comment from github-actions bot Sep 15, 2025
@paritytech paritytech deleted a comment from github-actions bot Sep 15, 2025
@paritytech paritytech deleted a comment from github-actions bot Sep 15, 2025
@sigurpol
Copy link
Contributor Author

/cmd bench --pallet pallet_proxy --runtime westend

@sigurpol
Copy link
Contributor Author

/cmd bench --pallet pallet_proxy --runtime asset-hub-westend

Copy link
Contributor

Command "bench --pallet pallet_proxy --runtime westend" has started 🚀 See logs here

Copy link
Contributor

Command "bench --pallet pallet_proxy --runtime asset-hub-westend" has started 🚀 See logs here

Copy link
Contributor

Command "bench --pallet pallet_proxy --runtime westend" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs create_pure 152.39us 375.68us +146.52
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs add_proxy 151.82us 319.06us +110.16
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs kill_pure 149.76us 311.03us +107.69
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_proxies 148.48us 305.30us +105.61
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_proxy 151.51us 310.82us +105.16
substrate/frame/proxy/src/weights.rs add_proxy 154.85us 312.64us +101.89
polkadot/runtime/westend/src/weights/pallet_proxy.rs create_pure 155.43us 312.11us +100.80
polkadot/runtime/westend/src/weights/pallet_proxy.rs add_proxy 155.39us 311.94us +100.75
substrate/frame/proxy/src/weights.rs create_pure 155.59us 312.23us +100.68
polkadot/runtime/westend/src/weights/pallet_proxy.rs kill_pure 152.76us 301.05us +97.07
substrate/frame/proxy/src/weights.rs remove_proxies 151.88us 299.26us +97.04
substrate/frame/proxy/src/weights.rs kill_pure 152.77us 300.39us +96.62
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_proxies 151.88us 297.82us +96.08
substrate/frame/proxy/src/weights.rs remove_proxy 154.80us 303.31us +95.94
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_proxy 155.37us 303.27us +95.19
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs announce 319.66us 542.22us +69.62
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs proxy_announced 323.63us 538.65us +66.44
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs reject_announcement 282.24us 447.66us +58.61
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_announcement 282.21us 447.53us +58.58
substrate/frame/proxy/src/weights.rs remove_announcement 285.50us 434.24us +52.10
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_announcement 285.20us 433.76us +52.09
substrate/frame/proxy/src/weights.rs reject_announcement 285.53us 434.11us +52.03
polkadot/runtime/westend/src/weights/pallet_proxy.rs reject_announcement 285.16us 433.43us +52.00
substrate/frame/proxy/src/weights.rs announce 318.85us 475.60us +49.16
polkadot/runtime/westend/src/weights/pallet_proxy.rs announce 319.14us 474.39us +48.64
polkadot/runtime/westend/src/weights/pallet_proxy.rs proxy_announced 323.09us 471.78us +46.02
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs poke_deposit 420.42us 601.82us +43.15
substrate/frame/proxy/src/weights.rs proxy_announced 380.06us 530.50us +39.58
polkadot/runtime/westend/src/weights/pallet_proxy.rs poke_deposit 425.37us 590.85us +38.90
substrate/frame/proxy/src/weights.rs poke_deposit 422.97us 587.16us +38.82
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs proxy 41.07us 46.05us +12.13
substrate/frame/proxy/src/weights.rs migration_complete 5.81ms Added
substrate/frame/proxy/src/weights.rs migrate_proxy_account 185.06us Added
substrate/frame/proxy/src/weights.rs migrate_announcement_account 185.78us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migration_complete 5.81ms Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migrate_proxy_account 183.53us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migrate_announcement_account 186.79us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- westend: ['pallet_proxy']

Copy link
Contributor

Command "bench --pallet pallet_proxy --runtime asset-hub-westend" has finished ✅ See logs here

Subweight results:
File Extrinsic Old New Change [%]
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs create_pure 152.39us 377.50us +147.72
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs add_proxy 151.82us 320.42us +111.06
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs kill_pure 149.76us 310.83us +107.56
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_proxy 151.51us 313.97us +107.23
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_proxies 148.48us 306.42us +106.37
polkadot/runtime/westend/src/weights/pallet_proxy.rs create_pure 155.43us 314.18us +102.14
substrate/frame/proxy/src/weights.rs add_proxy 154.85us 312.64us +101.89
polkadot/runtime/westend/src/weights/pallet_proxy.rs add_proxy 155.39us 312.21us +100.92
substrate/frame/proxy/src/weights.rs create_pure 155.59us 312.23us +100.68
polkadot/runtime/westend/src/weights/pallet_proxy.rs kill_pure 152.76us 301.51us +97.37
substrate/frame/proxy/src/weights.rs remove_proxies 151.88us 299.26us +97.04
substrate/frame/proxy/src/weights.rs kill_pure 152.77us 300.39us +96.62
substrate/frame/proxy/src/weights.rs remove_proxy 154.80us 303.31us +95.94
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_proxies 151.88us 297.26us +95.72
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_proxy 155.37us 302.84us +94.92
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs announce 319.66us 542.58us +69.74
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs proxy_announced 323.63us 538.92us +66.53
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs reject_announcement 282.24us 447.60us +58.59
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs remove_announcement 282.21us 446.94us +58.37
polkadot/runtime/westend/src/weights/pallet_proxy.rs remove_announcement 285.20us 434.36us +52.30
polkadot/runtime/westend/src/weights/pallet_proxy.rs reject_announcement 285.16us 434.16us +52.25
substrate/frame/proxy/src/weights.rs remove_announcement 285.50us 434.24us +52.10
substrate/frame/proxy/src/weights.rs reject_announcement 285.53us 434.11us +52.03
substrate/frame/proxy/src/weights.rs announce 318.85us 475.60us +49.16
polkadot/runtime/westend/src/weights/pallet_proxy.rs announce 319.14us 475.36us +48.95
polkadot/runtime/westend/src/weights/pallet_proxy.rs proxy_announced 323.09us 472.69us +46.30
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs poke_deposit 420.42us 602.54us +43.32
substrate/frame/proxy/src/weights.rs proxy_announced 380.06us 530.50us +39.58
polkadot/runtime/westend/src/weights/pallet_proxy.rs poke_deposit 425.37us 591.62us +39.08
substrate/frame/proxy/src/weights.rs poke_deposit 422.97us 587.16us +38.82
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs proxy 41.07us 46.27us +12.68
substrate/frame/proxy/src/weights.rs migration_complete 5.81ms Added
substrate/frame/proxy/src/weights.rs migrate_proxy_account 185.06us Added
substrate/frame/proxy/src/weights.rs migrate_announcement_account 185.78us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
polkadot/runtime/westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
polkadot/runtime/rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/people/people-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/people/people-rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/coretime/coretime-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/coretime/coretime-rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/collectives/collectives-westend/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migration_complete 6.05ms Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migrate_proxy_account 189.85us Added
cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_proxy.rs migrate_announcement_account 194.71us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migration_complete 272.00us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migrate_proxy_account 135.50us Added
cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_proxy.rs migrate_announcement_account 136.00us Added
Command output:

✅ Successful benchmarks of runtimes/pallets:
-- asset-hub-westend: ['pallet_proxy']

rockbmb added a commit to open-web3-stack/polkadot-ecosystem-tests that referenced this pull request Sep 27, 2025
* Init balances e2e tests (wip)

* Rework initial tests for clarity

Most of them were written with recourse to Cursor, and were just not
very useful.

* Refactor `transfer_allow_death` test

It scrutinizes the extrinsic's events and their inner data.

* Recreate tests for all Polkadot/Kusama relay/SPs

* Rework networks that run `transferAllowDeath` test

Now, at the calling site of the test tree creation function, chains can
signal whether their ED is too low to run the basic `transferAllowDeath`
test.

* Scrutinize more events in `transferAllowDeath` test

* Test non-destructive `transfer_allow_death`

* Test `force_transfer` with account reaping

* Test to `force_transfer` reaping

* Test `transfer_allow_death` below ED

* Test `force_transfer` below ED

* Test overtransferring account

* Update comments and snapshots

* Test `force_transfer` with insufficient funds

* Test self `transfer_allow_death` of near-entire balance

* Update snapshots

* Update accounts tests after merge from `master`

PR #384 required some additional fixes that auto-merge could not perform.

* Update snapshots

* Fund new test account on Bridge Hub

* Revert change to Polkadot AH multisig suite name

* Create test to liquidity restrictions bug

See paritytech/polkadot-sdk#9560 and
paritytech/polkadot-sdk#8108.

TL;DR proxy and multisig pallets are using the old `Currency` trait
and not the new fungible traits, it is possible for an operation that
is permissible to an account at a given point in time and state to
fail.

See #401

* Test liquidity restrictions when creating proxy

* Parametrize deposit-requiring action liquidity restriction test

The `balances.LiquidityRestrictions` error can occur is different
contexts, as multiple pallets still use the old `Currency::reserve`
operation.

This commit parametrizes the test to allow for different kinds of
actions to be tested, not just proxy addition.

* Extend liquidity restriction tests to cover more cases

The test now combinatorially covers several cases:
1. Reserve action can vary between staking bond and nomination pool creation
2. Lock action is always vested transfer (for now)
3. Deposit action can vary between proxy creation, referendum submission
   and staking bond

* Test manual reserve/lock in liquidity restriction tests

This adds the possibility of manually set reserve/locks to the reserve/
lock actions used to combinatorially generate tests to liquidity
restrictions.

This is needed because some chains have no vesting or staking, but the
behavior should still be tested.

* Fix manual reserve/lock actions in liq. restriction tests

Fees were not being accounted for correctly when performing checks
on free/frozen balances.

* Update snapshots and accounts E2E test tree call sites

* Filter vesting as locking action on Asset Hubs

... while the AHM is pending - vesting operations are filtered, and
thus cannot be used.

* Add more comments to liquidity restriction test

Especially the action interfaces.

* Add more comments to liquidity restriction tests

* Remove leftover debug code from self-transfer test

* Fix Asset Hub test suites' use of relay chain

An invalid argument was being passed to the `scheduleInlineCallWithOrigin`
function: the base's chains block provider, instead of the relay chain's,
which is always `Local`.

* Snapshot skipped liquidity restriction tests

... instead of logging a message. Logs add some noise to CI test output.

* Apply lint fixes

* Update block numbers

* Change lock identifier used

* Remove unstable `Transfer` event from snapshots

* Update snapshots

* Simplify liquidity restriction tests

The `Balance.locks` storage is no longer modified - Polkadot Relay is
failing for an undetermined reason.

* Use nonces when setting storage

* Test `transfer_allow_death` with reserve

* Add test to `transfer_all` with reserve

* Add `force_transfer` with reserve test

* Add origin check tests for gated extrinsics

* Add tests to transfer functions with insufficient funds

* Test `transfer_all` with `keepAlive = true`

* Correct previous transfer all test snapshot

* Test `transfer_all` with `keep_alive = false`

* Correct snapshots of accounts tests

* Test `transfer_keep_alive` with source left below ED

* Split `transfer_keep_alive` tests

... into two separate tests:
1. one for chains with low ED (below a typical transfer fee)
2. one for chains with normal ED

* Test `force_adjust_total_issuance` with zero delta

* Test total issuance changes

* Test `force_unreserve` no-op cases

* Update accounts E2E test snapshots

* Update liquidity restriction test snapshots for AHs

* Test forceful unreservation of funds

* Add more self-transfer tests

* Add self-transfer test to `force_transfer`

* Add tests to `force_set_balance`

* Refactor `burn` tests into low/normal ED tests

* Update snapshots with new `burn` tests

* Test burning from account with consumer reference

* Add test to burning of entire balance (or more than it)

* Update snapshots to remove obsolete data

* Improve documentation and `README`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants