Implements a variable deposit base calculation for EPM signed submissions#13983
Implements a variable deposit base calculation for EPM signed submissions#13983
Conversation
…elements in the queue; adds tests
|
bot rebase |
|
Rebased |
Ank4n
left a comment
There was a problem hiding this comment.
Couple of nits, otherwise LGTM!
Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com>
|
Moreover I think this is not the case in the code as it stands now yet:
|
kianenigma
left a comment
There was a problem hiding this comment.
I think this is mainly done, but needs to be brought up to date before a final review.
|
bot fmt |
|
@gpestana https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2965106 was started for your command Comment |
|
@gpestana Command |
…ed types for progression configs
|
can be merged once conflict is resolved. |
This PR implements a generic BaseDeposit calculation for signed submissions, based on the size of the submission queue.
It adds a new associated type to EPM's config,
type SignedDepositBase, that implementsConvert<usize, BalanceOf<T>>, which is used to calculate the base deposit for signed submissions based on the size of the signed submissions queue.struct GeometricDepositBase<Balance, Fixed, Inc>implements the convert trait so that the deposit value increases as a geometric progression. The deposit base is calculated bydeposit_base = fixed_deposit_base * (1 + increase_factor)^n, wherenis the term of the progression (i.e. the number of signed submissions in the queue).FixedandIncgeneric params are getters forBalanceandIncreaseFactorto compute the geometric progression. IfIncreaseFactor = 0, then the signed deposit is constant and equal toFixedregardless of the size of the queue.polkadot companion: paritytech/polkadot#7140
Closes https://github.com/paritytech/srlabs_findings/issues/189