substrate
substrate copied to clipboard
Implements a variable deposit base calculation for EPM signed submissions
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 implements Convert<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 by deposit_base = fixed_deposit_base * (1 + increase_factor)^n, where n is the term of the progression (i.e. the number of signed submissions in the queue). Fixed and Inc generic params are getters for Balance and IncreaseFactor to compute the geometric progression. If IncreaseFactor = 0, then the signed deposit is constant and equal to Fixed regardless of the size of the queue.
polkadot companion: https://github.com/paritytech/polkadot/pull/7140
Closes https://github.com/paritytech/srlabs_findings/issues/189
bot rebase
Rebased
bot rebase
Rebased
Moreover I think this is not the case in the code as it stands now yet:
It adds a new associated type to EPM's config type BaseDeposit that implements Convert<usize, Balance>, which is used to calculate the base deposit for signed submissions based on the size of the signed submissions queue.
bot fmt
@gpestana https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2965106 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment bot cancel 9-9b73b719-c72e-4e0a-a380-9251ec5eea62 to cancel this command or bot cancel to cancel all commands in this pull request.
@gpestana Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2965106 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2965106/artifacts/download.
can be merged once conflict is resolved.