-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Implements a variable deposit base calculation for EPM signed submissions #13983
base: master
Are you sure you want to change the base?
Conversation
…elements in the queue; adds tests
bot rebase |
Rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
, wheren
is the term of the progression (i.e. the number of signed submissions in the queue).Fixed
andInc
generic params are getters forBalance
andIncreaseFactor
to compute the geometric progression. IfIncreaseFactor = 0
, then the signed deposit is constant and equal toFixed
regardless of the size of the queue.polkadot companion: paritytech/polkadot#7140
Closes https://github.com/paritytech/srlabs_findings/issues/189