Summary
Per @QuantumExplorer's review on PR #3648:
"We haven't been using the platform_payment_managed_account, and have plans to get rid of it entirely. Instead we use the thing in platform wallet."
key_wallet_manager::platform_payment_managed_account is on the removal path. The replacement is platform_wallet::PlatformPaymentAddressProvider. Today the public API in PlatformAddressWallet (next_unused_receive_address, etc.) is already on the modern layer, but the implementation still reaches into managed_account.addresses for the actual AddressPool (containing used_indices, highest_used, gap_limit, mark_index_used, etc.). The provider is currently a read-only sync-state mirror — it has a BiBTreeMap<AddressIndex, PlatformP2PKHAddress> but no pool semantics.
User Story
As a platform-wallet maintainer I want the AddressPool to live on the modern provider so that the deprecated platform_payment_managed_account type can be deleted without breaking the wallet's address-derivation, gap-limit, and Found-026 hand-out-reservation behaviour.
Scope
- Move
AddressPool (or an equivalent stateful structure) onto PlatformPaymentAddressProvider::PerAccountPlatformAddressState, replacing the read-only BiBTreeMap<AddressIndex, PlatformP2PKHAddress> with a pool that owns used_indices, highest_used, highest_generated, gap_limit.
- Expose
next_unused_with_info() and mark_index_used() as crate-public methods on the provider.
- Refactor
PlatformAddressWallet::next_unused_receive_address (packages/rs-platform-wallet/src/wallet/platform_addresses/wallet.rs:232) to call the provider's methods instead of managed_account.addresses — closes the last deprecated-pool touch in the production hand-out path.
- Update sync paths (
sync.rs, transfer.rs, withdrawal.rs) to read pool state from the provider, not from the managed account.
- Once production no longer touches the deprecated pool, delete
platform_payment_managed_account (or whatever subset @QuantumExplorer's removal plan covers).
E2E test impact
The current e2e campaign (#3549) has 8 call sites across 6 files that touch the deprecated pool. Most likely covered by this issue:
| File |
Line |
What it needs |
After this issue |
tests/e2e/framework/cleanup.rs |
251 |
highest_generated / highest_used for sweep-pool signer ceiling |
Reads via new accessor on PlatformAddressWallet (planned in #3549 stop-gap) |
tests/e2e/framework/bank.rs |
327 |
same |
same |
tests/e2e/framework/gap_limit.rs |
127 |
Batch derivation past pool watermark |
Needs new batch-derive API on provider |
tests/e2e/cases/pa_005b_gap_limit_triplet.rs |
172, 214 |
mark_index_used on boundary, gap_limit read |
Rewrite against provider pool, or retire if provider doesn't expose mutation |
tests/e2e/framework/wallet_factory.rs |
1151 |
Inspect used_indices for Found-026 guard |
Rewrite against provider pool |
PR #3549 ships with two new wrapper accessors (platform_payment_account_max_derived_index, platform_payment_account_gap_limit) and #[allow(deprecated)] annotations on the un-migratable test sites — see PR for stop-gap details. Once this issue lands, those #[allow(deprecated)] sites can be cleaned up and PA-005b can be rewritten or retired.
Related
Acceptance criteria
Out of scope
🤖 Co-authored by Claudius the Magnificent AI Agent
Summary
Per @QuantumExplorer's review on PR #3648:
key_wallet_manager::platform_payment_managed_accountis on the removal path. The replacement isplatform_wallet::PlatformPaymentAddressProvider. Today the public API inPlatformAddressWallet(next_unused_receive_address, etc.) is already on the modern layer, but the implementation still reaches intomanaged_account.addressesfor the actualAddressPool(containingused_indices,highest_used,gap_limit,mark_index_used, etc.). The provider is currently a read-only sync-state mirror — it has aBiBTreeMap<AddressIndex, PlatformP2PKHAddress>but no pool semantics.User Story
As a platform-wallet maintainer I want the
AddressPoolto live on the modern provider so that the deprecatedplatform_payment_managed_accounttype can be deleted without breaking the wallet's address-derivation, gap-limit, and Found-026 hand-out-reservation behaviour.Scope
AddressPool(or an equivalent stateful structure) ontoPlatformPaymentAddressProvider::PerAccountPlatformAddressState, replacing the read-onlyBiBTreeMap<AddressIndex, PlatformP2PKHAddress>with a pool that ownsused_indices,highest_used,highest_generated,gap_limit.next_unused_with_info()andmark_index_used()as crate-public methods on the provider.PlatformAddressWallet::next_unused_receive_address(packages/rs-platform-wallet/src/wallet/platform_addresses/wallet.rs:232) to call the provider's methods instead ofmanaged_account.addresses— closes the last deprecated-pool touch in the production hand-out path.sync.rs,transfer.rs,withdrawal.rs) to read pool state from the provider, not from the managed account.platform_payment_managed_account(or whatever subset @QuantumExplorer's removal plan covers).E2E test impact
The current e2e campaign (#3549) has 8 call sites across 6 files that touch the deprecated pool. Most likely covered by this issue:
tests/e2e/framework/cleanup.rshighest_generated/highest_usedfor sweep-pool signer ceilingtests/e2e/framework/bank.rstests/e2e/framework/gap_limit.rstests/e2e/cases/pa_005b_gap_limit_triplet.rsmark_index_usedon boundary,gap_limitreadtests/e2e/framework/wallet_factory.rsused_indicesfor Found-026 guardPR #3549 ships with two new wrapper accessors (
platform_payment_account_max_derived_index,platform_payment_account_gap_limit) and#[allow(deprecated)]annotations on the un-migratable test sites — see PR for stop-gap details. Once this issue lands, those#[allow(deprecated)]sites can be cleaned up and PA-005b can be rewritten or retired.Related
Acceptance criteria
platform_payment_managed_accountis deleted (or whatever subset @QuantumExplorer's removal plan covers)managed_account.addresses(the pool) are gone#[allow(deprecated)]annotations added in test(platform-wallet): e2e framework + full test suite — triage pins, Found-*/PA-* guards, fail-closed persist, Stage-2 merge #3549 referencing this issue are removedOut of scope
mark_index_usedflip on hand-out (tracked separately in register_wallet: partial-commit on restore-phase failure (persisted record orphaned) #3736)register_wallet(tracked in register_wallet: partial-commit on restore-phase failure (persisted record orphaned) #3736)🤖 Co-authored by Claudius the Magnificent AI Agent