You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adds `AllowanceBasedPriority` extension
This extension gives `store` transactions a proportional priority boost based on the already consumed allowance.
* Nit plus test
* Do not degrade user's performance in time - reset usage when refresh_authorization
* Migration for Paseo
* Fix migration
* fmt
* Ping CI
* Fix tests to match assignment semantics of `authorize`
Re-authorizing an unexpired account/preimage replaces `bytes_allowance`
rather than adding to it. Three tests assumed the additive form. Renamed
`authorize_account_does_not_push_expiry` to
`re_authorize_account_replaces_allowance_and_keeps_expiry` to reflect both
invariants it now covers.
* Compilation for paseo after main merge
* Doc nit for refresh_authorization
* Migration for paseo, which was merged meantime
* Refactor allowance boost behind `BoostStrategy`, default to `FlatBoost`
`AllowanceBasedPriority` is now generic over a `BoostStrategy` so the
runtime can pick its policy in the `TxExtension` tuple. Two impls ship:
- `ProportionalBoost`: original PR #448 behaviour — linear in remaining
allowance.
- `FlatBoost`: constant boost while in-budget, `0` once over-budget.
The proportional form is vulnerable to censorship: a fresh-allowance
signer outranks partly-used ones and can starve them with small-tx spam
(see karolk91's analysis on PR #448). `FlatBoost` makes in-budget
signers all rank equal and over-budget ones strictly lower; pool nonce/
arrival ordering breaks ties. Both runtimes are wired to `FlatBoost`.
Three pallet unit tests (`proportional_scales_with_remaining_allowance`,
`flat_is_constant_while_in_budget`,
`flat_does_not_let_fresh_outrank_partly_used`) document the contracts
and the censorship-relevant difference.
* Docs nits
* Compute allowance boost against post-this-tx state
* Minimalistic alignment with paritytech/individuality#785 (part 1)
* Pick transactions_used / transactions_allowance from #469
Brings just the AuthorizationExtent + boost-strategy parts of #469;
the period / two-slot / bytes_permanent surface is left out.
- AuthorizationExtent: gain transactions_used / transactions_allowance
fields. authorize_account now uses its 3rd parameter to set/extend
transactions_allowance; check_authorization saturating-bumps
transactions_used on consume.
- BoostStrategy: a shared in_budget helper gates both the byte and tx
axes; FlatBoost is in-budget at-cap (matching #469); ProportionalBoost
scales by the tighter of the two remainders.
- AllowanceBasedPriority::validate increments transactions_used in the
post-this-tx extent before computing the boost.
- v1->v2 migration carries the old transaction-count field over to the
new transactions_allowance.
- Genesis config tuple becomes (account, transactions_allowance,
bytes_allowance); preimage authorize_* always sets
transactions_allowance = 1.
- Tests + bulletin-{westend,paseo} runtime tests updated for the new
expected counters; new boost_tests::tx_axis_gates_boost_independently.
Out of scope (per #469): bytes_permanent, the two-slot
current/next grant model, for_period parameter, renew matching in the
boost extension, the People-Chain-aligned period model.
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
* transactions_used -> transactions
* Refresh: only extend expiry, do not reset consumed counters
Per review feedback (#448 r3163274071): resetting `bytes` and
`transactions` on refresh implicitly grants a fresh boost-tier window,
which conflates two operations under one extrinsic. Refresh now does
exactly what its name says — extend the expiration block. Holders who
want more capacity call `authorize_account` (additive on the unexpired
path).
Doc updates on `refresh_account_authorization`,
`refresh_preimage_authorization` and the `refresh_authorization` helper
make the split explicit. `authorize_account`'s doc also gets updated
to describe the new tx-axis additivity.
* Move back to 14
* Tighten priority constants for store / renew
- `AuthorizationPeriod` 90 days -> 14 days, aligning with the
`LongTermStoragePeriodDuration` (2 weeks) on the People-Chain side.
- Drop the unused `SudoPriority` and `SetPurgeKeysPriority` constants;
they were only chained into `RemoveExpiredAuthorizationPriority` and
not wired anywhere else.
- `RemoveExpiredAuthorizationPriority` is now `TransactionPriority::MAX`
so permissionless cleanups always outrank stores.
- `StoreRenewPriority` is `TransactionPriority::MAX / 4`. With
`AllowanceBasedPriority` adding `ALLOWANCE_PRIORITY_BOOST` for
in-budget signers, in-budget txs land just above over-budget ones
without saturating `u64` and with plenty of headroom both above
generic transactions and below the cleanup ceiling.
* Nit
* More nits
---------
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Francisco Aguirre <franciscoaguirreperez@gmail.com>
0 commit comments